From 92dd8ed1fee057effdb3f785d12179d0b58fb2d7 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 26 May 2020 17:23:47 -0700 Subject: [PATCH] [Refactor] Delete unused apps / assetts --- .../analytics/inquiry_questionnaire.js | 1 - .../apps/artwork/artworkClient.tsx | 2 +- src/desktop/assets/artist.js | 1 - src/desktop/assets/artist.styl | 2 -- src/desktop/assets/artwork.js | 1 - src/desktop/assets/collect.styl | 0 src/desktop/assets/collect.ts | 1 - src/desktop/assets/identity_verification.styl | 0 src/desktop/assets/identity_verification.ts | 1 - src/desktop/assets/order.js | 1 - src/desktop/assets/search2.js | 1 - src/desktop/assets/search2.styl | 0 src/desktop/assets/viewing-room.tsx | 1 - .../artworkBuyersPremium/index.coffee | 22 +++++++++++++++++++ .../artworkBuyersPremium/index.styl | 10 +++++++++ src/desktop/{index.js => index.ts} | 8 +------ 16 files changed, 34 insertions(+), 18 deletions(-) delete mode 100644 src/desktop/assets/artist.js delete mode 100644 src/desktop/assets/artist.styl delete mode 100644 src/desktop/assets/artwork.js delete mode 100644 src/desktop/assets/collect.styl delete mode 100644 src/desktop/assets/collect.ts delete mode 100644 src/desktop/assets/identity_verification.styl delete mode 100644 src/desktop/assets/identity_verification.ts delete mode 100644 src/desktop/assets/order.js delete mode 100644 src/desktop/assets/search2.js delete mode 100644 src/desktop/assets/search2.styl delete mode 100644 src/desktop/assets/viewing-room.tsx create mode 100644 src/desktop/components/artworkBuyersPremium/index.coffee create mode 100644 src/desktop/components/artworkBuyersPremium/index.styl rename src/desktop/{index.js => index.ts} (91%) diff --git a/src/desktop/analytics/inquiry_questionnaire.js b/src/desktop/analytics/inquiry_questionnaire.js index ad25e3999da..1f33e254bdb 100644 --- a/src/desktop/analytics/inquiry_questionnaire.js +++ b/src/desktop/analytics/inquiry_questionnaire.js @@ -54,7 +54,6 @@ const analytics = window.analytics // _per session_, and therefore can't rely on `once`, as subsequent // inquiries would then not get tracked as there's no "hard jumps" // between pages. See: https://github.com/artsy/force/pull/5232 - // FIXME: Remove once A/B test completes analyticsHooks.on(namespace(name), handler) } diff --git a/src/desktop/apps/experimental-app-shell/apps/artwork/artworkClient.tsx b/src/desktop/apps/experimental-app-shell/apps/artwork/artworkClient.tsx index 7f4ab5503d4..5a86e08df63 100644 --- a/src/desktop/apps/experimental-app-shell/apps/artwork/artworkClient.tsx +++ b/src/desktop/apps/experimental-app-shell/apps/artwork/artworkClient.tsx @@ -7,7 +7,7 @@ export const artworkClient = () => { const Artwork = require("desktop/models/artwork.coffee") const ArtworkInquiry = require("desktop/models/artwork_inquiry.coffee") const openInquiryQuestionnaireFor = require("desktop/components/inquiry_questionnaire/index.coffee") - const openAuctionBuyerPremium = require("desktop/apps/artwork/components/buyers_premium/index.coffee") + const openAuctionBuyerPremium = require("desktop/components/artworkBuyersPremium/index.coffee") const ViewInRoomView = require("desktop/components/view_in_room/view.coffee") const $ = require("jquery") const mediator = require("desktop/lib/mediator.coffee") diff --git a/src/desktop/assets/artist.js b/src/desktop/assets/artist.js deleted file mode 100644 index 35f587ae198..00000000000 --- a/src/desktop/assets/artist.js +++ /dev/null @@ -1 +0,0 @@ -import "desktop/apps/artist/client" diff --git a/src/desktop/assets/artist.styl b/src/desktop/assets/artist.styl deleted file mode 100644 index 38366117f4d..00000000000 --- a/src/desktop/assets/artist.styl +++ /dev/null @@ -1,2 +0,0 @@ -.artist__foo - width: 100% diff --git a/src/desktop/assets/artwork.js b/src/desktop/assets/artwork.js deleted file mode 100644 index 89b8f301a76..00000000000 --- a/src/desktop/assets/artwork.js +++ /dev/null @@ -1 +0,0 @@ -import "desktop/apps/artwork/client" diff --git a/src/desktop/assets/collect.styl b/src/desktop/assets/collect.styl deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/desktop/assets/collect.ts b/src/desktop/assets/collect.ts deleted file mode 100644 index e6ddc3c2206..00000000000 --- a/src/desktop/assets/collect.ts +++ /dev/null @@ -1 +0,0 @@ -import "desktop/apps/collect/client" diff --git a/src/desktop/assets/identity_verification.styl b/src/desktop/assets/identity_verification.styl deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/desktop/assets/identity_verification.ts b/src/desktop/assets/identity_verification.ts deleted file mode 100644 index d29090814f0..00000000000 --- a/src/desktop/assets/identity_verification.ts +++ /dev/null @@ -1 +0,0 @@ -import "desktop/apps/identity_verification/client" diff --git a/src/desktop/assets/order.js b/src/desktop/assets/order.js deleted file mode 100644 index d1039da9780..00000000000 --- a/src/desktop/assets/order.js +++ /dev/null @@ -1 +0,0 @@ -import "desktop/apps/order/client" diff --git a/src/desktop/assets/search2.js b/src/desktop/assets/search2.js deleted file mode 100644 index ba540b106b3..00000000000 --- a/src/desktop/assets/search2.js +++ /dev/null @@ -1 +0,0 @@ -import "desktop/apps/search2/client" diff --git a/src/desktop/assets/search2.styl b/src/desktop/assets/search2.styl deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/desktop/assets/viewing-room.tsx b/src/desktop/assets/viewing-room.tsx deleted file mode 100644 index 29574b5a269..00000000000 --- a/src/desktop/assets/viewing-room.tsx +++ /dev/null @@ -1 +0,0 @@ -import "desktop/apps/viewing-room/client" diff --git a/src/desktop/components/artworkBuyersPremium/index.coffee b/src/desktop/components/artworkBuyersPremium/index.coffee new file mode 100644 index 00000000000..6f8731e854a --- /dev/null +++ b/src/desktop/components/artworkBuyersPremium/index.coffee @@ -0,0 +1,22 @@ +modalize = require '../modalize/index.coffee' +Auction = require '../../models/auction.coffee' +fetchBuyersPremium = require '../buyers_premium/index.coffee' + +module.exports = (auction_id) -> + $el = $('
') + + view = render: -> $el: $el + + modal = modalize view, + className: 'modalize artwork-auction-buyers-premium-modal' + dimensions: width: '700px' + + auction = new Auction id: auction_id + + modal.load (open) -> + auction.fetch().then -> + fetchBuyersPremium auction, (err, html) -> + $el.html html + open() + + modal diff --git a/src/desktop/components/artworkBuyersPremium/index.styl b/src/desktop/components/artworkBuyersPremium/index.styl new file mode 100644 index 00000000000..6eeef36c983 --- /dev/null +++ b/src/desktop/components/artworkBuyersPremium/index.styl @@ -0,0 +1,10 @@ +@require '../../../../../../components/buyers_premium' + +.artwork-auction-buyers-premium-modal + // + + .modalize-body + padding (gutter * 3) + + h1 + sans('l-headline') diff --git a/src/desktop/index.js b/src/desktop/index.ts similarity index 91% rename from src/desktop/index.js rename to src/desktop/index.ts index e0950a463bd..8a946ee4ce0 100644 --- a/src/desktop/index.js +++ b/src/desktop/index.ts @@ -8,6 +8,7 @@ const app = (module.exports = require("express")()) // See: https://github.com/artsy/stitch/tree/master/src/internal for more info. app.use( stitchMiddleware({ + // @ts-ignore modules: globalReactModules, wrapper: globalReactModules.StitchWrapper, }) @@ -26,19 +27,13 @@ app.use(require("./apps/auctions2").app) app.use(require("./apps/auction_lots")) // TODO: Remove after AB test ends. -app.use(require("./apps/artist/server").app) app.use(require("./apps/purchases/server").app) app.use(require("./apps/conversations/server").app) -app.use(require("./apps/artwork/server").app) -app.use(require("./apps/collect/server").app) -app.use(require("./apps/search2/server").app) app.use(require("./apps/art_keeps_going/server").app) -app.use(require("./apps/viewing-room/server").app) app.use(require("./apps/artists")) app.use(require("./apps/auction").app) app.use(require("./apps/auction_support")) -app.use(require("./apps/identity_verification/server").app) app.use(require("./apps/about")) app.use(require("./apps/categories").app) app.use(require("./apps/consign").app) @@ -52,7 +47,6 @@ app.use(require("./apps/gene")) app.use(require("./apps/geo")) app.use(require("./apps/jobs")) app.use(require("./apps/notifications")) -app.use(require("./apps/order/server").app) app.use(require("./apps/personalize")) app.use(require("./apps/press"))