Skip to content

Commit

Permalink
[PLAY-1539] Playbook Website Redirects - Go to Parent not Home (#4013)
Browse files Browse the repository at this point in the history
**What does this PR do?** A clear and concise description with your
runway ticket url.

This fixes the redirection of none sense urls to the parent page if
there is one otherwise, it sends the user home.

[PLAY-1539](https://runway.powerhrg.com/backlog_items/PLAY-1539)


**Screenshots:** Screenshots to visualize your addition/change


**How to test?** Steps to confirm the desired behavior:
1. Go to links listed on Story card
2. Should see appropriate redirects


#### Checklist:
- [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new
kit`, `deprecated`, or `breaking`. See [Changelog &
Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels)
for details.
- [ ] **DEPLOY** I have added the `milano` label to show I'm ready for a
review.
- [ ] **TESTS** I have added test coverage to my code.
  • Loading branch information
Tomm1128 authored Dec 20, 2024
1 parent 4a0f70c commit a5af760
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ const VisualGuidelines = ({
return <Truncate example={examples.truncate_jsx} />

default:
return <Colors/>;
if (window.location.pathname !== "/visual_guidelines/colors") {
window.history.replaceState(null, "", "/visual_guidelines/colors");
}
return <Colors />;
}
}
return <div className="visual_guidelines_individual">{getComponent(result)}</div>;
Expand Down
2 changes: 2 additions & 0 deletions playbook-website/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
get "changelog/figma", to: "pages#changelog_figma"
get "changelog", to: redirect("changelog/web")

get "changelog/*path", to: redirect("changelog/web")

# Kits

## Beta View
Expand Down

0 comments on commit a5af760

Please sign in to comment.