diff --git a/.gitignore b/.gitignore index 5a57ae01511..d278dd1e529 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,6 @@ cypress/screenshots reports* junit.xml cypress/videos + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json \ No newline at end of file diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index 6da2fac877d..998b053143f 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -43,7 +43,7 @@ const { } = process.env const isCI = CI || NETLIFY -const notOnCI = (value) => (isCI ? [] : [value]) +const notOnCI = value => (isCI ? [] : [value]) /** * Write out a file that stubs the data that’s normally shared with the client @@ -138,7 +138,7 @@ module.exports = async ({ config, mode }) => { // Filter out default Storybooks progress bar plugin if CI, which is merged in // with custom plugins. See: https://github.com/storybooks/storybook/issues/1260#issuecomment-308036626 if (isCI) { - config.plugins = config.plugins.filter((plugin) => { + config.plugins = config.plugins.filter(plugin => { return !(plugin instanceof webpack.ProgressPlugin) }) } @@ -168,7 +168,7 @@ module.exports = async ({ config, mode }) => { { loader: "babel-loader", options: { - cacheDirectory: path.join(cacheDirectory, "babel"), + cacheDirectory: path.join(cacheDirectory, "babel/storybook"), }, }, ], diff --git a/cypress/integration/flashMessage.spec.js b/cypress/integration/flashMessage.spec.js new file mode 100644 index 00000000000..dc283324ab9 --- /dev/null +++ b/cypress/integration/flashMessage.spec.js @@ -0,0 +1,14 @@ +describe("flash_message", () => { + it("renders the email confirmed banner when ?flash_message is confirmed", () => { + cy.visit("/?flash_message=confirmed") + cy.get("#main-layout-header").should( + "contain", + "Your email has been confirmed" + ) + }) + + it("ignores flash messages that aren't explicitly supported", () => { + cy.visit("/?flash_message=l33thaxor") + cy.get("#main-layout-header").should("not.contain", "l33thaxor") + }) +}) diff --git a/src/desktop/components/react/stitch_components/NavBar.tsx b/src/desktop/components/react/stitch_components/NavBar.tsx index ea4ca0f1437..d10193fae66 100644 --- a/src/desktop/components/react/stitch_components/NavBar.tsx +++ b/src/desktop/components/react/stitch_components/NavBar.tsx @@ -1,6 +1,7 @@ import React from "react" import styled from "styled-components" import { NavBar as ReactionNavBar } from "v2/Components/NavBar" +import { FlashBanner } from "v2/Components/FlashBanner" import { data as sd } from "sharify" import { SystemContextProvider, SystemContextProps } from "v2/Artsy" @@ -42,6 +43,7 @@ export const NavBar: React.FC = ({ {showStagingBanner && } + ) diff --git a/src/mobile/apps/partner_profile/client/artworks.coffee b/src/mobile/apps/partner_profile/client/artworks.coffee index 1cdae4c968d..68016d73385 100644 --- a/src/mobile/apps/partner_profile/client/artworks.coffee +++ b/src/mobile/apps/partner_profile/client/artworks.coffee @@ -27,7 +27,9 @@ module.exports.PartnerArtworksView = class PartnerArtworksView extends Backbone. @$('#partner-artworks-spinner').hide() render: => - @$('#partner-artworks-list ul').append $(artworkColumnsTemplate(artworkColumns: @collection.groupByColumnsInOrder())).html() + $columns = $(artworkColumnsTemplate(artworkColumns: @collection.groupByColumnsInOrder())) + @$('#partner-artworks-list .artwork-columns-column').each (i, column) => + $(column).append $columns.find('.artwork-columns-column').eq(i).html() @$('#partner-artworks-spinner').hide() module.exports.init = -> diff --git a/src/mobile/apps/partner_profile/test/client/artworks.test.coffee b/src/mobile/apps/partner_profile/test/client/artworks.test.coffee new file mode 100644 index 00000000000..e5f6b18a676 --- /dev/null +++ b/src/mobile/apps/partner_profile/test/client/artworks.test.coffee @@ -0,0 +1,48 @@ +benv = require 'benv' +Backbone = require 'backbone' +sinon = require 'sinon' +path = require 'path' +Artworks = require '../../../../collections/artworks.coffee' +Artwork = require '../../../../models/artwork.coffee' +Profile = require '../../../../models/profile' +{ fabricate } = require '@artsy/antigravity' + +describe 'PartnerArtworksView', -> + beforeEach (done) -> + benv.setup => + benv.expose { $: benv.require 'jquery' } + $.onInfiniteScroll = sinon.stub() + Backbone.$ = $ + sinon.stub Backbone, 'sync' + + artworkColumns = [[new Artwork(fabricate('artwork'))], [new Artwork(fabricate('artwork'))]] + benv.render path.resolve(__dirname, '../../templates/artworks.jade'), + sd: {} + profile: new Profile(fabricate('profile')) + artworkColumns: artworkColumns + , => + { PartnerArtworksView } = benv.requireWithJadeify path.resolve(__dirname, '../../client/artworks.coffee'), ['artworkColumnsTemplate'] + @view = new PartnerArtworksView( + collection: new Artworks([]), + el: $ 'body' + params: {} + ) + done() + + afterEach -> + benv.teardown() + Backbone.sync.restore() + + describe '#render', -> + it 'appends artworks in collection to columns', -> + $('.artwork-columns-column').length.should.equal 2 + $('.artwork-columns-column').eq(0).find('.artwork-columns-artwork').length.should.equal 1 + $('.artwork-columns-column').eq(1).find('.artwork-columns-artwork').length.should.equal 1 + + artworks = new Artworks([fabricate('artwork'), fabricate('artwork'), fabricate('artwork')]) + @view.collection = artworks + @view.render() + + $('.artwork-columns-column').length.should.equal 2 + $('.artwork-columns-column').eq(0).find('.artwork-columns-artwork').length.should.equal 3 + $('.artwork-columns-column').eq(1).find('.artwork-columns-artwork').length.should.equal 2 diff --git a/src/v2/Apps/IdentityVerification/IdentityVerificationApp/index.tsx b/src/v2/Apps/IdentityVerification/IdentityVerificationApp/index.tsx index eea8dff5173..c14f819b24b 100644 --- a/src/v2/Apps/IdentityVerification/IdentityVerificationApp/index.tsx +++ b/src/v2/Apps/IdentityVerification/IdentityVerificationApp/index.tsx @@ -120,62 +120,69 @@ const IdentityVerificationApp: React.FC = ({ me, relay }) => { {AlternateComponent ? ( ) : ( - <> - setShowErrorModal(false)} - /> + <> + setShowErrorModal(false)} + /> - - - Artsy identity verification + + + Artsy identity verification - - You’ll need + + You’ll need - - • A camera on your phone or computer + + • A camera on your phone or computer
• Your government ID
- - Keep in mind + + Keep in mind - - • Verification will take 5–10 minutes + + • Verification may take up to 5–10 minutes
• The name on your ID must match the name on your payment method +
• Your ID and photo will only be used for verification + purposes, and will not be shared +
+ + Compatible browsers + + + • iOS: Safari +
• Android: Chrome, Samsung Internet +
• Mac/PC: Safari, Chrome, Firefox, Microsoft Edge
- • Your ID and photo will only be used for verification purposes, - and will not be shared
-
By clicking the button, you'll be redirected to our identity verification partner.
- - - For more information, see the{" "} - FAQ. + + For more information, see the{" "} + FAQ. -
- - )} +
+ + )} ) } diff --git a/src/v2/Apps/ViewingRoom/Components/ViewingRoomClosed.tsx b/src/v2/Apps/ViewingRoom/Components/ViewingRoomClosed.tsx new file mode 100644 index 00000000000..96a87313176 --- /dev/null +++ b/src/v2/Apps/ViewingRoom/Components/ViewingRoomClosed.tsx @@ -0,0 +1,47 @@ +import React from "react" +import { Box, Button, Flex, Sans } from "@artsy/palette" +import { createFragmentContainer, graphql } from "react-relay" +import { RouterLink } from "v2/Artsy/Router/RouterLink" + +import { ViewingRoomClosed_viewingRoom } from "v2/__generated__/ViewingRoomClosed_viewingRoom.graphql" + +interface ViewingRoomClosedProps { + viewingRoom: ViewingRoomClosed_viewingRoom +} + +const ViewingRoomClosed: React.FC = props => { + const { + viewingRoom: { + partner: { href }, + }, + } = props + + return ( + + + + This viewing room is now closed. We invite you to view this gallery's + current works. + + {href && ( + + + + )} + + + ) +} + +export const ViewingRoomClosedFragmentContainer = createFragmentContainer( + ViewingRoomClosed, + { + viewingRoom: graphql` + fragment ViewingRoomClosed_viewingRoom on ViewingRoom { + partner { + href + } + } + `, + } +) diff --git a/src/v2/Apps/ViewingRoom/ViewingRoomApp.tsx b/src/v2/Apps/ViewingRoom/ViewingRoomApp.tsx index 97099b251b8..f03d87c1c1f 100644 --- a/src/v2/Apps/ViewingRoom/ViewingRoomApp.tsx +++ b/src/v2/Apps/ViewingRoom/ViewingRoomApp.tsx @@ -2,6 +2,7 @@ import React from "react" import { AppContainer } from "v2/Apps/Components/AppContainer" import { Box, Separator } from "@artsy/palette" import { ViewingRoomHeaderFragmentContainer as ViewingRoomHeader } from "./Components/ViewingRoomHeader" +import { ViewingRoomClosedFragmentContainer as ViewingRoomClosed } from "./Components/ViewingRoomClosed" import { ViewingRoomTabBar } from "./Components/ViewingRoomTabBar" import { createFragmentContainer, graphql } from "react-relay" @@ -18,6 +19,8 @@ const ViewingRoomApp: React.FC = ({ children, viewingRoom, }) => { + // FIXME: We should rely on state to determin if VR is closed. + return ( <> @@ -25,9 +28,14 @@ const ViewingRoomApp: React.FC = ({ - - - {children} + {viewingRoom.formattedEndAt === "Closed" ? ( + + ) : ( + <> + + {children} + + )} @@ -44,6 +52,8 @@ export default createFragmentContainer(ViewingRoomApp, { fragment ViewingRoomApp_viewingRoom on ViewingRoom { ...ViewingRoomMeta_viewingRoom ...ViewingRoomHeader_viewingRoom + ...ViewingRoomClosed_viewingRoom + formattedEndAt } `, }) diff --git a/src/v2/Apps/ViewingRoom/__tests__/ViewingRoomApp.jest.tsx b/src/v2/Apps/ViewingRoom/__tests__/ViewingRoomApp.jest.tsx index c758a3fd6a8..c60b0a97dc4 100644 --- a/src/v2/Apps/ViewingRoom/__tests__/ViewingRoomApp.jest.tsx +++ b/src/v2/Apps/ViewingRoom/__tests__/ViewingRoomApp.jest.tsx @@ -2,7 +2,8 @@ import React from "react" import { MockBoot, renderRelayTree } from "v2/DevTools" import ViewingRoomApp from "../ViewingRoomApp" import { graphql } from "react-relay" -import { ViewingRoomApp_Test_QueryRawResponse } from "v2/__generated__/ViewingRoomApp_Test_Query.graphql" +import { ViewingRoomApp_OpenTest_QueryRawResponse } from "v2/__generated__/ViewingRoomApp_OpenTest_Query.graphql" +import { ViewingRoomApp_ClosedTest_QueryRawResponse } from "v2/__generated__/ViewingRoomApp_ClosedTest_Query.graphql" import { Breakpoint } from "@artsy/palette" jest.unmock("react-relay") @@ -20,78 +21,146 @@ jest.mock("v2/Artsy/Router/useRouter", () => ({ describe("ViewingRoomApp", () => { const slug = "subscription-demo-gg-guy-yanai" - const getWrapper = async ( - breakpoint: Breakpoint = "lg", - response: ViewingRoomApp_Test_QueryRawResponse = ViewingRoomAppFixture - ) => { - return await renderRelayTree({ - Component: ({ viewingRoom }) => { - return ( - - - some child - - - ) - }, - query: graphql` - query ViewingRoomApp_Test_Query($slug: ID!) @raw_response_type { - viewingRoom(id: $slug) { - ...ViewingRoomApp_viewingRoom + describe("with open viewing room", () => { + const getWrapper = async ( + breakpoint: Breakpoint = "lg", + response: ViewingRoomApp_OpenTest_QueryRawResponse = OpenViewingRoomAppFixture + ) => { + return renderRelayTree({ + Component: ({ viewingRoom }) => { + return ( + + + some child + + + ) + }, + query: graphql` + query ViewingRoomApp_OpenTest_Query($slug: ID!) @raw_response_type { + viewingRoom(id: $slug) { + ...ViewingRoomApp_viewingRoom + } } - } - `, - variables: { - slug, - }, - mockData: response, + `, + variables: { + slug, + }, + mockData: response, + }) + } + + it("renders the correct components", async () => { + const wrapper = await getWrapper() + expect(wrapper.find("ViewingRoomMeta").length).toBe(1) + expect(wrapper.find("AppContainer").length).toBe(1) + expect(wrapper.find("ViewingRoomHeader").length).toBe(1) + expect(wrapper.find("ViewingRoomTabBar").length).toBe(1) + expect(wrapper.find("ViewingRoomClosed").length).toBe(0) + expect(wrapper.html()).toContain("some child") }) - } - it("renders the correct components", async () => { - const wrapper = await getWrapper() - expect(wrapper.find("ViewingRoomMeta").length).toBe(1) - expect(wrapper.find("AppContainer").length).toBe(1) - expect(wrapper.find("ViewingRoomHeader").length).toBe(1) - expect(wrapper.find("ViewingRoomTabBar").length).toBe(1) - expect(wrapper.html()).toContain("some child") - }) + describe("ViewingRoomHeader", () => { + describe("desktop", () => { + it("renders correctly", async () => { + const wrapper = await getWrapper() + expect(wrapper.find("ResponsiveImage").length).toBe(1) + const html = wrapper.html() + expect(html).toContain("Guy Yanai") + expect(html).toContain("Subscription Demo GG") + expect(html).toContain("Closes in about 1 month") + }) + }) - describe("ViewingRoomHeader", () => { - describe("desktop", () => { - it("renders correctly", async () => { - const wrapper = await getWrapper() - expect(wrapper.find("ResponsiveImage").length).toBe(1) - const html = wrapper.html() - expect(html).toContain("Guy Yanai") - expect(html).toContain("Subscription Demo GG") - expect(html).toContain("Closes in about 1 month") + describe("mobile", () => { + it("renders correctly", async () => { + const wrapper = await getWrapper() + expect(wrapper.find("ResponsiveImage").length).toBe(1) + const html = wrapper.html() + expect(html).toContain("Guy Yanai") + expect(html).toContain("Subscription Demo GG") + expect(html).toContain("Closes in about 1 month") + }) }) }) - describe("mobile", () => { - it("renders correctly", async () => { + describe("ViewingRoomTabBar", () => { + it("renders correct tabs", async () => { const wrapper = await getWrapper() - expect(wrapper.find("ResponsiveImage").length).toBe(1) + expect(wrapper.find("Tab").length).toBe(2) const html = wrapper.html() - expect(html).toContain("Guy Yanai") - expect(html).toContain("Subscription Demo GG") + expect(html).toContain(`href="/viewing-room/${slug}"`) + expect(html).toContain(`href="/viewing-room/${slug}/works"`) }) }) }) - describe("ViewingRoomTabBar", () => { - it("renders correct tabs", async () => { + describe("with closed viewing room", () => { + const getWrapper = async ( + breakpoint: Breakpoint = "lg", + response: ViewingRoomApp_ClosedTest_QueryRawResponse = ClosedViewingRoomAppFixture + ) => { + return renderRelayTree({ + Component: ({ viewingRoom }) => { + return ( + + + some child + + + ) + }, + query: graphql` + query ViewingRoomApp_ClosedTest_Query($slug: ID!) @raw_response_type { + viewingRoom(id: $slug) { + ...ViewingRoomApp_viewingRoom + } + } + `, + variables: { + slug, + }, + mockData: response, + }) + } + + it("renders the correct components", async () => { const wrapper = await getWrapper() - expect(wrapper.find("Tab").length).toBe(2) - const html = wrapper.html() - expect(html).toContain(`href="/viewing-room/${slug}"`) - expect(html).toContain(`href="/viewing-room/${slug}/works"`) + expect(wrapper.find("ViewingRoomMeta").length).toBe(1) + expect(wrapper.find("AppContainer").length).toBe(1) + expect(wrapper.find("ViewingRoomHeader").length).toBe(1) + expect(wrapper.find("ViewingRoomTabBar").length).toBe(0) + expect(wrapper.find("ViewingRoomClosed").length).toBe(1) + expect(wrapper.html()).not.toContain("some child") + }) + + describe("ViewingRoomHeader", () => { + describe("desktop", () => { + it("renders correctly", async () => { + const wrapper = await getWrapper() + expect(wrapper.find("ResponsiveImage").length).toBe(1) + const html = wrapper.html() + expect(html).toContain("Guy Yanai") + expect(html).toContain("Subscription Demo GG") + expect(html).toContain("Closed") + }) + }) + + describe("mobile", () => { + it("renders correctly", async () => { + const wrapper = await getWrapper() + expect(wrapper.find("ResponsiveImage").length).toBe(1) + const html = wrapper.html() + expect(html).toContain("Guy Yanai") + expect(html).toContain("Subscription Demo GG") + expect(html).toContain("Closed") + }) + }) }) }) }) -const ViewingRoomAppFixture: ViewingRoomApp_Test_QueryRawResponse = { +const OpenViewingRoomAppFixture: ViewingRoomApp_OpenTest_QueryRawResponse = { viewingRoom: { title: "Guy Yanai", heroImageURL: @@ -99,7 +168,22 @@ const ViewingRoomAppFixture: ViewingRoomApp_Test_QueryRawResponse = { partner: { name: "Subscription Demo GG", id: "UGFydG5lcjo1NTQxMjM3MzcyNjE2OTJiMTk4YzAzMDA=", + href: "/partner-demo-gg", }, formattedEndAt: "Closes in about 1 month", }, } + +const ClosedViewingRoomAppFixture: ViewingRoomApp_ClosedTest_QueryRawResponse = { + viewingRoom: { + title: "Guy Yanai", + heroImageURL: + "https://d7hftxdivxxvm.cloudfront.net/?resize_to=width&src=https%3A%2F%2Fartsy-media-uploads.s3.amazonaws.com%2F0RnxWDsVmKuALfpmd75YyA%2FCTPHSEPT19_018_JO_Guy_Yanai_TLV_031_20190913.jpg&width=1200&quality=80", + partner: { + name: "Subscription Demo GG", + id: "UGFydG5lcjo1NTQxMjM3MzcyNjE2OTJiMTk4YzAzMDA=", + href: "/partner-demo-gg", + }, + formattedEndAt: "Closed", + }, +} diff --git a/src/v2/Components/FlashBanner.tsx b/src/v2/Components/FlashBanner/FlashMessage.tsx similarity index 57% rename from src/v2/Components/FlashBanner.tsx rename to src/v2/Components/FlashBanner/FlashMessage.tsx index 4c86a967b26..5a35c3f00f5 100644 --- a/src/v2/Components/FlashBanner.tsx +++ b/src/v2/Components/FlashBanner/FlashMessage.tsx @@ -1,23 +1,11 @@ import React from "react" import { Banner, Sans } from "@artsy/palette" -interface Props { - messageCode: FlashMessageKey -} - -export type FlashMessageKey = - /* email confirmed */ - | "confirmed" - /* email already confirmed */ - | "already_confirmed" - /* email confirmation token was invalid */ - | "invalid_token" - /* email confirmation token was empty */ - | "blank_token" - /* email confirmation token was expired */ - | "expired_token" - -const messages: Record = { +/** Flash messages triggered by a url `flash_message` query param + * A message can be a string or a React Component that takes no props + * (that is, use relay or context if necessary) + */ +const messageByQueryParam: { [k: string]: string | React.FC } = { confirmed: "Your email has been confirmed.", already_confirmed: "You have already confirmed your email.", invalid_token: "An error has occurred. Please contact support@artsy.net.", @@ -25,10 +13,10 @@ const messages: Record = { expired_token: "Link expired. Resend verification email.", } -export const FlashBanner: React.FunctionComponent = ({ +export const FlashMessage: React.FC<{ messageCode: string }> = ({ messageCode, }) => { - const Message = messages[messageCode] + const Message = messageByQueryParam[messageCode] if (!Message) return null return ( Message && ( diff --git a/src/v2/Components/FlashBanner.story.tsx b/src/v2/Components/FlashBanner/__stories__/FlashMessage.story.tsx similarity index 100% rename from src/v2/Components/FlashBanner.story.tsx rename to src/v2/Components/FlashBanner/__stories__/FlashMessage.story.tsx diff --git a/src/v2/Components/FlashBanner/__tests__/FlashBanner.jest.tsx b/src/v2/Components/FlashBanner/__tests__/FlashBanner.jest.tsx new file mode 100644 index 00000000000..44ccde667d6 --- /dev/null +++ b/src/v2/Components/FlashBanner/__tests__/FlashBanner.jest.tsx @@ -0,0 +1,32 @@ +import { mount } from "enzyme" +import "jest-styled-components" +import React from "react" +import { FlashBanner } from "v2/Components/FlashBanner" + +const { location: originalLocation } = window + +describe("FlashBanner", () => { + afterEach(() => { + window.location = originalLocation + }) + + it("renders a banner based on a messageCode prop", () => { + const wrapper = mount() + expect(wrapper.text()).toContain("Your email has been confirmed.") + }) + + it("returns nothing without complaint if the message code is not supported", () => { + const wrapper = mount() + expect(wrapper.html()).toBeNull() + }) + + it("can determine a messageCode from the query string", () => { + delete window.location + const fakeLocation: any = { search: "?flash_message=expired_token" } + window.location = fakeLocation + + const wrapper = mount() + + expect(wrapper.text()).toContain("Link expired. Resend verification email.") + }) +}) diff --git a/src/v2/Components/FlashBanner/index.tsx b/src/v2/Components/FlashBanner/index.tsx new file mode 100644 index 00000000000..d69c7ed04a8 --- /dev/null +++ b/src/v2/Components/FlashBanner/index.tsx @@ -0,0 +1,43 @@ +import React from "react" +import qs from "qs" +import { Banner, Sans } from "@artsy/palette" + +/** Flash messages triggered by a url `flash_message` query param + * A message can be a string or a React Component that takes no props + * (that is, use relay or context if necessary) + */ +const messageByQueryParam: { [k: string]: string | React.FC } = { + confirmed: "Your email has been confirmed.", + already_confirmed: "You have already confirmed your email.", + invalid_token: "An error has occurred. Please contact support@artsy.net.", + blank_token: "An error has occurred. Please contact support@artsy.net.", + expired_token: "Link expired. Resend verification email.", +} + +/** + * The component responsible for selecting a flash message key from the `flash_message` url query param + */ +export const FlashBanner: React.FunctionComponent<{ + messageCode?: string +}> = props => { + const [messageCode, setMessageCode] = React.useState(props.messageCode) + + React.useEffect(() => { + if (!messageCode) { + const query = qs.parse(window.location.search.slice(1)) + if (query["flash_message"]) setMessageCode(query["flash_message"]) + } + }, []) + + if (!messageCode) return null + const Message = messageByQueryParam[messageCode] + if (!Message) return null + + return ( + + + {typeof Message === "string" ? Message : } + + + ) +} diff --git a/src/v2/Components/__tests__/FlashBanner.jest.tsx b/src/v2/Components/__tests__/FlashBanner.jest.tsx deleted file mode 100644 index 31f6c9d5ed0..00000000000 --- a/src/v2/Components/__tests__/FlashBanner.jest.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { mount } from "enzyme" -import "jest-styled-components" -import React from "react" -import { FlashBanner } from "../FlashBanner" - -describe("FlashBanner", () => { - it("renders a banner based on a message code", () => { - const wrapper = mount() - expect(wrapper.text()).toContain("Your email has been confirmed.") - }) - - it("returns nothing without complaint if the message code is not supported", () => { - const wrapper = mount() - expect(wrapper.html()).toBeNull() - }) -}) diff --git a/src/v2/__generated__/ViewingRoomApp_ClosedTest_Query.graphql.ts b/src/v2/__generated__/ViewingRoomApp_ClosedTest_Query.graphql.ts new file mode 100644 index 00000000000..2958b7b5a18 --- /dev/null +++ b/src/v2/__generated__/ViewingRoomApp_ClosedTest_Query.graphql.ts @@ -0,0 +1,195 @@ +/* tslint:disable */ + +import { ConcreteRequest } from "relay-runtime"; +import { FragmentRefs } from "relay-runtime"; +export type ViewingRoomApp_ClosedTest_QueryVariables = { + slug: string; +}; +export type ViewingRoomApp_ClosedTest_QueryResponse = { + readonly viewingRoom: { + readonly " $fragmentRefs": FragmentRefs<"ViewingRoomApp_viewingRoom">; + } | null; +}; +export type ViewingRoomApp_ClosedTest_QueryRawResponse = { + readonly viewingRoom: ({ + readonly title: string; + readonly heroImageURL: string | null; + readonly partner: ({ + readonly name: string | null; + readonly id: string | null; + readonly href: string | null; + }) | null; + readonly formattedEndAt: string | null; + }) | null; +}; +export type ViewingRoomApp_ClosedTest_Query = { + readonly response: ViewingRoomApp_ClosedTest_QueryResponse; + readonly variables: ViewingRoomApp_ClosedTest_QueryVariables; + readonly rawResponse: ViewingRoomApp_ClosedTest_QueryRawResponse; +}; + + + +/* +query ViewingRoomApp_ClosedTest_Query( + $slug: ID! +) { + viewingRoom(id: $slug) { + ...ViewingRoomApp_viewingRoom + } +} + +fragment ViewingRoomApp_viewingRoom on ViewingRoom { + ...ViewingRoomMeta_viewingRoom + ...ViewingRoomHeader_viewingRoom + ...ViewingRoomClosed_viewingRoom + formattedEndAt +} + +fragment ViewingRoomClosed_viewingRoom on ViewingRoom { + partner { + href + id + } +} + +fragment ViewingRoomHeader_viewingRoom on ViewingRoom { + heroImageURL + title + partner { + name + id + } + formattedEndAt +} + +fragment ViewingRoomMeta_viewingRoom on ViewingRoom { + title +} +*/ + +const node: ConcreteRequest = (function(){ +var v0 = [ + { + "kind": "LocalArgument", + "name": "slug", + "type": "ID!", + "defaultValue": null + } +], +v1 = [ + { + "kind": "Variable", + "name": "id", + "variableName": "slug" + } +]; +return { + "kind": "Request", + "fragment": { + "kind": "Fragment", + "name": "ViewingRoomApp_ClosedTest_Query", + "type": "Query", + "metadata": null, + "argumentDefinitions": (v0/*: any*/), + "selections": [ + { + "kind": "LinkedField", + "alias": null, + "name": "viewingRoom", + "storageKey": null, + "args": (v1/*: any*/), + "concreteType": "ViewingRoom", + "plural": false, + "selections": [ + { + "kind": "FragmentSpread", + "name": "ViewingRoomApp_viewingRoom", + "args": null + } + ] + } + ] + }, + "operation": { + "kind": "Operation", + "name": "ViewingRoomApp_ClosedTest_Query", + "argumentDefinitions": (v0/*: any*/), + "selections": [ + { + "kind": "LinkedField", + "alias": null, + "name": "viewingRoom", + "storageKey": null, + "args": (v1/*: any*/), + "concreteType": "ViewingRoom", + "plural": false, + "selections": [ + { + "kind": "ScalarField", + "alias": null, + "name": "title", + "args": null, + "storageKey": null + }, + { + "kind": "ScalarField", + "alias": null, + "name": "heroImageURL", + "args": null, + "storageKey": null + }, + { + "kind": "LinkedField", + "alias": null, + "name": "partner", + "storageKey": null, + "args": null, + "concreteType": "Partner", + "plural": false, + "selections": [ + { + "kind": "ScalarField", + "alias": null, + "name": "name", + "args": null, + "storageKey": null + }, + { + "kind": "ScalarField", + "alias": null, + "name": "id", + "args": null, + "storageKey": null + }, + { + "kind": "ScalarField", + "alias": null, + "name": "href", + "args": null, + "storageKey": null + } + ] + }, + { + "kind": "ScalarField", + "alias": null, + "name": "formattedEndAt", + "args": null, + "storageKey": null + } + ] + } + ] + }, + "params": { + "operationKind": "query", + "name": "ViewingRoomApp_ClosedTest_Query", + "id": null, + "text": "query ViewingRoomApp_ClosedTest_Query(\n $slug: ID!\n) {\n viewingRoom(id: $slug) {\n ...ViewingRoomApp_viewingRoom\n }\n}\n\nfragment ViewingRoomApp_viewingRoom on ViewingRoom {\n ...ViewingRoomMeta_viewingRoom\n ...ViewingRoomHeader_viewingRoom\n ...ViewingRoomClosed_viewingRoom\n formattedEndAt\n}\n\nfragment ViewingRoomClosed_viewingRoom on ViewingRoom {\n partner {\n href\n id\n }\n}\n\nfragment ViewingRoomHeader_viewingRoom on ViewingRoom {\n heroImageURL\n title\n partner {\n name\n id\n }\n formattedEndAt\n}\n\nfragment ViewingRoomMeta_viewingRoom on ViewingRoom {\n title\n}\n", + "metadata": {} + } +}; +})(); +(node as any).hash = 'fa8ab7ef7254649a80f9196118fc65e0'; +export default node; diff --git a/src/v2/__generated__/ViewingRoomApp_Test_Query.graphql.ts b/src/v2/__generated__/ViewingRoomApp_OpenTest_Query.graphql.ts similarity index 67% rename from src/v2/__generated__/ViewingRoomApp_Test_Query.graphql.ts rename to src/v2/__generated__/ViewingRoomApp_OpenTest_Query.graphql.ts index 08dcfe044ea..ae8328cf615 100644 --- a/src/v2/__generated__/ViewingRoomApp_Test_Query.graphql.ts +++ b/src/v2/__generated__/ViewingRoomApp_OpenTest_Query.graphql.ts @@ -2,35 +2,36 @@ import { ConcreteRequest } from "relay-runtime"; import { FragmentRefs } from "relay-runtime"; -export type ViewingRoomApp_Test_QueryVariables = { +export type ViewingRoomApp_OpenTest_QueryVariables = { slug: string; }; -export type ViewingRoomApp_Test_QueryResponse = { +export type ViewingRoomApp_OpenTest_QueryResponse = { readonly viewingRoom: { readonly " $fragmentRefs": FragmentRefs<"ViewingRoomApp_viewingRoom">; } | null; }; -export type ViewingRoomApp_Test_QueryRawResponse = { +export type ViewingRoomApp_OpenTest_QueryRawResponse = { readonly viewingRoom: ({ readonly title: string; readonly heroImageURL: string | null; readonly partner: ({ readonly name: string | null; readonly id: string | null; + readonly href: string | null; }) | null; readonly formattedEndAt: string | null; }) | null; }; -export type ViewingRoomApp_Test_Query = { - readonly response: ViewingRoomApp_Test_QueryResponse; - readonly variables: ViewingRoomApp_Test_QueryVariables; - readonly rawResponse: ViewingRoomApp_Test_QueryRawResponse; +export type ViewingRoomApp_OpenTest_Query = { + readonly response: ViewingRoomApp_OpenTest_QueryResponse; + readonly variables: ViewingRoomApp_OpenTest_QueryVariables; + readonly rawResponse: ViewingRoomApp_OpenTest_QueryRawResponse; }; /* -query ViewingRoomApp_Test_Query( +query ViewingRoomApp_OpenTest_Query( $slug: ID! ) { viewingRoom(id: $slug) { @@ -41,6 +42,15 @@ query ViewingRoomApp_Test_Query( fragment ViewingRoomApp_viewingRoom on ViewingRoom { ...ViewingRoomMeta_viewingRoom ...ViewingRoomHeader_viewingRoom + ...ViewingRoomClosed_viewingRoom + formattedEndAt +} + +fragment ViewingRoomClosed_viewingRoom on ViewingRoom { + partner { + href + id + } } fragment ViewingRoomHeader_viewingRoom on ViewingRoom { @@ -78,7 +88,7 @@ return { "kind": "Request", "fragment": { "kind": "Fragment", - "name": "ViewingRoomApp_Test_Query", + "name": "ViewingRoomApp_OpenTest_Query", "type": "Query", "metadata": null, "argumentDefinitions": (v0/*: any*/), @@ -103,7 +113,7 @@ return { }, "operation": { "kind": "Operation", - "name": "ViewingRoomApp_Test_Query", + "name": "ViewingRoomApp_OpenTest_Query", "argumentDefinitions": (v0/*: any*/), "selections": [ { @@ -151,6 +161,13 @@ return { "name": "id", "args": null, "storageKey": null + }, + { + "kind": "ScalarField", + "alias": null, + "name": "href", + "args": null, + "storageKey": null } ] }, @@ -167,12 +184,12 @@ return { }, "params": { "operationKind": "query", - "name": "ViewingRoomApp_Test_Query", + "name": "ViewingRoomApp_OpenTest_Query", "id": null, - "text": "query ViewingRoomApp_Test_Query(\n $slug: ID!\n) {\n viewingRoom(id: $slug) {\n ...ViewingRoomApp_viewingRoom\n }\n}\n\nfragment ViewingRoomApp_viewingRoom on ViewingRoom {\n ...ViewingRoomMeta_viewingRoom\n ...ViewingRoomHeader_viewingRoom\n}\n\nfragment ViewingRoomHeader_viewingRoom on ViewingRoom {\n heroImageURL\n title\n partner {\n name\n id\n }\n formattedEndAt\n}\n\nfragment ViewingRoomMeta_viewingRoom on ViewingRoom {\n title\n}\n", + "text": "query ViewingRoomApp_OpenTest_Query(\n $slug: ID!\n) {\n viewingRoom(id: $slug) {\n ...ViewingRoomApp_viewingRoom\n }\n}\n\nfragment ViewingRoomApp_viewingRoom on ViewingRoom {\n ...ViewingRoomMeta_viewingRoom\n ...ViewingRoomHeader_viewingRoom\n ...ViewingRoomClosed_viewingRoom\n formattedEndAt\n}\n\nfragment ViewingRoomClosed_viewingRoom on ViewingRoom {\n partner {\n href\n id\n }\n}\n\nfragment ViewingRoomHeader_viewingRoom on ViewingRoom {\n heroImageURL\n title\n partner {\n name\n id\n }\n formattedEndAt\n}\n\nfragment ViewingRoomMeta_viewingRoom on ViewingRoom {\n title\n}\n", "metadata": {} } }; })(); -(node as any).hash = '8749bcc17435f6b8c12ef726f58c5866'; +(node as any).hash = 'cdbb14e9b2536f43953bc8e28b911b02'; export default node; diff --git a/src/v2/__generated__/ViewingRoomApp_viewingRoom.graphql.ts b/src/v2/__generated__/ViewingRoomApp_viewingRoom.graphql.ts index 2c3fb53ac1b..bb4bdc7cb2a 100644 --- a/src/v2/__generated__/ViewingRoomApp_viewingRoom.graphql.ts +++ b/src/v2/__generated__/ViewingRoomApp_viewingRoom.graphql.ts @@ -3,7 +3,8 @@ import { ReaderFragment } from "relay-runtime"; import { FragmentRefs } from "relay-runtime"; export type ViewingRoomApp_viewingRoom = { - readonly " $fragmentRefs": FragmentRefs<"ViewingRoomMeta_viewingRoom" | "ViewingRoomHeader_viewingRoom">; + readonly formattedEndAt: string | null; + readonly " $fragmentRefs": FragmentRefs<"ViewingRoomMeta_viewingRoom" | "ViewingRoomHeader_viewingRoom" | "ViewingRoomClosed_viewingRoom">; readonly " $refType": "ViewingRoomApp_viewingRoom"; }; export type ViewingRoomApp_viewingRoom$data = ViewingRoomApp_viewingRoom; @@ -21,6 +22,13 @@ const node: ReaderFragment = { "metadata": null, "argumentDefinitions": [], "selections": [ + { + "kind": "ScalarField", + "alias": null, + "name": "formattedEndAt", + "args": null, + "storageKey": null + }, { "kind": "FragmentSpread", "name": "ViewingRoomMeta_viewingRoom", @@ -30,8 +38,13 @@ const node: ReaderFragment = { "kind": "FragmentSpread", "name": "ViewingRoomHeader_viewingRoom", "args": null + }, + { + "kind": "FragmentSpread", + "name": "ViewingRoomClosed_viewingRoom", + "args": null } ] }; -(node as any).hash = 'd2efc956a382ae816a9b332367fad39d'; +(node as any).hash = 'c3b6c8102fe6a5d190c45fbaadf14faa'; export default node; diff --git a/src/v2/__generated__/ViewingRoomClosed_viewingRoom.graphql.ts b/src/v2/__generated__/ViewingRoomClosed_viewingRoom.graphql.ts new file mode 100644 index 00000000000..2275ed103b6 --- /dev/null +++ b/src/v2/__generated__/ViewingRoomClosed_viewingRoom.graphql.ts @@ -0,0 +1,47 @@ +/* tslint:disable */ + +import { ReaderFragment } from "relay-runtime"; +import { FragmentRefs } from "relay-runtime"; +export type ViewingRoomClosed_viewingRoom = { + readonly partner: { + readonly href: string | null; + } | null; + readonly " $refType": "ViewingRoomClosed_viewingRoom"; +}; +export type ViewingRoomClosed_viewingRoom$data = ViewingRoomClosed_viewingRoom; +export type ViewingRoomClosed_viewingRoom$key = { + readonly " $data"?: ViewingRoomClosed_viewingRoom$data; + readonly " $fragmentRefs": FragmentRefs<"ViewingRoomClosed_viewingRoom">; +}; + + + +const node: ReaderFragment = { + "kind": "Fragment", + "name": "ViewingRoomClosed_viewingRoom", + "type": "ViewingRoom", + "metadata": null, + "argumentDefinitions": [], + "selections": [ + { + "kind": "LinkedField", + "alias": null, + "name": "partner", + "storageKey": null, + "args": null, + "concreteType": "Partner", + "plural": false, + "selections": [ + { + "kind": "ScalarField", + "alias": null, + "name": "href", + "args": null, + "storageKey": null + } + ] + } + ] +}; +(node as any).hash = '6bd511c97fcfdf50711b53bcf45cc54c'; +export default node; diff --git a/src/v2/__generated__/routes_ViewingRoomQuery.graphql.ts b/src/v2/__generated__/routes_ViewingRoomQuery.graphql.ts index d7a9818ecd7..50cbb5e4470 100644 --- a/src/v2/__generated__/routes_ViewingRoomQuery.graphql.ts +++ b/src/v2/__generated__/routes_ViewingRoomQuery.graphql.ts @@ -29,6 +29,15 @@ query routes_ViewingRoomQuery( fragment ViewingRoomApp_viewingRoom on ViewingRoom { ...ViewingRoomMeta_viewingRoom ...ViewingRoomHeader_viewingRoom + ...ViewingRoomClosed_viewingRoom + formattedEndAt +} + +fragment ViewingRoomClosed_viewingRoom on ViewingRoom { + partner { + href + id + } } fragment ViewingRoomHeader_viewingRoom on ViewingRoom { @@ -139,6 +148,13 @@ return { "name": "id", "args": null, "storageKey": null + }, + { + "kind": "ScalarField", + "alias": null, + "name": "href", + "args": null, + "storageKey": null } ] }, @@ -157,7 +173,7 @@ return { "operationKind": "query", "name": "routes_ViewingRoomQuery", "id": null, - "text": "query routes_ViewingRoomQuery(\n $slug: ID!\n) {\n viewingRoom(id: $slug) {\n ...ViewingRoomApp_viewingRoom\n }\n}\n\nfragment ViewingRoomApp_viewingRoom on ViewingRoom {\n ...ViewingRoomMeta_viewingRoom\n ...ViewingRoomHeader_viewingRoom\n}\n\nfragment ViewingRoomHeader_viewingRoom on ViewingRoom {\n heroImageURL\n title\n partner {\n name\n id\n }\n formattedEndAt\n}\n\nfragment ViewingRoomMeta_viewingRoom on ViewingRoom {\n title\n}\n", + "text": "query routes_ViewingRoomQuery(\n $slug: ID!\n) {\n viewingRoom(id: $slug) {\n ...ViewingRoomApp_viewingRoom\n }\n}\n\nfragment ViewingRoomApp_viewingRoom on ViewingRoom {\n ...ViewingRoomMeta_viewingRoom\n ...ViewingRoomHeader_viewingRoom\n ...ViewingRoomClosed_viewingRoom\n formattedEndAt\n}\n\nfragment ViewingRoomClosed_viewingRoom on ViewingRoom {\n partner {\n href\n id\n }\n}\n\nfragment ViewingRoomHeader_viewingRoom on ViewingRoom {\n heroImageURL\n title\n partner {\n name\n id\n }\n formattedEndAt\n}\n\nfragment ViewingRoomMeta_viewingRoom on ViewingRoom {\n title\n}\n", "metadata": {} } }; diff --git a/webpack/envs/baseConfig.js b/webpack/envs/baseConfig.js index 876265b79f8..7162e0660a4 100644 --- a/webpack/envs/baseConfig.js +++ b/webpack/envs/baseConfig.js @@ -27,7 +27,15 @@ exports.baseConfig = { { test: /\.coffee$/, include: path.resolve(basePath, "src"), - use: ["cache-loader", "coffee-loader"], + use: [ + { + loader: "cache-loader", + options: { + cacheDirectory: ".cache", + }, + }, + "coffee-loader", + ], }, { test: /\.(jade|pug)$/, @@ -49,7 +57,8 @@ exports.baseConfig = { { loader: "babel-loader", options: { - cacheDirectory: !isCI && path.join(basePath, ".cache", "babel"), + cacheDirectory: + !isCI && path.join(basePath, ".cache", "babel/force"), }, }, ],