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 #6458

Merged
merged 34 commits into from
Oct 13, 2020
Merged

Deploy #6458

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6a34cf6
deprecate analytics/articles, move legacy tracking events to related …
eessex Oct 8, 2020
a9a3a7f
merge conflicts
eessex Oct 8, 2020
4002c65
deprecate unused embedded-inquiry track events
eessex Oct 8, 2020
90987d6
fix backbone/jquery flake in mocha tests
eessex Oct 12, 2020
103ba88
Merge pull request #6457 from artsy/test-flake
eessex Oct 12, 2020
3c99922
sync metaphysics schema
eessex Oct 12, 2020
bf422a7
reinstate sync schema command
eessex Oct 12, 2020
90dad17
add data attrs for integrity to bid buttons
eessex Oct 12, 2020
4871b6a
trivial: Add data attrs for integrity to bid buttons (#6460)
artsy-peril[bot] Oct 12, 2020
e3de47b
Update metaphysics schema
artsyit Oct 12, 2020
a051884
Update metaphysics schema (#6461)
artsy-peril[bot] Oct 12, 2020
a4e30e7
[Show] Rename to uppercase Components/ folder
mzikherman Oct 12, 2020
36bed8d
Merge pull request #6462 from artsy/rename-show
dzucconi Oct 12, 2020
0b89188
Corrects casing
dzucconi Oct 12, 2020
79913ca
Resizes from higher quality source
dzucconi Oct 9, 2020
a2e0eb4
Removes double border
dzucconi Oct 9, 2020
3711576
Displays install shot captions if present
dzucconi Oct 12, 2020
bab60bc
Merge branch 'master' of https://github.com/artsy/force into sync-schema
eessex Oct 12, 2020
583d3a5
restore schema changes
eessex Oct 12, 2020
bb67db1
Sets up show info route
dzucconi Oct 9, 2020
e305b88
Corrects casing
dzucconi Oct 12, 2020
f8b5ade
Merge pull request #6464 from artsy/chore/casing
dzucconi Oct 12, 2020
faf924b
[FX-2206] Show info page (#6455)
artsy-peril[bot] Oct 12, 2020
3637977
[Dev] Add plug in to warn about case insensitive imports
mzikherman Oct 12, 2020
4744b83
Merge pull request #6449 from artsy/deprecate-embedded-inquiry
Oct 12, 2020
cf83ff5
Merge pull request #6448 from artsy/articles-analytics
Oct 12, 2020
132dfea
[Dev] Add plug in to warn about case insensitive imports (#6463)
artsy-peril[bot] Oct 12, 2020
114f4a2
Merge branch 'master' of https://github.com/artsy/force into sync-schema
eessex Oct 12, 2020
28de71f
[Show] Add context card for a fair
mzikherman Oct 12, 2020
9d084eb
Pin dep case-sensitive-paths-webpack-plugin from ^2.3.0 to 2.3.0
renovate-bot Oct 12, 2020
9bea93b
[Show] Add context card for a fair (#6466)
artsy-peril[bot] Oct 12, 2020
1318f5f
Merge pull request #6459 from artsy/sync-schema
eessex Oct 13, 2020
5930909
bugfix: move backbone jquery declaration in flakey test (#6470)
eessex Oct 13, 2020
b236676
refactor: Consolidate pageType/pageSlug logic (#6443)
eessex Oct 13, 2020
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
1 change: 1 addition & 0 deletions data/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -9337,6 +9337,7 @@ enum SearchEntity {
SALE
SHOW
TAG
VIEWING_ROOM
}

enum SearchMode {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"start:prod": "yarn assets && yarn build:server && NODE_ENV=production yarn start",
"start": "scripts/start.sh",
"storybook": "concurrently --raw --kill-others 'yarn relay --watch' 'start-storybook --quiet -s ./public -p 9001'",
"sync-schema": "scripts/sync-schema-pull.sh",
"test:acceptance": "yarn acceptance src/test/acceptance/*.js",
"test:smoke": "scripts/smoke_test.sh",
"test": "scripts/test.sh",
Expand Down Expand Up @@ -285,6 +286,7 @@
"babel-plugin-styled-components": "1.11.1",
"benv": "3.3.0",
"cache-loader": "1.2.2",
"case-sensitive-paths-webpack-plugin": "2.3.0",
"coffee-loader": "0.8.0",
"coffeescript": "1.11.1",
"cypress": "5.1.0",
Expand Down
55 changes: 0 additions & 55 deletions src/desktop/analytics/articles.js

This file was deleted.

23 changes: 0 additions & 23 deletions src/desktop/analytics/embedded_inquiry.js

This file was deleted.

9 changes: 5 additions & 4 deletions src/desktop/analytics/main_layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { data as sd } from "sharify"
import { reportLoadTimeToVolley } from "lib/volley"
import { match } from "path-to-regexp"
import { timeOnPageListener } from "./timeOnPageListener"
import { getPageTypeFromClient } from "lib/getPageType"
import { OwnerType } from "@artsy/cohesion"

// We exclude these routes from analytics.page calls because they're already
// taken care of in Reaction.
Expand All @@ -32,8 +34,7 @@ const excludedRoutes = [

// Track pageview
const pathname = new URL(window.location.href).pathname
let slug = pathname.split("/")[2]
let pageType = window.sd.PAGE_TYPE || pathname.split("/")[1]
const { pageType, pageSlug } = getPageTypeFromClient()

const foundExcludedPath = excludedRoutes.some(excludedPath => {
const matcher = match(excludedPath, { decode: decodeURIComponent })
Expand All @@ -48,7 +49,7 @@ if (!foundExcludedPath) {
)
}

if (pageType === "auction") {
if (pageType === OwnerType.sale) {
// Let reaction track reaction-based app routes
const matcher = match("/auction/:saleID/bid(2)?/:artworkID", {
decode: decodeURIComponent,
Expand All @@ -57,7 +58,7 @@ if (pageType === "auction") {
if (!matchedBidRoute) {
window.addEventListener("load", function () {
// distinct event required for marketing integrations (Criteo)
window.analytics.track("Auction Pageview", { auction_slug: slug })
window.analytics.track("Auction Pageview", { auction_slug: pageSlug })
})
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/desktop/analytics/timeOnPageListener.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { trackEvent } from "./helpers"
import { OwnerType, timeOnPage } from "@artsy/cohesion"
import { timeOnPage } from "@artsy/cohesion"
import { getPageTypeFromClient } from "lib/getPageType"

export const timeOnPageListener = (delay: number = 15000) => {
setTimeout(() => {
const { pageType, pageSlug } = getPageTypeFromClient()
const pathname = new URL(window.location.href).pathname
const slug = pathname.split("/")[2]
const pageType = window.sd.PAGE_TYPE || pathname.split("/")[1]

const referrer = window.analytics.__artsyClientSideRoutingReferrer
// 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
Expand All @@ -18,12 +19,12 @@ export const timeOnPageListener = (delay: number = 15000) => {
},
}
}
const contextPageOwnerSlug = pageType === "partner" ? pathname : slug
const contextPageOwnerSlug = pageType === "partner" ? pathname : pageSlug

trackEvent(
timeOnPage({
contextPageOwnerSlug,
contextPageOwnerType: OwnerType[pageType],
contextPageOwnerType: pageType,
}),
trackingOptions
)
Expand Down
9 changes: 5 additions & 4 deletions src/desktop/apps/artsy-v2/apps/artist/artistMiddleware.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { getPageType } from "../../utils/getPageType"
import { OwnerType } from "@artsy/cohesion"
import { getPageTypeFromReq } from "lib/getPageType"

export const artistMiddleware = (req, res, next) => {
const { pageType, pageParts } = getPageType(req)
const { pageType, pageSlug } = getPageTypeFromReq(req)

if (pageType === "artist") {
const artistID = pageParts[2]
if (pageType === OwnerType.artist) {
const artistID = pageSlug
const user = req.user && req.user.toJSON()
const { APP_URL, IS_MOBILE, REFERRER } = res.locals.sd
const isExternalReferer = !(REFERRER && REFERRER.includes(APP_URL))
Expand Down
9 changes: 5 additions & 4 deletions src/desktop/apps/artsy-v2/apps/artwork/artworkClient.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { enableIntercom } from "lib/intercom"
import { recordArtworkView } from "lib/components/record_artwork_view"
import { data as sd } from "sharify"
import { getPageTypeFromClient } from "lib/getPageType"
import { OwnerType } from "@artsy/cohesion"

export const artworkClient = () => {
const User = require("desktop/models/user.coffee")
Expand All @@ -13,11 +15,10 @@ export const artworkClient = () => {

const $ = require("jquery")
const mediator = require("desktop/lib/mediator.coffee")
const pageType = window.location.pathname.split("/")[1]
const { pageType, pageSlug } = getPageTypeFromClient()

if (pageType === "artwork") {
const artworkSlug = location.pathname.replace(/\/artwork\//, "")
recordArtworkView(artworkSlug, sd.CURRENT_USER)
if (pageType === OwnerType.artwork) {
recordArtworkView(pageSlug, sd.CURRENT_USER)
}

const openInquireableModal = (
Expand Down
7 changes: 4 additions & 3 deletions src/desktop/apps/artsy-v2/apps/search/searchMiddleware.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { stringify } from "querystring"
import { SearchResultsSkeleton } from "v2/Apps/Search/Components/SearchResultsSkeleton"
import { StitchWrapper } from "desktop/components/react/stitch_components/StitchWrapper"
import { stitch } from "@artsy/stitch"
import { getPageType } from "../../utils/getPageType"
import { getPageTypeFromReq } from "lib/getPageType"
import { OwnerType } from "@artsy/cohesion"

export const searchMiddleware = async (req, res, next) => {
const { pageType } = getPageType(req)
const { pageType } = getPageTypeFromReq(req)

if (pageType === "search") {
if (pageType === OwnerType.search) {
try {
if (!req.query.term) {
if (req.query.q) {
Expand Down
8 changes: 5 additions & 3 deletions src/desktop/apps/artsy-v2/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { data as sd } from "sharify"
import { artworkClient } from "./apps/artwork/artworkClient"
import { artistClient } from "./apps/artist/artistClient"
import { loadableReady } from "@loadable/component"
import { getPageTypeFromClient } from "lib/getPageType"
import { OwnerType } from "@artsy/cohesion"

const mediator = require("desktop/lib/mediator.coffee")

Expand Down Expand Up @@ -35,17 +37,17 @@ buildClientApp({
<ClientApp />,
document.getElementById("react-root"),
() => {
const pageType = window.location.pathname.split("/")[1]
const { pageType } = getPageTypeFromClient()

if (pageType === "search") {
if (pageType === OwnerType.search) {
document.getElementById("loading-container").remove()
document.getElementById("search-page-header").remove()
}
}
)
})
})
.catch((error) => {
.catch(error => {
console.error(error)
})

Expand Down
4 changes: 2 additions & 2 deletions src/desktop/apps/artsy-v2/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { artistMiddleware } from "./apps/artist/artistMiddleware"
import { userRequiredMiddleware } from "./middleware/userRequiredMiddleware"
import { searchMiddleware } from "./apps/search/searchMiddleware"
import { handleCollectionToArtistSeriesRedirect } from "./apps/collection/collectionMiddleware"
import { getPageTypeFromReq } from "lib/getPageType"

export const app = express()

Expand Down Expand Up @@ -58,8 +59,7 @@ app.get(
*/
async (req: Request, res, next) => {
try {
const pageParts = req.path.split("/")
const pageType = pageParts[1]
const { pageType } = getPageTypeFromReq(req)

const {
status,
Expand Down
13 changes: 0 additions & 13 deletions src/desktop/apps/artsy-v2/utils/__tests__/getPageType.jest.ts

This file was deleted.

26 changes: 0 additions & 26 deletions src/desktop/apps/artsy-v2/utils/getPageType.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/desktop/assets/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ $(() =>
onAnalyticsReady()
setupSplitTests()

require("../analytics/articles.js")
require("../analytics/artwork.js")
require("../analytics/consignments.js")
require("../analytics/contact.js")
require("../analytics/embedded_inquiry.js")
require("../analytics/galleries.js")
require("../analytics/inquiry_questionnaire.js")
require("../analytics/recently_viewed_artworks.js")
Expand Down
33 changes: 33 additions & 0 deletions src/desktop/components/article/client/super_article.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ initCarousel = require '../../merry_go_round/horizontal_nav_mgr.coffee'
sd = require('sharify').data

module.exports = class SuperArticleView extends Backbone.View
events:
'click .article-sa-primary-logo a': 'trackPrimaryLogoClick'
'click .article-sa-secondary-logo a': 'trackSecondaryLogoClick'
'click .article-sa-cta-container a': 'trackCtaClick'
'click .article-sa-footer-blurb a': 'trackFooterBlurbClick'

initialize: (options) ->
{ @article } = options
Expand Down Expand Up @@ -79,3 +84,31 @@ module.exports = class SuperArticleView extends Backbone.View
else
@$superArticleNavToc.css 'height', '100vh'
@$body.addClass 'is-open'

trackPrimaryLogoClick: (e) ->
window.analytics.track("Clicked primary partner logo", {
destination_path: e.currentTarget.href,
impression_type: "sa_primary_logo",
context_type: "article_fixed",
})

trackSecondaryLogoClick: (e) ->
window.analytics.track("Clicked secondary partner logo", {
destination_path: e.currentTarget.href,
impression_type: "sa_secondary_logo",
context_type: "article_fixed",
})

trackCtaClick: (e) ->
window.analytics.track("Clicked partner cta link", {
destination_path: e.currentTarget.href,
impression_type: "sa_partner_cta",
context_type: "article_fixed",
})

trackFooterBlurbClick: (e) ->
window.analytics.track("Clicked partner cta link in footer blurb", {
destination_path: e.currentTarget.href,
impression_type: "sa_partner_cta",
context_type: "article_fixed",
})
Loading