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: add preserveQuery option to Wizard #126

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

teofanis
Copy link
Contributor

@teofanis teofanis commented Aug 25, 2023

This is a continuation/remake of this PR.
Also addresses issue #36

Description

Introduced the preserveQuery prop to the Wizard component to allow for maintaining search parameters in the URL during navigation. This addition ensures users can maintain state in the URL, enabling deep-linking scenarios and improving user experience.

Motivation and Context

The preserveQuery prop addresses a common use-case where developers want to maintain URL parameters for various reasons, such as sharing links or retaining user settings across navigation.

Addresses issue #36 .

How Has This Been Tested?

Wrote tests cases using the enzyme testing library. Tests handle scenarios listed below.

(Only when the preserveQuery prop is passed).

  • Ensure that it handles initial path with query
  • Ensure that it preserves initial query when navigating to the next step
  • Ensure that it preserves initial query when using replace
  • Ensure that it works with search params
  • Ensure that it does not add params if there were none

Let me know if there's a specific test scenario that I should add.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (adding or updating documentation)
  • Dependency update

Checklist:

  • My change requires a change to the documentation and I have updated the documentation accordingly.
  • My changes are in sync with the code style of this project.
  • There aren't any other open Pull Requests for the same issue/update.
  • These changes should be applied to a maintenance branch.
  • This change requires cross browser checks.
  • This change adds additional environment variable requirements for react-albus users.
  • I have added the Apache 2.0 license header to any new files created.

What is the Impact to Developers Using react-albus?

Developers now have the option to maintain URL parameters using the preserveQuery prop. This enhancement will provide flexibility to developers, ensuring a better user experience in scenarios where URL state needs to be retained.

P.S - I can add an example under examples/preserve-query later on.

@teofanis teofanis requested a review from a team as a code owner August 25, 2023 19:36
@Matthew-Mallimo Matthew-Mallimo added the Contribution For contributions from outside the github team label Aug 28, 2023
@Matthew-Mallimo Matthew-Mallimo requested a review from a team August 28, 2023 15:41
@github-actions
Copy link

This pull request is stale because it has been open 30 days with no activity.

@JAdshead JAdshead merged commit 142d4b3 into americanexpress:main Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution For contributions from outside the github team stale-pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants