-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEVPROD-5762 Replace all hardcoded slugs with an enum slug and consol…
…idate slug name to associated resource (#18)
- Loading branch information
Showing
57 changed files
with
366 additions
and
213 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
apps/spruce/src/analytics/distroSettings/useDistroSettingsAnalytics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { useParams } from "react-router-dom"; | ||
import { useAnalyticsRoot } from "analytics/useAnalyticsRoot"; | ||
import { slugs } from "constants/routes"; | ||
|
||
type Action = | ||
| { name: "Save distro"; section: string } | ||
| { name: "Create new distro"; newDistroId: string } | ||
| { name: "Duplicate distro"; newDistroId: string }; | ||
|
||
export const useDistroSettingsAnalytics = () => { | ||
const { distroId } = useParams<{ distroId: string }>(); | ||
const { [slugs.distroId]: distroId } = useParams(); | ||
return useAnalyticsRoot<Action>("DistroSettings", { distroId }); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { useParams, Navigate } from "react-router-dom"; | ||
import { getUserPatchesRoute } from "constants/routes"; | ||
import { getUserPatchesRoute, slugs } from "constants/routes"; | ||
|
||
export const UserPatchesRedirect: React.FC = () => { | ||
const { id } = useParams<{ id: string }>(); | ||
return <Navigate replace to={getUserPatchesRoute(id)} />; | ||
const { [slugs.userId]: userId } = useParams(); | ||
return <Navigate replace to={getUserPatchesRoute(userId)} />; | ||
}; |
4 changes: 2 additions & 2 deletions
4
apps/spruce/src/components/Redirects/WaterfallCommitsRedirect.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { useParams, Navigate } from "react-router-dom"; | ||
import { getCommitsRoute } from "constants/routes"; | ||
import { getCommitsRoute, slugs } from "constants/routes"; | ||
|
||
export const WaterfallCommitsRedirect: React.FC = () => { | ||
const { projectIdentifier } = useParams<{ projectIdentifier: string }>(); | ||
const { [slugs.projectIdentifier]: projectIdentifier } = useParams(); | ||
return <Navigate to={getCommitsRoute(projectIdentifier)} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.