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: updates to stepper component (breaking change + new tag attribute) #573

Merged
merged 12 commits into from
Aug 19, 2024

Conversation

ethanWallace
Copy link
Collaborator

@ethanWallace ethanWallace commented Jun 26, 2024

Summary | Résumé

Update gcds-stepper to match new design changing stepper from a caption to a heading with caption.

Changes

  • New tag attribute lets you set heading level h1 | h2 | h3.
  • Previously, the heading level was set to h6, this functionality has changed.
  • New default slot to pass heading text to stepper

Old implementation

<gcds-stepper current-step="1" total-steps="4">
</gcds-stepper>

New implementation

<gcds-stepper current-step="1" total-steps="4" tag="h2">
  Section title
</gcds-stepper>

Requires tokens from cds-snc/gcds-tokens#278.

@daine
Copy link
Collaborator

daine commented Jun 26, 2024

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:
feat: updates to stepper component (new tag attribute)

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.

  • New tag attribute lets you set heading level h1 | h2 | h3.
  • Previously, the heading level was set to h6, this functionality has changed.
  • New default slot to pass heading text to stepper

@ethanWallace ethanWallace changed the title refactor: stepper component V2 feat: updates to stepper component (new tag attribute) Jun 27, 2024
@ethanWallace
Copy link
Collaborator Author

Just waiting on the translation for our will not render error.

Copy link
Collaborator

@melaniebmn melaniebmn 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, will approve when translation comes back

Comment on lines 36 to 40
if (this.totalSteps == undefined) {
this.totalSteps = 3;
} else if (this.totalSteps < this.currentStep) {
this.totalSteps = this.currentStep;
}
Copy link
Collaborator

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?

Copy link
Collaborator

@daine daine left a 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.

/**
* State to track if component should render
*/
@State() renderError: boolean = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

@ethanWallace ethanWallace requested review from daine and melaniebmn July 4, 2024 17:25
Copy link
Collaborator

@melaniebmn melaniebmn left a 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!

@ethanWallace
Copy link
Collaborator Author

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

Copy link
Collaborator

@daine daine 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 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?
    Screenshot 2024-07-09 at 8 19 47 AM

  • 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?
    Screenshot 2024-07-09 at 8 28 45 AM

Thank you!

melaniebmn
melaniebmn previously approved these changes Jul 9, 2024
Copy link
Collaborator

@melaniebmn melaniebmn left a comment

Choose a reason for hiding this comment

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

LGTM

daine
daine previously approved these changes Jul 9, 2024
Copy link
Collaborator

@daine daine left a comment

Choose a reason for hiding this comment

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

LGTM!

@ethanWallace ethanWallace dismissed stale reviews from daine and melaniebmn via c99e7c7 July 24, 2024 18:40
@ethanWallace ethanWallace requested review from daine and melaniebmn July 24, 2024 18:40
@ethanWallace ethanWallace changed the title feat: updates to stepper component (new tag attribute) feat: updates to stepper component (breaking change + new tag attribute) Jul 24, 2024
daine
daine previously approved these changes Jul 25, 2024
Copy link
Collaborator

@daine daine left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@melaniebmn melaniebmn left a comment

Choose a reason for hiding this comment

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

LGTM

@ethanWallace ethanWallace merged commit 0f8bd2f into main Aug 19, 2024
3 checks passed
@ethanWallace ethanWallace deleted the refactor/stepper-component branch August 19, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants