From 9770e7020b103ac3aabeef1650528a2486f6dd30 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 26 May 2020 15:59:06 -0700 Subject: [PATCH 01/12] [Refactor] Remove references tto A/B test --- .storybook/webpack.config.js | 2 - .../analytics/inquiry_questionnaire.js | 27 +++---- src/desktop/analytics/main_layout.js | 21 +++--- .../apps/experimental-app-shell/client.tsx | 1 - .../apps/experimental-app-shell/server.tsx | 18 +++-- src/desktop/assets/analytics.coffee | 20 +++--- .../split_test/running_tests.coffee | 8 +-- .../skipIfClientSideRoutingEnabled.ts | 6 +- src/desktop/config.coffee | 3 - src/desktop/lib/global_client_setup.tsx | 13 +--- src/lib/setup_sharify.js | 3 - src/typings/sharify.d.ts | 1 - src/v2/Apps/Artwork/ArtworkApp.tsx | 5 -- .../ArtworkSidebarCommercial.tsx | 58 ++++++--------- src/v2/Apps/Auction/__tests__/routes.jest.ts | 10 --- src/v2/Apps/Order/OrderApp.tsx | 23 ++---- src/v2/Artsy/Analytics/trackingMiddleware.ts | 24 +++---- src/v2/Artsy/Router/RenderStatus.tsx | 58 ++++++--------- src/v2/Artsy/SystemContext.tsx | 3 - src/v2/Components/NavBar/NavBar.tsx | 18 ++--- src/v2/Components/Search/SearchBar.tsx | 72 +++++++------------ 21 files changed, 131 insertions(+), 263 deletions(-) diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index 998b053143f..a89dd9e82cf 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -22,7 +22,6 @@ const { CI, CMS_URL, ENABLE_SIGN_IN_WITH_APPLE, - EXPERIMENTAL_APP_SHELL, FACEBOOK_APP_NAMESPACE, PREDICTION_URL, FORCE_CLOUDFRONT_URL, @@ -56,7 +55,6 @@ const sharifyPath = sharify({ CDN_URL, CMS_URL, ENABLE_SIGN_IN_WITH_APPLE, - EXPERIMENTAL_APP_SHELL, FACEBOOK_APP_NAMESPACE, FORCE_CLOUDFRONT_URL, GEMINI_CLOUDFRONT_URL, diff --git a/src/desktop/analytics/inquiry_questionnaire.js b/src/desktop/analytics/inquiry_questionnaire.js index 03283569f81..ad25e3999da 100644 --- a/src/desktop/analytics/inquiry_questionnaire.js +++ b/src/desktop/analytics/inquiry_questionnaire.js @@ -17,18 +17,15 @@ const analytics = window.analytics function getTrackingOptions() { var trackingOptions = {} - // FIXME: Remove once A/B test completes - if (sd.CLIENT_NAVIGATION_V5 === "experiment") { - const referrer = window.analytics.__artsyReferrer - // Grab referrer from our trackingMiddleware in Reaction, since we're in a - // single-page-app context and the value will need to be refreshed on route - // change. See: https://github.com/artsy/reaction/blob/master/src/Artsy/Analytics/trackingMiddleware.ts - if (referrer) { - trackingOptions = { - page: { - referrer, - }, - } + const referrer = window.analytics.__artsyReferrer + // Grab referrer from our trackingMiddleware in Reaction, since we're in a + // single-page-app context and the value will need to be refreshed on route + // change. See: https://github.com/artsy/reaction/blob/master/src/Artsy/Analytics/trackingMiddleware.ts + if (referrer) { + trackingOptions = { + page: { + referrer, + }, } } @@ -58,11 +55,7 @@ const analytics = window.analytics // 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 - if (window.sd.CLIENT_NAVIGATION_V5 === "experiment") { - analyticsHooks.on(namespace(name), handler) - } else { - analyticsHooks.once(namespace(name), handler) - } + analyticsHooks.on(namespace(name), handler) } // DOM events diff --git a/src/desktop/analytics/main_layout.js b/src/desktop/analytics/main_layout.js index cbdf21084ca..7c60ac58e7c 100644 --- a/src/desktop/analytics/main_layout.js +++ b/src/desktop/analytics/main_layout.js @@ -90,18 +90,15 @@ class PageTimeTracker { this.timer = setTimeout(() => { let trackingOptions = {} - // FIXME: Remove once A/B test completes - if (sd.CLIENT_NAVIGATION_V5 === "experiment") { - const referrer = window.analytics.__artsyReferrer - // Grab referrer from our trackingMiddleware in Reaction, since we're in a - // single-page-app context and the value will need to be refreshed on route - // change. See: https://github.com/artsy/reaction/blob/master/src/Artsy/Analytics/trackingMiddleware.ts - if (referrer) { - trackingOptions = { - page: { - referrer, - }, - } + const referrer = window.analytics.__artsyReferrer + // Grab referrer from our trackingMiddleware in Reaction, since we're in a + // single-page-app context and the value will need to be refreshed on route + // change. See: https://github.com/artsy/reaction/blob/master/src/Artsy/Analytics/trackingMiddleware.ts + if (referrer) { + trackingOptions = { + page: { + referrer, + }, } } diff --git a/src/desktop/apps/experimental-app-shell/client.tsx b/src/desktop/apps/experimental-app-shell/client.tsx index 3935df32b3d..e69530762cd 100644 --- a/src/desktop/apps/experimental-app-shell/client.tsx +++ b/src/desktop/apps/experimental-app-shell/client.tsx @@ -12,7 +12,6 @@ const mediator = require("desktop/lib/mediator.coffee") buildClientApp({ routes: getAppRoutes(), context: { - EXPERIMENTAL_APP_SHELL: true, user: sd.CURRENT_USER, mediator, } as any, diff --git a/src/desktop/apps/experimental-app-shell/server.tsx b/src/desktop/apps/experimental-app-shell/server.tsx index 5b68db7125b..96dd10455e0 100644 --- a/src/desktop/apps/experimental-app-shell/server.tsx +++ b/src/desktop/apps/experimental-app-shell/server.tsx @@ -22,14 +22,14 @@ app.get("/artwork/:artworkID/download/:filename", handleArtworkImageDownload) */ app.get( "/*", - (_req, res, next) => { - const isExperiment = res.locals.sd.CLIENT_NAVIGATION_V5 === "experiment" + // (_req, res, next) => { + // const isExperiment = res.locals.sd.CLIENT_NAVIGATION_V5 === "experiment" - if (!isExperiment) { - return next("route") - } - return next() - }, + // if (!isExperiment) { + // return next("route") + // } + // return next() + // }, userRequiredMiddleware, @@ -58,9 +58,7 @@ app.get( bodyHTML, headTags, } = await buildServerApp({ - context: buildServerAppContext(req, res, { - EXPERIMENTAL_APP_SHELL: true, - }), + context: buildServerAppContext(req, res), routes: getAppRoutes(), url: req.url, userAgent: req.header("User-Agent"), diff --git a/src/desktop/assets/analytics.coffee b/src/desktop/assets/analytics.coffee index 20beedf7f33..ae3f3fe7422 100644 --- a/src/desktop/assets/analytics.coffee +++ b/src/desktop/assets/analytics.coffee @@ -45,18 +45,16 @@ trackEvent = (data) -> trackingData = _.omit data, 'action_type' trackingOptions = {} - # FIXME: Remove after A/B test ends - if sd.CLIENT_NAVIGATION_V5 == "experiment" - referrer = analytics.__artsyReferrer - # Grab referrer from our trackingMiddleware in Reaction, since we're in a - # single-page-app context and the value will need to be refreshed on route - # change. See: https://github.com/artsy/reaction/blob/master/src/Artsy/Analytics/trackingMiddleware.ts - if referrer - trackingOptions = { - page: { - referrer: referrer - } + referrer = analytics.__artsyReferrer + # Grab referrer from our trackingMiddleware in Reaction, since we're in a + # single-page-app context and the value will need to be refreshed on route + # change. See: https://github.com/artsy/reaction/blob/master/src/Artsy/Analytics/trackingMiddleware.ts + if referrer + trackingOptions = { + page: { + referrer: referrer } + } analytics.track data.action_type, trackingData, trackingOptions else diff --git a/src/desktop/components/split_test/running_tests.coffee b/src/desktop/components/split_test/running_tests.coffee index d73a473cc81..2e789a7b747 100644 --- a/src/desktop/components/split_test/running_tests.coffee +++ b/src/desktop/components/split_test/running_tests.coffee @@ -26,10 +26,4 @@ # this should export empty Object # module.exports = {} -module.exports = { - client_navigation_v5: - key: "client_navigation_v5" - outcomes: - control: 50 - experiment: 50 -} +module.exports = {} diff --git a/src/desktop/components/split_test/skipIfClientSideRoutingEnabled.ts b/src/desktop/components/split_test/skipIfClientSideRoutingEnabled.ts index 2aa953cf29c..e57a8d2df65 100644 --- a/src/desktop/components/split_test/skipIfClientSideRoutingEnabled.ts +++ b/src/desktop/components/split_test/skipIfClientSideRoutingEnabled.ts @@ -1,7 +1,3 @@ export const skipIfClientSideRoutingEnabled = (_req, res, next) => { - // Remove once A/B test completes - if (res.locals.sd.CLIENT_NAVIGATION_V5 === "experiment") { - return next("route") - } - return next() + return next("route") } diff --git a/src/desktop/config.coffee b/src/desktop/config.coffee index 7d570e28dd2..67e7235b68f 100644 --- a/src/desktop/config.coffee +++ b/src/desktop/config.coffee @@ -46,9 +46,6 @@ module.exports = EF_VENICE: '58f5eb75faef6a3a8e7fe1ad' EF_GUCCI: '5a009372c88a280f5e9efa7e' EF_VIDEO_GUIDE: '5901d64b4682400017f0e3cb' - - # FIXME: Remove experimental flag - EXPERIMENTAL_APP_SHELL: false, FACEBOOK_APP_NAMESPACE: "artsyinc" FACEBOOK_DOMAIN_VERIFICATION: 'yeg3dqrlq548zc77ggvfipouil1l1e' FACEBOOK_ID: null diff --git a/src/desktop/lib/global_client_setup.tsx b/src/desktop/lib/global_client_setup.tsx index 699bf36d248..64fabb4fc6b 100644 --- a/src/desktop/lib/global_client_setup.tsx +++ b/src/desktop/lib/global_client_setup.tsx @@ -126,7 +126,7 @@ function setupJquery() { // once you click it. For these cases do `$el.click -> $(@).hidehover()` and // the menu will hide and then remove the `display` property so the default // CSS will kick in again. - $.fn.hidehover = function () { + $.fn.hidehover = function() { const $el = $(this) $el.css({ display: "none" }) return setTimeout(() => $el.css({ display: "" }), 200) @@ -146,17 +146,10 @@ function setupErrorReporting() { if (sd.NODE_ENV === "production") { Sentry.init({ dsn: sd.SENTRY_PUBLIC_DSN }) - // FIXME: Remove once A/B test ends - Sentry.addBreadcrumb({ - category: "experimental-app-shell-ab-test", - message: `A/B v5 test group: ${sd.CLIENT_NAVIGATION_V5}`, - level: Sentry.Severity.Info, - }) - const user = sd && sd.CURRENT_USER if (sd.CURRENT_USER) { - Sentry.configureScope((scope) => { + Sentry.configureScope(scope => { scope.setUser(_.pick(user, "id", "email")) }) } @@ -182,7 +175,7 @@ export function trackAuthenticationEvents() { const modes = ["login", "signup"] const user = sd && sd.CURRENT_USER - modes.forEach((mode) => { + modes.forEach(mode => { if (Cookies.get(`analytics-${mode}`)) { const data = JSON.parse(Cookies.get(`analytics-${mode}`)) Cookies.expire(`analytics-${mode}`) diff --git a/src/lib/setup_sharify.js b/src/lib/setup_sharify.js index 7c568658776..edaab8cd84d 100644 --- a/src/lib/setup_sharify.js +++ b/src/lib/setup_sharify.js @@ -52,9 +52,6 @@ sharify.data = _.extend( "EF_GUCCI", "EF_VENICE", "EF_VIDEO_GUIDE", - - // FIXME: Remove experimental flag - "EXPERIMENTAL_APP_SHELL", "FACEBOOK_APP_NAMESPACE", "FACEBOOK_ID", "FORCE_CLOUDFRONT_URL", diff --git a/src/typings/sharify.d.ts b/src/typings/sharify.d.ts index 8a44d62ac9e..4202026f00e 100644 --- a/src/typings/sharify.d.ts +++ b/src/typings/sharify.d.ts @@ -20,7 +20,6 @@ declare module "sharify" { readonly APP_URL: string readonly ARTIST_COLLECTIONS_RAIL?: string // TODO: remove after CollectionsRail a/b test readonly ARTIST_COLLECTIONS_RAIL_IDS: string[] - readonly CLIENT_NAVIGATION_V5: "experiment" | "control" // TODO: Remove after A/B test. readonly CMS_URL: string readonly CDN_URL: string CURRENT_PATH: string diff --git a/src/v2/Apps/Artwork/ArtworkApp.tsx b/src/v2/Apps/Artwork/ArtworkApp.tsx index 34c300d2c15..ece96b3fcfc 100644 --- a/src/v2/Apps/Artwork/ArtworkApp.tsx +++ b/src/v2/Apps/Artwork/ArtworkApp.tsx @@ -90,11 +90,6 @@ export class ArtworkApp extends React.Component { // See trackingMiddleware.ts window.analytics.__artsyReferrer = referrer window.analytics.page(properties, { integrations: { Marketo: false } }) - - // TODO: Remove after EXPERIMENTAL_APP_SHELL AB test ends. - // if (sd.CLIENT_NAVIGATION_V5) { - // trackExperimentViewed("client_navigation_v5", properties) - // } } } diff --git a/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx b/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx index 2cf5f7273b1..0a3f8ea8058 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx @@ -41,7 +41,6 @@ export interface ArtworkSidebarCommercialContainerProps mediator: Mediator router?: Router user: User - EXPERIMENTAL_APP_SHELL?: boolean } export interface ArtworkSidebarCommercialContainerState { @@ -63,8 +62,8 @@ const logger = createLogger( @track() export class ArtworkSidebarCommercialContainer extends React.Component< -ArtworkSidebarCommercialContainerProps, -ArtworkSidebarCommercialContainerState + ArtworkSidebarCommercialContainerProps, + ArtworkSidebarCommercialContainerState > { state: ArtworkSidebarCommercialContainerState = { isCommittingCreateOrderMutation: false, @@ -235,13 +234,7 @@ ArtworkSidebarCommercialContainerState ) } else { const url = `/orders/${orderOrError.order.internalID}` - - // FIXME: Remove once A/B test completes - if (this.props.EXPERIMENTAL_APP_SHELL) { - this.props.router.push(url) - } else { - window.location.assign(url) - } + this.props.router.push(url) } } ) @@ -326,13 +319,7 @@ ArtworkSidebarCommercialContainerState ) } else { const url = `/orders/${orderOrError.order.internalID}/offer` - - // FIXME: Remove once A/B test completes - if (this.props.EXPERIMENTAL_APP_SHELL) { - this.props.router.push(url) - } else { - window.location.assign(url) - } + this.props.router.push(url) } } ) @@ -378,16 +365,16 @@ ArtworkSidebarCommercialContainerState ) ) : ( - <> - {this.renderEditionSets(artworkEcommerceAvailable)} - {selectedEditionSet && ( - <> - - {this.renderSaleMessage(selectedEditionSet.sale_message)} - - )} - - )} + <> + {this.renderEditionSets(artworkEcommerceAvailable)} + {selectedEditionSet && ( + <> + + {this.renderSaleMessage(selectedEditionSet.sale_message)} + + )} + + )} {artworkEcommerceAvailable && (artwork.shippingOrigin || artwork.shippingInfo) && } @@ -408,12 +395,12 @@ ArtworkSidebarCommercialContainerState )} {artwork.is_inquireable || - artwork.is_acquireable || - artwork.is_offerable ? ( - artwork.sale_message && - ) : ( - - )} + artwork.is_acquireable || + artwork.is_offerable ? ( + artwork.sale_message && + ) : ( + + )} {artwork.is_acquireable && ( @@ -54,8 +54,8 @@ const logger = createLogger("Order/Routes/NewPayment/index.tsx") @track() export class NewPaymentRoute extends Component< -NewPaymentProps, -NewPaymentState + NewPaymentProps, + NewPaymentState > { paymentPicker = React.createRef() state = { @@ -295,7 +295,7 @@ NewPaymentState artistId() { return get( this.props.order, - o => o.lineItems.edges[0].node.artwork.artists[0].slug + (o) => o.lineItems.edges[0].node.artwork.artists[0].slug ) } @@ -347,6 +347,3 @@ export const NewPaymentFragmentContainer = createFragmentContainer( `, } ) - -// For bundle splitting in router -export default NewPaymentFragmentContainer diff --git a/src/v2/Apps/Order/Routes/Offer/index.tsx b/src/v2/Apps/Order/Routes/Offer/index.tsx index c69d220207a..4e7fe03ed40 100644 --- a/src/v2/Apps/Order/Routes/Offer/index.tsx +++ b/src/v2/Apps/Order/Routes/Offer/index.tsx @@ -60,7 +60,7 @@ export class OfferRoute extends Component { highSpeedBumpEncountered: false, } - @track(props => ({ + @track((props) => ({ order_id: props.order.internalID, action_type: Schema.ActionType.FocusedOnOfferInput, flow: Schema.Flow.MakeOffer, @@ -69,7 +69,7 @@ export class OfferRoute extends Component { // noop } - @track(props => ({ + @track((props) => ({ order_id: props.order.internalID, action_type: Schema.ActionType.ViewedOfferTooLow, flow: Schema.Flow.MakeOffer, @@ -84,7 +84,7 @@ export class OfferRoute extends Component { }) } - @track(props => ({ + @track((props) => ({ order_id: props.order.internalID, action_type: Schema.ActionType.ViewedOfferHigherThanListPrice, flow: Schema.Flow.MakeOffer, @@ -235,7 +235,7 @@ export class OfferRoute extends Component { showError={ this.state.formIsDirty && this.state.offerValue <= 0 } - onChange={offerValue => this.setState({ offerValue })} + onChange={(offerValue) => this.setState({ offerValue })} onFocus={this.onOfferInputFocus.bind(this)} /> @@ -247,7 +247,7 @@ export class OfferRoute extends Component { + onChange={(offerNoteValue) => this.setState({ offerNoteValue }) } artworkId={artworkId} @@ -337,6 +337,3 @@ export const OfferFragmentContainer = createFragmentContainer( `, } ) - -// For bundle splitting in router -export default OfferFragmentContainer diff --git a/src/v2/Apps/Order/Routes/Payment/index.tsx b/src/v2/Apps/Order/Routes/Payment/index.tsx index 0d20c2d5bfd..7267ea9a462 100644 --- a/src/v2/Apps/Order/Routes/Payment/index.tsx +++ b/src/v2/Apps/Order/Routes/Payment/index.tsx @@ -30,7 +30,7 @@ import { } from "v2/Apps/Order/Utils/commitMutation" import { AnalyticsSchema, track } from "v2/Artsy" -export const ContinueButton = props => ( +export const ContinueButton = (props) => ( @@ -241,6 +241,3 @@ export const PaymentFragmentContainer = createFragmentContainer( `, } ) - -// For bundle splitting in router -export default PaymentFragmentContainer diff --git a/src/v2/Apps/Order/Routes/Reject/index.tsx b/src/v2/Apps/Order/Routes/Reject/index.tsx index cf506e14b52..4529dfdf09e 100644 --- a/src/v2/Apps/Order/Routes/Reject/index.tsx +++ b/src/v2/Apps/Order/Routes/Reject/index.tsx @@ -211,6 +211,3 @@ export const RejectFragmentContainer = createFragmentContainer( `, } ) - -// For bundle splitting in router -export default RejectFragmentContainer diff --git a/src/v2/Apps/Order/Routes/Respond/index.tsx b/src/v2/Apps/Order/Routes/Respond/index.tsx index d9a08ba3b25..98f01e91a72 100644 --- a/src/v2/Apps/Order/Routes/Respond/index.tsx +++ b/src/v2/Apps/Order/Routes/Respond/index.tsx @@ -71,7 +71,7 @@ export class RespondRoute extends Component { highSpeedBumpEncountered: false, } - @track(props => ({ + @track((props) => ({ order_id: props.order.internalID, action_type: Schema.ActionType.FocusedOnOfferInput, flow: Schema.Flow.MakeOffer, @@ -80,7 +80,7 @@ export class RespondRoute extends Component { // noop } - @track(props => ({ + @track((props) => ({ order_id: props.order.internalID, action_type: Schema.ActionType.ViewedOfferTooLow, flow: Schema.Flow.MakeOffer, @@ -95,7 +95,7 @@ export class RespondRoute extends Component { }) } - @track(props => ({ + @track((props) => ({ order_id: props.order.internalID, action_type: Schema.ActionType.ViewedOfferHigherThanListPrice, flow: Schema.Flow.MakeOffer, @@ -272,7 +272,7 @@ export class RespondRoute extends Component { showError={ this.state.formIsDirty && this.state.offerValue <= 0 } - onChange={offerValue => this.setState({ offerValue })} + onChange={(offerValue) => this.setState({ offerValue })} onFocus={this.onOfferInputFocus.bind(this)} /> @@ -282,7 +282,7 @@ export class RespondRoute extends Component { > + onChange={(offerNoteValue) => this.setState({ offerNoteValue }) } artworkId={artworkId} @@ -393,6 +393,3 @@ export const RespondFragmentContainer = createFragmentContainer( `, } ) - -// For bundle splitting in router -export default RespondFragmentContainer diff --git a/src/v2/Apps/Order/Routes/Review/index.tsx b/src/v2/Apps/Order/Routes/Review/index.tsx index 5ccc674de64..4e4ca2bd8ba 100644 --- a/src/v2/Apps/Order/Routes/Review/index.tsx +++ b/src/v2/Apps/Order/Routes/Review/index.tsx @@ -65,7 +65,7 @@ export class ReviewRoute extends Component { } } - @track(props => ({ + @track((props) => ({ action_type: props.order.mode === "BUY" ? Schema.ActionType.SubmittedOrder @@ -85,7 +85,7 @@ export class ReviewRoute extends Component { this.props.order.mode === "BUY" ? (await this.submitBuyOrder()).commerceSubmitOrder.orderOrError : (await this.submitOffer(setupIntentId)).commerceSubmitOrderWithOffer - .orderOrError + .orderOrError if (orderOrError.error) { this.handleSubmitError(orderOrError.error) @@ -97,7 +97,7 @@ export class ReviewRoute extends Component { ) { this.state.stripe .handleCardAction(orderOrError.actionData.clientSecret) - .then(result => { + .then((result) => { if (result.error) { this.props.dialog.showErrorDialog({ title: "An error occurred", @@ -115,7 +115,7 @@ export class ReviewRoute extends Component { ) { this.state.stripe .handleCardSetup(orderOrError.actionData.clientSecret) - .then(result => { + .then((result) => { if (result.error) { this.props.dialog.showErrorDialog({ title: "An error occurred", @@ -289,14 +289,14 @@ export class ReviewRoute extends Component { artistId() { return get( this.props.order, - o => o.lineItems.edges[0].node.artwork.artists[0].slug + (o) => o.lineItems.edges[0].node.artwork.artists[0].slug ) } routeToArtworkPage() { const artworkId = get( this.props.order, - o => o.lineItems.edges[0].node.artwork.slug + (o) => o.lineItems.edges[0].node.artwork.slug ) // Don't confirm whether or not you want to leave the page this.props.route.onTransition = () => null @@ -448,6 +448,3 @@ export const ReviewFragmentContainer = createFragmentContainer( `, } ) - -// For bundle splitting in router -export default ReviewFragmentContainer diff --git a/src/v2/Apps/Order/Routes/Shipping/index.tsx b/src/v2/Apps/Order/Routes/Shipping/index.tsx index d4f390590df..bdaeb778bd9 100644 --- a/src/v2/Apps/Order/Routes/Shipping/index.tsx +++ b/src/v2/Apps/Order/Routes/Shipping/index.tsx @@ -79,7 +79,7 @@ const logger = createLogger("Order/Routes/Shipping/index.tsx") export class ShippingRoute extends Component { state: ShippingState = { shippingOption: (this.props.order.requestedFulfillment && - this.props.order.requestedFulfillment.__typename !== "CommerceShip" + this.props.order.requestedFulfillment.__typename !== "CommerceShip" ? "PICKUP" : "SHIP") as CommerceOrderFulfillmentTypeEnum, address: this.startingAddress, @@ -87,8 +87,8 @@ export class ShippingRoute extends Component { addressTouched: {}, phoneNumber: this.props.order.requestedFulfillment && - (this.props.order.requestedFulfillment.__typename === "CommerceShip" || - this.props.order.requestedFulfillment.__typename === "CommercePickup") + (this.props.order.requestedFulfillment.__typename === "CommerceShip" || + this.props.order.requestedFulfillment.__typename === "CommercePickup") ? this.props.order.requestedFulfillment.phoneNumber : "", phoneNumberError: "", @@ -231,7 +231,7 @@ export class ShippingRoute extends Component { handleSubmitError(error: { code: string; data: string }) { logger.error(error) - const parsedData = get(error, e => JSON.parse(e.data), {}) + const parsedData = get(error, (e) => JSON.parse(e.data), {}) if ( error.code === "missing_region" || error.code === "missing_country" || @@ -267,7 +267,8 @@ export class ShippingRoute extends Component { country: validatePresence(country), postalCode: usOrCanada && validatePresence(postalCode), } - const hasErrors = Object.keys(errors).filter(key => errors[key]).length > 0 + const hasErrors = + Object.keys(errors).filter((key) => errors[key]).length > 0 return { errors, @@ -300,7 +301,7 @@ export class ShippingRoute extends Component { }) } - onPhoneNumberChange: PhoneNumberChangeHandler = phoneNumber => { + onPhoneNumberChange: PhoneNumberChangeHandler = (phoneNumber) => { const { error } = this.validatePhoneNumber(phoneNumber) this.setState({ phoneNumber, @@ -334,7 +335,7 @@ export class ShippingRoute extends Component { } = this.state const artwork = get( this.props, - props => props.order.lineItems.edges[0].node.artwork + (props) => props.order.lineItems.edges[0].node.artwork ) return ( @@ -508,6 +509,3 @@ export const ShippingFragmentContainer = createFragmentContainer( `, } ) - -// For bundle splitting in router -export default ShippingFragmentContainer diff --git a/src/v2/Apps/Order/Routes/Status/index.tsx b/src/v2/Apps/Order/Routes/Status/index.tsx index fa4609b2e73..460f5c223db 100644 --- a/src/v2/Apps/Order/Routes/Status/index.tsx +++ b/src/v2/Apps/Order/Routes/Status/index.tsx @@ -53,26 +53,26 @@ export class StatusRoute extends Component { case "SUBMITTED": return isOfferFlow ? { - title: "Your offer has been submitted", - description: ( - <> - The seller will respond to your offer by {stateExpiresAt}. + title: "Your offer has been submitted", + description: ( + <> + The seller will respond to your offer by {stateExpiresAt}. Keep in mind making an offer doesn’t guarantee you the work. - - ), - } + + ), + } : { - title: "Your order has been submitted", - description: ( - <> - Thank you for your purchase. You will receive a confirmation + title: "Your order has been submitted", + description: ( + <> + Thank you for your purchase. You will receive a confirmation email by {stateExpiresAt}. -
+
Disruptions caused by COVID-19 may cause delays — we appreciate your understanding. - - ), - } + + ), + } case "APPROVED": return { title: isOfferFlow ? "Offer accepted" : "Your order is confirmed", @@ -85,25 +85,25 @@ export class StatusRoute extends Component { your understanding. ) : ( - <> - Thank you for your purchase. A specialist will contact you within - 2 business days to coordinate pickup. -
+ <> + Thank you for your purchase. A specialist will contact you within + 2 business days to coordinate pickup. +
Disruptions caused by COVID-19 may cause delays — we appreciate your understanding. - - ), + + ), } case "FULFILLED": { return isShip ? { - title: "Your order has shipped", - description: this.getFulfilmentDescription(), - } + title: "Your order has shipped", + description: this.getFulfilmentDescription(), + } : { - title: "Your order has been picked up", - description: null, - } + title: "Your order has been picked up", + description: null, + } } case "CANCELED": case "REFUNDED": @@ -205,7 +205,7 @@ export class StatusRoute extends Component { getFulfilmentDescription(): React.ReactNode { const fulfillment = get( this.props.order, - o => o.lineItems.edges[0].node.fulfillments.edges[0].node + (o) => o.lineItems.edges[0].node.fulfillments.edges[0].node ) if (!fulfillment) { @@ -272,16 +272,16 @@ export class StatusRoute extends Component { /> ) : ( - - )} + + )} } @@ -373,6 +373,3 @@ export const StatusFragmentContainer = createFragmentContainer(StatusRoute, { } `, }) - -// For bundle splitting in router -export default StatusFragmentContainer diff --git a/src/v2/Apps/Order/routes.tsx b/src/v2/Apps/Order/routes.tsx index 4d4130f1d30..75abec965f6 100644 --- a/src/v2/Apps/Order/routes.tsx +++ b/src/v2/Apps/Order/routes.tsx @@ -6,17 +6,18 @@ import { Redirect, RedirectException, RouteConfig } from "found" import * as React from "react" import { graphql } from "react-relay" +import { RespondFragmentContainer as RespondRoute } from "./Routes/Respond" +import { OfferFragmentContainer as OfferRoute } from "./Routes/Offer" +import { ShippingFragmentContainer as ShippingRoute } from "./Routes/Shipping" +import { PaymentFragmentContainer as PaymentRoute } from "./Routes/Payment" +import { NewPaymentFragmentContainer as NewPaymentRoute } from "./Routes/NewPayment" +import { CounterFragmentContainer as CounterRoute } from "./Routes/Counter" +import { ReviewFragmentContainer as ReviewRoute } from "./Routes/Review" +import { AcceptFragmentContainer as AcceptRoute } from "./Routes/Accept" +import { RejectFragmentContainer as DeclineRoute } from "./Routes/Reject" +import { StatusFragmentContainer as StatusRoute } from "./Routes/Status" + const OrderApp = loadable(() => import("./OrderApp")) -const RespondRoute = loadable(() => import("./Routes/Respond")) -const OfferRoute = loadable(() => import("./Routes/Offer")) -const ShippingRoute = loadable(() => import("./Routes/Shipping")) -const PaymentRoute = loadable(() => import("./Routes/Payment")) -const NewPaymentRoute = loadable(() => import("./Routes/NewPayment")) -const CounterRoute = loadable(() => import("./Routes/Counter")) -const ReviewRoute = loadable(() => import("./Routes/Review")) -const AcceptRoute = loadable(() => import("./Routes/Accept")) -const DeclineRoute = loadable(() => import("./Routes/Reject")) -const StatusRoute = loadable(() => import("./Routes/Status")) // FIXME: // * `render` functions requires casting @@ -74,10 +75,7 @@ export const routes: RouteConfig[] = [ children: [ { path: "respond", - getComponent: () => RespondRoute, - prepare: () => { - RespondRoute.preload() - }, + Component: RespondRoute, shouldWarnBeforeLeaving: true, query: graphql` query routes_RespondQuery($orderID: ID!) { @@ -92,10 +90,7 @@ export const routes: RouteConfig[] = [ }, { path: "offer", - getComponent: () => OfferRoute, - prepare: () => { - OfferRoute.preload() - }, + Component: OfferRoute, shouldWarnBeforeLeaving: true, query: graphql` query routes_OfferQuery($orderID: ID!) { @@ -110,10 +105,7 @@ export const routes: RouteConfig[] = [ }, { path: "shipping", - getComponent: () => ShippingRoute, - prepare: () => { - ShippingRoute.preload() - }, + Component: ShippingRoute, shouldWarnBeforeLeaving: true, query: graphql` query routes_ShippingQuery($orderID: ID!) { @@ -128,10 +120,7 @@ export const routes: RouteConfig[] = [ }, { path: "payment", - getComponent: () => PaymentRoute, - prepare: () => { - PaymentRoute.preload() - }, + Component: PaymentRoute, shouldWarnBeforeLeaving: true, query: graphql` query routes_PaymentQuery($orderID: ID!) { @@ -149,10 +138,7 @@ export const routes: RouteConfig[] = [ }, { path: "payment/new", - getComponent: () => NewPaymentRoute, - prepare: () => { - NewPaymentRoute.preload() - }, + Component: NewPaymentRoute, shouldWarnBeforeLeaving: true, query: graphql` query routes_NewPaymentQuery($orderID: ID!) { @@ -170,10 +156,7 @@ export const routes: RouteConfig[] = [ }, { path: "review/counter", - getComponent: () => CounterRoute, - prepare: () => { - CounterRoute.preload() - }, + Component: CounterRoute, shouldWarnBeforeLeaving: true, query: graphql` query routes_CounterQuery($orderID: ID!) { @@ -188,10 +171,7 @@ export const routes: RouteConfig[] = [ }, { path: "review", - getComponent: () => ReviewRoute, - prepare: () => { - ReviewRoute.preload() - }, + Component: ReviewRoute, shouldWarnBeforeLeaving: true, query: graphql` query routes_ReviewQuery($orderID: ID!) { @@ -206,10 +186,7 @@ export const routes: RouteConfig[] = [ }, { path: "review/accept", - getComponent: () => AcceptRoute, - prepare: () => { - AcceptRoute.preload() - }, + Component: AcceptRoute, query: graphql` query routes_AcceptQuery($orderID: ID!) { order: commerceOrder(id: $orderID) { @@ -223,10 +200,7 @@ export const routes: RouteConfig[] = [ }, { path: "review/decline", - getComponent: () => DeclineRoute, - prepare: () => { - DeclineRoute.preload() - }, + Component: DeclineRoute, query: graphql` query routes_RejectQuery($orderID: ID!) { order: commerceOrder(id: $orderID) { @@ -237,10 +211,7 @@ export const routes: RouteConfig[] = [ }, { path: "status", - getComponent: () => StatusRoute, - prepare: () => { - StatusRoute.preload() - }, + Component: StatusRoute, query: graphql` query routes_StatusQuery($orderID: ID!) { order: commerceOrder(id: $orderID) { @@ -259,7 +230,7 @@ export const routes: RouteConfig[] = [ }) as any, { path: "*", - Component: props => { + Component: (props) => { return }, }, From f6f6b9425e1cd05180e6a8f971d785492c129fe6 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 26 May 2020 19:09:06 -0700 Subject: [PATCH 07/12] Fix react server warning --- src/v2/Utils/Hooks/useWindowSize.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/v2/Utils/Hooks/useWindowSize.ts b/src/v2/Utils/Hooks/useWindowSize.ts index f7acc436a27..07a6a272f47 100644 --- a/src/v2/Utils/Hooks/useWindowSize.ts +++ b/src/v2/Utils/Hooks/useWindowSize.ts @@ -4,6 +4,10 @@ import { getViewportDimensions } from "v2/Utils/viewport" export const useWindowSize = () => { const [size, setSize] = useState({ width: 0, height: 0 }) + if (typeof window === "undefined") { + return size + } + useLayoutEffect(() => { function resize() { const { width, height } = getViewportDimensions() @@ -15,9 +19,5 @@ export const useWindowSize = () => { return () => window.removeEventListener("resize", resize) }, []) - if (typeof window === "undefined") { - return { width: 0, height: 0 } - } - return size } From 87644e54c7db57ee843fdcf5fc96ae2eb09e5b8d Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 26 May 2020 19:18:41 -0700 Subject: [PATCH 08/12] [Toolchain] Point jest cache at .jest/cache --- jest.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 9df50df3479..d0d7b913488 100644 --- a/jest.config.js +++ b/jest.config.js @@ -4,6 +4,7 @@ const sharedConfig = { ".(ts|tsx|js|jsx)": "babel-jest", "\\.graphql$": "jest-raw-loader", }, + cacheDirectory: ".cache/jest", coverageDirectory: "./coverage/", collectCoverage: true, coverageReporters: ["lcov", "text-summary"], @@ -18,7 +19,7 @@ module.exports = { */ { ...sharedConfig, - modulePathIgnorePatterns: ["v2"], + modulePathIgnorePatterns: ["v2", "data"], testRegex: ".*\\.jest\\.(ts|tsx|js|jsx)$", setupFiles: ["/test.config.js"], roots: ["/src"], From ceaf326cf5d67bdcc9b31e7585fbcced45f6f6e8 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 26 May 2020 19:31:32 -0700 Subject: [PATCH 09/12] [Toolchain] Make jest graphql more robust --- jest.config.js | 2 +- package.json | 3 ++- yarn.lock | 15 ++++++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/jest.config.js b/jest.config.js index d0d7b913488..d065850c827 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,8 +1,8 @@ const sharedConfig = { transform: { + "\\.(gql|graphql)$": "jest-transform-graphql", "^.+\\.coffee$": "/node_modules/jest-coffee-preprocessor/index.js", ".(ts|tsx|js|jsx)": "babel-jest", - "\\.graphql$": "jest-raw-loader", }, cacheDirectory: ".cache/jest", coverageDirectory: "./coverage/", diff --git a/package.json b/package.json index f30bded14e2..8f14b7daee7 100644 --- a/package.json +++ b/package.json @@ -328,6 +328,7 @@ "fork-ts-checker-notifier-webpack-plugin": "0.4.0", "fork-ts-checker-webpack-plugin": "0.4.10", "friendly-errors-webpack-plugin": "1.6.1", + "graphql-tag": "^2.10.3", "graphql-tools": "4.0.3", "hulk-editor": "craigspaeth/hulk", "husky": "3.0.5", @@ -337,8 +338,8 @@ "jest": "24.9.0", "jest-coffee-preprocessor": "1.0.0", "jest-junit": "6.4.0", - "jest-raw-loader": "1.0.1", "jest-styled-components": "7.0.0-2", + "jest-transform-graphql": "^2.1.0", "jsdom": "11.6.2", "jsdom-global": "3.0.2", "json-loader": "0.5.7", diff --git a/yarn.lock b/yarn.lock index 618b1da2509..4baeea528e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11295,6 +11295,11 @@ graceful-fs@4.2.3, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= +graphql-tag@^2.10.3: + version "2.10.3" + resolved "https://registry.yarnpkg.com/graphql-tag/-/graphql-tag-2.10.3.tgz#ea1baba5eb8fc6339e4c4cf049dabe522b0edf03" + integrity sha512-4FOv3ZKfA4WdOKJeHdz6B3F/vxBLSgmBcGeAFPf4n1F64ltJUvOOerNj0rsJxONQGdhUMynQIvd6LzB+1J5oKA== + graphql-tools@4.0.3, graphql-tools@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.3.tgz#23b5cb52c519212b1b2e4630a361464396ad264b" @@ -13288,11 +13293,6 @@ jest-pnp-resolver@^1.2.1: resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== -jest-raw-loader@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/jest-raw-loader/-/jest-raw-loader-1.0.1.tgz#ce9f56d54650f157c4a7d16d224ba5d613bcd626" - integrity sha1-zp9W1UZQ8VfEp9FtIkul1hO81iY= - jest-regex-util@^24.3.0, jest-regex-util@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636" @@ -13403,6 +13403,11 @@ jest-styled-components@7.0.0-2: dependencies: css "^2.2.4" +jest-transform-graphql@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/jest-transform-graphql/-/jest-transform-graphql-2.1.0.tgz#903cb66bb27bc2772fd3e5dd4f7e9b57230f5829" + integrity sha1-kDy2a7J7wncv0+XdT36bVyMPWCk= + jest-util@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.9.0.tgz#7396814e48536d2e85a37de3e4c431d7cb140162" From be156e9feda1505b3a231e6c3ea347d1a1a02cb9 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 26 May 2020 19:45:59 -0700 Subject: [PATCH 10/12] [Refactor] Fix failing tests --- .../ArtworkSidebarCommercial.tsx | 2 +- .../ArtworkSidebarCommercial.jest.tsx | 51 ++++++++++--------- src/v2/Components/Modal/ErrorModal.tsx | 3 -- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx b/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx index 0a3f8ea8058..6a82029af3b 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkSidebar/ArtworkSidebarCommercial.tsx @@ -50,7 +50,7 @@ export interface ArtworkSidebarCommercialContainerState { selectedEditionSet: EditionSet } -const Row: React.SFC = ({ children, ...others }) => ( +const Row: React.FC = ({ children, ...others }) => ( {children} diff --git a/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarCommercial.jest.tsx b/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarCommercial.jest.tsx index b2f5bb467f0..33383a251b8 100644 --- a/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarCommercial.jest.tsx +++ b/src/v2/Apps/Artwork/Components/ArtworkSidebar/__tests__/ArtworkSidebarCommercial.jest.tsx @@ -29,14 +29,15 @@ const commitMutation = _commitMutation as jest.Mock describe("ArtworkSidebarCommercial", () => { let user const mediator = { trigger: jest.fn() } - const getWrapper = artwork => { + const getWrapper = (artwork, otherProps = {}) => { return mount( ) @@ -85,7 +86,7 @@ describe("ArtworkSidebarCommercial", () => { } ) - const wrapper = await getWrapper(artwork) + const wrapper = getWrapper(artwork) expect(wrapper.text()).toContain("VAT included in price") }) @@ -99,7 +100,7 @@ describe("ArtworkSidebarCommercial", () => { } ) - const wrapper = await getWrapper(artwork) + const wrapper = getWrapper(artwork) expect(wrapper.text()).not.toContain("VAT included in price") }) @@ -107,7 +108,7 @@ describe("ArtworkSidebarCommercial", () => { it("displays single editioned hidden availability inquire work", async () => { const artwork = Object.assign({}, ArtworkSingleEditionHiddenAvailability) - const wrapper = await getWrapper(artwork) + const wrapper = getWrapper(artwork) expect(wrapper.text()).not.toContain("20 × 24 in") expect(wrapper.text()).not.toContain("50.8 × 61 cm") @@ -117,7 +118,7 @@ describe("ArtworkSidebarCommercial", () => { it("displays artwork enrolled in Buy Now", async () => { const artwork = Object.assign({}, ArtworkBuyNow) - const wrapper = await getWrapper(artwork) + const wrapper = getWrapper(artwork) expect(wrapper.text()).toContain("Buy now") }) @@ -125,7 +126,7 @@ describe("ArtworkSidebarCommercial", () => { it("displays sold acquireable artwork", async () => { const artwork = Object.assign({}, ArtworkSold) - const wrapper = await getWrapper(artwork) + const wrapper = getWrapper(artwork) expect(wrapper.text()).toContain("Sold") }) @@ -133,7 +134,7 @@ describe("ArtworkSidebarCommercial", () => { it("displays artwork enrolled in Make Offer", async () => { const artwork = Object.assign({}, ArtworkMakeOffer) - const wrapper = await getWrapper(artwork) + const wrapper = getWrapper(artwork) expect(wrapper.text()).toContain("Make offer") }) @@ -141,7 +142,7 @@ describe("ArtworkSidebarCommercial", () => { it("displays artwork enrolled in Make Offer when enabled for both make offer and inquiry", async () => { const artwork = Object.assign({}, ArtworkOfferableAndInquireable) - const wrapper = await getWrapper(artwork) + const wrapper = getWrapper(artwork) expect(wrapper.text()).toContain("Make offer") expect(wrapper.text()).not.toContain("Contact gallery") @@ -150,18 +151,20 @@ describe("ArtworkSidebarCommercial", () => { it("displays artwork enrolled in both Buy Now and Make Offer", async () => { const artwork = Object.assign({}, ArtworkBuyNowMakeOffer) - const wrapper = await getWrapper(artwork) + const wrapper = getWrapper(artwork) expect(wrapper.text()).toContain("Buy now") expect(wrapper.text()).toContain("Make offer") }) it("creates a Buy Now order and redirects to the order page", () => { - Object.defineProperty(window, "location", { - writable: true, - value: { assign: jest.fn() }, - }) - const component = getWrapper(ArtworkBuyNow) + const spy = jest.fn() + const props = { + router: { + push: spy, + }, + } + const component = getWrapper(ArtworkBuyNow, props) commitMutation.mockImplementationOnce((_environment, { onCompleted }) => { onCompleted(OrderWithSuccess) @@ -170,7 +173,7 @@ describe("ArtworkSidebarCommercial", () => { component.find(Button).simulate("click") expect(commitMutation).toHaveBeenCalledTimes(1) - expect(window.location.assign).toHaveBeenCalledWith("/orders/orderId") + expect(spy).toHaveBeenCalledWith("/orders/orderId") }) it("displays an error modal when a Buy Now mutation fails", () => { @@ -201,11 +204,13 @@ describe("ArtworkSidebarCommercial", () => { }) it("creates a Make Offer order and redirects to the order offer page", () => { - Object.defineProperty(window, "location", { - writable: true, - value: { assign: jest.fn() }, - }) - const component = getWrapper(ArtworkMakeOffer) + const spy = jest.fn() + const props = { + router: { + push: spy, + }, + } + const component = getWrapper(ArtworkMakeOffer, props) commitMutation.mockImplementationOnce((_environment, { onCompleted }) => { onCompleted(OfferOrderWithSuccess) @@ -213,8 +218,8 @@ describe("ArtworkSidebarCommercial", () => { component.find(Button).simulate("click") - expect(commitMutation).toHaveBeenCalledTimes(1) - expect(window.location.assign).toHaveBeenCalledWith("/orders/orderId/offer") + expect(spy).toHaveBeenCalledTimes(1) + expect(spy).toHaveBeenCalledWith("/orders/orderId/offer") }) it("displays an error modal when a Make Offer mutation fails", () => { diff --git a/src/v2/Components/Modal/ErrorModal.tsx b/src/v2/Components/Modal/ErrorModal.tsx index 1f75f5d2759..0a0dd635348 100644 --- a/src/v2/Components/Modal/ErrorModal.tsx +++ b/src/v2/Components/Modal/ErrorModal.tsx @@ -15,9 +15,6 @@ interface ErrorModalProps { ctaAction?: () => void } -/** - * @deprecated use `Dialogs` and `injectDialogs` instead - */ export class ErrorModal extends React.Component { static defaultProps = { headerText: "An error occurred", From be481b676cf58681a8cf2f1aff2fcf05eeb22b40 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 26 May 2020 21:00:57 -0700 Subject: [PATCH 11/12] Add some wait to partner smoke test --- cypress/integration/partnerProfile.spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/integration/partnerProfile.spec.js b/cypress/integration/partnerProfile.spec.js index 23e0a8caa74..837a74e2cf3 100644 --- a/cypress/integration/partnerProfile.spec.js +++ b/cypress/integration/partnerProfile.spec.js @@ -46,6 +46,7 @@ describe("/:partner_id", () => { }) it("shows partner articles", () => { cy.visit("gagosian-gallery/articles") + cy.wait(2000) cy.contains("Articles") }) From be1a46df28aa793007b482281c22b382c8ca1cb3 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 26 May 2020 22:13:15 -0700 Subject: [PATCH 12/12] [Refactor] Preload purchases app js bundle --- src/v2/Apps/Purchase/routes.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/v2/Apps/Purchase/routes.tsx b/src/v2/Apps/Purchase/routes.tsx index d400b436f1b..b568de3130f 100644 --- a/src/v2/Apps/Purchase/routes.tsx +++ b/src/v2/Apps/Purchase/routes.tsx @@ -2,10 +2,15 @@ import loadable from "@loadable/component" import { graphql } from "react-relay" import { RouteConfig } from "found" +const PurchasesApp = loadable(() => import("./PurchaseApp")) + export const routes: RouteConfig[] = [ { path: "/user/purchases", - getComponent: () => loadable(() => import("./PurchaseApp")), + getComponent: () => PurchasesApp, + prepare: () => { + PurchasesApp.preload() + }, query: graphql` query routes_PurchaseQuery { me {