Skip to content

Commit b635c5d

Browse files
authored
feat: Add artwork template tracking schema (#663)
* feat: Add artwork template tracking events * export CMS events in Schema/index.ts
1 parent fbd4ffa commit b635c5d

File tree

6 files changed

+135
-2
lines changed

6 files changed

+135
-2
lines changed

src/Schema/CMS/Events/SettingsFlow.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,27 @@ export interface SettingsFlowEditLocation {
4545
user_id: string
4646
}
4747

48+
/**
49+
* Event fired after user deletes an artwork template
50+
*
51+
* @example
52+
* ```
53+
* {
54+
* action: "deletedArtworkTemplate",
55+
* context_module: "Settings",
56+
* template_id: "template-id",
57+
* user_id: "some-user-id",
58+
* }
59+
* ```
60+
*/
61+
export interface SettingsFlowDeleteArtworkTemplate {
62+
action: CmsActionType.deletedArtworkTemplate
63+
context_module: CmsContextModule.settings
64+
template_id: string
65+
user_id: string
66+
}
67+
4868
export type CmsSettingsFlow =
4969
| SettingsFlowAddNewLocation
5070
| SettingsFlowEditLocation
71+
| SettingsFlowDeleteArtworkTemplate

src/Schema/CMS/Events/UploadArtworkFlow.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
import { CmsContextModule } from "../Values/CmsContextModule"
22
import { CmsActionType } from "."
33

4+
/**
5+
* Click "Create from template" in upload artwork flow
6+
*
7+
* @example
8+
* ```
9+
* {
10+
* action: "click",
11+
* context_module: "Uploads",
12+
* label: "Create from template",
13+
* }
14+
* ```
15+
*/
16+
export interface UploadArtworkFlowClickedCreateFromTemplate {
17+
action: "click"
18+
context_module: CmsContextModule.uploads
19+
label: "Create from template"
20+
}
21+
422
/**
523
* Click "Next" after selecting an existing artist
624
*
@@ -39,6 +57,26 @@ export interface UploadArtworkFlowClickFinishUploadingImages {
3957
artwork_ids: string[]
4058
}
4159

60+
/**
61+
* Click "Add Another Artwork" in Review page
62+
*
63+
* @example
64+
* ```
65+
* {
66+
* action: "click",
67+
* context_module: "Uploads",
68+
* label: "Add another artwork",
69+
* template_id: "template-123",
70+
* }
71+
* ```
72+
*/
73+
export interface UploadArtworkFlowClickedAddAnotherArtwork {
74+
action: "click"
75+
context_module: CmsContextModule.uploads
76+
label: "Add another artwork"
77+
template_id: string
78+
}
79+
4280
/**
4381
* Click "View my artworks" after creating artworks
4482
*
@@ -79,8 +117,33 @@ export interface UploadArtworkFlowCreateArtworks {
79117
user_id: string
80118
}
81119

120+
/**
121+
* Event fired after user created artworks from template
122+
*
123+
* @example
124+
* ```
125+
* {
126+
* action: "createdArtworkFromTemplate",
127+
* context_module: "Uploads",
128+
* template_id: "template-123",
129+
* artwork_ids: ['some-artwork-id'],
130+
* user_id: "some-user-id",
131+
* }
132+
* ```
133+
*/
134+
export interface UploadArtworkFlowCreateArtworksFromTemplate {
135+
action: CmsActionType.createdArtworkFromTemplate
136+
context_module: CmsContextModule.uploads
137+
template_id: string
138+
artwork_ids: string[]
139+
user_id: string
140+
}
141+
82142
export type CmsUploadArtworkFlow =
143+
| UploadArtworkFlowClickedCreateFromTemplate
83144
| UploadArtworkFlowClickSelectExistingArtist
84145
| UploadArtworkFlowClickFinishUploadingImages
146+
| UploadArtworkFlowClickedAddAnotherArtwork
85147
| UploadArtworkFlowClickViewMyArtworks
86148
| UploadArtworkFlowCreateArtworks
149+
| UploadArtworkFlowCreateArtworksFromTemplate

src/Schema/CMS/Events/index.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type CmsEvent =
3131
*/
3232
export enum CmsActionType {
3333
/**
34-
* Corresponds to {@link SettingsFlow}
34+
* Corresponds to {@link CmsSettingsFlow}
3535
*/
3636
addedNewLocation = "addedNewLocation",
3737

@@ -75,6 +75,11 @@ export enum CmsActionType {
7575
*/
7676
createdArtwork = "created artwork",
7777

78+
/**
79+
* Corresponds to {@link CmsUploadArtworkFlow}
80+
*/
81+
createdArtworkFromTemplate = "createdArtworkFromTemplate",
82+
7883
/**
7984
* Corresponds to {@link CmsBatchImportFlow}
8085
*/
@@ -86,7 +91,7 @@ export enum CmsActionType {
8691
editedBatchImportField = "editedBatchImportField",
8792

8893
/**
89-
* Corresponds to {@link SettingsFlow}
94+
* Corresponds to {@link CmsSettingsFlow}
9095
*/
9196
editedLocation = "editedLocation",
9297

@@ -210,6 +215,11 @@ export enum CmsActionType {
210215
*/
211216
deletedTemplate = "deletedTemplate",
212217

218+
/**
219+
* Corresponds to {@link CmsSettingsFlow}
220+
*/
221+
deletedArtworkTemplate = "deletedArtworkTemplate",
222+
213223
/**
214224
* Corresponds to {@link CmsQuickReplyFlow}
215225
*/

src/Schema/Events/Click.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,30 @@ export interface ClickedSave {
16541654
shipping_preset_id?: string
16551655
}
16561656

1657+
/**
1658+
* A partner clicks on Save as Template button on an artwork in the CMS.
1659+
*
1660+
* This schema describes events sent to Segment from [[ClickedSaveAsTemplate]]
1661+
*
1662+
* @example
1663+
* ```
1664+
* {
1665+
* action: "clickedSaveAsTemplate",
1666+
* context_module: "voltArtworksEdit" | "artworkForm",
1667+
* artwork_id: "60de173a47476c000fd5c4cc"
1668+
* label: "Save as template"
1669+
* flow: "artworksList" | "artworkForm"
1670+
* }
1671+
* ```
1672+
*/
1673+
export interface ClickedSaveAsTemplate {
1674+
action: ActionType.clickedSaveAsTemplate
1675+
context_module: ContextModule
1676+
artwork_id: string
1677+
label: string
1678+
flow: string
1679+
}
1680+
16571681
/**
16581682
* A Partner selects a filter on the conversations page in CMS.
16591683
*

src/Schema/Events/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ import {
111111
ClickedPaymentMethod,
112112
ClickedPromoSpace,
113113
ClickedPublish,
114+
ClickedSaveAsTemplate,
114115
ClickedSelectShippingOption,
115116
ClickedSendPartnerOffer,
116117
ClickedShippingAddress,
@@ -405,6 +406,7 @@ export type Event =
405406
| ClickedPromoSpace
406407
| ClickedPublish
407408
| ClickedRegisterToBid
409+
| ClickedSaveAsTemplate
408410
| ClickedSelectShippingOption
409411
| ClickedSendPartnerOffer
410412
| ClickedShareButton
@@ -916,6 +918,10 @@ export enum ActionType {
916918
* Corresponds to {@link ClickedSave}
917919
*/
918920
clickedSave = "clickedSave",
921+
/**
922+
* Corresponds to {@link ClickedSaveAsTemplate}
923+
*/
924+
clickedSaveAsTemplate = "clickedSaveAsTemplate",
919925
/**
920926
* Corresponds to {@link ClickedShareButton}
921927
*/

src/Schema/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,12 @@ export * from "./Values/Tab"
4141
export * from "./CMS/Events"
4242
export * from "./CMS/Values/CmsContextModule"
4343
export * from "./CMS/Values/CmsOwnerType"
44+
export * from "./CMS/Events/AnalyticsPage"
45+
export * from "./CMS/Events/ArtworkFilter"
46+
export * from "./CMS/Events/BatchImportFlow"
47+
export * from "./CMS/Events/BulkEditFlow"
48+
export * from "./CMS/Events/CompletenessScoreFlow"
49+
export * from "./CMS/Events/QuickReplyFlow"
50+
export * from "./CMS/Events/SettingsFlow"
51+
export * from "./CMS/Events/ShowFlow"
52+
export * from "./CMS/Events/UploadArtworkFlow"

0 commit comments

Comments
 (0)