@dev.smartpricing/message-composer-layer 4.5.1-next.4 → 4.5.1-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -133
- package/app/api/index.ts +0 -1
- package/app/api/messageGroups.ts +1 -5
- package/app/api/meta.ts +36 -0
- package/app/components/Common/MessageGroupSelect.vue +1 -30
- package/app/components/Composer/EmailComposer.vue +1 -5
- package/app/components/Composer/MessageLibrary.vue +8 -0
- package/app/components/Composer/WabaSelectModal.vue +1 -3
- package/app/components/Composer/WhatsappComposer.vue +1 -5
- package/app/components/Layout/BasePage.vue +0 -2
- package/app/components/MetaImport/Button.vue +50 -0
- package/app/components/MetaImport/Dialog.vue +261 -0
- package/app/components/MetaImport/Outcome.vue +136 -0
- package/app/components/MetaImport/ProposalList.vue +192 -0
- package/app/components/TemplateList/BaseTable.vue +22 -1
- package/app/composables/apiErrorMessages.ts +0 -1
- package/app/composables/composerContext.ts +3 -3
- package/app/composables/useMessageGroupWaba.ts +10 -7
- package/app/composables/useTemplateOperations.ts +3 -8
- package/app/pages/index.vue +5 -1
- package/app/pages/template/email/[id].vue +0 -5
- package/app/pages/template/email/create.vue +0 -5
- package/app/pages/template/whatsapp/[id].vue +0 -5
- package/app/pages/template/whatsapp/create.vue +0 -5
- package/app/queries/index.ts +0 -1
- package/app/queries/messageGroups.ts +29 -20
- package/app/queries/meta.ts +91 -1
- package/app/stores/appContext.ts +1 -1
- package/app/types/app-config.d.ts +0 -3
- package/app/types/tracking.ts +0 -33
- package/app/utils/testIds.const.ts +1 -107
- package/app.config.ts +5 -0
- package/i18n/locales/de.ts +64 -269
- package/i18n/locales/en.ts +61 -255
- package/i18n/locales/es.ts +62 -258
- package/i18n/locales/fr.ts +63 -264
- package/i18n/locales/it.ts +65 -260
- package/package.json +4 -4
- package/app/api/automations.ts +0 -74
- package/app/app.config.ts +0 -10
- package/app/components/Automations/ActionCard.vue +0 -174
- package/app/components/Automations/ActionEditor.vue +0 -398
- package/app/components/Automations/Actions.vue +0 -148
- package/app/components/Automations/CloneModal.vue +0 -78
- package/app/components/Automations/Conditions.vue +0 -155
- package/app/components/Automations/Create.vue +0 -114
- package/app/components/Automations/Data.vue +0 -46
- package/app/components/Automations/DeleteModal.vue +0 -80
- package/app/components/Automations/Edit.vue +0 -145
- package/app/components/Automations/Form.vue +0 -282
- package/app/components/Automations/List.vue +0 -370
- package/app/components/Automations/PageGate.vue +0 -50
- package/app/components/Automations/SaveProblems.vue +0 -54
- package/app/components/Automations/Unavailable.vue +0 -71
- package/app/components/Automations/UnavailableBadge.vue +0 -35
- package/app/components/Filters/DateInput.vue +0 -57
- package/app/components/Filters/Editor.vue +0 -163
- package/app/components/Filters/Row.vue +0 -119
- package/app/components/Filters/Summary.vue +0 -215
- package/app/components/Filters/UnavailableRow.vue +0 -74
- package/app/components/Filters/ValueInput.vue +0 -215
- package/app/composables/automationsContext.ts +0 -42
- package/app/composables/useAutomationClone.ts +0 -33
- package/app/composables/useAutomationEditorTrip.ts +0 -77
- package/app/composables/useAutomationSaveProblems.ts +0 -82
- package/app/composables/useAutomationUnavailable.ts +0 -98
- package/app/composables/useAutomationsGate.ts +0 -68
- package/app/composables/useBuiltInOptionLists.ts +0 -44
- package/app/composables/useEditorTripBack.ts +0 -15
- package/app/middleware/automations-enabled.ts +0 -12
- package/app/pages/automations/[id].vue +0 -87
- package/app/pages/automations/index.vue +0 -28
- package/app/pages/automations/new.vue +0 -53
- package/app/queries/automations.ts +0 -206
- package/app/stores/editorTrip.ts +0 -67
- package/app/utils/automations/form.ts +0 -389
- package/app/utils/automations/metadata.ts +0 -71
- package/app/utils/automations/unavailable.ts +0 -90
- package/app/utils/filters/data/countries.json +0 -998
- package/app/utils/filters/data/languages.json +0 -754
- package/app/utils/filters/rows.ts +0 -367
|
@@ -21,8 +21,7 @@ interface TemplateData<T = Message | PostEntity<Message>> {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
interface UseTemplateOperationsOptions {
|
|
24
|
-
|
|
25
|
-
onSuccess?: (saved?: { id: string; name: string }) => void
|
|
24
|
+
onSuccess?: () => void
|
|
26
25
|
onError?: (error: Error) => void
|
|
27
26
|
}
|
|
28
27
|
|
|
@@ -68,11 +67,7 @@ export function useTemplateOperations(options: UseTemplateOperationsOptions = {}
|
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
saved.value = true
|
|
71
|
-
options.onSuccess?.(
|
|
72
|
-
createdMessageGroup?.id
|
|
73
|
-
? { id: String(createdMessageGroup.id), name: createdMessageGroup.name }
|
|
74
|
-
: undefined,
|
|
75
|
-
)
|
|
70
|
+
options.onSuccess?.()
|
|
76
71
|
return createdMessageGroup
|
|
77
72
|
} catch (error) {
|
|
78
73
|
options.onError?.(error as Error)
|
|
@@ -106,7 +101,7 @@ export function useTemplateOperations(options: UseTemplateOperationsOptions = {}
|
|
|
106
101
|
}
|
|
107
102
|
|
|
108
103
|
saved.value = true
|
|
109
|
-
options.onSuccess?.(
|
|
104
|
+
options.onSuccess?.()
|
|
110
105
|
} catch (error) {
|
|
111
106
|
options.onError?.(error as Error)
|
|
112
107
|
throw error
|
package/app/pages/index.vue
CHANGED
|
@@ -25,6 +25,9 @@ watch(renderType, (newType) => {
|
|
|
25
25
|
trackEvent('change_tab', { messages_kind: newType === 'email_v1' ? 'email' : 'whatsapp' })
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
+
// The Import from Meta check waits for the list: it must never slow it down.
|
|
29
|
+
const listLoaded = ref(false)
|
|
30
|
+
|
|
28
31
|
const tabItems = computed(() => {
|
|
29
32
|
const items = []
|
|
30
33
|
if (hasWhatsapp.value) {
|
|
@@ -55,9 +58,10 @@ const tabItems = computed(() => {
|
|
|
55
58
|
>
|
|
56
59
|
<template #actions>
|
|
57
60
|
<CommonOrganizationSelect />
|
|
61
|
+
<MetaImportButton :enabled="listLoaded" @imported="renderType = 'whatsapp_v1'" />
|
|
58
62
|
<CreateTemplateButton />
|
|
59
63
|
</template>
|
|
60
64
|
|
|
61
|
-
<ComposerMessageLibrary v-model:render-type="renderType" />
|
|
65
|
+
<ComposerMessageLibrary v-model:render-type="renderType" @loaded="listLoaded = true" />
|
|
62
66
|
</LayoutBasePage>
|
|
63
67
|
</template>
|
|
@@ -8,9 +8,6 @@ definePageMeta({
|
|
|
8
8
|
const route = useRoute()
|
|
9
9
|
const composerRef = useTemplateRef('composerRef')
|
|
10
10
|
const store = useEmailComposerStore()
|
|
11
|
-
const tripBack = useEditorTripBack(
|
|
12
|
-
() => composerRef.value?.saving || composerRef.value?.isTranslating,
|
|
13
|
-
)
|
|
14
11
|
</script>
|
|
15
12
|
|
|
16
13
|
<template>
|
|
@@ -28,8 +25,6 @@ const tripBack = useEditorTripBack(
|
|
|
28
25
|
]"
|
|
29
26
|
:active-tab="store.activeTab"
|
|
30
27
|
:test-id="templateEmailEditTestIds.navbar"
|
|
31
|
-
:back="tripBack"
|
|
32
|
-
@back="composerRef?.handleCancel()"
|
|
33
28
|
@tab-change="store.activeTab = $event as 'content' | 'translations'"
|
|
34
29
|
>
|
|
35
30
|
<template #actions>
|
|
@@ -7,9 +7,6 @@ definePageMeta({
|
|
|
7
7
|
|
|
8
8
|
const composerRef = useTemplateRef('composerRef')
|
|
9
9
|
const store = useEmailComposerStore()
|
|
10
|
-
const tripBack = useEditorTripBack(
|
|
11
|
-
() => composerRef.value?.saving || composerRef.value?.isTranslating,
|
|
12
|
-
)
|
|
13
10
|
</script>
|
|
14
11
|
|
|
15
12
|
<template>
|
|
@@ -27,8 +24,6 @@ const tripBack = useEditorTripBack(
|
|
|
27
24
|
]"
|
|
28
25
|
:active-tab="store.activeTab"
|
|
29
26
|
:test-id="templateEmailCreateTestIds.navbar"
|
|
30
|
-
:back="tripBack"
|
|
31
|
-
@back="composerRef?.handleCancel()"
|
|
32
27
|
@tab-change="store.activeTab = $event as 'content' | 'translations'"
|
|
33
28
|
>
|
|
34
29
|
<template #actions>
|
|
@@ -8,9 +8,6 @@ definePageMeta({
|
|
|
8
8
|
const route = useRoute()
|
|
9
9
|
const composerRef = useTemplateRef('composerRef')
|
|
10
10
|
const store = useWhatsappComposerStore()
|
|
11
|
-
const tripBack = useEditorTripBack(
|
|
12
|
-
() => composerRef.value?.saving || composerRef.value?.isTranslating,
|
|
13
|
-
)
|
|
14
11
|
</script>
|
|
15
12
|
|
|
16
13
|
<template>
|
|
@@ -22,8 +19,6 @@ const tripBack = useEditorTripBack(
|
|
|
22
19
|
]"
|
|
23
20
|
:active-tab="store.activeTab"
|
|
24
21
|
:test-id="templateWhatsappEditTestIds.navbar"
|
|
25
|
-
:back="tripBack"
|
|
26
|
-
@back="composerRef?.handleCancel()"
|
|
27
22
|
@tab-change="store.activeTab = $event as 'content' | 'translations'"
|
|
28
23
|
>
|
|
29
24
|
<template #actions>
|
|
@@ -7,9 +7,6 @@ definePageMeta({
|
|
|
7
7
|
|
|
8
8
|
const composerRef = useTemplateRef('composerRef')
|
|
9
9
|
const store = useWhatsappComposerStore()
|
|
10
|
-
const tripBack = useEditorTripBack(
|
|
11
|
-
() => composerRef.value?.saving || composerRef.value?.isTranslating,
|
|
12
|
-
)
|
|
13
10
|
</script>
|
|
14
11
|
|
|
15
12
|
<template>
|
|
@@ -21,8 +18,6 @@ const tripBack = useEditorTripBack(
|
|
|
21
18
|
]"
|
|
22
19
|
:active-tab="store.activeTab"
|
|
23
20
|
:test-id="templateWhatsappCreateTestIds.navbar"
|
|
24
|
-
:back="tripBack"
|
|
25
|
-
@back="composerRef?.handleCancel()"
|
|
26
21
|
@tab-change="store.activeTab = $event as 'content' | 'translations'"
|
|
27
22
|
>
|
|
28
23
|
<template #actions>
|
package/app/queries/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { MaybeRefOrGetter } from 'vue'
|
|
|
3
3
|
import type {
|
|
4
4
|
DuplicateMessageGroupBody,
|
|
5
5
|
MessageGroup,
|
|
6
|
-
MessageGroupWithMessageSummary,
|
|
7
6
|
PostEntity,
|
|
8
7
|
} from '@dev.smartpricing/message-composer-utils/types'
|
|
9
8
|
import { messageGroupsApi } from '~/api'
|
|
@@ -56,7 +55,9 @@ export function useMessageGroupListQuery(
|
|
|
56
55
|
// Never across Organizations: a switch must not show the previous one's rows.
|
|
57
56
|
placeholderData: (previousData, previousEntry) =>
|
|
58
57
|
previousEntry?.key.at(-1) === listOrganizationId() ? previousData : undefined,
|
|
59
|
-
|
|
58
|
+
// Until an Organization is resolved the list waits (pending, so callers
|
|
59
|
+
// show it as loading) instead of failing into an empty table.
|
|
60
|
+
enabled: () => toValue(queryOptions.enabled ?? true) && !!listOrganizationId(),
|
|
60
61
|
})
|
|
61
62
|
}
|
|
62
63
|
|
|
@@ -76,6 +77,32 @@ export function useMessageGroupQuery(
|
|
|
76
77
|
})
|
|
77
78
|
}
|
|
78
79
|
|
|
80
|
+
/**
|
|
81
|
+
* The names of the Message Groups of these ids, by id. One that cannot be
|
|
82
|
+
* read is missing from the answer: the caller shows what it has instead.
|
|
83
|
+
*/
|
|
84
|
+
export function useMessageGroupNamesQuery(ids: MaybeRefOrGetter<string[]>) {
|
|
85
|
+
return useQuery({
|
|
86
|
+
key: () => ['message-groups', 'names', ...toValue(ids)],
|
|
87
|
+
query: async () => {
|
|
88
|
+
const names: Record<string, string> = {}
|
|
89
|
+
await Promise.all(
|
|
90
|
+
toValue(ids).map((id) =>
|
|
91
|
+
messageGroupsApi
|
|
92
|
+
.getById(id)
|
|
93
|
+
.then((group) => {
|
|
94
|
+
names[id] = group.name
|
|
95
|
+
})
|
|
96
|
+
.catch(() => {}),
|
|
97
|
+
),
|
|
98
|
+
)
|
|
99
|
+
return names
|
|
100
|
+
},
|
|
101
|
+
staleTime: 0,
|
|
102
|
+
enabled: () => toValue(ids).length > 0,
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
|
|
79
106
|
// MUTATIONS
|
|
80
107
|
export function useCreateMessageGroupMutation() {
|
|
81
108
|
const queryCache = useQueryCache()
|
|
@@ -139,24 +166,6 @@ export function useDeleteMessageGroupMutation() {
|
|
|
139
166
|
|
|
140
167
|
return useMutation({
|
|
141
168
|
mutation: messageGroupsApi.delete,
|
|
142
|
-
onMutate: async (id) => {
|
|
143
|
-
// Optimistic update
|
|
144
|
-
queryCache.cancelQueries({ key: ['message-groups'] })
|
|
145
|
-
const previous = queryCache.getQueryData(['message-groups'])
|
|
146
|
-
|
|
147
|
-
queryCache.setQueryData(
|
|
148
|
-
['message-groups'],
|
|
149
|
-
(old: MessageGroupWithMessageSummary[] | undefined) => old?.filter((g) => g.id !== id),
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
return { previous }
|
|
153
|
-
},
|
|
154
|
-
onError: (_, __, context) => {
|
|
155
|
-
// Rollback on error
|
|
156
|
-
if (context?.previous) {
|
|
157
|
-
queryCache.setQueryData(['message-groups'], context.previous)
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
169
|
onSuccess: () => {
|
|
161
170
|
queryCache.invalidateQueries({ key: ['message-groups'] })
|
|
162
171
|
},
|
package/app/queries/meta.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { useQuery } from '@pinia/colada'
|
|
1
|
+
import { useMutation, useQuery, useQueryCache } from '@pinia/colada'
|
|
2
|
+
import type { MaybeRefOrGetter } from 'vue'
|
|
3
|
+
import type {
|
|
4
|
+
MetaImportScope,
|
|
5
|
+
OrganizationWaba,
|
|
6
|
+
} from '@dev.smartpricing/message-composer-utils/types'
|
|
2
7
|
import { metaApi } from '~/api'
|
|
3
8
|
|
|
4
9
|
/**
|
|
@@ -16,3 +21,88 @@ export function useOrganizationWabasQuery() {
|
|
|
16
21
|
staleTime: 5 * 60 * 1000,
|
|
17
22
|
})
|
|
18
23
|
}
|
|
24
|
+
|
|
25
|
+
/** A WABA with how many of its Meta Templates an Import would offer. */
|
|
26
|
+
export interface WabaImportCheck {
|
|
27
|
+
waba: OrganizationWaba
|
|
28
|
+
count: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The check of an Import (ADR 0020), for the Message Group list: each WABA of
|
|
33
|
+
* the list's Organization with how many Meta Templates an Import would offer,
|
|
34
|
+
* under the Host's Product. Not asked for an Organization without a WABA. A
|
|
35
|
+
* WABA whose check fails counts zero, like one Meta cannot read.
|
|
36
|
+
*/
|
|
37
|
+
export function useMetaImportCheckQuery(options: { enabled?: MaybeRefOrGetter<boolean> } = {}) {
|
|
38
|
+
const organization = useEffectiveOrganizationStore()
|
|
39
|
+
const appContext = useAppContextStore()
|
|
40
|
+
const { data: wabas } = useOrganizationWabasQuery()
|
|
41
|
+
|
|
42
|
+
return useQuery({
|
|
43
|
+
key: () => [
|
|
44
|
+
'meta-import-check',
|
|
45
|
+
organization.organizationId,
|
|
46
|
+
appContext.product ?? null,
|
|
47
|
+
(wabas.value ?? []).map((waba) => waba.id).join(','),
|
|
48
|
+
],
|
|
49
|
+
query: (): Promise<WabaImportCheck[]> => {
|
|
50
|
+
const organization_id = organization.requireOrganizationId()
|
|
51
|
+
const product = appContext.product
|
|
52
|
+
if (!product) throw new Error('[message-composer] No Product: the import check was not sent')
|
|
53
|
+
|
|
54
|
+
return Promise.all(
|
|
55
|
+
(wabas.value ?? []).map(async (waba) => {
|
|
56
|
+
const { count } = await metaApi
|
|
57
|
+
.checkImport({ organization_id, product, waba_id: waba.id })
|
|
58
|
+
.catch(() => ({ count: 0 }))
|
|
59
|
+
return { waba, count }
|
|
60
|
+
}),
|
|
61
|
+
)
|
|
62
|
+
},
|
|
63
|
+
enabled: () =>
|
|
64
|
+
toValue(options.enabled ?? true) &&
|
|
65
|
+
!!appContext.product &&
|
|
66
|
+
!!wabas.value?.length &&
|
|
67
|
+
// The list's Organization, not one an editor page still claims while
|
|
68
|
+
// the list mounts.
|
|
69
|
+
organization.organizationId === organization.resolvedOrganizationId,
|
|
70
|
+
// The backend keeps each WABA's count for ten minutes; this only spares
|
|
71
|
+
// the round trip when the list is left and reopened.
|
|
72
|
+
staleTime: 60 * 1000,
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The proposal of an Import, read from Meta when the dialog asks and never
|
|
78
|
+
* reused: the user ticks against exactly what this answered, so nothing
|
|
79
|
+
* refetches it behind their back.
|
|
80
|
+
*/
|
|
81
|
+
export function useMetaImportProposalQuery(scope: MaybeRefOrGetter<MetaImportScope | undefined>) {
|
|
82
|
+
return useQuery({
|
|
83
|
+
key: () => ['meta-import-proposal', JSON.stringify(toValue(scope) ?? null)],
|
|
84
|
+
query: () => {
|
|
85
|
+
const value = toValue(scope)
|
|
86
|
+
if (!value) throw new Error('[message-composer] No WABA chosen: the proposal was not asked')
|
|
87
|
+
return metaApi.getImportProposal(value)
|
|
88
|
+
},
|
|
89
|
+
enabled: () => !!toValue(scope),
|
|
90
|
+
staleTime: 0,
|
|
91
|
+
gcTime: 0,
|
|
92
|
+
refetchOnWindowFocus: false,
|
|
93
|
+
refetchOnReconnect: false,
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Confirms an Import. The list and the check are read again whatever the outcome. */
|
|
98
|
+
export function useConfirmMetaImportMutation() {
|
|
99
|
+
const queryCache = useQueryCache()
|
|
100
|
+
|
|
101
|
+
return useMutation({
|
|
102
|
+
mutation: metaApi.confirmImport,
|
|
103
|
+
onSettled: () => {
|
|
104
|
+
queryCache.invalidateQueries({ key: ['message-groups'] })
|
|
105
|
+
queryCache.invalidateQueries({ key: ['meta-import-check'] })
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
}
|
package/app/stores/appContext.ts
CHANGED
|
@@ -23,7 +23,7 @@ export const useAppContextStore = defineStore('appContext', () => {
|
|
|
23
23
|
const mainLanguage = computed(() => ctx.mainLanguage?.value ?? 'en')
|
|
24
24
|
const default_tags = computed<string[]>(() => ctx.default_tags?.value ?? [])
|
|
25
25
|
const isAdmin = computed(() => ctx.isAdmin?.value ?? false)
|
|
26
|
-
// The Host
|
|
26
|
+
// The WABA the Host works on: the target of a new Message Group (ADR 0015).
|
|
27
27
|
const metaWabaId = computed(() => ctx.metaWabaId?.value || undefined)
|
|
28
28
|
|
|
29
29
|
// Sync i18n locale when mainLanguage changes
|
|
@@ -2,14 +2,11 @@ declare module 'nuxt/schema' {
|
|
|
2
2
|
interface AppConfigInput {
|
|
3
3
|
composer?: {
|
|
4
4
|
tracking?: boolean
|
|
5
|
-
/** Turns the Automation pages on (ADR 0019). Off, their routes answer 404. */
|
|
6
|
-
automations?: boolean
|
|
7
5
|
}
|
|
8
6
|
}
|
|
9
7
|
interface AppConfig {
|
|
10
8
|
composer: {
|
|
11
9
|
tracking: boolean
|
|
12
|
-
automations: boolean
|
|
13
10
|
}
|
|
14
11
|
}
|
|
15
12
|
}
|
package/app/types/tracking.ts
CHANGED
|
@@ -76,39 +76,6 @@ export interface TrackingEventMap {
|
|
|
76
76
|
// === Global ===
|
|
77
77
|
'Page View': { page_name: string }
|
|
78
78
|
|
|
79
|
-
// === Automation_list ===
|
|
80
|
-
'automation_list.delete': { automation_name: string; automation_id: string }
|
|
81
|
-
'automation_list.duplicate': { automation_name: string; automation_id: string }
|
|
82
|
-
'automation_list.edit': { automation_name: string; automation_id: string }
|
|
83
|
-
'automation_list.filter_changed': {
|
|
84
|
-
search_term: string
|
|
85
|
-
/** A Trigger type, a status, a Channel; `all` when not narrowed. */
|
|
86
|
-
trigger_type: string
|
|
87
|
-
status: string
|
|
88
|
-
channel: string
|
|
89
|
-
}
|
|
90
|
-
'automation_list.sort_changed': { column: string; direction: 'asc' | 'desc' }
|
|
91
|
-
|
|
92
|
-
// === Automation create / edit ===
|
|
93
|
-
'Automation setup': {
|
|
94
|
-
automation_sender: string
|
|
95
|
-
automation_name: string
|
|
96
|
-
automation_trigger: string
|
|
97
|
-
automation_type: string
|
|
98
|
-
automation_rules_audience: 'all' | 'segmented'
|
|
99
|
-
automation_subject: string
|
|
100
|
-
automation_moment: string
|
|
101
|
-
automation_channel: string
|
|
102
|
-
automation_status: string
|
|
103
|
-
automation_days: number
|
|
104
|
-
created_by: 'user'
|
|
105
|
-
}
|
|
106
|
-
'automation.clone': { automation_name: string; source_id: string }
|
|
107
|
-
'automation.trigger_changed': { from: string; to: string }
|
|
108
|
-
'automation.action_added': { channel: string }
|
|
109
|
-
'automation.action_deleted': { channel: string }
|
|
110
|
-
'automation.action_toggled': { channel: string; new_status: string }
|
|
111
|
-
|
|
112
79
|
// === Brand ===
|
|
113
80
|
brand_create: BrandBaseProperties & { has_logo: boolean }
|
|
114
81
|
brand_update: BrandBaseProperties & { changed_fields: string[] }
|
|
@@ -519,6 +519,7 @@ export const templateListTableTestIds = {
|
|
|
519
519
|
paginationSummary: 'template-list-table-pagination-summary',
|
|
520
520
|
card: 'template-list-table-card',
|
|
521
521
|
table: 'template-list-table-table',
|
|
522
|
+
loading: 'template-list-table-loading',
|
|
522
523
|
rowName: 'template-list-table-row-name',
|
|
523
524
|
rowInternalBadge: 'template-list-table-row-internal-badge',
|
|
524
525
|
rowCategoryBadge: 'template-list-table-row-category-badge',
|
|
@@ -784,110 +785,3 @@ export const messageSendFlowTestIds = {
|
|
|
784
785
|
cancel: 'message-send-flow-cancel',
|
|
785
786
|
confirm: 'message-send-flow-confirm',
|
|
786
787
|
} as const
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
* The Automation pages. The values are the ones Smartconnect's own pages used
|
|
790
|
-
* (`automationsTestIds` in its `testIds.const.ts`): host e2e suites target them.
|
|
791
|
-
*/
|
|
792
|
-
export const automationsTestIds = {
|
|
793
|
-
// List page
|
|
794
|
-
page: 'automations-page',
|
|
795
|
-
newButton: 'automations-new-button',
|
|
796
|
-
|
|
797
|
-
// List
|
|
798
|
-
searchInput: 'automations-search-input',
|
|
799
|
-
filterTrigger: 'automations-filter-trigger',
|
|
800
|
-
filterStatus: 'automations-filter-status',
|
|
801
|
-
filterChannel: 'automations-filter-channel',
|
|
802
|
-
table: 'automations-table',
|
|
803
|
-
rowActionsButton: 'automations-row-actions-button',
|
|
804
|
-
editAction: 'automations-edit-action',
|
|
805
|
-
duplicateAction: 'automations-duplicate-action',
|
|
806
|
-
deleteAction: 'automations-delete-action',
|
|
807
|
-
channelsCell: 'automations-channels-cell',
|
|
808
|
-
statusCell: 'automations-status-cell',
|
|
809
|
-
|
|
810
|
-
// Delete modal
|
|
811
|
-
deleteModal: 'automations-delete-modal',
|
|
812
|
-
deleteModalCloseButton: 'automations-delete-modal-close-button',
|
|
813
|
-
deleteModalCancel: 'automations-delete-modal-cancel',
|
|
814
|
-
deleteModalConfirm: 'automations-delete-modal-confirm',
|
|
815
|
-
deleteModalMessages: 'automations-delete-modal-messages',
|
|
816
|
-
|
|
817
|
-
// New page
|
|
818
|
-
newPage: 'automations-new-page',
|
|
819
|
-
newPageCancelButton: 'automations-new-page-cancel-button',
|
|
820
|
-
newPageCreateButton: 'automations-new-page-create-button',
|
|
821
|
-
|
|
822
|
-
// Edit page
|
|
823
|
-
editPage: 'automations-edit-page',
|
|
824
|
-
editPageCancelButton: 'automations-edit-page-cancel-button',
|
|
825
|
-
editPageCreateButton: 'automations-edit-page-create-button',
|
|
826
|
-
|
|
827
|
-
// Form
|
|
828
|
-
form: 'automations-form',
|
|
829
|
-
errorAlert: 'automations-error-alert',
|
|
830
|
-
nameInput: 'automations-name-input',
|
|
831
|
-
triggerSelect: 'automations-trigger-select',
|
|
832
|
-
|
|
833
|
-
// Send to (audience). The rows of the slideover are `audience-filter-*`.
|
|
834
|
-
sendToSummary: 'automations-send-to-summary',
|
|
835
|
-
addFiltersButton: 'automations-add-filters-button',
|
|
836
|
-
editFiltersButton: 'automations-edit-filters-button',
|
|
837
|
-
filtersSlideover: 'automations-filters-slideover',
|
|
838
|
-
filtersSlideoverCloseButton: 'automations-filters-slideover-close-button',
|
|
839
|
-
filtersSlideoverCancel: 'automations-filters-slideover-cancel',
|
|
840
|
-
filtersSlideoverSave: 'automations-filters-slideover-save',
|
|
841
|
-
|
|
842
|
-
// Actions list
|
|
843
|
-
actionsEmpty: 'automations-actions-empty',
|
|
844
|
-
addChannelButton: 'automations-add-channel-button',
|
|
845
|
-
|
|
846
|
-
// Action card (suffixed with `-${action.key}`, which is also on `data-testvalue`)
|
|
847
|
-
actionCard: 'automations-action-card',
|
|
848
|
-
actionEnabledSwitch: 'automations-action-enabled-switch',
|
|
849
|
-
actionDeleteButton: 'automations-action-delete-button',
|
|
850
|
-
actionPreviewButton: 'automations-action-preview-button',
|
|
851
|
-
actionEditButton: 'automations-action-edit-button',
|
|
852
|
-
|
|
853
|
-
// Message slideover. The message picker is `messageGroupSelectTestIds.root`.
|
|
854
|
-
channelSlideover: 'automations-channel-slideover',
|
|
855
|
-
channelSlideoverCloseButton: 'automations-channel-slideover-close-button',
|
|
856
|
-
channelTypeSelect: 'automations-channel-type-select',
|
|
857
|
-
channelDaysInput: 'automations-channel-days-input',
|
|
858
|
-
channelDateRefSelect: 'automations-channel-date-ref-select',
|
|
859
|
-
channelSendingTimeSelect: 'automations-channel-sending-time-select',
|
|
860
|
-
channelCreateNewButton: 'automations-channel-create-new-button',
|
|
861
|
-
channelEditTemplateButton: 'automations-channel-edit-template-button',
|
|
862
|
-
channelPreview: 'automations-channel-preview',
|
|
863
|
-
channelAdvancedCollapse: 'automations-channel-advanced-collapse',
|
|
864
|
-
channelAdvancedCollapseButton: 'automations-channel-advanced-collapse-button',
|
|
865
|
-
channelRecurrenceSelect: 'automations-channel-recurrence-select',
|
|
866
|
-
channelStrictDelaySwitch: 'automations-channel-strict-delay-switch',
|
|
867
|
-
channelPreventDuplicatesSwitch: 'automations-channel-prevent-duplicates-switch',
|
|
868
|
-
channelSlideoverCancel: 'automations-channel-slideover-cancel',
|
|
869
|
-
channelSlideoverSave: 'automations-channel-slideover-save',
|
|
870
|
-
|
|
871
|
-
// Preview slideover (action card)
|
|
872
|
-
previewSlideover: 'automations-preview-slideover',
|
|
873
|
-
previewSlideoverCloseButton: 'automations-preview-slideover-close-button',
|
|
874
|
-
|
|
875
|
-
// System Automation
|
|
876
|
-
lockedBadge: 'automations-locked-badge',
|
|
877
|
-
lockedAlert: 'automations-locked-alert',
|
|
878
|
-
lockedDuplicateButton: 'automations-locked-duplicate-button',
|
|
879
|
-
|
|
880
|
-
// Clone modal
|
|
881
|
-
cloneModal: 'automations-clone-modal',
|
|
882
|
-
cloneModalNameInput: 'automations-clone-modal-name-input',
|
|
883
|
-
cloneModalConfirm: 'automations-clone-modal-confirm',
|
|
884
|
-
cloneModalCancel: 'automations-clone-modal-cancel',
|
|
885
|
-
} as const
|
|
886
|
-
|
|
887
|
-
/**
|
|
888
|
-
* The `content` of a UModal or a USlideover that puts a test id on the dialog:
|
|
889
|
-
* the two render no attribute of their own, and `content` types no `data-*`.
|
|
890
|
-
*/
|
|
891
|
-
export function dialogTestId(testId: string): object {
|
|
892
|
-
return { 'data-testid': testId }
|
|
893
|
-
}
|