Skip to content

Commit

Permalink
[Refactor] Delete Conversation and Purchases apps
Browse files Browse the repository at this point in the history
  • Loading branch information
damassi committed May 27, 2020
1 parent 92dd8ed commit 51f973d
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 197 deletions.
28 changes: 0 additions & 28 deletions src/desktop/apps/conversations/client.tsx

This file was deleted.

54 changes: 0 additions & 54 deletions src/desktop/apps/conversations/server.tsx

This file was deleted.

32 changes: 0 additions & 32 deletions src/desktop/apps/purchases/client.tsx

This file was deleted.

55 changes: 0 additions & 55 deletions src/desktop/apps/purchases/server.tsx

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion src/desktop/assets/conversations.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/desktop/assets/purchases.js

This file was deleted.

4 changes: 1 addition & 3 deletions src/desktop/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ app.use(require("./apps/auctions"))
app.use(require("./apps/auctions2").app)
app.use(require("./apps/auction_lots"))

// TODO: Remove after AB test ends.
app.use(require("./apps/purchases/server").app)
app.use(require("./apps/conversations/server").app)
// FIXME: Remove once JSONPage + new app shell is worked out
app.use(require("./apps/art_keeps_going/server").app)

app.use(require("./apps/artists"))
Expand Down
2 changes: 0 additions & 2 deletions src/v2/Apps/Conversation/Routes/Conversation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,3 @@ export const ConversationFragmentContainer = createFragmentContainer(
`,
}
)

export default ConversationFragmentContainer
3 changes: 2 additions & 1 deletion src/v2/Apps/Conversation/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import loadable from "@loadable/component"
import { RouteConfig } from "found"
import { graphql } from "react-relay"
import { ConversationFragmentContainer as ConversationRoute } from "./Routes/Conversation"

export const conversationRoutes: RouteConfig[] = [
{
Expand All @@ -26,7 +27,7 @@ export const conversationRoutes: RouteConfig[] = [
{
path: "/user/conversations/:conversationID",
displayFullPage: true,
getComponent: () => loadable(() => import("./Routes/Conversation")),
Component: ConversationRoute,
prepareVariables: (params, _props) => {
return {
conversationID: params.conversationID,
Expand Down
21 changes: 11 additions & 10 deletions src/v2/Apps/Purchase/PurchaseApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Title } from "react-head"
import { createFragmentContainer, graphql } from "react-relay"
import { userIsAdmin } from "v2/Utils/user"
import { PurchaseHistoryFragmentContainer as PurchaseHistory } from "./Components/PurchaseHistory"
import { Spacer } from "@artsy/palette"

export interface PurchaseAppProps {
me: PurchaseApp_me
Expand All @@ -20,6 +21,7 @@ export const PurchaseApp = (props: any) => {
return (
<AppContainer>
<Title>My Orders | Artsy</Title>
<Spacer mt={2} />
<PurchaseHistory me={me} />
</AppContainer>
)
Expand All @@ -29,13 +31,12 @@ export const PurchaseApp = (props: any) => {
}
}

export const PurchaseAppFragmentContainer = createFragmentContainer(
PurchaseApp,
{
me: graphql`
fragment PurchaseApp_me on Me {
...PurchaseHistory_me
}
`,
}
)
const PurchaseAppFragmentContainer = createFragmentContainer(PurchaseApp, {
me: graphql`
fragment PurchaseApp_me on Me {
...PurchaseHistory_me
}
`,
})

export default PurchaseAppFragmentContainer
9 changes: 3 additions & 6 deletions src/v2/Apps/Purchase/__tests__/PurchaseApp.jest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from "react"
import { HeadProvider } from "react-head"
import { graphql } from "react-relay"
import { PurchaseHistoryProps } from "../Components/PurchaseHistory"
import { PurchaseAppFragmentContainer } from "../PurchaseApp"
import PurchaseAppFragmentContainer from "../PurchaseApp"

jest.unmock("react-relay")

Expand Down Expand Up @@ -72,7 +72,7 @@ const render = (me: PurchaseAppTestQueryRawResponse["me"], user: User) =>
}
}
`,
wrapper: children => (
wrapper: (children) => (
<MockBoot>
<HeadProvider>
<SystemContextProvider user={user}>{children}</SystemContextProvider>
Expand Down Expand Up @@ -126,10 +126,7 @@ describe("Purchase app", () => {
const pagination = component.find("LargePagination")
expect(pagination.length).toBe(1)
expect(pagination.text()).toContain("1234...7")
pagination
.find("button")
.at(1)
.simulate("click")
pagination.find("button").at(1).simulate("click")
expect(refetchSpy).toHaveBeenCalledTimes(1)
expect(refetchSpy.mock.calls[0][0]).toEqual(
expect.objectContaining({ first: 10, after: "NQ" })
Expand Down
6 changes: 2 additions & 4 deletions src/v2/Apps/Purchase/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import loadable from "@loadable/component"
import { graphql } from "react-relay"

// @ts-ignore
import { RouteConfig } from "found"
import { PurchaseAppFragmentContainer as PurchaseApp } from "./PurchaseApp"

export const routes: RouteConfig[] = [
{
path: "/user/purchases",
Component: PurchaseApp,
getComponent: () => loadable(() => import("./PurchaseApp")),
query: graphql`
query routes_PurchaseQuery {
me {
Expand Down
4 changes: 4 additions & 0 deletions src/v2/Apps/getAppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { collectRoutes } from "v2/Apps/Collect/collectRoutes"
import { conversationRoutes } from "v2/Apps/Conversation/routes"
import { routes as identityVerificationRoutes } from "v2/Apps/IdentityVerification/routes"
import { routes as orderRoutes } from "v2/Apps/Order/routes"
import { routes as purchasesRoutes } from "v2/Apps/Purchase/routes"
import { routes as searchRoutes } from "v2/Apps/Search/routes"
import { routes as viewingRoomRoutes } from "./ViewingRoom/routes"

Expand All @@ -29,6 +30,9 @@ export function getAppRoutes(): RouteConfig[] {
{
routes: orderRoutes,
},
{
routes: purchasesRoutes,
},
{
routes: searchRoutes,
},
Expand Down

0 comments on commit 51f973d

Please sign in to comment.