Skip to content

Commit

Permalink
chore: update alert screen routes (#9590)
Browse files Browse the repository at this point in the history
* chore: update alert screen routes

Match web routes for deep-link support.

```
/my-profile/saved-search-alerts > /settings/alerts
/my-profile/saved-search-alerts/:id > /settings/alerts/:id/edit
```

* chore: add `/settings` to AndroidManifest file to support deep-linking
  • Loading branch information
dblandin authored Nov 23, 2023
1 parent 8d22776 commit 355ffda
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<data android:pathPrefix="/privacy-request" />
<data android:pathPrefix="/sales" />
<data android:pathPrefix="/search" />
<data android:pathPrefix="/settings" />
<data android:pathPrefix="/show" />
<data android:pathPrefix="/tag" />
<data android:pathPrefix="/user/conversations" />
Expand Down
2 changes: 1 addition & 1 deletion src/app/Components/Artist/ArtistHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const ArtistHeader: React.FC<Props> = ({ artist, me, onLayoutChange }) =>
<Touchable
haptic
onPress={() => {
navigate(`/my-profile/saved-search-alerts?artistID=${artistData.internalID}`)
navigate(`/settings/alerts?artistID=${artistData.internalID}`)
}}
>
<Text variant="xs" color="blue100">
Expand Down
2 changes: 1 addition & 1 deletion src/app/Scenes/Artwork/ArtworkAuctionCreateAlertHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const ArtworkAuctionCreateAlertHeader: FC<ArtworkAuctionCreateAlertHeader
variant="outline"
haptic
onPress={() => {
navigate("/my-profile/saved-search-alerts")
navigate("/settings/alerts")
}}
icon={<BellIcon fill="black100" />}
block
Expand Down
2 changes: 1 addition & 1 deletion src/app/Scenes/MyProfile/MyProfileSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const MyProfileSettings: React.FC<MyProfileSettingsProps> = ({ onSuccess
<Separator my={1} borderColor={separatorColor} />
<MenuItem title="Account Settings" onPress={() => navigate("my-account")} />
<Separator my={1} borderColor={separatorColor} />
<MenuItem title="Saved Alerts" onPress={() => navigate("my-profile/saved-search-alerts")} />
<MenuItem title="Saved Alerts" onPress={() => navigate("settings/alerts")} />
<Separator my={1} borderColor={separatorColor} />
<MenuItem title="Follows" onPress={() => navigate("favorites")} />
<Separator my={1} borderColor={separatorColor} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ describe("SavedSearchAlertForm", () => {

await waitFor(() => expect(spyAlert.mock.calls[0][0]).toBe("Duplicate Alert"))

expect(navigate).toBeCalledWith("/my-profile/saved-search-alerts/internalID-1")
expect(navigate).toBeCalledWith("/settings/alerts/internalID-1/edit")
})

it('should call update mutation when "Replace" button is pressed', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/Scenes/SavedSearchAlert/SavedSearchAlertForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const SavedSearchAlertForm: React.FC<SavedSearchAlertFormProps> = (props)
goBack()

requestAnimationFrame(() => {
navigate(`/my-profile/saved-search-alerts/${duplicateSavedSearchId}`)
navigate(`/settings/alerts/${duplicateSavedSearchId}/edit`)
})
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe(ConfirmationScreen, () => {
fireEvent.press(manageButton!)
await flushPromiseQueue()

expect(navigate).toHaveBeenCalledWith("/my-profile/saved-search-alerts")
expect(navigate).toHaveBeenCalledWith("/settings/alerts")
})

it("renders see-all button if there are more works to show", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const ConfirmationScreen: React.FC = () => {
const handleManageAlerts = () => {
closeModal?.()
requestAnimationFrame(() => {
navigate("/my-profile/saved-search-alerts")
navigate("/settings/alerts")
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const SavedSearchesList: React.FC<SavedSearchesListProps> = (props) => {
<SavedSearchListItem
title={item.displayName}
onPress={() => {
navigate(`my-profile/saved-search-alerts/${item.internalID}`)
navigate(`settings/alerts/${item.internalID}/edit`)
}}
/>
)
Expand Down
4 changes: 2 additions & 2 deletions src/app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ function getDomainMap(): Record<string, RouteMatcher[] | null> {
addRoute("/my-profile/payment", "MyProfilePayment"),
addRoute("/my-profile/payment/new-card", "MyProfilePaymentNewCreditCard"),
addRoute("/my-profile/push-notifications", "MyProfilePushNotifications"),
addRoute("/my-profile/saved-search-alerts", "SavedSearchAlertsList"),
addRoute("/my-profile/saved-search-alerts/:savedSearchAlertId", "EditSavedSearchAlert"),
addRoute("/my-profile/settings", "MyProfileSettings"),
addRoute("/new-for-you", "NewWorksForYou"),
addRoute("/new-works-from-galleries-you-follow", "NewWorksFromGalleriesYouFollow"),
Expand All @@ -252,6 +250,8 @@ function getDomainMap(): Record<string, RouteMatcher[] | null> {
addRoute("/search", "Search"),
addRoute("/sell/inquiry", "ConsignmentInquiry"),
addRoute("/selling-with-artsy", "MyCollectionSellingWithartsyFAQ"),
addRoute("/settings/alerts", "SavedSearchAlertsList"),
addRoute("/settings/alerts/:savedSearchAlertId", "EditSavedSearchAlert"),
addRoute("/settings/dark-mode", "DarkModeSettings"),
addRoute("/show/:showID", "Show"),
addRoute("/show/:showID/info", "ShowMoreInfo"),
Expand Down
2 changes: 1 addition & 1 deletion src/app/system/navigation/navigate.tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ describe(navigate, () => {

it("pop to root tab view in cases where that's required", async () => {
await navigate("my-profile/payment")
await navigate("my-profile/saved-search-alerts", {
await navigate("settings/alerts", {
popToRootTabView: true,
showInTabName: "profile",
})
Expand Down

0 comments on commit 355ffda

Please sign in to comment.