Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy #5652

Merged
merged 17 commits into from
May 27, 2020
Merged

Deploy #5652

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
})
}
Expand Down Expand Up @@ -168,7 +168,7 @@ module.exports = async ({ config, mode }) => {
{
loader: "babel-loader",
options: {
cacheDirectory: path.join(cacheDirectory, "babel"),
cacheDirectory: path.join(cacheDirectory, "babel/storybook"),
},
},
],
Expand Down
14 changes: 14 additions & 0 deletions cypress/integration/flashMessage.spec.js
Original file line number Diff line number Diff line change
@@ -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")
})
})
2 changes: 2 additions & 0 deletions src/desktop/components/react/stitch_components/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -42,6 +43,7 @@ export const NavBar: React.FC<NavBarProps> = ({
<NavBarContainer id="main-layout-header">
{showStagingBanner && <StagingBanner />}
<ReactionNavBar />
<FlashBanner />
</NavBarContainer>
</SystemContextProvider>
)
Expand Down
4 changes: 3 additions & 1 deletion src/mobile/apps/partner_profile/client/artworks.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ->
Expand Down
48 changes: 48 additions & 0 deletions src/mobile/apps/partner_profile/test/client/artworks.test.coffee
Original file line number Diff line number Diff line change
@@ -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
81 changes: 44 additions & 37 deletions src/v2/Apps/IdentityVerification/IdentityVerificationApp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,62 +120,69 @@ const IdentityVerificationApp: React.FC<Props> = ({ me, relay }) => {
{AlternateComponent ? (
<AlternateComponent />
) : (
<>
<ErrorModal
show={showErrorModal}
contactEmail="verification@artsy.net"
onClose={() => setShowErrorModal(false)}
/>
<>
<ErrorModal
show={showErrorModal}
contactEmail="verification@artsy.net"
onClose={() => setShowErrorModal(false)}
/>

<Box px="2" mb="6" mt="3" mx="auto" width="100%" maxWidth="400px">
<Serif size="6" textAlign="center">
Artsy identity verification
<Box px="2" mb="6" mt="3" mx="auto" width="100%" maxWidth="400px">
<Serif size="6" textAlign="center">
Artsy identity verification
</Serif>

<Sans size="4" mt="2" weight="medium">
You’ll need
<Sans size="4" mt="2" weight="medium">
You’ll need
</Sans>
<Sans size="4">
• A camera on your phone or computer
<Sans size="4">
• A camera on your phone or computer
<br />• Your government ID
</Sans>

<Sans size="4" mt="2" weight="medium">
Keep in mind
<Sans size="4" mt="2" weight="medium">
Keep in mind
</Sans>
<Sans size="4">
• Verification will take 5–10 minutes
<Sans size="4">
• Verification may take up to 5–10 minutes
<br />
• The name on your ID must match the name on your payment method
<br />• Your ID and photo will only be used for verification
purposes, and will not be shared
</Sans>
<Sans size="4" mt="2" weight="medium">
Compatible browsers
</Sans>
<Sans size="4">
• iOS: Safari
<br />• Android: Chrome, Samsung Internet
<br />• Mac/PC: Safari, Chrome, Firefox, Microsoft Edge
<br />
• Your ID and photo will only be used for verification purposes,
and will not be shared
<br />
<br />
By clicking the button, you'll be redirected to our identity
verification partner.
</Sans>

<Button
mt="4"
width="100%"
loading={requesting}
onClick={() => {
setRequesting(true)
trackClickedContinueToVerification()
startIdentityVerification()
}}
>
Continue to verification
<Button
mt="4"
width="100%"
loading={requesting}
onClick={() => {
setRequesting(true)
trackClickedContinueToVerification()
startIdentityVerification()
}}
>
Continue to verification
</Button>

<Sans mt="4" size="4" color="black60">
For more information, see the{" "}
<Link href="/identity-verification-faq">FAQ</Link>.
<Sans mt="4" size="4" color="black60">
For more information, see the{" "}
<Link href="/identity-verification-faq">FAQ</Link>.
</Sans>
</Box>
</>
)}
</Box>
</>
)}
</AppContainer>
)
}
Expand Down
47 changes: 47 additions & 0 deletions src/v2/Apps/ViewingRoom/Components/ViewingRoomClosed.tsx
Original file line number Diff line number Diff line change
@@ -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<ViewingRoomClosedProps> = props => {
const {
viewingRoom: {
partner: { href },
},
} = props

return (
<Box>
<Flex flexDirection="column" alignItems="center">
<Sans size="4" mt={50} mb={1} textAlign="center" maxWidth="470px">
This viewing room is now closed. We invite you to view this gallery's
current works.
</Sans>
{href && (
<RouterLink to={href}>
<Button variant="secondaryGray">View Gallery</Button>
</RouterLink>
)}
</Flex>
</Box>
)
}

export const ViewingRoomClosedFragmentContainer = createFragmentContainer(
ViewingRoomClosed,
{
viewingRoom: graphql`
fragment ViewingRoomClosed_viewingRoom on ViewingRoom {
partner {
href
}
}
`,
}
)
16 changes: 13 additions & 3 deletions src/v2/Apps/ViewingRoom/ViewingRoomApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -18,16 +19,23 @@ const ViewingRoomApp: React.FC<ViewingRoomAppProps> = ({
children,
viewingRoom,
}) => {
// FIXME: We should rely on state to determin if VR is closed.

return (
<>
<ViewingRoomMeta viewingRoom={viewingRoom} />

<AppContainer maxWidth="100%">
<ViewingRoomHeader viewingRoom={viewingRoom} />

<ViewingRoomTabBar mb={[2, 3]} />

{children}
{viewingRoom.formattedEndAt === "Closed" ? (
<ViewingRoomClosed viewingRoom={viewingRoom} />
) : (
<>
<ViewingRoomTabBar mb={[2, 3]} />
{children}
</>
)}

<Box mx={2}>
<Separator mt={6} mb={3} />
Expand All @@ -44,6 +52,8 @@ export default createFragmentContainer(ViewingRoomApp, {
fragment ViewingRoomApp_viewingRoom on ViewingRoom {
...ViewingRoomMeta_viewingRoom
...ViewingRoomHeader_viewingRoom
...ViewingRoomClosed_viewingRoom
formattedEndAt
}
`,
})
Loading