diff --git a/package-lock.json b/package-lock.json index 9a633e5ef..3dea77026 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "that-us", - "version": "3.15.0", + "version": "3.16.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "that-us", - "version": "3.15.0", + "version": "3.16.1", "license": "GPL-3.0", "dependencies": { "@sentry/sveltekit": "^7.58.1" @@ -85,7 +85,7 @@ "uuid": "^9.0.1", "vite": "^4.3.9", "vite-plugin-sentry": "^1.3.0", - "xstate": "^4.38.2", + "xstate": "^4.38.3", "yup": "^0.32.11", "zod": "^3.21.4" }, @@ -10178,9 +10178,9 @@ } }, "node_modules/xstate": { - "version": "4.38.2", - "resolved": "https://registry.npmjs.org/xstate/-/xstate-4.38.2.tgz", - "integrity": "sha512-Fba/DwEPDLneHT3tbJ9F3zafbQXszOlyCJyQqqdzmtlY/cwE2th462KK48yaANf98jHlP6lJvxfNtN0LFKXPQg==", + "version": "4.38.3", + "resolved": "https://registry.npmjs.org/xstate/-/xstate-4.38.3.tgz", + "integrity": "sha512-SH7nAaaPQx57dx6qvfcIgqKRXIh4L0A1iYEqim4s1u7c9VoCgzZc+63FY90AKU4ZzOC2cfJzTnpO4zK7fCUzzw==", "dev": true, "funding": { "type": "opencollective", @@ -17371,9 +17371,9 @@ "requires": {} }, "xstate": { - "version": "4.38.2", - "resolved": "https://registry.npmjs.org/xstate/-/xstate-4.38.2.tgz", - "integrity": "sha512-Fba/DwEPDLneHT3tbJ9F3zafbQXszOlyCJyQqqdzmtlY/cwE2th462KK48yaANf98jHlP6lJvxfNtN0LFKXPQg==", + "version": "4.38.3", + "resolved": "https://registry.npmjs.org/xstate/-/xstate-4.38.3.tgz", + "integrity": "sha512-SH7nAaaPQx57dx6qvfcIgqKRXIh4L0A1iYEqim4s1u7c9VoCgzZc+63FY90AKU4ZzOC2cfJzTnpO4zK7fCUzzw==", "dev": true }, "y18n": { diff --git a/package.json b/package.json index 73816c3d9..c3c544eeb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "that-us", - "version": "3.16.1", + "version": "3.16.2", "description": "THAT.us website", "main": "index.js", "type": "module", @@ -97,7 +97,7 @@ "uuid": "^9.0.1", "vite": "^4.3.9", "vite-plugin-sentry": "^1.3.0", - "xstate": "^4.38.2", + "xstate": "^4.38.3", "yup": "^0.32.11", "zod": "^3.21.4" }, diff --git a/src/_dataSources/api.that.tech/events/queries.js b/src/_dataSources/api.that.tech/events/queries.js index 367544a7a..6a555a14f 100644 --- a/src/_dataSources/api.that.tech/events/queries.js +++ b/src/_dataSources/api.that.tech/events/queries.js @@ -11,6 +11,7 @@ const productBaseFieldsFragment = ` price isEnabled uiReference + eventActivities shortDescription onSaleFrom onSaleUntil diff --git a/src/_utils/claimTicket/config.js b/src/_utils/claimTicket/config.js index dd0e45b08..714397a53 100644 --- a/src/_utils/claimTicket/config.js +++ b/src/_utils/claimTicket/config.js @@ -7,7 +7,8 @@ function createConfig(metaContext) { eventId: undefined, productId: undefined, pendingClaim: false, - claimResults: undefined + claimResults: undefined, + ticketType: undefined }, states: { verification: { @@ -71,7 +72,7 @@ function createConfig(metaContext) { onDone: [ { cond: 'wasTicketClaimed', - actions: ['claimTicketSuccess', 'clearCart', 'clearLocalStorage'], + actions: ['claimTicketSuccess'], target: 'ticketClaimed' }, { @@ -83,7 +84,27 @@ function createConfig(metaContext) { }, ticketClaimed: { - entry: 'redirectToSuccess' + entry: ['clearCart', 'clearLocalStorage'], + initial: 'initial', + states: { + initial: { + always: [ + { + cond: 'isExpoHallTicket', + target: 'expoHall' + }, + { + target: 'defaultRedirect' + } + ] + }, + expoHall: { + entry: 'expoHallRedirect' + }, + defaultRedirect: { + entry: 'defaultRedirect' + } + } }, ticketClaimIssue: {}, diff --git a/src/_utils/claimTicket/machine.js b/src/_utils/claimTicket/machine.js index f956fdd98..51aaa375f 100644 --- a/src/_utils/claimTicket/machine.js +++ b/src/_utils/claimTicket/machine.js @@ -13,11 +13,16 @@ const claimCartVersion = '1.0.0'; function createServices() { const { claimTicket } = orderMutationApi(); + const TICKET_TYPE = { + EXPO_HALL: 'expoHall', + OTHER: 'other' + }; return { guards: { isPendingClaim: (context) => context.pendingClaim, - wasTicketClaimed: (_, { data }) => data.result + wasTicketClaimed: (_, { data }) => data.result, + isExpoHallTicket: (context) => context?.ticketType === TICKET_TYPE.EXPO_HALL }, services: { @@ -39,23 +44,30 @@ function createServices() { const localCart = browser ? window.localStorage.getItem(claimCartKeyName) : null; const results = JSON.parse(localCart) || {}; - const { eventId = undefined, productId = undefined, eventDetails = undefined } = results; + const { + eventId = undefined, + productId = undefined, + eventDetails = undefined, + productDetails = undefined + } = results; return { eventId, eventDetails, productId, + productDetails, pendingClaim: eventId && productId ? true : false }; }), setLocalStorage: (context) => { - const { eventId, productId, eventDetails } = context; + const { eventId, productId, eventDetails, productDetails } = context; const localCart = { version: claimCartVersion, eventId, eventDetails, - productId + productId, + productDetails }; window.localStorage.setItem(claimCartKeyName, JSON.stringify(localCart)); @@ -65,7 +77,8 @@ function createServices() { pendingClaim: () => false, eventId: () => undefined, eventDetails: () => undefined, - productId: () => undefined + productId: () => undefined, + productDetails: () => undefined }), clearLocalStorage: () => window.localStorage.removeItem(claimCartKeyName), @@ -77,18 +90,35 @@ function createServices() { ? { logo: event.eventDetails.logo, name: event.eventDetails.name, - slug: event.eventDetails.slug + slug: event.eventDetails.slug, + type: event.eventDetails.type } : context.eventDetails, eventId: (context, event) => context.eventId || event.eventId, - productId: (context, event) => context.productId || event.productId + productId: (context, event) => context.productId || event.productId, + productDetails: (context, event) => + event.productDetails + ? { + name: event.productDetails.name, + eventActivities: event.productDetails.eventActivities, + uiReference: event.productDetails.uiReference + } + : context.productDetails }), claimTicketSuccess: assign({ - claimResults: (_, { data }) => data.results + claimResults: (_, { data }) => data.results, + ticketType: ({ productDetails }) => { + let ticketType = TICKET_TYPE.OTHER; + if (productDetails?.eventActivities?.includes('EXPO_HALL')) { + ticketType = TICKET_TYPE.EXPO_HALL; + } + return ticketType; + } }), - redirectToSuccess: () => goto('/orders/success/claim-ticket/') + defaultRedirect: () => goto('/orders/success/claim-ticket/'), + expoHallRedirect: () => goto('/orders/success/expo-hall-ticket') } }; } diff --git a/src/routes/events/(online)/[event]/[date]/+page.svelte b/src/routes/events/(online)/[event]/[date]/+page.svelte index dd06d02e6..e95740a6e 100644 --- a/src/routes/events/(online)/[event]/[date]/+page.svelte +++ b/src/routes/events/(online)/[event]/[date]/+page.svelte @@ -46,7 +46,8 @@ const ticket = { eventId: event.id, eventDetails: event, - productId: product.id + productId: product.id, + productDetails: product }; claimTicket.send('ADD_ITEM', ticket); diff --git a/src/routes/events/(online)/_components/EventTicket.svelte b/src/routes/events/(online)/_components/EventTicket.svelte index 72b28275c..cdfd83f87 100644 --- a/src/routes/events/(online)/_components/EventTicket.svelte +++ b/src/routes/events/(online)/_components/EventTicket.svelte @@ -21,14 +21,19 @@ dayjs.extend(advancedFormat); const tickets = event.products - .filter((f) => f.isEnabled) - .filter((e) => e.productType === 'TICKET'); + .filter((f) => f.isEnabled === true && f.productType === 'TICKET') + // if claimable_ticket don't filter in if eventActivities includes expo hall + .filter((e) => + e.uiReference === 'CLAIMABLE_TICKET' ? !e.eventActivities?.includes('EXPO_HALL') : true + ); const eventTickets = keyBy( tickets.filter((t) => t.uiReference), (i) => i.uiReference ); + const claimableTicket = eventTickets['CLAIMABLE_TICKET'] ?? {}; + const dispatch = createEventDispatcher(); @@ -52,68 +57,63 @@
+ {event.name} +
++ {dayjs(event.startDate).format('dddd, MMMM D, YYYY - h:mm A z')} +
++ {claimableTicket.description} +
- {event.name} -
-- {dayjs(event.startDate).format('dddd, MMMM D, YYYY - h:mm A z')} -
-- {eventTickets['VIRTUAL_CAMPER'].description} -
-Full Access All Day
-Full Access All Day
+Create and Facilitate Activities
-Create and Facilitate Activities
+Join Any Activity
-Join Any Activity
+{dayjs(event.startDate).format('dddd, MMMM D, YYYY - h:mm A z')}
-+
{eventTickets['VIRTUAL_CAMPER'].description}
Expo Hall Only Ticket
+{$state.context.productDetails?.name}
FREE
@@ -49,8 +49,8 @@+ WELCOME TO THAT CONFERENCE +
++ Welcome to THAT Conference, we are excited you’re joining us. Here are details about your Expo + Hall Only ticket and next steps you need to complete. +
+ ++ The Expo Hall Only ticket provides access only to the Expo Hall (sponsor booths), Open Spaces, + Game Night, the Waterpark Party, and the Closing Ceremony. It does not provide food, beverages, + access to sessions or any other activities not listed above. +
+ ++ Visit https://sponsor.that.us for a one-stop resource for + your sponsorship. It contains links to lead generation, a sponsor handbook and many other important + resources. +
++ If you have any questions you can email us or speak + to anyone onsite with a staff t-shirt. +
+ +Thank you for your support and we look forward to seeing you soon.
++
THAT code is invalid. Please contact THAT Crew.