Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(profile-topbar): upgrade component - INNO-586 #238

Merged
merged 24 commits into from
Jul 11, 2017

Conversation

kalinchernev
Copy link
Contributor

For @ec-europa/ecl-context-navs there is change only in the template to be reusable, but I haven't changed the CSS as it's not in scope of this ticket.

@kalinchernev kalinchernev changed the title feat(profile-topbar) upgrade component - INNO-586 feat (profile-topbar) upgrade component - INNO-586 Jul 4, 2017
@kalinchernev kalinchernev changed the title feat (profile-topbar) upgrade component - INNO-586 feat(profile-topbar): upgrade component - INNO-586 Jul 4, 2017
@ec-europa ec-europa deleted a comment Jul 4, 2017
@ec-europa ec-europa deleted a comment Jul 4, 2017
@ec-europa ec-europa deleted a comment Jul 4, 2017
@emeryro emeryro self-assigned this Jul 5, 2017
Copy link
Contributor

@emeryro emeryro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but a few changes to be done, see below

</div>
<div class="ecl-col-md-10 ecl-profile-topbar__pane">
{% include '@ec-europa/ecl-context-navs' with context_nav %}
{% include '@ec-europa/ecl-buttons' with profile.expandable.button %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Label of the button should change when expanding the text.
It will require an update of the expandable component; this can be done in a follow-up ticket.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created INNO-682 as a follow-up.

<div class="container">
Expander content
</div>
<div class="ecl-profile-topbar">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the same structure for twig file as we started to use in other components:

  • api interface
  • declaration and initialisation of variables
  • markup

See featured-items component for instance.

},
},
details:
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this content could be a complexe html structure (with, list, grid, etc.), I would rather use a block in twig file instead of a variable.

margin: 0;
}

// This is esentially .section__group which can be used when refactored.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo in "essentially"

}

// This is esentially .section__group which can be used when refactored.
.ecl-profile-topbar__wrapper {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the puropose of this wrapper? Couldn't we use padding inside the component instead?
Here it adds margin outside the content of the component.

Copy link
Contributor Author

@kalinchernev kalinchernev Jul 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it's a perfect candidate for a re-usable class. It's section__group as of current state of the repo. So, i added them as a wrapper and added specifically the section__group name so that it's found in the code base and replaced when the latter is upgraded.

The inverse padding will have to be added on a specific class in a similar way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand what you say..
My remark was: instead of using external margins on a wrapper, we should probably use padding on the main .ecl-profile-topbar element.
That way, there won't be anything going outside the component.
And also if we do so, the wrapper itself becomes useless (no more css attributes on it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I made it right this time, the result is not totally the same, but hopefully acceptable.

"name": "@ec-europa/ecl-profile-topbars",
"version": "0.3.0",
"version": "0.4.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to change version manually, it is handles automagically.

Copy link
Contributor Author

@kalinchernev kalinchernev Jul 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted 👍

@@ -20,4 +20,3 @@ export * from './components/ecl-navigation/ecl-navigation-menus/megamenu';
export * from './components/ecl-tables/ecl-tables';
export * from './components/ecl-tabs/tabs';
// export * from './components/ecl-timelines/timelines';
// export * from './components/ecl-profile-topbars/profile-topbars';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that the js was there to manage expandable block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it contained a console statement to refactor the js. Since the expandable component can be simply instantiated via the local package js file, I did that directly there without this file.

// Set viewport size
browser.setViewportSize({
width: 1400,
height: 600,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshots could be smaller (but no need to change it now).

<div class="ecl-container">
<div class="ecl-row ecl-profile-topbar__wrapper">
<div class="ecl-col-md-2">
<img src="{{ profile.avatar }}"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing alt for image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, changed to {% include '@ec-europa/ecl-images' with profile.image %} :)

name: 'profile-toolbars',
});
expect(screenshots).to.matchReference();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add accessibility tests too, as in other test files:

it('should be accessible', () => {
  const a11yReport = browser.runAxeCore('ecl-profile-topbar').value;
  expect(a11yReport).to.be.accessible;
});

@kalinchernev
Copy link
Contributor Author

Updates applied, ready for another review round.

@kalinchernev kalinchernev requested a review from a team July 10, 2017 11:32
Copy link
Contributor

@emeryro emeryro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost good for me.
Just see my comment concerning the wrapper.

@degliwe degliwe merged commit fdf2fb5 into master Jul 11, 2017
@degliwe degliwe deleted the feat/profile-topbar-INNO-586 branch July 11, 2017 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants