-
Notifications
You must be signed in to change notification settings - Fork 16
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: updates to stepper component (breaking change + new tag attribute) #573
Conversation
When we merge this commit, could we name it as close as possible to the changes it has on current users? I'm thinking something like: I love how you've detailed the changes in the PR description! Would it be possible to refine it a bit more? This is the page users get to dive into more info on the changes as it's linked on the CHANGELOG and release description.
|
Just waiting on the translation for our will not render error. |
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.
Looks good, will approve when translation comes back
if (this.totalSteps == undefined) { | ||
this.totalSteps = 3; | ||
} else if (this.totalSteps < this.currentStep) { | ||
this.totalSteps = this.currentStep; | ||
} |
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 comment here as above on validation; I feel like we shouldn't be setting arbitrary values for these because they are a required field, is there a really good reason that we have to set it instead of reporting it as an invalid parameter?
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.
Tested the code and it works pretty well! Just a few changes mostly around validation and testing.
packages/web/src/components/gcds-stepper/test/gcds-stepper.spec.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/components/gcds-stepper/test/gcds-stepper.spec.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/components/gcds-stepper/test/gcds-stepper.spec.tsx
Outdated
Show resolved
Hide resolved
/** | ||
* State to track if component should render | ||
*/ | ||
@State() renderError: boolean = false; |
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.
Nice!
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.
+1 on the unit tests that @daine mentioned - the rest looks great!
I believe I have captured all the ways the stepper would fail to render in the unit tests but let me know if I missed one |
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.
Just a few more requests please then we should be good to go!
-
Can we fix the linting? @melaniebmn and I noticed a while back that you and I don't seem to be getting the lint complaints, I messed around with my IDE's configuration and it now shows me the lint warnings, could you check yours too?
-
When you run the tests or check the overview and structure, 4 of them just shows "renders steps" and I realize we have the description in the comments, could we update those?
Thank you!
packages/web/src/components/gcds-stepper/test/gcds-stepper.spec.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/components/gcds-stepper/test/gcds-stepper.spec.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/components/gcds-stepper/test/gcds-stepper.spec.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/components/gcds-stepper/test/gcds-stepper.spec.tsx
Outdated
Show resolved
Hide resolved
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.
LGTM
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.
LGTM!
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.
LGTM!
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.
LGTM
Summary | Résumé
Update
gcds-stepper
to match new design changing stepper from a caption to a heading with caption.Changes
Old implementation
New implementation
Requires tokens from cds-snc/gcds-tokens#278.