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

chore: url path after OMP switch #1770

Merged
merged 3 commits into from
Nov 25, 2024
Merged

chore: url path after OMP switch #1770

merged 3 commits into from
Nov 25, 2024

Conversation

gitanjli525
Copy link
Contributor

@gitanjli525 gitanjli525 commented Nov 20, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

currently on profile switch user is always redirected to home page
with this change - on profile switch the user will land on the same subsection link

for org and merchant switch
currently: for the url that does not exist it shows error page and for others it goes to home page
with this change: same behaviour as on profile switch (will land on the same subsection link )

suppose url is /payments/pay_eHqoQH7t3efEazeiEXu2/pro_IJGV7MaFtoDvI9P5Ri0h it will be redirected to /payments
and so on, this ensures that user does not see any error and still remains under same module after switch

Motivation and Context

improving user experience

How did you test it?

  • observe url changes on different pages on profile switch

Where to test it?

  • INTEG
  • SANDBOX
  • PROD

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

@gitanjli525 gitanjli525 self-assigned this Nov 20, 2024
@gitanjli525 gitanjli525 requested a review from a team as a code owner November 20, 2024 08:54
Copy link

Review changes with  SemanticDiff

@gitanjli525 gitanjli525 added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed core Status: issues related to core labels Nov 20, 2024
@gitanjli525 gitanjli525 changed the title chore: path after profile switch chore: url path after OMP switch Nov 20, 2024
Comment on lines 32 to 40
let extractModulePath = (url: RescriptReactRouter.url) => {
let currentPathList = url.path->List.toArray
let path = switch currentPathList->Array.get(0) {
| Some("dashboard") => currentPathList->Array.slice(~start=0, ~end=2)->Array.joinWith("/")
| _ => currentPathList->LogicUtils.getValueFromArray(0, "home")
}
appendTrailingSlash(path)
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let extractModulePath = (url: RescriptReactRouter.url) => {
let currentPathList = url.path->List.toArray
let path = switch currentPathList->Array.get(0) {
| Some("dashboard") => currentPathList->Array.slice(~start=0, ~end=2)->Array.joinWith("/")
| _ => currentPathList->LogicUtils.getValueFromArray(0, "home")
}
appendTrailingSlash(path)
}
let extractModulePath = (url: RescriptReactRouter.url) => {
let currentPathList = url.path->List.toArray
let path = switch currentPathList->Array.get(0) {
| Some("dashboard") => currentPathList->Array.slice(~start=0, ~end=2)->Array.joinWith("/")
| _ => currentPathList->LogicUtils.getValueFromArray(0, "home")
}
appendTrailingSlash(path)
}
let extractModulePath = (url: RescriptReactRouter.url) => {
url.path->List.toArray->Array.slice(~start=0, ~end=2)->Array.joinWith("/")->appendTrailingSlash
}

@JeevaRamu0104 JeevaRamu0104 merged commit db22304 into main Nov 25, 2024
5 of 6 checks passed
@JeevaRamu0104 JeevaRamu0104 deleted the path-after-switch branch November 25, 2024 11:30
@github-actions github-actions bot added Closed Applied to issues or pull requests that have been successfully resolved or completed and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed core Status: issues related to core labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Applied to issues or pull requests that have been successfully resolved or completed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CHORE]: update the url to which user lands after performing OMP switch from dropdowns
2 participants