Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

feat: implement timeline2 component - INNO-1546 #102

Merged
merged 21 commits into from
Jun 28, 2019

Conversation

haringsrob
Copy link
Contributor

PR description

Please drop a few lines about the PR: what it does, how to test it, etc.

QA Checklist

In order to ensure a safe and quick review, please check that your PR follow those guidelines:

  • I have put the vanilla component as devDependencies
  • I have put the specs package as devDependencies
  • I have added the components directly used in the twig file (with include or embed) as dependencies
  • My component is listed in @ecl-twig/ec-components's dependencies
  • My variables naming follow the guidelines (snake case for twig)
  • I have provided tests
  • I have provided documentation (for the "notes" tab)
  • If my local yarn.lock contains changes, I have committed it
  • I have given my PR the proper label (pr: review needed to indicate that I'm done and now waiting for a review ,pr: wip to indicate that I'm actively working on it ...)

@haringsrob haringsrob added the pr: wip Mark the PR as WIP label Jun 21, 2019
@haringsrob haringsrob changed the title Inno 1546 timeline2 component wip: INNO-1546 timeline2 component Jun 21, 2019
@haringsrob haringsrob changed the base branch from master to v2.7-dev June 21, 2019 10:49
@haringsrob haringsrob added pr: review needed Use this label to show that your PR needs to be review and removed pr: wip Mark the PR as WIP labels Jun 21, 2019
@haringsrob haringsrob changed the title wip: INNO-1546 timeline2 component feat: INNO-1546 timeline2 component Jun 21, 2019
@yhuard yhuard self-assigned this Jun 24, 2019
@yhuard yhuard added pr: under review and removed pr: review needed Use this label to show that your PR needs to be review labels Jun 24, 2019
Copy link
Contributor

@yhuard yhuard left a comment

Choose a reason for hiding this comment

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

Impressive work so far 👍 I've spotted some small things to enhance or fix here and there, nothing dramatic.

Regarding the title of the PR, we try to follow Angular's conventions with a small change: we add the Jira ticket at the end of the title. Could you please update it? 😉

src/ec/packages/ec-component-timeline/demo/data.js Outdated Show resolved Hide resolved
src/ec/packages/ec-component-timeline/timeline.html.twig Outdated Show resolved Hide resolved
src/ec/packages/ec-component-timeline/timeline.html.twig Outdated Show resolved Hide resolved
@yhuard yhuard removed their assignment Jun 24, 2019
@haringsrob haringsrob added pr: wip Mark the PR as WIP and removed pr: modification needed labels Jun 24, 2019
@haringsrob haringsrob changed the title feat: INNO-1546 timeline2 component feat: timeline2 component - INNO-1546 Jun 24, 2019
@haringsrob
Copy link
Contributor Author

Hi @yhuard,

In addition to your comments some other fixes were made as well.

  • Leftover "accordion" in the docs.
  • A leftover
  • in the twig file.

The button is now using the component and I added the extra icon classes parameter.

I removed the button attribute from the component paremeters, not sure where I got that from..

Other remarks were due to copy pasting. Adjusted those.

@haringsrob haringsrob added pr: review needed Use this label to show that your PR needs to be review and removed pr: wip Mark the PR as WIP labels Jun 24, 2019
@haringsrob haringsrob added the pr: review needed Use this label to show that your PR needs to be review label Jun 27, 2019
@yhuard yhuard added pr: under review and removed pr: review needed Use this label to show that your PR needs to be review labels Jun 27, 2019
@yhuard yhuard self-assigned this Jun 27, 2019
@yhuard yhuard removed their assignment Jun 27, 2019
@haringsrob
Copy link
Contributor Author

Hi @yhuard I have taken care of the comments.

@haringsrob haringsrob added pr: review needed Use this label to show that your PR needs to be review and removed pr: modification needed labels Jun 27, 2019
@yhuard yhuard added pr: under review and removed pr: review needed Use this label to show that your PR needs to be review labels Jun 28, 2019
@yhuard yhuard self-assigned this Jun 28, 2019
Copy link
Contributor

@yhuard yhuard left a comment

Choose a reason for hiding this comment

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

Technically, it works well! Now there are just some small cosmetic changes that you could make and then we can merge this PR 🎉

}

return {
toggle_collapsed: 'Show %d more items'.replace('%d', hiddenCount),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
toggle_collapsed: 'Show %d more items'.replace('%d', hiddenCount),
toggle_collapsed: `Show ${hiddenCount} more items`,


return {
toggle_collapsed: 'Show %d more items'.replace('%d', hiddenCount),
toggle_expanded: 'Hide %d items'.replace('%d', hiddenCount),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
toggle_expanded: 'Hide %d items'.replace('%d', hiddenCount),
toggle_expanded: `Hide ${hiddenCount} items`,

if (to > 0) {
hiddenCount = to - from;
} else {
hiddenCount = specData.items.length - (from + Math.abs(to));
Copy link
Contributor

Choose a reason for hiding this comment

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

or simpler:

Suggested change
hiddenCount = specData.items.length - (from + Math.abs(to));
hiddenCount = initialData.items.length + to - from;

if (to > 0) {
hiddenCount = to - from;
} else {
hiddenCount = demoData.items.length - (from + Math.abs(to));
Copy link
Contributor

Choose a reason for hiding this comment

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

same remark as earlier, it could be simplified a bit :)

.add(
'default',
() => {
const from = number('From', 10);
Copy link
Contributor

Choose a reason for hiding this comment

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

what about using demoData.hide.from as a default instead of 10? (same for to)
thus the changes made to demo/data.js would be reflected here as well


const fullDemoData = {
...demoData,
toggle_collapsed: 'Show %d more items'.replace('%d', hiddenCount),
Copy link
Contributor

Choose a reason for hiding this comment

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

same remark as earlier, template literals are preferable (more JS-y)

src/ec/packages/ec-component-timeline/timeline.html.twig Outdated Show resolved Hide resolved
@haringsrob haringsrob added pr: review needed Use this label to show that your PR needs to be review and removed pr: modification needed labels Jun 28, 2019
@yhuard yhuard added pr: under review and removed pr: review needed Use this label to show that your PR needs to be review labels Jun 28, 2019
Copy link
Contributor

@yhuard yhuard left a comment

Choose a reason for hiding this comment

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

Great work! 🎉

@yhuard yhuard merged commit 1406b9d into v2.7-dev Jun 28, 2019
@yhuard yhuard deleted the INNO-1546-timeline2-component branch June 28, 2019 14:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants