@dev.smartpricing/message-composer-layer 5.0.0-automations.0 → 5.0.0-automations.2
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 +2 -2
- package/app/api/meta.ts +36 -0
- package/app/components/Automations/ActionCard.vue +12 -1
- package/app/components/Automations/ActionEditor.vue +25 -3
- package/app/components/Automations/Actions.vue +20 -3
- package/app/components/Automations/CloneModal.vue +4 -0
- package/app/components/Automations/Conditions.vue +12 -3
- package/app/components/Automations/Create.vue +8 -0
- package/app/components/Automations/DeleteModal.vue +15 -3
- package/app/components/Automations/Edit.vue +10 -0
- package/app/components/Automations/Form.vue +3 -0
- package/app/components/Automations/List.vue +32 -5
- package/app/components/Automations/SaveProblems.vue +2 -0
- package/app/components/Composer/MessageLibrary.vue +8 -0
- package/app/components/Composer/WabaSelectModal.vue +1 -3
- 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 +1 -0
- package/app/composables/composerContext.ts +3 -3
- package/app/composables/useMessageGroupWaba.ts +10 -7
- package/app/pages/automations/[id].vue +3 -1
- package/app/pages/automations/index.vue +2 -1
- package/app/pages/automations/new.vue +3 -1
- package/app/pages/index.vue +5 -1
- package/app/queries/messageGroups.ts +29 -20
- package/app/queries/meta.ts +91 -1
- package/app/stores/appContext.ts +1 -1
- package/app/utils/automations/form.ts +21 -0
- package/app/utils/testIds.const.ts +108 -0
- package/i18n/locales/de.ts +65 -0
- package/i18n/locales/en.ts +62 -0
- package/i18n/locales/es.ts +63 -0
- package/i18n/locales/fr.ts +64 -0
- package/i18n/locales/it.ts +66 -0
- package/package.json +2 -2
|
@@ -17,9 +17,9 @@ export interface ComposerContext {
|
|
|
17
17
|
mainLanguage?: Ref<string>
|
|
18
18
|
default_tags?: Ref<string[]>
|
|
19
19
|
/**
|
|
20
|
-
* The WABA the Host works on.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* The WABA the Host works on. A new Message Group is submitted to it and
|
|
21
|
+
* the user is not asked, as long as it is one of the Organization's
|
|
22
|
+
* (ADR 0015). Without it the user picks when there are several.
|
|
23
23
|
*/
|
|
24
24
|
metaWabaId?: Ref<string>
|
|
25
25
|
isAdmin?: Ref<boolean>
|
|
@@ -43,9 +43,10 @@ export function useMessageGroupWaba(storedWabaId: MaybeRefOrGetter<string | null
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* The WABA to name in a submission.
|
|
47
|
-
*
|
|
48
|
-
*
|
|
46
|
+
* The WABA to name in a submission. At the first submission of a Message
|
|
47
|
+
* Group whose Organization has several WABAs, it is the Host's when the
|
|
48
|
+
* Host passed one of them, otherwise the user is asked. In every other
|
|
49
|
+
* case none is named and the backend resolves it. A lookup that has not
|
|
49
50
|
* answered yet is waited for; one that failed leaves it to the backend.
|
|
50
51
|
* Returns null when the user gives up.
|
|
51
52
|
*/
|
|
@@ -55,10 +56,12 @@ export function useMessageGroupWaba(storedWabaId: MaybeRefOrGetter<string | null
|
|
|
55
56
|
const candidates = wabas.value
|
|
56
57
|
if (!candidates || candidates.length < 2) return {}
|
|
57
58
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
:
|
|
61
|
-
|
|
59
|
+
const hostWabaId = metaWabaId.value
|
|
60
|
+
if (hostWabaId && candidates.some((candidate) => candidate.id === hostWabaId)) {
|
|
61
|
+
return { wabaId: hostWabaId }
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const chosen = await modal.open({ wabas: candidates }).result
|
|
62
65
|
|
|
63
66
|
return chosen ? { wabaId: chosen } : null
|
|
64
67
|
}
|
|
@@ -21,12 +21,13 @@ const edit = useTemplateRef('edit')
|
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<template>
|
|
24
|
-
<LayoutBasePage :title="t('automations.editTitle')">
|
|
24
|
+
<LayoutBasePage :title="t('automations.editTitle')" :test-id="automationsTestIds.editPage">
|
|
25
25
|
<template #actions>
|
|
26
26
|
<UButton
|
|
27
27
|
variant="ghost"
|
|
28
28
|
size="lg"
|
|
29
29
|
:label="t('common.actions.cancel')"
|
|
30
|
+
:data-testid="automationsTestIds.editPageCancelButton"
|
|
30
31
|
@click="goBackOrFallback({ name: 'automations-list' })"
|
|
31
32
|
/>
|
|
32
33
|
<UButton
|
|
@@ -34,6 +35,7 @@ const edit = useTemplateRef('edit')
|
|
|
34
35
|
size="lg"
|
|
35
36
|
:loading="edit.saving"
|
|
36
37
|
:label="t('common.actions.save')"
|
|
38
|
+
:data-testid="automationsTestIds.editPageCreateButton"
|
|
37
39
|
@click="edit.submit()"
|
|
38
40
|
/>
|
|
39
41
|
</template>
|
|
@@ -9,7 +9,7 @@ const gate = useAutomationsGate()
|
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<template>
|
|
12
|
-
<LayoutBasePage :title="t('automations.title')">
|
|
12
|
+
<LayoutBasePage :title="t('automations.title')" :test-id="automationsTestIds.page">
|
|
13
13
|
<template #actions>
|
|
14
14
|
<CommonOrganizationSelect />
|
|
15
15
|
<UButton
|
|
@@ -17,6 +17,7 @@ const gate = useAutomationsGate()
|
|
|
17
17
|
icon="ph:plus-bold"
|
|
18
18
|
:label="t('automations.new')"
|
|
19
19
|
:to="{ name: 'automation-create' }"
|
|
20
|
+
:data-testid="automationsTestIds.newButton"
|
|
20
21
|
/>
|
|
21
22
|
</template>
|
|
22
23
|
|
|
@@ -12,12 +12,13 @@ const create = useTemplateRef('create')
|
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
|
-
<LayoutBasePage :title="t('automations.newTitle')">
|
|
15
|
+
<LayoutBasePage :title="t('automations.newTitle')" :test-id="automationsTestIds.newPage">
|
|
16
16
|
<template #actions>
|
|
17
17
|
<UButton
|
|
18
18
|
variant="ghost"
|
|
19
19
|
size="lg"
|
|
20
20
|
:label="t('common.actions.cancel')"
|
|
21
|
+
:data-testid="automationsTestIds.newPageCancelButton"
|
|
21
22
|
@click="goBackOrFallback({ name: 'automations-list' })"
|
|
22
23
|
/>
|
|
23
24
|
<UButton
|
|
@@ -25,6 +26,7 @@ const create = useTemplateRef('create')
|
|
|
25
26
|
size="lg"
|
|
26
27
|
:loading="create.saving"
|
|
27
28
|
:label="t('automations.form.create')"
|
|
29
|
+
:data-testid="automationsTestIds.newPageCreateButton"
|
|
28
30
|
@click="create.submit()"
|
|
29
31
|
/>
|
|
30
32
|
</template>
|
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>
|
|
@@ -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
|
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
AutomationActionInput,
|
|
6
6
|
AutomationActionStatus,
|
|
7
7
|
AutomationChannel,
|
|
8
|
+
AutomationEngineRejectedDetails,
|
|
8
9
|
AutomationPartlySavedDetails,
|
|
9
10
|
AutomationSaveProblem,
|
|
10
11
|
AutomationTrigger,
|
|
@@ -329,6 +330,26 @@ export function automationSaveProblems(error: unknown): AutomationSaveProblem[]
|
|
|
329
330
|
return Array.isArray(problems) ? (problems as AutomationSaveProblem[]) : []
|
|
330
331
|
}
|
|
331
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Why the Automation Engine refused a request (422
|
|
335
|
+
* `AUTOMATION_ENGINE_REJECTED`), in the engine's own words, or `undefined`
|
|
336
|
+
* for any other error.
|
|
337
|
+
*/
|
|
338
|
+
export function automationEngineRejected(error: unknown): string | undefined {
|
|
339
|
+
const data = (
|
|
340
|
+
error as {
|
|
341
|
+
data?: { code?: unknown; details?: Partial<AutomationEngineRejectedDetails> }
|
|
342
|
+
} | null
|
|
343
|
+
)?.data
|
|
344
|
+
if (data?.code !== 'AUTOMATION_ENGINE_REJECTED') return undefined
|
|
345
|
+
|
|
346
|
+
const { message = '', errors } = data.details ?? {}
|
|
347
|
+
const reasons = Array.isArray(errors)
|
|
348
|
+
? errors.map(({ field, message }) => `${field}: ${message}`)
|
|
349
|
+
: []
|
|
350
|
+
return reasons.length > 0 ? reasons.join('; ') : message
|
|
351
|
+
}
|
|
352
|
+
|
|
332
353
|
/**
|
|
333
354
|
* What the Automation Engine holds after an update that was saved only in
|
|
334
355
|
* part (502 `UPSTREAM_ERROR` with the current state, ADR 0016), or
|
|
@@ -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,3 +785,110 @@ export const messageSendFlowTestIds = {
|
|
|
784
785
|
cancel: 'message-send-flow-cancel',
|
|
785
786
|
confirm: 'message-send-flow-confirm',
|
|
786
787
|
} as const
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* The Automation pages. The values are the ones Smartconnect's own pages used
|
|
791
|
+
* (`automationsTestIds` in its `testIds.const.ts`): host e2e suites target them.
|
|
792
|
+
*/
|
|
793
|
+
export const automationsTestIds = {
|
|
794
|
+
// List page
|
|
795
|
+
page: 'automations-page',
|
|
796
|
+
newButton: 'automations-new-button',
|
|
797
|
+
|
|
798
|
+
// List
|
|
799
|
+
searchInput: 'automations-search-input',
|
|
800
|
+
filterTrigger: 'automations-filter-trigger',
|
|
801
|
+
filterStatus: 'automations-filter-status',
|
|
802
|
+
filterChannel: 'automations-filter-channel',
|
|
803
|
+
table: 'automations-table',
|
|
804
|
+
rowActionsButton: 'automations-row-actions-button',
|
|
805
|
+
editAction: 'automations-edit-action',
|
|
806
|
+
duplicateAction: 'automations-duplicate-action',
|
|
807
|
+
deleteAction: 'automations-delete-action',
|
|
808
|
+
channelsCell: 'automations-channels-cell',
|
|
809
|
+
statusCell: 'automations-status-cell',
|
|
810
|
+
|
|
811
|
+
// Delete modal
|
|
812
|
+
deleteModal: 'automations-delete-modal',
|
|
813
|
+
deleteModalCloseButton: 'automations-delete-modal-close-button',
|
|
814
|
+
deleteModalCancel: 'automations-delete-modal-cancel',
|
|
815
|
+
deleteModalConfirm: 'automations-delete-modal-confirm',
|
|
816
|
+
deleteModalMessages: 'automations-delete-modal-messages',
|
|
817
|
+
|
|
818
|
+
// New page
|
|
819
|
+
newPage: 'automations-new-page',
|
|
820
|
+
newPageCancelButton: 'automations-new-page-cancel-button',
|
|
821
|
+
newPageCreateButton: 'automations-new-page-create-button',
|
|
822
|
+
|
|
823
|
+
// Edit page
|
|
824
|
+
editPage: 'automations-edit-page',
|
|
825
|
+
editPageCancelButton: 'automations-edit-page-cancel-button',
|
|
826
|
+
editPageCreateButton: 'automations-edit-page-create-button',
|
|
827
|
+
|
|
828
|
+
// Form
|
|
829
|
+
form: 'automations-form',
|
|
830
|
+
errorAlert: 'automations-error-alert',
|
|
831
|
+
nameInput: 'automations-name-input',
|
|
832
|
+
triggerSelect: 'automations-trigger-select',
|
|
833
|
+
|
|
834
|
+
// Send to (audience). The rows of the slideover are `audience-filter-*`.
|
|
835
|
+
sendToSummary: 'automations-send-to-summary',
|
|
836
|
+
addFiltersButton: 'automations-add-filters-button',
|
|
837
|
+
editFiltersButton: 'automations-edit-filters-button',
|
|
838
|
+
filtersSlideover: 'automations-filters-slideover',
|
|
839
|
+
filtersSlideoverCloseButton: 'automations-filters-slideover-close-button',
|
|
840
|
+
filtersSlideoverCancel: 'automations-filters-slideover-cancel',
|
|
841
|
+
filtersSlideoverSave: 'automations-filters-slideover-save',
|
|
842
|
+
|
|
843
|
+
// Actions list
|
|
844
|
+
actionsEmpty: 'automations-actions-empty',
|
|
845
|
+
addChannelButton: 'automations-add-channel-button',
|
|
846
|
+
|
|
847
|
+
// Action card (suffixed with `-${action.key}`, which is also on `data-testvalue`)
|
|
848
|
+
actionCard: 'automations-action-card',
|
|
849
|
+
actionEnabledSwitch: 'automations-action-enabled-switch',
|
|
850
|
+
actionDeleteButton: 'automations-action-delete-button',
|
|
851
|
+
actionPreviewButton: 'automations-action-preview-button',
|
|
852
|
+
actionEditButton: 'automations-action-edit-button',
|
|
853
|
+
|
|
854
|
+
// Message slideover. The message picker is `messageGroupSelectTestIds.root`.
|
|
855
|
+
channelSlideover: 'automations-channel-slideover',
|
|
856
|
+
channelSlideoverCloseButton: 'automations-channel-slideover-close-button',
|
|
857
|
+
channelTypeSelect: 'automations-channel-type-select',
|
|
858
|
+
channelDaysInput: 'automations-channel-days-input',
|
|
859
|
+
channelDateRefSelect: 'automations-channel-date-ref-select',
|
|
860
|
+
channelSendingTimeSelect: 'automations-channel-sending-time-select',
|
|
861
|
+
channelCreateNewButton: 'automations-channel-create-new-button',
|
|
862
|
+
channelEditTemplateButton: 'automations-channel-edit-template-button',
|
|
863
|
+
channelPreview: 'automations-channel-preview',
|
|
864
|
+
channelAdvancedCollapse: 'automations-channel-advanced-collapse',
|
|
865
|
+
channelAdvancedCollapseButton: 'automations-channel-advanced-collapse-button',
|
|
866
|
+
channelRecurrenceSelect: 'automations-channel-recurrence-select',
|
|
867
|
+
channelStrictDelaySwitch: 'automations-channel-strict-delay-switch',
|
|
868
|
+
channelPreventDuplicatesSwitch: 'automations-channel-prevent-duplicates-switch',
|
|
869
|
+
channelSlideoverCancel: 'automations-channel-slideover-cancel',
|
|
870
|
+
channelSlideoverSave: 'automations-channel-slideover-save',
|
|
871
|
+
|
|
872
|
+
// Preview slideover (action card)
|
|
873
|
+
previewSlideover: 'automations-preview-slideover',
|
|
874
|
+
previewSlideoverCloseButton: 'automations-preview-slideover-close-button',
|
|
875
|
+
|
|
876
|
+
// System Automation
|
|
877
|
+
lockedBadge: 'automations-locked-badge',
|
|
878
|
+
lockedAlert: 'automations-locked-alert',
|
|
879
|
+
lockedDuplicateButton: 'automations-locked-duplicate-button',
|
|
880
|
+
|
|
881
|
+
// Clone modal
|
|
882
|
+
cloneModal: 'automations-clone-modal',
|
|
883
|
+
cloneModalNameInput: 'automations-clone-modal-name-input',
|
|
884
|
+
cloneModalConfirm: 'automations-clone-modal-confirm',
|
|
885
|
+
cloneModalCancel: 'automations-clone-modal-cancel',
|
|
886
|
+
} as const
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* The `content` of a UModal or a USlideover that puts a test id on the dialog:
|
|
890
|
+
* the two render no attribute of their own, and `content` types no `data-*`.
|
|
891
|
+
*/
|
|
892
|
+
export function dialogTestId(testId: string): object {
|
|
893
|
+
return { 'data-testid': testId }
|
|
894
|
+
}
|
package/i18n/locales/de.ts
CHANGED
|
@@ -178,6 +178,7 @@ export default {
|
|
|
178
178
|
created: 'Automatisierung erfolgreich erstellt',
|
|
179
179
|
deleted: 'Automatisierung erfolgreich gelöscht',
|
|
180
180
|
deleted_messages: 'Mit ihr gelöschte Nachrichten: {names}',
|
|
181
|
+
engine_rejected: 'Die Automation Engine hat die Anfrage abgelehnt',
|
|
181
182
|
kept_messages: 'Nachrichten, die nicht gelöscht werden konnten und erhalten bleiben: {names}',
|
|
182
183
|
partly_saved: 'Die Automatisierung wurde nur teilweise gespeichert',
|
|
183
184
|
partly_saved_description:
|
|
@@ -341,6 +342,68 @@ export default {
|
|
|
341
342
|
title: 'Fehlende Übersetzungen',
|
|
342
343
|
translate_and_save: 'Automatisch übersetzen und speichern',
|
|
343
344
|
},
|
|
345
|
+
meta_import: {
|
|
346
|
+
choose_waba: 'Wähle das WhatsApp-Business-Konto, aus dem importiert werden soll.',
|
|
347
|
+
close: 'Schließen',
|
|
348
|
+
confirm: 'Importieren',
|
|
349
|
+
continue: 'Weiter',
|
|
350
|
+
description:
|
|
351
|
+
'Übernimm die WhatsApp-Vorlagen, die dein WhatsApp-Business-Konto bereits bei Meta hat, in deine Nachrichten.',
|
|
352
|
+
empty: 'Aus diesem WhatsApp-Business-Konto gibt es nichts Neues zu importieren.',
|
|
353
|
+
failed_title: 'Nicht importiert',
|
|
354
|
+
fallback_description:
|
|
355
|
+
'Vorlagen mit unterschiedlichen Namen wurden nur anhand ihrer Namen zusammengefasst, nicht anhand ihres Textes. Prüfe jede Nachricht vor dem Import.',
|
|
356
|
+
fallback_title: 'Die Übersetzungen konnten nicht geprüft werden',
|
|
357
|
+
group_failures: {
|
|
358
|
+
duplicate_language: 'Zwei ihrer Vorlagen sind in derselben Sprache.',
|
|
359
|
+
nothing_to_import: 'Keine ihrer Vorlagen konnte importiert werden.',
|
|
360
|
+
write_failed: 'Sie konnte nicht gespeichert werden. Versuche es erneut.',
|
|
361
|
+
},
|
|
362
|
+
held_count: 'Ausgelassen, weil bereits unter deinen Nachrichten: {count}',
|
|
363
|
+
imported_count: 'Importierte Nachrichten: {count}',
|
|
364
|
+
intro:
|
|
365
|
+
'Jedes Feld wird zu einer Nachricht, mit einer Übersetzung pro Sprache. Entferne das Häkchen bei allem, was du nicht importieren möchtest. Nichts wird importiert, bevor du bestätigst.',
|
|
366
|
+
load_failed_description: 'Versuche es in einigen Minuten erneut.',
|
|
367
|
+
load_failed_title: 'Die Vorlagen konnten nicht aus Meta gelesen werden',
|
|
368
|
+
loading: 'Vorlagen werden aus Meta gelesen...',
|
|
369
|
+
merged_hint: 'Als Übersetzungen einer Nachricht zusammengefasst',
|
|
370
|
+
not_importable: 'Kann nicht importiert werden',
|
|
371
|
+
partial_title: 'Ohne einige Sprachen importiert',
|
|
372
|
+
reasons: {
|
|
373
|
+
media_download_failed: 'Das Kopfzeilenbild konnte nicht aus Meta kopiert werden.',
|
|
374
|
+
not_found: 'Sie existiert bei Meta nicht mehr.',
|
|
375
|
+
not_offered: 'Sie ist bei Meta abgelehnt oder bereits unter deinen Nachrichten.',
|
|
376
|
+
positional_variables: 'Sie verwendet nummerierte Variablen, die nicht unterstützt werden.',
|
|
377
|
+
unknown_button: 'Sie hat einen Schaltflächentyp, der nicht unterstützt wird.',
|
|
378
|
+
unknown_component: 'Sie hat eine Komponente, die nicht unterstützt wird.',
|
|
379
|
+
unknown_header: 'Sie hat einen Kopfzeilentyp, der nicht unterstützt wird.',
|
|
380
|
+
unknown_language: 'Ihre Sprache ist hier nicht verfügbar.',
|
|
381
|
+
unsupported_category: 'Ihre Kategorie ist weder Marketing noch Utility.',
|
|
382
|
+
},
|
|
383
|
+
refresh_failed_title: 'Frühere Importe nicht aktualisiert',
|
|
384
|
+
refresh_failures: {
|
|
385
|
+
media_download_failed: 'Das Kopfzeilenbild konnte nicht aus Meta kopiert werden.',
|
|
386
|
+
write_failed: 'Sie konnte nicht gespeichert werden. Versuche es erneut.',
|
|
387
|
+
},
|
|
388
|
+
refreshed_count: 'Frühere Importe mit Meta abgeglichen: {count}',
|
|
389
|
+
result_title: 'Import abgeschlossen',
|
|
390
|
+
retry: 'Erneut versuchen',
|
|
391
|
+
selection: 'Ausgewählte Nachrichten: {groups} · Vorlagen: {templates}',
|
|
392
|
+
split: 'Trennen',
|
|
393
|
+
title: 'Aus Meta importieren',
|
|
394
|
+
waba_count: 'Neue Vorlagen: {count}',
|
|
395
|
+
warnings: {
|
|
396
|
+
buttons_over_limit:
|
|
397
|
+
'Sie hat mehr Schaltflächen, als hier zu einer Nachricht hinzugefügt werden können.',
|
|
398
|
+
call_permission_request:
|
|
399
|
+
'Sie hat eine Anruferlaubnis-Anfrage, die hier nicht angezeigt wird.',
|
|
400
|
+
dynamic_url_button: 'Sie hat eine Link-Schaltfläche mit einer Variablen.',
|
|
401
|
+
label_over_limit:
|
|
402
|
+
'Sie hat eine Schaltflächenbeschriftung, die länger ist als das hier geltende Limit.',
|
|
403
|
+
same_language_split:
|
|
404
|
+
'Eine andere Vorlage mit diesem Namen deckt diese Sprache bereits ab, daher wird diese zu einer eigenen Nachricht.',
|
|
405
|
+
},
|
|
406
|
+
},
|
|
344
407
|
publish_message_group: {
|
|
345
408
|
message: '„{name}“ veröffentlichen, damit es für Kundinnen und Kunden sichtbar ist?',
|
|
346
409
|
success: '„{name}“ wurde veröffentlicht.',
|
|
@@ -1093,6 +1156,8 @@ export default {
|
|
|
1093
1156
|
status: 'Status',
|
|
1094
1157
|
updated_at: 'Aktualisiert am',
|
|
1095
1158
|
},
|
|
1159
|
+
import_from_meta: 'Aus Meta importieren ({count})',
|
|
1160
|
+
loading: 'Nachrichten werden geladen...',
|
|
1096
1161
|
pagination_summary: '{from}–{to} von {total}',
|
|
1097
1162
|
product_placeholder: 'Produkt auswählen',
|
|
1098
1163
|
render_type_placeholder: 'Render-Typ auswählen',
|
package/i18n/locales/en.ts
CHANGED
|
@@ -167,6 +167,7 @@ export default {
|
|
|
167
167
|
created: 'Automation created successfully',
|
|
168
168
|
deleted: 'Automation deleted successfully',
|
|
169
169
|
deleted_messages: 'Messages deleted with it: {names}',
|
|
170
|
+
engine_rejected: 'The Automation Engine refused the request',
|
|
170
171
|
kept_messages: 'Messages that could not be deleted and were kept: {names}',
|
|
171
172
|
partly_saved: 'The automation was saved only in part',
|
|
172
173
|
partly_saved_description: 'Your changes are still here. Save again to complete it.',
|
|
@@ -324,6 +325,65 @@ export default {
|
|
|
324
325
|
title: 'Missing translations',
|
|
325
326
|
translate_and_save: 'Translate automatically and save',
|
|
326
327
|
},
|
|
328
|
+
meta_import: {
|
|
329
|
+
choose_waba: 'Choose the WhatsApp Business Account to import from.',
|
|
330
|
+
close: 'Close',
|
|
331
|
+
confirm: 'Import',
|
|
332
|
+
continue: 'Continue',
|
|
333
|
+
description:
|
|
334
|
+
'Bring the WhatsApp templates your WhatsApp Business Account already has at Meta into your messages.',
|
|
335
|
+
empty: 'There is nothing new to import from this WhatsApp Business Account.',
|
|
336
|
+
failed_title: 'Not imported',
|
|
337
|
+
fallback_description:
|
|
338
|
+
'Templates with different names were put together by their names alone, not by their text. Check each message before you import.',
|
|
339
|
+
fallback_title: 'The translations could not be checked',
|
|
340
|
+
group_failures: {
|
|
341
|
+
duplicate_language: 'Two of its templates are in the same language.',
|
|
342
|
+
nothing_to_import: 'None of its templates could be imported.',
|
|
343
|
+
write_failed: 'It could not be saved. Try again.',
|
|
344
|
+
},
|
|
345
|
+
held_count: 'Left out because they are already among your messages: {count}',
|
|
346
|
+
imported_count: 'Messages imported: {count}',
|
|
347
|
+
intro:
|
|
348
|
+
'Each box becomes one message, with one translation per language. Untick what you do not want to import. Nothing is imported until you confirm.',
|
|
349
|
+
load_failed_description: 'Try again in a few minutes.',
|
|
350
|
+
load_failed_title: 'The templates could not be read from Meta',
|
|
351
|
+
loading: 'Reading the templates from Meta...',
|
|
352
|
+
merged_hint: 'Put together as translations of one message',
|
|
353
|
+
not_importable: 'Cannot be imported',
|
|
354
|
+
partial_title: 'Imported without some languages',
|
|
355
|
+
reasons: {
|
|
356
|
+
media_download_failed: 'Its header image could not be copied from Meta.',
|
|
357
|
+
not_found: 'It no longer exists at Meta.',
|
|
358
|
+
not_offered: 'It is rejected at Meta or already among your messages.',
|
|
359
|
+
positional_variables: 'It uses numbered variables, which are not supported.',
|
|
360
|
+
unknown_button: 'It has a button type that is not supported.',
|
|
361
|
+
unknown_component: 'It has a component that is not supported.',
|
|
362
|
+
unknown_header: 'It has a header type that is not supported.',
|
|
363
|
+
unknown_language: 'Its language is not available here.',
|
|
364
|
+
unsupported_category: 'Its category is neither marketing nor utility.',
|
|
365
|
+
},
|
|
366
|
+
refresh_failed_title: 'Earlier imports not brought up to date',
|
|
367
|
+
refresh_failures: {
|
|
368
|
+
media_download_failed: 'Its header image could not be copied from Meta.',
|
|
369
|
+
write_failed: 'It could not be saved. Try again.',
|
|
370
|
+
},
|
|
371
|
+
refreshed_count: 'Earlier imports brought up to date with Meta: {count}',
|
|
372
|
+
result_title: 'Import completed',
|
|
373
|
+
retry: 'Try again',
|
|
374
|
+
selection: 'Selected messages: {groups} · templates: {templates}',
|
|
375
|
+
split: 'Split',
|
|
376
|
+
title: 'Import from Meta',
|
|
377
|
+
waba_count: 'New templates: {count}',
|
|
378
|
+
warnings: {
|
|
379
|
+
buttons_over_limit: 'It has more buttons than you can add to a message here.',
|
|
380
|
+
call_permission_request: 'It has a call permission request, which is not shown here.',
|
|
381
|
+
dynamic_url_button: 'It has a link button with a variable.',
|
|
382
|
+
label_over_limit: 'It has a button label longer than the limit used here.',
|
|
383
|
+
same_language_split:
|
|
384
|
+
'Another template with this name already covers this language, so this one becomes a message of its own.',
|
|
385
|
+
},
|
|
386
|
+
},
|
|
327
387
|
publish_message_group: {
|
|
328
388
|
message: 'Publish "{name}" to make it visible to clients?',
|
|
329
389
|
success: '"{name}" has been published.',
|
|
@@ -1068,6 +1128,8 @@ export default {
|
|
|
1068
1128
|
status: 'Status',
|
|
1069
1129
|
updated_at: 'Updated at',
|
|
1070
1130
|
},
|
|
1131
|
+
import_from_meta: 'Import from Meta ({count})',
|
|
1132
|
+
loading: 'Loading messages...',
|
|
1071
1133
|
pagination_summary: '{from}–{to} of {total}',
|
|
1072
1134
|
product_placeholder: 'Select product',
|
|
1073
1135
|
render_type_placeholder: 'Select render type',
|