Skip to content

Commit

Permalink
feat: remove sell tab and sell mentions (#11515)
Browse files Browse the repository at this point in the history
* feat: remove SWA mentions

* fix: broken test

* chore: remove routes

* fix: more broken tests

* remove: submission status from my collection
  • Loading branch information
MounirDhahri authored Feb 7, 2025
1 parent ff99ed4 commit dd9b616
Show file tree
Hide file tree
Showing 38 changed files with 73 additions and 2,155 deletions.
1 change: 0 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
<data android:pathPrefix="/partner-offer" />
<data android:pathPrefix="/price-database" />
<data android:pathPrefix="/privacy-request" />
<data android:pathPrefix="/sell" />
<data android:pathPrefix="/search" />
<data android:pathPrefix="/settings" />
<data android:pathPrefix="/show" />
Expand Down
21 changes: 2 additions & 19 deletions src/app/Components/ArtworkGrids/InfiniteScrollArtworksGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
// - leting the artwork component do a layout pass and calculate its own height based on the column width.
// 4. Update height of grid to encompass all items.

import { Box, Flex, Spinner, Button } from "@artsy/palette-mobile"
import { Box, Button, Flex, Spinner } from "@artsy/palette-mobile"
import { InfiniteScrollArtworksGrid_connection$data } from "__generated__/InfiniteScrollArtworksGrid_connection.graphql"
import { InfiniteScrollArtworksGrid_myCollectionConnection$data } from "__generated__/InfiniteScrollArtworksGrid_myCollectionConnection.graphql"
import ParentAwareScrollView from "app/Components/ParentAwareScrollView"
import { PAGE_SIZE } from "app/Components/constants"
import { MyCollectionArtworkGridItemFragmentContainer } from "app/Scenes/MyCollection/Screens/ArtworkList/MyCollectionArtworkGridItem"
import { GlobalStore } from "app/store/GlobalStore"
import { AnalyticsContextProvider } from "app/system/analytics/AnalyticsContext"
import { extractNodes } from "app/utils/extractNodes"
import { useFeatureFlag } from "app/utils/hooks/useFeatureFlag"
import { isCloseToBottom } from "app/utils/isCloseToBottom"
import { ArtworkActionTrackingProps } from "app/utils/track/ArtworkActions"
import React, { useState } from "react"
Expand All @@ -32,7 +30,7 @@ import {
View,
ViewStyle,
} from "react-native"
import { createFragmentContainer, RelayPaginationProp, graphql } from "react-relay"
import { createFragmentContainer, graphql, RelayPaginationProp } from "react-relay"
import Artwork, { ArtworkProps } from "./ArtworkGridItem"

/**
Expand Down Expand Up @@ -213,11 +211,6 @@ const InfiniteScrollArtworksGrid: React.FC<Props & PrivateProps> = ({
}) => {
const artworks = extractNodes(connection)

const enableMyCollectionSellOnboarding = useFeatureFlag(
"AREnableMyCollectionInterestedInSellingTooltip"
)
const { isDismissed } = GlobalStore.useAppState((state) => state.progressiveOnboarding)

const getSectionDimension = (gridWidth: number | null | undefined) => {
// Setting the dimension to 1 for tests to avoid adjusting the screen width
if (__TEST__) {
Expand Down Expand Up @@ -334,15 +327,6 @@ const InfiniteScrollArtworksGrid: React.FC<Props & PrivateProps> = ({
const imgWidth = sectionDimension
const imgHeight = imgWidth / aspectRatio

// Display "Interested in Selling?" tooltip if the first artwork is from a P1 artist in the list
const displayToolTip =
enableMyCollectionSellOnboarding &&
isMyCollection &&
!isDismissed("my-collection-sell-this-work").status &&
itemIndex === 0 &&
artwork.artist?.targetSupply?.isTargetSupply &&
!(artwork as any).consignmentSubmission

artworkComponents.push(
<ItemComponent
contextScreenOwnerType={contextScreenOwnerType}
Expand All @@ -359,7 +343,6 @@ const InfiniteScrollArtworksGrid: React.FC<Props & PrivateProps> = ({
{...itemComponentProps}
height={imgHeight}
{...componentSpecificProps}
displayToolTip={displayToolTip}
hideIncreasedInterestSignal={hideIncreasedInterest}
hideCuratorsPickSignal={hideCuratorsPick}
hideRegisterBySignal={hideRegisterBySignal}
Expand Down
16 changes: 0 additions & 16 deletions src/app/Navigation/AuthenticatedRoutes/SellTab.tsx

This file was deleted.

7 changes: 0 additions & 7 deletions src/app/Navigation/AuthenticatedRoutes/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { HomeTab } from "app/Navigation/AuthenticatedRoutes/HomeTab"
import { InboxTab } from "app/Navigation/AuthenticatedRoutes/InboxTab"
import { ProfileTab } from "app/Navigation/AuthenticatedRoutes/ProfileTab"
import { SearchTab } from "app/Navigation/AuthenticatedRoutes/SearchTab"
import { SellTab } from "app/Navigation/AuthenticatedRoutes/SellTab"
import { modalRoutes } from "app/Navigation/AuthenticatedRoutes/modalRoutes"
import { internal_navigationRef } from "app/Navigation/Navigation"
import { AppModule } from "app/Navigation/routes"
Expand All @@ -33,14 +32,12 @@ export type AuthenticatedRoutesParams = {
Search: undefined
Profile: undefined
Inbox: undefined
Sell: undefined
} & { [key in AppModule]: undefined }

type TabRoutesParams = {
home: undefined
search: undefined
inbox: undefined
sell: undefined
profile: undefined
}

Expand Down Expand Up @@ -143,7 +140,6 @@ const AppTabs: React.FC = () => {
<Tab.Screen name="home" component={HomeTab} options={{ ...tabsBadges["home"] }} />
<Tab.Screen name="search" component={SearchTab} />
<Tab.Screen name="inbox" component={InboxTab} options={{ ...tabsBadges["inbox"] }} />
<Tab.Screen name="sell" component={SellTab} />
<Tab.Screen name="profile" component={ProfileTab} options={{ ...tabsBadges["profile"] }} />
</Tab.Navigator>
)
Expand Down Expand Up @@ -188,9 +184,6 @@ export const tabsTracks = {
case "search":
tabScreen = OwnerType.search
break
case "sell":
tabScreen = OwnerType.sell
break
}

return {
Expand Down
20 changes: 0 additions & 20 deletions src/app/Navigation/routes.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ describe("artsy.net routes", () => {
expect(matchRoute("https://staging.artsy.net/")).toEqual(expected)
})

it("routes to Sell", () => {
expect(matchRoute("/sell")).toMatchInlineSnapshot(`
{
"module": "Sell",
"params": {},
"type": "match",
}
`)
})

it("routes to Search", () => {
expect(matchRoute("/search")).toMatchInlineSnapshot(`
{
Expand Down Expand Up @@ -860,16 +850,6 @@ describe("artsy.net routes", () => {
`)
})

it("routes to Sell", () => {
expect(matchRoute("/collections/my-collection/marketing-landing")).toMatchInlineSnapshot(`
{
"module": "SellNotRootTabView",
"params": {},
"type": "match",
}
`)
})

it("routes /conditions-of-sale to web view", () => {
expect(matchRoute("/conditions-of-sale")).toMatchInlineSnapshot(`
{
Expand Down
64 changes: 0 additions & 64 deletions src/app/Navigation/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ import {
MyCollectionArtworkScreen,
MyCollectionArtworkScreenQuery,
} from "app/Scenes/MyCollection/Screens/Artwork/MyCollectionArtwork"
import { MyCollectionSellingWithArtsyFAQ } from "app/Scenes/MyCollection/Screens/Artwork/MyCollectionSellingWithartsyFAQ"
import { MyCollectionArtworkAdd } from "app/Scenes/MyCollection/Screens/ArtworkForm/MyCollectionArtworkForm"
import { MyCollectionArtworkEditQueryRenderer } from "app/Scenes/MyCollection/Screens/ArtworkForm/Screens/MyCollectionArtworkEdit"
import { MyCollectionCollectedArtistsPrivacyQueryRenderer } from "app/Scenes/MyCollection/Screens/CollectedArtistsPrivacy/MyCollectionCollectedArtistsPrivacy"
Expand Down Expand Up @@ -126,11 +125,6 @@ import { AlertArtworks } from "app/Scenes/SavedSearchAlert/AlertArtworks"
import { EditSavedSearchAlertQueryRenderer } from "app/Scenes/SavedSearchAlert/EditSavedSearchAlert"
import { SavedSearchAlertsListQueryRenderer } from "app/Scenes/SavedSearchAlertsList/SavedSearchAlertsList"
import { SearchScreen, SearchScreenQuery } from "app/Scenes/Search/Search"
import { SubmitArtworkForm } from "app/Scenes/SellWithArtsy/ArtworkForm/SubmitArtworkForm"
import { SubmitArtworkFormEditContainer } from "app/Scenes/SellWithArtsy/ArtworkForm/SubmitArtworkFormEdit"
import { ConsignmentInquiryScreen } from "app/Scenes/SellWithArtsy/ConsignmentInquiry/ConsignmentInquiryScreen"
import { SellWithArtsyHomeScreenQuery } from "app/Scenes/SellWithArtsy/SellWithArtsyHome"
import { SellWithArtsy } from "app/Scenes/SellWithArtsy/SubmitArtwork/UploadPhotos/utils"
import { ShowMoreInfoQueryRenderer } from "app/Scenes/Show/Screens/ShowMoreInfo"
import { ShowQueryRenderer, ShowScreenQuery } from "app/Scenes/Show/Show"
import { SimilarToRecentlyViewedScreen } from "app/Scenes/SimilarToRecentlyViewed/SimilarToRecentlyViewed"
Expand Down Expand Up @@ -638,11 +632,6 @@ export const artsyDotNetRoutes = defineRoutes([
},
},
},
{
path: "/collections/my-collection/marketing-landing",
name: "SellNotRootTabView",
Component: SellWithArtsy,
},
{
path: "/conversation/:conversationID",
name: "Conversation",
Expand Down Expand Up @@ -1253,19 +1242,6 @@ export const artsyDotNetRoutes = defineRoutes([
},
queries: [RecentlyViewedScreenQuery],
},
{
path: "/sell",
name: "Sell",
Component: SellWithArtsy,
options: {
isRootViewForTabName: "sell",
onlyShowInTabName: "sell",
screenOptions: {
headerShown: false,
},
},
queries: [SellWithArtsyHomeScreenQuery],
},
{
path: "/search",
name: "Search",
Expand All @@ -1279,46 +1255,6 @@ export const artsyDotNetRoutes = defineRoutes([
},
queries: [SearchScreenQuery],
},
{
path: "/sell/inquiry",
name: "ConsignmentInquiry",
Component: ConsignmentInquiryScreen,
options: {
screenOptions: {
gestureEnabled: false,
},
},
},
{
path: "/sell/submissions/new",
name: "SubmitArtwork",
Component: SubmitArtworkForm,
options: {
alwaysPresentModally: true,
screenOptions: {
gestureEnabled: false,
headerShown: false,
},
},
},
{
path: "/sell/submissions/:externalID/edit",
name: "SubmitArtworkEdit",
Component: SubmitArtworkFormEditContainer,
options: {
alwaysPresentModally: true,
hidesBottomTabs: true,
screenOptions: {
gestureEnabled: false,
headerShown: false,
},
},
},
{
path: "/selling-with-artsy",
name: "MyCollectionSellingWithartsyFAQ",
Component: MyCollectionSellingWithArtsyFAQ,
},
{
path: "/favorites/alerts",
name: "SavedSearchAlertsList",
Expand Down
1 change: 0 additions & 1 deletion src/app/Navigation/utils/useBottomTabsBadges.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ describe("useBottomTabsBadges", () => {
home: { tabBarBadge: undefined, tabBarBadgeStyle: {} },
search: { tabBarBadge: undefined, tabBarBadgeStyle: {} },
inbox: { tabBarBadge: undefined, tabBarBadgeStyle: {} },
sell: { tabBarBadge: undefined, tabBarBadgeStyle: {} },
profile: { tabBarBadge: undefined, tabBarBadgeStyle: {} },
})
})
Expand Down
66 changes: 2 additions & 64 deletions src/app/Scenes/Artwork/Artwork.tests.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { fireEvent, screen } from "@testing-library/react-native"
import { ArtistSeriesMoreSeries } from "app/Scenes/ArtistSeries/ArtistSeriesMoreSeries"
import { ArtworkConsignments } from "app/Scenes/Artwork/Components/ArtworkConsignments"
import { ArtworkDetails } from "app/Scenes/Artwork/Components/ArtworkDetails"
import { ArtworkHistory } from "app/Scenes/Artwork/Components/ArtworkHistory"
import { ArtworkScreenHeader } from "app/Scenes/Artwork/Components/ArtworkScreenHeader"
Expand All @@ -12,9 +11,9 @@ import { PrivateArtworkMetadata } from "app/Scenes/Artwork/Components/PrivateArt
import { ShippingAndTaxesFragmentContainer } from "app/Scenes/Artwork/Components/ShippingAndTaxes"
import {
ArtworkFromLiveAuctionRegistrationClosed,
RegisteredBidder,
NotRegisteredToBid,
ArtworkFromLiveAuctionRegistrationOpen,
NotRegisteredToBid,
RegisteredBidder,
} from "app/__fixtures__/ArtworkBidAction"
import { ArtworkFixture } from "app/__fixtures__/ArtworkFixture"

Expand Down Expand Up @@ -928,66 +927,6 @@ describe("Artwork", () => {
})
})

describe("Consigments", () => {
it("shows consign link if at least 1 artist is consignable", async () => {
renderWithWrappers(<TestRenderer />, { includeNavigation: true })

// ArtworkAboveTheFoldQuery
resolveMostRecentRelayOperation(environment)
// ArtworkMarkAsRecentlyViewedQuery
resolveMostRecentRelayOperation(environment)
// ArtworkBelowTheFoldQuery
resolveMostRecentRelayOperation(environment, {
Artwork: () => ({
isUnlisted: false,
isForSale: true,
artists: [
{
name: "Santa",
isConsignable: true,
},
],
}),
})
await flushPromiseQueue()

expect(screen.getByText(/Consign with Artsy/)).toBeOnTheScreen()
})

it("doesn't render section", async () => {
renderWithWrappers(<TestRenderer />, { includeNavigation: true })

// ArtworkAboveTheFoldQuery
resolveMostRecentRelayOperation(environment, {
Artwork: () => ({
isUnlisted: false,
isAcquireable: false,
isOfferable: false,
isInAuction: false,
sale: null,
}),
})
// ArtworkMarkAsRecentlyViewedQuery
resolveMostRecentRelayOperation(environment)
// ArtworkBelowTheFoldQuery
resolveMostRecentRelayOperation(environment, {
Artwork: () => ({
isUnlisted: false,
isForSale: false,
artists: [
{
name: "Santa",
isConsignable: false,
},
],
}),
})
await flushPromiseQueue()

expect(screen.queryByText(/Consign with Artsy/)).toBeNull()
})
})

describe("Unlisted Private Artworks", () => {
it("renders correct components for unlisted private artworks", async () => {
renderWithWrappers(<TestRenderer />, { includeNavigation: true })
Expand Down Expand Up @@ -1023,7 +962,6 @@ describe("Artwork", () => {
expect(screen.UNSAFE_queryByType(OtherWorksFragmentContainer)).toBeNull()
expect(screen.UNSAFE_queryByType(ArtworksInSeriesRail)).toBeNull()
expect(screen.UNSAFE_queryByType(ArtistSeriesMoreSeries)).toBeNull()
expect(screen.UNSAFE_queryByType(ArtworkConsignments)).toBeNull()

// Displayed in unlisted private artworks
expect(screen.UNSAFE_queryByType(ArtworkScreenHeader)).toBeTruthy()
Expand Down
Loading

0 comments on commit dd9b616

Please sign in to comment.