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

feat(tag): Improve knobs on component - FRONT-492 #334

Merged
merged 8 commits into from
Feb 17, 2020
Merged

Conversation

Joosthe
Copy link
Contributor

@Joosthe Joosthe commented Feb 11, 2020

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 ...)

@Joosthe Joosthe added pr: review needed Use this label to show that your PR needs to be review tag: enhancement labels Feb 11, 2020
const variants = {
'As a link': 'link',
'As a Button': 'button',
Removable: 'removable',
Copy link
Contributor

Choose a reason for hiding this comment

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

missing quotes to Removable?

@@ -23,7 +29,9 @@ storiesOf('Components/Tag', module)
tag: {
label: text('Label', 'Link tag'),
path: text('Url', '/example'),
type: select('Variable', variants, 'link'),
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of having variants types as knobs if it's already defined as stories?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was literally the scope of the ticket to build in this functionality.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @papegaill , thanks for the review, your concern is clearly reasonable, this new select will let you switch between the different variants you have for the component which are indeed matching the stories we demo.
But if i have to consider what is redundant here, i'd say it's the "multiplication" of the stories for something that is actually just a parameter switch, not the availability of the parameter really handling the switch.
At the same time, i see that sometimes stories are a more evident way to show the different "variants" available per component, but we have to make it clear what is the real difference between them.
The label should be "variant", though, for this to happen, "variable" is not really identifying what the parameter is about

Copy link
Contributor

Choose a reason for hiding this comment

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

@planctus I think it's confusing, because for example if on the "as a link" story i switch variant, I'm then able to set "url" on a button or a removable tag. same with parameter "aria-label" available only on removable tag.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, you convinced me, let's remove it ;)

@papegaill papegaill added pr: modification needed and removed pr: review needed Use this label to show that your PR needs to be review labels Feb 11, 2020
@Joosthe Joosthe added pr: review needed Use this label to show that your PR needs to be review and removed pr: modification needed labels Feb 13, 2020
label: text('Label', 'Link tag'),
path: text('Url', '/example'),
label: text('Label', dataLink.tag.label),
path: text('Url', dataLink.tag.path),
Copy link
Contributor

Choose a reason for hiding this comment

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

MMhh, but if we are doing this in order to match as much as possible the specs, why we name the knob "url" when the property passed to the template is path? I understand that in any case a bit of ambiguity is in place, considering that both a path and an url can be used, so that's what i would do, we name it: Path (accepts also a full url), what do you think?

Copy link
Contributor

@planctus planctus left a comment

Choose a reason for hiding this comment

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

Just a question...

@planctus planctus added pr: questions and removed pr: review needed Use this label to show that your PR needs to be review labels Feb 13, 2020
@planctus planctus merged commit 7493eb8 into develop Feb 17, 2020
@planctus planctus deleted the FRONT-492 branch February 17, 2020 09:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants