-
Notifications
You must be signed in to change notification settings - Fork 5
feat: implement timeline2 component - INNO-1546 #102
Conversation
There was a problem hiding this 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? 😉
Hi @yhuard, In addition to your comments some other fixes were made as well.
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. |
…ecl-twig into INNO-1546-timeline2-component
Hi @yhuard I have taken care of the comments. |
There was a problem hiding this 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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or simpler:
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)); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 🎉
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:
devDependencies
devDependencies
include
orembed
) asdependencies
@ecl-twig/ec-components
'sdependencies
yarn.lock
contains changes, I have committed itpr: 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 ...)