Skip to content

Commit

Permalink
Merge pull request #9779 from artsy/staging
Browse files Browse the repository at this point in the history
Deploy
  • Loading branch information
annacarey committed Mar 31, 2022
2 parents 84cca99 + 206cebf commit 5973f4b
Show file tree
Hide file tree
Showing 24 changed files with 94 additions and 236 deletions.
15 changes: 9 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,22 @@ jobs:

validate_production_schema:
executor: node/build
parameters:
# find channel ID at the botton of channel details view (slack app) or by right clicking on channel, and copying the link. The ID will be visible at the end of that URL.
practice_web:
type: string
default: C2TQ4PT8R
dev:
type: string
default: C02BC3HEJ
steps:
- yarn/setup
- run:
name: Validate Production Schema
command: node scripts/validateSchemas.js production
- slack/notify:
event: fail
channel: "<< parameters.practice_web >>, << parameters.dev >>"
custom: |
{
"blocks": [
Expand Down Expand Up @@ -413,12 +422,6 @@ workflows:
requires:
- horizon/block
- validate_production_schema
post-steps:
# notify: practice-web, dev
- slack/notify:
event: fail
channel: "C2TQ4PT8R, C02BC3HEJ"
template: basic_fail_1

# Other
- run_deepcrawl_automator:
Expand Down
6 changes: 3 additions & 3 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
"filename": "src/config.ts",
"hashed_secret": "e88b861dd023258e4bbecae2721a214c49564a7c",
"is_verified": false,
"line_number": 104
"line_number": 103
}
],
"src/desktop/apps/article/__tests__/routes.jest.ts": [
Expand Down Expand Up @@ -311,7 +311,7 @@
"filename": "src/desktop/test/models/partner_location.jest.ts",
"hashed_secret": "8d02fa33afe952b0df3246121f081bd8614d17af",
"is_verified": false,
"line_number": 15
"line_number": 16
}
],
"src/v2/Apps/ViewingRoom/__tests__/ViewingRoomApp.jest.tsx": [
Expand Down Expand Up @@ -674,5 +674,5 @@
}
]
},
"generated_at": "2022-03-21T21:26:48Z"
"generated_at": "2022-03-30T17:51:09Z"
}
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export const GOOGLE_ADWORDS_ID: any = null
export const GOOGLE_ANALYTICS_ID: any = "UA-12450662-6"
export const GOOGLE_CLIENT_ID: any = null
export const GOOGLE_SECRET: any = null
export const GOOGLE_MAPS_API_KEY: any = null
export const IMAGE_PROXY: any = "GEMINI"
export const IP_DENYLIST: any = ""
export const METAPHYSICS_ENDPOINT: any =
Expand All @@ -105,6 +104,7 @@ export const PC_AUCTION_CHANNEL: any = "5759e4d7b5989e6f98f77997"
export const PORT: any = 5000
export const POSITRON_URL: any = "http://writer.artsy.net"
export const PREDICTION_URL: any = "https://live.artsy.net"
export const PUBLIC_GOOGLE_MAPS_API_KEY: any = null
export const RECAPTCHA_KEY: any = null
export const S3_BUCKET: any = null
export const S3_KEY: any = null
Expand Down
4 changes: 2 additions & 2 deletions src/desktop/components/geo/index.coffee
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GeoFormatter = require 'geoformatter'
Backbone = require 'backbone'
{ GOOGLE_MAPS_API_KEY } = require('sharify').data
{ PUBLIC_GOOGLE_MAPS_API_KEY } = require('sharify').data

module.exports =
googleMapsAPI: "https://maps.googleapis.com/maps/api/js?key=#{GOOGLE_MAPS_API_KEY}&libraries=places&sensor=true&language=en"
googleMapsAPI: "https://maps.googleapis.com/maps/api/js?key=#{PUBLIC_GOOGLE_MAPS_API_KEY}&libraries=places&sensor=true&language=en"

loadGoogleMaps: (cb) ->
if @googleMapsLoading? and @googleMapsLoading.state() is 'resolved'
Expand Down
8 changes: 4 additions & 4 deletions src/desktop/components/util/google_maps.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ module.exports =
zoom: 16
sensor: false
)
if sd.GOOGLE_MAPS_API_KEY
options.key = sd.GOOGLE_MAPS_API_KEY
if sd.PUBLIC_GOOGLE_MAPS_API_KEY
options.key = sd.PUBLIC_GOOGLE_MAPS_API_KEY
"https://maps.googleapis.com/maps/api/staticmap?#{qs.stringify(options)}"

getMapLink: (options) ->
"https://maps.google.com/maps?#{qs.stringify(options)}"

getDirections: (options) ->
if sd.GOOGLE_MAPS_API_KEY
options.key = sd.GOOGLE_MAPS_API_KEY
if sd.PUBLIC_GOOGLE_MAPS_API_KEY
options.key = sd.PUBLIC_GOOGLE_MAPS_API_KEY

"https://www.google.com/maps/dir/#{encodeURI(options.origin)}/#{options.destination}"
2 changes: 1 addition & 1 deletion src/desktop/components/util/test/google_maps.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("PartnerLocation", function () {
this.location = "Address, City, State 00000"
return benv.setup(() => {
benv.expose({ $: benv.require("jquery") })
sd.GOOGLE_MAPS_API_KEY = "GOOGLE-MAPS-API-KEY"
sd.PUBLIC_GOOGLE_MAPS_API_KEY = "GOOGLE-MAPS-API-KEY"
return done()
})
})
Expand Down
12 changes: 7 additions & 5 deletions src/desktop/test/models/partner_location.jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ describe("PartnerLocation", () => {
testContext = {}
})

beforeAll(done => {
benv.setup(() => {
benv.expose({ $: benv.require("jquery") })
sd.GOOGLE_MAPS_API_KEY = "GOOGLE-MAPS-API-KEY"
done()
beforeAll(() => {
return new Promise<void>(done => {
benv.setup(() => {
benv.expose({ $: benv.require("jquery") })
sd.PUBLIC_GOOGLE_MAPS_API_KEY = "GOOGLE-MAPS-API-KEY"
done()
})
})
})

Expand Down
2 changes: 1 addition & 1 deletion src/lib/setup_sharify.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ sharify.data = _.extend(
"GEODATA_URL",
"GOOGLE_ADWORDS_ID",
"GOOGLE_ANALYTICS_ID",
"GOOGLE_MAPS_API_KEY",
"IMAGE_PROXY",
"MARKETING_SIGNUP_MODALS",
"METAPHYSICS_ENDPOINT",
Expand All @@ -85,6 +84,7 @@ sharify.data = _.extend(
"PC_AUCTION_CHANNEL",
"POSITRON_URL",
"PREDICTION_URL",
"PUBLIC_GOOGLE_MAPS_API_KEY",
"RECAPTCHA_KEY",
"S3_BUCKET",
"SECURE_IMAGES_URL",
Expand Down
2 changes: 1 addition & 1 deletion src/typings/sharify.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ declare module "sharify" {
readonly VOLLEY_ENDPOINT: string
readonly WEBFONT_URL: string
readonly XAPP_TOKEN: string
readonly GOOGLE_MAPS_API_KEY: string
readonly PUBLIC_GOOGLE_MAPS_API_KEY: string
readonly ZENDESK_KEY: string
readonly AUCTION_ZENDESK_KEY: string

Expand Down
9 changes: 3 additions & 6 deletions src/v2/Apps/Auction/AuctionApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export const AuctionApp: React.FC<AuctionAppProps> = ({
showBuyNowTab: sale.showBuyNowTab,
}

const { cascadingEndTimeInterval, cascadingEndTime } = sale
const { cascadingEndTimeInterval } = sale

const isFullBleedHeaderFixed = !cascadingEndTimeInterval

return (
Expand All @@ -58,7 +59,7 @@ export const AuctionApp: React.FC<AuctionAppProps> = ({
>
{cascadingEndTimeInterval && (
<CascadingEndTimesBanner
intervalMessage={cascadingEndTime?.intervalLabel!}
cascadingEndTimeInterval={cascadingEndTimeInterval}
/>
)}

Expand Down Expand Up @@ -151,10 +152,6 @@ export const AuctionAppFragmentContainer = createFragmentContainer(AuctionApp, {
showBuyNowTab: promotedSale {
internalID
}
cascadingEndTime {
intervalLabel
}
cascadingEndTimeInterval
}
`,
Expand Down
61 changes: 31 additions & 30 deletions src/v2/Apps/Auction/Components/AuctionDetails/AuctionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ const AuctionDetails: React.FC<AuctionDetailsProps> = ({ sale, me }) => {
? formatIsoDateNoZoneOffset(sale.liveStartAt, 4)
: sale.endAt

const cascadingEndTimeIntervalLabel =
!!sale.cascadingEndTimeInterval &&
!sale.endedAt &&
sale.cascadingEndTime?.intervalLabel
const showCascadingEndTimeIntervalMessage: boolean =
!!sale.cascadingEndTimeInterval && !sale.isClosed

return (
<>
Expand All @@ -48,35 +46,42 @@ const AuctionDetails: React.FC<AuctionDetailsProps> = ({ sale, me }) => {
<RegisterButtonFragmentContainer sale={sale} me={me} />
</Column>
</GridColumns>
<Spacer my={4} />
<Flex alignItems="center" justifyContent="space-between">
{!!sale.cascadingEndTimeInterval && (
<SaleDetailTimerFragmentContainer sale={sale} />
<>
<SaleDetailTimerFragmentContainer sale={sale} />
<Spacer my={2} />
</>
)}
</Flex>
<Flex alignItems="center" justifyContent="space-between">
<Flex alignItems="center">
<AuctionDetailsStartTimeQueryRenderer id={sale.internalID} pr={2} />
<Flex alignItems="center">
<AuctionDetailsStartTimeQueryRenderer id={sale.internalID} pr={2} />

{!sale.isClosed && (
<Box mt={0.5}>
<AddToCalendar
startDate={sale.liveStartAt || sale.startAt!}
endDate={endDate!}
title={sale.name!}
description={sale.description!}
href={`${getENV("APP_URL")}${sale.href!}`}
liveAuctionUrl={liveAuctionUrl}
contextModule={ContextModule.auctionHome}
/>
</Box>
)}
</Flex>
{!sale.isClosed && (
<Box mt={0.5}>
<AddToCalendar
startDate={sale.liveStartAt || sale.startAt!}
endDate={endDate!}
title={sale.name!}
description={sale.description!}
href={`${getENV("APP_URL")}${sale.href!}`}
liveAuctionUrl={liveAuctionUrl}
contextModule={ContextModule.auctionHome}
/>
</Box>
)}
</Flex>

{cascadingEndTimeIntervalLabel && (
<Text variant="md" pr={2}>
{cascadingEndTimeIntervalLabel}
</Text>
{showCascadingEndTimeIntervalMessage && (
<>
<Spacer my={2} />
<Text variant="md" pr={2}>
{`Lots close at ${
sale.cascadingEndTimeInterval! / 60
}-minute intervals`}
</Text>
</>
)}

<Spacer my={2} />
Expand Down Expand Up @@ -107,14 +112,10 @@ export const AuctionDetailsFragmentContainer = createFragmentContainer(
liveStartAt
startAt
endAt
endedAt
description(format: HTML)
href
isClosed
cascadingEndTimeInterval
cascadingEndTime {
intervalLabel
}
}
`,
me: graphql`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { HorizontalPadding } from "v2/Apps/Components/HorizontalPadding"
import { getENV } from "v2/Utils/getENV"

interface CascadingEndTimesBannerProps {
intervalMessage: string
cascadingEndTimeInterval: number
}

export const CascadingEndTimesBanner: React.FC<CascadingEndTimesBannerProps> = ({
intervalMessage,
cascadingEndTimeInterval,
}) => {
const helpArticleLink = getENV("CASCADING_AUCTION_HELP_ARTICLE_LINK")

Expand All @@ -19,8 +19,7 @@ export const CascadingEndTimesBanner: React.FC<CascadingEndTimesBannerProps> = (
<AppContainer>
<HorizontalPadding>
<Banner dismissable pl={0} variant="brand">
This auction has staggered closing times.&nbsp;
{intervalMessage}.
{`Lots close at ${cascadingEndTimeInterval / 60}-minute intervals`}.
{hasLink && (
<>
&nbsp;
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { compact } from "lodash"
// eslint-disable-next-line no-restricted-imports
import { data as sd } from "sharify"
import qs from "qs"
import { PartnerContactMap_location } from "v2/__generated__/PartnerContactMap_location.graphql"
Expand Down Expand Up @@ -59,7 +60,9 @@ export function getGoogleStaticMapImageUrl(
size: `${width}x${height}`,
center: locationString,
markers: `color:0x873ff0|${locationString}`,
key: sd.GOOGLE_MAPS_API_KEY ? sd.GOOGLE_MAPS_API_KEY : undefined,
key: sd.PUBLIC_GOOGLE_MAPS_API_KEY
? sd.PUBLIC_GOOGLE_MAPS_API_KEY
: undefined,
}

return `https://maps.googleapis.com/maps/api/staticmap?${qs.stringify(
Expand Down
15 changes: 11 additions & 4 deletions src/v2/Apps/Partner/PartnerApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,15 @@ export const PartnerApp: React.FC<PartnerAppProps> = ({
throw new HttpError(404)
}

const isBlackOwned =
categories!.filter(c => c && c.name === "Black Owned").length > 0
const galleryBadges = ["Black Owned", "Women Owned"]

const eligibleCategories = (categories || []).filter(Boolean)
const categoryNames: string[] = eligibleCategories.map(
category => category?.name || ""
)
const firstEligibleBadgeName: string | undefined = galleryBadges.find(badge =>
categoryNames.includes(badge)
)

return (
<PartnerArtistsLoadingContextProvider>
Expand All @@ -46,8 +53,8 @@ export const PartnerApp: React.FC<PartnerAppProps> = ({
<PartnerHeader partner={partner} />

<FullBleed mb={[2, 4]}>
{isBlackOwned ? (
<Marquee speed="static" marqueeText="Black Owned" />
{firstEligibleBadgeName ? (
<Marquee speed="static" marqueeText={firstEligibleBadgeName} />
) : (
<Separator />
)}
Expand Down
2 changes: 1 addition & 1 deletion src/v2/Components/EntityHeaders/EntityHeaderPartner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { extractNodes } from "v2/Utils/extractNodes"
import { EntityHeaderPartner_partner } from "v2/__generated__/EntityHeaderPartner_partner.graphql"
import { FollowProfileButtonFragmentContainer } from "../FollowButton/FollowProfileButton"

const DISPLAYABLE_BADGES = ["black-owned"]
const DISPLAYABLE_BADGES = ["black-owned", "women-owned"]

export interface EntityHeaderPartnerProps extends BoxProps {
partner: EntityHeaderPartner_partner
Expand Down
2 changes: 1 addition & 1 deletion src/v2/Components/LocationAutocompleteInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { debounce } from "lodash"
const DEBOUNCE_DELAY = 300

const GOOGLE_PLACES_API_SRC = `https://maps.googleapis.com/maps/api/js?key=${getENV(
"GOOGLE_MAPS_API_KEY"
"PUBLIC_GOOGLE_MAPS_API_KEY"
)}&libraries=places&v=weekly&language=en&sessiontoken=${getENV(
"SESSION_ID"
)}&callback=__googleMapsCallback`
Expand Down
2 changes: 1 addition & 1 deletion src/v2/System/Server/sharifyHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const V2_SHARIFY_ALLOWLIST = [
"GEMINI_CLOUDFRONT_URL",
"GENOME_URL",
"GOOGLE_ADWORDS_ID",
"GOOGLE_MAPS_API_KEY",
"PUBLIC_GOOGLE_MAPS_API_KEY",
"MARKETING_SIGNUP_MODALS",
"METAPHYSICS_ENDPOINT",
"NODE_ENV",
Expand Down

0 comments on commit 5973f4b

Please sign in to comment.