@dev.smartpricing/message-composer-layer 1.0.11 → 1.0.13
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/app/components/CreateTemplateButton.vue +1 -1
- package/app/components/Layout/BasePage.vue +43 -0
- package/app/composables/useGoBack.ts +1 -1
- package/app/layouts/default.vue +5 -0
- package/app/middleware/channel-guard.ts +3 -6
- package/app/pages/brands.vue +4 -8
- package/app/pages/images.vue +6 -9
- package/app/pages/index.vue +11 -15
- package/app/pages/preview/[id].vue +5 -0
- package/app/pages/template/email/[id].vue +47 -50
- package/app/pages/template/email/create.vue +48 -50
- package/app/pages/template/whatsapp/[id].vue +55 -57
- package/app/pages/template/whatsapp/create.vue +42 -44
- package/app/types/page-meta.d.ts +7 -0
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ const { trackEvent } = useTracking()
|
|
|
9
9
|
|
|
10
10
|
function createTemplate(type: 'whatsapp' | 'email') {
|
|
11
11
|
trackEvent('message_create', { message_kind: type })
|
|
12
|
-
router.push(
|
|
12
|
+
router.push({ name: `${type}-message-create` })
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const templateOptions = computed(() => {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ButtonProps, TabsItem } from '#ui/types'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
title: string
|
|
6
|
+
tabs?: TabsItem[]
|
|
7
|
+
activeTab?: string | number
|
|
8
|
+
back?: ButtonProps
|
|
9
|
+
testId?: string
|
|
10
|
+
}>()
|
|
11
|
+
|
|
12
|
+
const emit = defineEmits<{
|
|
13
|
+
tabChange: [value: string | number]
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
watchEffect(() => {
|
|
17
|
+
useHead({ title: props.title })
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="flex flex-col min-h-0">
|
|
23
|
+
<SNavigationBarHeader
|
|
24
|
+
:title="title"
|
|
25
|
+
:back="back"
|
|
26
|
+
:tabs="tabs"
|
|
27
|
+
:active-tab="activeTab"
|
|
28
|
+
:data-testid="testId"
|
|
29
|
+
class="bg-white sticky top-0 z-10"
|
|
30
|
+
@tab-change="emit('tabChange', $event)"
|
|
31
|
+
>
|
|
32
|
+
<template #actions>
|
|
33
|
+
<div class="flex items-center gap-1.5">
|
|
34
|
+
<slot name="actions" />
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
</SNavigationBarHeader>
|
|
38
|
+
|
|
39
|
+
<div class="flex flex-col gap-4 sm:gap-6 flex-1 overflow-y-auto sm:p-4 p-4">
|
|
40
|
+
<slot />
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
@@ -3,7 +3,7 @@ import type { RouteLocationRaw } from 'vue-router'
|
|
|
3
3
|
export function useGoBack() {
|
|
4
4
|
const router = useRouter()
|
|
5
5
|
|
|
6
|
-
function goBackOrFallback(fallback: RouteLocationRaw = '
|
|
6
|
+
function goBackOrFallback(fallback: RouteLocationRaw = { name: 'message-library' }) {
|
|
7
7
|
if (router.options.history.state.back) {
|
|
8
8
|
router.back()
|
|
9
9
|
} else {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export default defineNuxtRouteMiddleware((to) => {
|
|
2
2
|
const { isChannelAllowed } = useChannels()
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (!pathMatch) return
|
|
7
|
-
|
|
8
|
-
const channel = pathMatch[1] as 'whatsapp' | 'email'
|
|
4
|
+
const channel = to.meta.channel as 'whatsapp' | 'email' | undefined
|
|
5
|
+
if (!channel) return
|
|
9
6
|
|
|
10
7
|
if (!isChannelAllowed(channel)) {
|
|
11
|
-
return navigateTo('
|
|
8
|
+
return navigateTo({ name: 'message-library' }, { replace: true })
|
|
12
9
|
}
|
|
13
10
|
})
|
package/app/pages/brands.vue
CHANGED
|
@@ -128,13 +128,9 @@ function handleDrawerSaved() {
|
|
|
128
128
|
</script>
|
|
129
129
|
|
|
130
130
|
<template>
|
|
131
|
-
<
|
|
132
|
-
<template #
|
|
133
|
-
<
|
|
134
|
-
<template #actions>
|
|
135
|
-
<UButton icon="ph:plus" :label="t('pages.brands.new_brand')" @click="openCreate" />
|
|
136
|
-
</template>
|
|
137
|
-
</SNavigationBarHeader>
|
|
131
|
+
<LayoutBasePage :title="t('pages.brands.title')">
|
|
132
|
+
<template #actions>
|
|
133
|
+
<UButton icon="ph:plus" :label="t('pages.brands.new_brand')" @click="openCreate" />
|
|
138
134
|
</template>
|
|
139
135
|
|
|
140
136
|
<div class="flex-1 space-y-2.5 relative min-h-0 flex flex-col">
|
|
@@ -191,5 +187,5 @@ function handleDrawerSaved() {
|
|
|
191
187
|
</div>
|
|
192
188
|
|
|
193
189
|
<BrandDrawer v-model="drawerOpen" :brand-id="editingBrandId" @saved="handleDrawerSaved" />
|
|
194
|
-
</
|
|
190
|
+
</LayoutBasePage>
|
|
195
191
|
</template>
|
package/app/pages/images.vue
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
definePageMeta({
|
|
3
|
+
name: 'images',
|
|
4
|
+
})
|
|
5
|
+
|
|
2
6
|
import type { MediaFromDb } from '@dev.smartpricing/message-composer-utils/types'
|
|
3
7
|
import { useMediaQuery, useUploadToSmartchatMutation, useDeleteMediaMutation } from '~/queries'
|
|
4
8
|
import { formatDate } from '@dev.smartpricing/message-composer-utils/utils'
|
|
@@ -46,14 +50,7 @@ async function handleDelete(item: MediaFromDb) {
|
|
|
46
50
|
</script>
|
|
47
51
|
|
|
48
52
|
<template>
|
|
49
|
-
<
|
|
50
|
-
<template #header>
|
|
51
|
-
<SNavigationBarHeader
|
|
52
|
-
:title="t('pages.images.title')"
|
|
53
|
-
:data-testid="imagesPageTestIds.navbar"
|
|
54
|
-
/>
|
|
55
|
-
</template>
|
|
56
|
-
|
|
53
|
+
<LayoutBasePage :title="t('pages.images.title')" :test-id="imagesPageTestIds.navbar">
|
|
57
54
|
<div v-if="isPending" class="flex justify-center py-12">
|
|
58
55
|
<UIcon
|
|
59
56
|
name="i-heroicons-arrow-path"
|
|
@@ -137,5 +134,5 @@ async function handleDelete(item: MediaFromDb) {
|
|
|
137
134
|
</div>
|
|
138
135
|
</UCard>
|
|
139
136
|
</div>
|
|
140
|
-
</
|
|
137
|
+
</LayoutBasePage>
|
|
141
138
|
</template>
|
package/app/pages/index.vue
CHANGED
|
@@ -143,7 +143,7 @@ const router = useRouter()
|
|
|
143
143
|
function navigate(row: MessageGroupWithMessageSummary) {
|
|
144
144
|
trackEvent('message_edit', getMessageTrackingProps(row))
|
|
145
145
|
const type = row.messages[0]?.render_type === 'email_v1' ? 'email' : 'whatsapp'
|
|
146
|
-
router.push(
|
|
146
|
+
router.push({ name: `${type}-message-edit`, params: { id: row.id } })
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
const { t } = useI18n()
|
|
@@ -169,19 +169,15 @@ const tabItems = computed(() => {
|
|
|
169
169
|
</script>
|
|
170
170
|
|
|
171
171
|
<template>
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
<template #actions>
|
|
182
|
-
<CreateTemplateButton />
|
|
183
|
-
</template>
|
|
184
|
-
</SNavigationBarHeader>
|
|
172
|
+
<LayoutBasePage
|
|
173
|
+
:title="$t('pages.message_library.title')"
|
|
174
|
+
:tabs="tabItems.length > 1 ? tabItems : undefined"
|
|
175
|
+
:active-tab="renderType"
|
|
176
|
+
:test-id="homeTestIds.navbar"
|
|
177
|
+
@tab-change="renderType = $event"
|
|
178
|
+
>
|
|
179
|
+
<template #actions>
|
|
180
|
+
<CreateTemplateButton />
|
|
185
181
|
</template>
|
|
186
182
|
|
|
187
183
|
<BaseTable
|
|
@@ -194,5 +190,5 @@ const tabItems = computed(() => {
|
|
|
194
190
|
@publish="askPublishGroup"
|
|
195
191
|
@unpublish="askUnpublishGroup"
|
|
196
192
|
/>
|
|
197
|
-
</
|
|
193
|
+
</LayoutBasePage>
|
|
198
194
|
</template>
|
|
@@ -5,6 +5,11 @@ import { useRoute } from 'vue-router'
|
|
|
5
5
|
import { useI18n } from 'vue-i18n'
|
|
6
6
|
import { useMessageGroupQuery } from '~/queries/messageGroups'
|
|
7
7
|
|
|
8
|
+
definePageMeta({
|
|
9
|
+
name: 'message-preview',
|
|
10
|
+
layout: false,
|
|
11
|
+
})
|
|
12
|
+
|
|
8
13
|
const route = useRoute()
|
|
9
14
|
const { locale } = useI18n()
|
|
10
15
|
const { data: messageGroup } = useMessageGroupQuery(() => route.params.id as string)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
definePageMeta({
|
|
3
3
|
name: 'email-message-edit',
|
|
4
4
|
middleware: ['channel-guard'],
|
|
5
|
+
channel: 'email',
|
|
5
6
|
})
|
|
6
7
|
|
|
7
8
|
import EmailEditor from '@/components/Email/Editor/Index.vue'
|
|
@@ -412,55 +413,51 @@ watch(
|
|
|
412
413
|
</script>
|
|
413
414
|
|
|
414
415
|
<template>
|
|
415
|
-
<
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
:
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
:data-testid="templateEmailEditTestIds.saveTemplateButton"
|
|
461
|
-
/>
|
|
462
|
-
</template>
|
|
463
|
-
</SNavigationBarHeader>
|
|
416
|
+
<LayoutBasePage
|
|
417
|
+
:title="$t('pages.email.edit_message_group.title')"
|
|
418
|
+
:tabs="[
|
|
419
|
+
{
|
|
420
|
+
label: $t('pages.email.edit_message_group.tab_content'),
|
|
421
|
+
value: 'content',
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
label: $t('pages.email.edit_message_group.tab_translations'),
|
|
425
|
+
value: 'translations',
|
|
426
|
+
},
|
|
427
|
+
]"
|
|
428
|
+
:active-tab="activeTab"
|
|
429
|
+
:test-id="templateEmailEditTestIds.navbar"
|
|
430
|
+
@tab-change="activeTab = $event"
|
|
431
|
+
>
|
|
432
|
+
<template #actions>
|
|
433
|
+
<UButton
|
|
434
|
+
@click="
|
|
435
|
+
() => {
|
|
436
|
+
notifyParent('TEMPLATE_CANCELLED', { id: messageGroup?.id })
|
|
437
|
+
goBackOrFallback()
|
|
438
|
+
}
|
|
439
|
+
"
|
|
440
|
+
:label="$t('common.actions.cancel')"
|
|
441
|
+
color="primary"
|
|
442
|
+
variant="ghost"
|
|
443
|
+
:loading="saving || isTranslating"
|
|
444
|
+
:data-testid="templateEmailEditTestIds.cancelButton"
|
|
445
|
+
/>
|
|
446
|
+
<UButton
|
|
447
|
+
@click="handleSaveAsDraft"
|
|
448
|
+
:label="$t('pages.email.edit_message_group.save_as_draft')"
|
|
449
|
+
color="primary"
|
|
450
|
+
variant="outline"
|
|
451
|
+
:loading="saving || isTranslating"
|
|
452
|
+
:data-testid="templateEmailEditTestIds.saveDraftButton"
|
|
453
|
+
/>
|
|
454
|
+
<UButton
|
|
455
|
+
@click="handleSaveTemplate"
|
|
456
|
+
:label="$t('pages.email.edit_message_group.save_message')"
|
|
457
|
+
color="primary"
|
|
458
|
+
:loading="saving || isTranslating"
|
|
459
|
+
:data-testid="templateEmailEditTestIds.saveTemplateButton"
|
|
460
|
+
/>
|
|
464
461
|
</template>
|
|
465
462
|
|
|
466
463
|
<div v-if="validationErrors.length">
|
|
@@ -592,5 +589,5 @@ watch(
|
|
|
592
589
|
@translate-and-save="translateAndSave"
|
|
593
590
|
@go-to-translations="goToTranslations"
|
|
594
591
|
/>
|
|
595
|
-
</
|
|
592
|
+
</LayoutBasePage>
|
|
596
593
|
</template>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
definePageMeta({
|
|
3
|
+
name: 'email-message-create',
|
|
3
4
|
middleware: ['channel-guard'],
|
|
5
|
+
channel: 'email',
|
|
4
6
|
})
|
|
5
7
|
|
|
6
8
|
import EmailEditor from '@/components/Email/Editor/Index.vue'
|
|
@@ -375,55 +377,51 @@ async function translateAndSave() {
|
|
|
375
377
|
</script>
|
|
376
378
|
|
|
377
379
|
<template>
|
|
378
|
-
<
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
:
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
:data-testid="templateEmailCreateTestIds.saveTemplateButton"
|
|
424
|
-
/>
|
|
425
|
-
</template>
|
|
426
|
-
</SNavigationBarHeader>
|
|
380
|
+
<LayoutBasePage
|
|
381
|
+
:title="$t('pages.email.create_message_group.title')"
|
|
382
|
+
:tabs="[
|
|
383
|
+
{
|
|
384
|
+
label: $t('pages.email.create_message_group.tab_content'),
|
|
385
|
+
value: 'content',
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
label: $t('pages.email.create_message_group.tab_translations'),
|
|
389
|
+
value: 'translations',
|
|
390
|
+
},
|
|
391
|
+
]"
|
|
392
|
+
:active-tab="activeTab"
|
|
393
|
+
:test-id="templateEmailCreateTestIds.navbar"
|
|
394
|
+
@tab-change="activeTab = $event"
|
|
395
|
+
>
|
|
396
|
+
<template #actions>
|
|
397
|
+
<UButton
|
|
398
|
+
@click="
|
|
399
|
+
() => {
|
|
400
|
+
notifyParent('TEMPLATE_CANCELLED')
|
|
401
|
+
goBackOrFallback()
|
|
402
|
+
}
|
|
403
|
+
"
|
|
404
|
+
:label="$t('common.actions.cancel')"
|
|
405
|
+
color="primary"
|
|
406
|
+
variant="ghost"
|
|
407
|
+
:loading="saving || isTranslating"
|
|
408
|
+
:data-testid="templateEmailCreateTestIds.cancelButton"
|
|
409
|
+
/>
|
|
410
|
+
<UButton
|
|
411
|
+
@click="handleSaveAsDraft"
|
|
412
|
+
:label="$t('pages.email.create_message_group.save_as_draft')"
|
|
413
|
+
color="primary"
|
|
414
|
+
variant="outline"
|
|
415
|
+
:loading="saving || isTranslating"
|
|
416
|
+
:data-testid="templateEmailCreateTestIds.saveDraftButton"
|
|
417
|
+
/>
|
|
418
|
+
<UButton
|
|
419
|
+
@click="handleSaveTemplate"
|
|
420
|
+
:label="$t('pages.email.create_message_group.save_message')"
|
|
421
|
+
color="primary"
|
|
422
|
+
:loading="saving || isTranslating"
|
|
423
|
+
:data-testid="templateEmailCreateTestIds.saveTemplateButton"
|
|
424
|
+
/>
|
|
427
425
|
</template>
|
|
428
426
|
|
|
429
427
|
<div v-if="validationErrors.length">
|
|
@@ -558,5 +556,5 @@ async function translateAndSave() {
|
|
|
558
556
|
@translate-and-save="translateAndSave"
|
|
559
557
|
@go-to-translations="goToTranslations"
|
|
560
558
|
/>
|
|
561
|
-
</
|
|
559
|
+
</LayoutBasePage>
|
|
562
560
|
</template>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
definePageMeta({
|
|
3
3
|
name: 'whatsapp-message-edit',
|
|
4
4
|
middleware: ['channel-guard'],
|
|
5
|
+
channel: 'whatsapp',
|
|
5
6
|
})
|
|
6
7
|
|
|
7
8
|
import WhatsappEditorSyncWrapper from '@/components/Whatsapp/Editor/SyncWrapper.vue'
|
|
@@ -239,7 +240,7 @@ async function saveAsNew() {
|
|
|
239
240
|
const result = await createTemplate(templateData, 'draft')
|
|
240
241
|
if (result) {
|
|
241
242
|
notifyParent('TEMPLATE_SAVED_AS_NEW', { id: result.id, name: result.name })
|
|
242
|
-
navigateTo(
|
|
243
|
+
navigateTo({ name: 'whatsapp-message-edit', params: { id: result.id } }, { replace: true })
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
246
|
|
|
@@ -361,61 +362,58 @@ watch(
|
|
|
361
362
|
</script>
|
|
362
363
|
|
|
363
364
|
<template>
|
|
364
|
-
<
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
()
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
/>
|
|
417
|
-
</template>
|
|
418
|
-
</SNavigationBarHeader>
|
|
365
|
+
<LayoutBasePage
|
|
366
|
+
:title="$t('pages.whatsapp.edit_message_group.title')"
|
|
367
|
+
:tabs="[
|
|
368
|
+
{ label: $t('pages.whatsapp.tabs.content'), value: 'content' },
|
|
369
|
+
{ label: $t('pages.whatsapp.tabs.translations'), value: 'translations' },
|
|
370
|
+
]"
|
|
371
|
+
:active-tab="activeTab"
|
|
372
|
+
:test-id="templateWhatsappEditTestIds.navbar"
|
|
373
|
+
@tab-change="activeTab = $event"
|
|
374
|
+
>
|
|
375
|
+
<template #actions>
|
|
376
|
+
<template v-if="messageGroup">
|
|
377
|
+
<UButton
|
|
378
|
+
@click="
|
|
379
|
+
() => {
|
|
380
|
+
notifyParent('TEMPLATE_CANCELLED', { id: messageGroup?.id })
|
|
381
|
+
goBackOrFallback()
|
|
382
|
+
}
|
|
383
|
+
"
|
|
384
|
+
:label="$t('common.actions.cancel')"
|
|
385
|
+
color="primary"
|
|
386
|
+
variant="ghost"
|
|
387
|
+
:loading="saving || isTranslating"
|
|
388
|
+
:data-testid="templateWhatsappEditTestIds.cancelButton"
|
|
389
|
+
/>
|
|
390
|
+
<UButton
|
|
391
|
+
v-if="isPending || isApproved"
|
|
392
|
+
@click="handleSaveAsNew()"
|
|
393
|
+
:label="$t('pages.whatsapp.create_message_group.save_as_new')"
|
|
394
|
+
color="secondary"
|
|
395
|
+
variant="outline"
|
|
396
|
+
:loading="saving || isTranslating"
|
|
397
|
+
:data-testid="templateWhatsappEditTestIds.saveAsNewButton"
|
|
398
|
+
/>
|
|
399
|
+
<UButton
|
|
400
|
+
v-else
|
|
401
|
+
@click="handleSaveDraft()"
|
|
402
|
+
:label="$t('pages.whatsapp.create_message_group.save_draft')"
|
|
403
|
+
color="secondary"
|
|
404
|
+
variant="outline"
|
|
405
|
+
:loading="saving || isTranslating"
|
|
406
|
+
:data-testid="templateWhatsappEditTestIds.saveDraftButton"
|
|
407
|
+
/>
|
|
408
|
+
<UButton
|
|
409
|
+
v-if="!isPending && !isApproved"
|
|
410
|
+
@click="handleRequestApproval()"
|
|
411
|
+
:label="$t('pages.whatsapp.create_message_group.request_approval')"
|
|
412
|
+
color="primary"
|
|
413
|
+
:loading="saving || isTranslating"
|
|
414
|
+
:data-testid="templateWhatsappEditTestIds.requestApprovalButton"
|
|
415
|
+
/>
|
|
416
|
+
</template>
|
|
419
417
|
</template>
|
|
420
418
|
|
|
421
419
|
<div v-if="validationErrors.length">
|
|
@@ -557,5 +555,5 @@ watch(
|
|
|
557
555
|
@translate-and-save="translateAndSave"
|
|
558
556
|
@go-to-translations="goToTranslations"
|
|
559
557
|
/>
|
|
560
|
-
</
|
|
558
|
+
</LayoutBasePage>
|
|
561
559
|
</template>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
definePageMeta({
|
|
3
|
+
name: 'whatsapp-message-create',
|
|
3
4
|
middleware: ['channel-guard'],
|
|
5
|
+
channel: 'whatsapp',
|
|
4
6
|
})
|
|
5
7
|
|
|
6
8
|
import WhatsappEditorSyncWrapper from '@/components/Whatsapp/Editor/SyncWrapper.vue'
|
|
@@ -275,49 +277,45 @@ async function translateAndSave() {
|
|
|
275
277
|
</script>
|
|
276
278
|
|
|
277
279
|
<template>
|
|
278
|
-
<
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
:data-testid="templateWhatsappCreateTestIds.requestApprovalButton"
|
|
318
|
-
/>
|
|
319
|
-
</template>
|
|
320
|
-
</SNavigationBarHeader>
|
|
280
|
+
<LayoutBasePage
|
|
281
|
+
:title="$t('pages.whatsapp.create_message_group.title')"
|
|
282
|
+
:tabs="[
|
|
283
|
+
{ label: $t('pages.whatsapp.tabs.content'), value: 'content' },
|
|
284
|
+
{ label: $t('pages.whatsapp.tabs.translations'), value: 'translations' },
|
|
285
|
+
]"
|
|
286
|
+
:active-tab="activeTab"
|
|
287
|
+
:test-id="templateWhatsappCreateTestIds.navbar"
|
|
288
|
+
@tab-change="activeTab = $event"
|
|
289
|
+
>
|
|
290
|
+
<template #actions>
|
|
291
|
+
<UButton
|
|
292
|
+
@click="
|
|
293
|
+
() => {
|
|
294
|
+
notifyParent('TEMPLATE_CANCELLED')
|
|
295
|
+
goBackOrFallback()
|
|
296
|
+
}
|
|
297
|
+
"
|
|
298
|
+
:label="$t('common.actions.cancel')"
|
|
299
|
+
color="primary"
|
|
300
|
+
variant="ghost"
|
|
301
|
+
:loading="saving || isTranslating"
|
|
302
|
+
:data-testid="templateWhatsappCreateTestIds.cancelButton"
|
|
303
|
+
/>
|
|
304
|
+
<UButton
|
|
305
|
+
@click="handleSaveDraft()"
|
|
306
|
+
:label="$t('pages.whatsapp.create_message_group.save_draft')"
|
|
307
|
+
color="primary"
|
|
308
|
+
variant="outline"
|
|
309
|
+
:loading="saving || isTranslating"
|
|
310
|
+
:data-testid="templateWhatsappCreateTestIds.saveDraftButton"
|
|
311
|
+
/>
|
|
312
|
+
<UButton
|
|
313
|
+
@click="handleRequestApproval()"
|
|
314
|
+
:label="$t('pages.whatsapp.create_message_group.request_approval')"
|
|
315
|
+
color="primary"
|
|
316
|
+
:loading="saving || isTranslating"
|
|
317
|
+
:data-testid="templateWhatsappCreateTestIds.requestApprovalButton"
|
|
318
|
+
/>
|
|
321
319
|
</template>
|
|
322
320
|
|
|
323
321
|
<div v-if="validationErrors.length">
|
|
@@ -464,5 +462,5 @@ async function translateAndSave() {
|
|
|
464
462
|
@translate-and-save="translateAndSave"
|
|
465
463
|
@go-to-translations="goToTranslations"
|
|
466
464
|
/>
|
|
467
|
-
</
|
|
465
|
+
</LayoutBasePage>
|
|
468
466
|
</template>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev.smartpricing/message-composer-layer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"vue-router": "^5.0.6",
|
|
40
40
|
"vue3-emoji-picker": "^1.1.8",
|
|
41
41
|
"zod": "^4.4.1",
|
|
42
|
-
"@dev.smartpricing/message-composer-utils": "3.1.
|
|
42
|
+
"@dev.smartpricing/message-composer-utils": "3.1.13"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@nuxt/eslint": "^1.15.2",
|