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(Wizard): add preventNavigation callback function to onStepChange #3924

Merged
merged 10 commits into from
Sep 12, 2024

Conversation

joakbjerk
Copy link
Contributor

@joakbjerk joakbjerk commented Sep 12, 2024

  • Add example to Wizard.Container
  • Update docs
  • Update tests
  • Fix types

Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia 🛑 Canceled (Inspect) Sep 12, 2024 1:40pm

@joakbjerk joakbjerk changed the title feat(Wizard): add preventNavigation´ callback function to onStepChange` feat(Wizard): add preventNavigation callback function to onStepChange Sep 12, 2024
Copy link

codesandbox-ci bot commented Sep 12, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@langz langz marked this pull request as ready for review September 12, 2024 13:02
Copy link
Contributor

@langz langz left a comment

Choose a reason for hiding this comment

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

Other than the failing unit test, it looks good to me 🎆 🥳
Maybe @tujoworker also have the time to quickly look through this?

In general I like providing interactive examples instead of just "textual code" as done for this feature in https://eufemia-git-feat-wizard-preventnavigation-eufemia.vercel.app/uilib/extensions/forms/Wizard/Container/#controlling-the-wizard-steps

When it's interactive, I think:

  • Consumers/users of the feature will better understand the use case of the example/feature.
  • It's easier for a reviewer to test if it actually works.
  • We'll write the example/demo as actual code and not just "textual code" which will find potential errors in the example, such as random human coding errors, typescript errors, etc. This will also make it easier to find if we'll make breaking changes(refactoring) to it in the future, etc.

When thinking about it, as an alternative to a demo/example a lot of these points could also be solved by adding story, especially points regarding typescript errors, code errors and future potential refactoring.

Just give it a consideration 🙏

@tujoworker tujoworker force-pushed the feat/wizard-preventnavigation branch 2 times, most recently from 66f04d4 to f96e4bf Compare September 12, 2024 13:22
@joakbjerk joakbjerk force-pushed the feat/wizard-preventnavigation branch from f6879ad to e511b76 Compare September 12, 2024 13:27
Copy link
Member

@tujoworker tujoworker left a comment

Choose a reason for hiding this comment

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

Nice. Added another test to verify that the validation is run before the preventNavigation

@joakbjerk joakbjerk merged commit 5ec2772 into main Sep 12, 2024
10 checks passed
@joakbjerk joakbjerk deleted the feat/wizard-preventnavigation branch September 12, 2024 13:51
tujoworker pushed a commit that referenced this pull request Sep 12, 2024
## [10.48.0](v10.47.0...v10.48.0) (2024-09-12)

### 🐛 Bug Fixes

* **countries:** Fixes wrong country code for Martinique [#3915](#3915) ([a9f86e4](a9f86e4))
* **countries:** Remove outdated countries [#3915](#3915) ([36ef5cf](36ef5cf))
* **Forms:** rename 'Macedonia' to 'North Macedonia' ([#3918](#3918)) ([a4eb8a4](a4eb8a4))
* **Forms:** rename "Hviterussland" to "Belarus" ([#3917](#3917)) ([702118a](702118a))
* removes outdated countries based on ISO 3166-1 alpha-2 ([#3916](#3916)) ([a045acd](a045acd))

### ✨ Features

* **Forms:** add `toolbarVariant="minimumOneItem"` to Iterate.Toolbar for hiding buttons when there is only one item in the array ([#3919](#3919)) ([3367a77](3367a77)), closes [#3877](#3877)
* **Forms:** add `validator` support to Iterate.Array ([#3926](#3926)) ([6fd439e](6fd439e))
* **Forms:** auto-open Form.Section container when fields have errors and add `validateInitially` prop  ([#3878](#3878)) ([9b49006](9b49006))
* **Forms:** auto-open iterate containers when validation errors and make `Iterate.Toolbar` fully customizable ([#3877](#3877)) ([52326bf](52326bf)), closes [#3919](#3919)
* **Forms:** show optional label when a field uses `required={false}` and add `labelSuffix` prop to each field ([#3921](#3921)) ([60e440a](60e440a))
* **Wizard:** add `preventNavigation` callback function to `onStepChange` ([#3924](#3924)) ([5ec2772](5ec2772))
@tujoworker
Copy link
Member

🎉 This PR is included in version 10.48.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants