@dev.smartpricing/message-composer-layer 4.2.9-ux.0 → 4.2.10

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.
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
- import type { RenderType, MessageStatus } from '@dev.smartpricing/message-composer-utils/types'
2
+ import type { RenderType } from '@dev.smartpricing/message-composer-utils/types'
3
3
  import { useMessageGroupsQuery } from '~/queries/messageGroups'
4
4
 
5
- defineOptions({ name: 'MessageGroupSelect' })
5
+ defineOptions({ name: 'TemplateSelect' })
6
6
 
7
7
  const props = withDefaults(
8
8
  defineProps<{
@@ -11,7 +11,7 @@ const props = withDefaults(
11
11
  searchPlaceholder?: string
12
12
  }>(),
13
13
  {
14
- placeholder: 'Select a message group',
14
+ placeholder: 'Select a template',
15
15
  searchPlaceholder: 'Search...',
16
16
  },
17
17
  )
@@ -22,38 +22,16 @@ const emit = defineEmits<{
22
22
  select: [item: { id: string; name: string }]
23
23
  }>()
24
24
 
25
- const { t } = useI18n()
26
-
27
25
  const { data: messageGroups, isLoading } = useMessageGroupsQuery(() => ({
28
26
  renderType: props.renderType,
29
27
  }))
30
28
 
31
- const hideInactive = ref(false)
32
-
33
- function isGroupActive(messages: Array<{ status: MessageStatus }>): boolean {
34
- return messages.length > 0 && messages.every((m) => m.status === 'approved')
35
- }
36
-
37
29
  const items = computed(() => {
38
30
  if (!messageGroups.value) return []
39
- return messageGroups.value.reduce<
40
- Array<{
41
- label: string
42
- value: string
43
- disabled: boolean
44
- chip: { color: 'success' | 'neutral' }
45
- }>
46
- >((acc, group) => {
47
- const active = isGroupActive(group.messages)
48
- if (hideInactive.value && !active) return acc
49
- acc.push({
50
- label: group.name,
51
- value: group.id,
52
- disabled: !active,
53
- chip: { color: active ? 'success' : 'neutral' },
54
- })
55
- return acc
56
- }, [])
31
+ return messageGroups.value.map((group) => ({
32
+ label: group.name,
33
+ value: group.id,
34
+ }))
57
35
  })
58
36
 
59
37
  function handleUpdate(value: string) {
@@ -72,21 +50,7 @@ function handleUpdate(value: string) {
72
50
  searchable
73
51
  :placeholder="placeholder"
74
52
  :search-input="{ placeholder: searchPlaceholder }"
75
- :data-testid="messageGroupSelectTestIds.root"
53
+ :data-testid="templateSelectTestIds.root"
76
54
  @update:model-value="handleUpdate"
77
- >
78
- <template #item-label="{ item }">
79
- <UTooltip v-if="item.disabled" :text="t('common.messageGroupSelect.inactive_tooltip')">
80
- <span class="text-muted">{{ item.label }}</span>
81
- </UTooltip>
82
- <span v-else>{{ item.label }}</span>
83
- </template>
84
-
85
- <template #content-top>
86
- <div class="flex items-center gap-2 px-2 py-1.5 border-b border-default">
87
- <USwitch v-model="hideInactive" size="xs" />
88
- <span class="text-xs text-muted">{{ t('common.messageGroupSelect.hide_inactive') }}</span>
89
- </div>
90
- </template>
91
- </USelectMenu>
55
+ />
92
56
  </template>
@@ -738,9 +738,6 @@ export const previewByIdTestIds = {
738
738
  loading: 'preview-by-id-loading',
739
739
  } as const
740
740
 
741
- export const messageGroupSelectTestIds = {
742
- root: 'message-group-select-root',
741
+ export const templateSelectTestIds = {
742
+ root: 'template-select-root',
743
743
  } as const
744
-
745
- /** @deprecated Use `messageGroupSelectTestIds` instead */
746
- export const templateSelectTestIds = messageGroupSelectTestIds
@@ -54,11 +54,6 @@ export default {
54
54
  search: 'Suchen...',
55
55
  success: 'Erfolg',
56
56
  translation_failed: 'Übersetzung fehlgeschlagen',
57
- messageGroupSelect: {
58
- inactive_tooltip:
59
- 'Diese Nachrichtengruppe enthält nicht genehmigte oder fehlende Nachrichten',
60
- hide_inactive: 'Inaktive ausblenden',
61
- },
62
57
  view_less: 'Weniger anzeigen',
63
58
  view_more: 'Mehr anzeigen',
64
59
  },
@@ -668,6 +663,7 @@ export default {
668
663
  button_bg_color: 'Hintergrund',
669
664
  button_text_color: 'Text',
670
665
  change_logo: 'Logo ändern',
666
+ colors: 'Farben',
671
667
  contact_address: 'Adresse',
672
668
  contact_address_placeholder: 'Z.B. Via Roma 1, 39100 Bolzano',
673
669
  contact_email: 'E-Mail',
@@ -678,7 +674,6 @@ export default {
678
674
  contact_telephone_placeholder: 'Z.B. +39 0471 123456',
679
675
  contact_website: 'Webseite',
680
676
  contact_website_placeholder: 'Z.B. https://www.hotel.com',
681
- colors: 'Farben',
682
677
  default_button_colors: 'Standard-Schaltflächen-Farben',
683
678
  default_email_colors: 'Standard-E-Mail-Farben',
684
679
  default_font: 'Standardschriftart',
@@ -53,10 +53,6 @@ export default {
53
53
  search: 'Search...',
54
54
  success: 'Success',
55
55
  translation_failed: 'Translation failed',
56
- messageGroupSelect: {
57
- inactive_tooltip: 'This message group has unapproved or missing messages',
58
- hide_inactive: 'Hide inactive',
59
- },
60
56
  view_less: 'View less',
61
57
  view_more: 'View more',
62
58
  },
@@ -657,6 +653,7 @@ export default {
657
653
  button_bg_color: 'Background',
658
654
  button_text_color: 'Text',
659
655
  change_logo: 'Change logo',
656
+ colors: 'Brand colors',
660
657
  contact_address: 'Address',
661
658
  contact_address_placeholder: 'E.g. Via Roma 1, 39100 Bolzano',
662
659
  contact_email: 'Email',
@@ -667,7 +664,6 @@ export default {
667
664
  contact_telephone_placeholder: 'E.g. +39 0471 123456',
668
665
  contact_website: 'Website',
669
666
  contact_website_placeholder: 'E.g. https://www.hotel.com',
670
- colors: 'Brand colors',
671
667
  default_button_colors: 'Default button colors',
672
668
  default_email_colors: 'Default email colors',
673
669
  default_font: 'Default font',
@@ -54,10 +54,6 @@ export default {
54
54
  search: 'Buscar...',
55
55
  success: 'Éxito',
56
56
  translation_failed: 'La traducción ha fallado',
57
- messageGroupSelect: {
58
- inactive_tooltip: 'Este grupo de mensajes tiene mensajes no aprobados o faltantes',
59
- hide_inactive: 'Ocultar inactivos',
60
- },
61
57
  view_less: 'Ver menos',
62
58
  view_more: 'Ver más',
63
59
  },
@@ -666,6 +662,7 @@ export default {
666
662
  button_bg_color: 'Fondo',
667
663
  button_text_color: 'Texto',
668
664
  change_logo: 'Cambiar logo',
665
+ colors: 'Colores',
669
666
  contact_address: 'Dirección',
670
667
  contact_address_placeholder: 'Ej. Via Roma 1, 39100 Bolzano',
671
668
  contact_email: 'Email',
@@ -676,7 +673,6 @@ export default {
676
673
  contact_telephone_placeholder: 'Ej. +39 0471 123456',
677
674
  contact_website: 'Sitio web',
678
675
  contact_website_placeholder: 'Ej. https://www.hotel.com',
679
- colors: 'Colores',
680
676
  default_button_colors: 'Colores de botón predeterminados',
681
677
  default_email_colors: 'Colores de correo predeterminados',
682
678
  default_font: 'Fuente predeterminada',
@@ -54,10 +54,6 @@ export default {
54
54
  search: 'Rechercher...',
55
55
  success: 'Succès',
56
56
  translation_failed: 'Échec de la traduction',
57
- messageGroupSelect: {
58
- inactive_tooltip: 'Ce groupe de messages contient des messages non approuvés ou manquants',
59
- hide_inactive: 'Masquer inactifs',
60
- },
61
57
  view_less: 'Afficher moins',
62
58
  view_more: 'Afficher plus',
63
59
  },
@@ -670,6 +666,7 @@ export default {
670
666
  button_bg_color: 'Fond',
671
667
  button_text_color: 'Texte',
672
668
  change_logo: 'Changer le logo',
669
+ colors: 'Couleurs',
673
670
  contact_address: 'Adresse',
674
671
  contact_address_placeholder: 'Ex. Via Roma 1, 39100 Bolzano',
675
672
  contact_email: 'Email',
@@ -680,7 +677,6 @@ export default {
680
677
  contact_telephone_placeholder: 'Ex. +39 0471 123456',
681
678
  contact_website: 'Site web',
682
679
  contact_website_placeholder: 'Ex. https://www.hotel.com',
683
- colors: 'Couleurs',
684
680
  default_button_colors: 'Couleurs de bouton par défaut',
685
681
  default_email_colors: "Couleurs d'e-mail par défaut",
686
682
  default_font: 'Police par défaut',
@@ -53,10 +53,6 @@ export default {
53
53
  search: 'Cerca...',
54
54
  success: 'Successo',
55
55
  translation_failed: 'Traduzione non riuscita',
56
- messageGroupSelect: {
57
- inactive_tooltip: 'Questo gruppo di messaggi contiene messaggi non approvati o mancanti',
58
- hide_inactive: 'Nascondi inattivi',
59
- },
60
56
  view_less: 'Mostra meno',
61
57
  view_more: 'Mostra di più',
62
58
  },
@@ -663,6 +659,7 @@ export default {
663
659
  button_bg_color: 'Sfondo',
664
660
  button_text_color: 'Testo',
665
661
  change_logo: 'Cambia logo',
662
+ colors: 'Colori',
666
663
  contact_address: 'Indirizzo',
667
664
  contact_address_placeholder: 'Es. Via Roma 1, 39100 Bolzano',
668
665
  contact_email: 'Email',
@@ -673,7 +670,6 @@ export default {
673
670
  contact_telephone_placeholder: 'Es. +39 0471 123456',
674
671
  contact_website: 'Sito web',
675
672
  contact_website_placeholder: 'Es. https://www.hotel.com',
676
- colors: 'Colori',
677
673
  default_button_colors: 'Colori pulsante predefiniti',
678
674
  default_email_colors: 'Colori email predefiniti',
679
675
  default_font: 'Font predefinito',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev.smartpricing/message-composer-layer",
3
- "version": "4.2.9-ux.0",
3
+ "version": "4.2.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -36,7 +36,7 @@
36
36
  "vue-router": "^5.0.7",
37
37
  "vue3-emoji-picker": "^1.1.8",
38
38
  "zod": "^4.4.3",
39
- "@dev.smartpricing/message-composer-utils": "4.2.9-ux.0"
39
+ "@dev.smartpricing/message-composer-utils": "4.2.10"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@nuxt/eslint": "^1.15.2",