@dev.smartpricing/message-composer-layer 4.2.6-brands.1 → 4.2.6-brands.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.
@@ -26,13 +26,21 @@ const takenPropertyMap = computed(() => {
26
26
  return map
27
27
  })
28
28
 
29
+ const hasRestrictedProperties = computed(() =>
30
+ (properties.value ?? []).some((p: Property) => !p.hasAccess),
31
+ )
32
+
29
33
  const propertyItems = computed(() =>
30
- (properties.value ?? []).map((p: Property) => ({
31
- label: p.name,
32
- value: p.id,
33
- disabled: takenPropertyMap.value.has(p.id),
34
- takenByBrand: takenPropertyMap.value.get(p.id),
35
- })),
34
+ (properties.value ?? []).map((p: Property) => {
35
+ const takenBy = takenPropertyMap.value.get(p.id)
36
+ return {
37
+ label: p.name,
38
+ value: p.id,
39
+ disabled: !p.hasAccess || !!takenBy,
40
+ takenByBrand: takenBy,
41
+ noAccess: !p.hasAccess,
42
+ }
43
+ }),
36
44
  )
37
45
  </script>
38
46
 
@@ -46,6 +54,13 @@ const propertyItems = computed(() =>
46
54
  </UFormField>
47
55
 
48
56
  <UFormField :label="$t('pages.brands.fields.properties')">
57
+ <UAlert
58
+ v-if="hasRestrictedProperties"
59
+ :description="$t('pages.brands.fields.properties_access_hint')"
60
+ color="neutral"
61
+ variant="subtle"
62
+ class="mb-2"
63
+ />
49
64
  <USelectMenu
50
65
  v-model="selectedPropertyIds"
51
66
  :items="propertyItems"
@@ -55,8 +70,13 @@ const propertyItems = computed(() =>
55
70
  class="w-full"
56
71
  >
57
72
  <template #item-label="{ item }">
73
+ <UTooltip v-if="item.noAccess" :text="t('pages.brands.fields.property_no_access_tooltip')">
74
+ <span class="text-muted">
75
+ {{ item.label }}
76
+ </span>
77
+ </UTooltip>
58
78
  <UTooltip
59
- v-if="item.disabled"
79
+ v-else-if="item.disabled"
60
80
  :text="t('pages.brands.fields.property_taken_tooltip', { brand: item.takenByBrand })"
61
81
  >
62
82
  <span class="text-muted">
@@ -676,7 +676,10 @@ export default {
676
676
  name: 'Name',
677
677
  name_placeholder: 'Markennamen eingeben',
678
678
  properties: 'Unterkünfte',
679
+ properties_access_hint:
680
+ 'Nur Unterkünfte, auf die Sie Zugriff haben, können zugewiesen werden. Jede Unterkunft kann nur einer Marke zugeordnet sein.',
679
681
  properties_placeholder: 'Unterkünfte auswählen',
682
+ property_no_access_tooltip: 'Sie haben keinen Zugriff auf diese Unterkunft',
680
683
  property_taken_tooltip: 'Bereits mit „{brand}" verknüpft',
681
684
  upload_logo: 'Logo hochladen',
682
685
  },
@@ -667,7 +667,10 @@ export default {
667
667
  name: 'Brand name',
668
668
  name_placeholder: 'E.g. Smartness',
669
669
  properties: 'Properties',
670
+ properties_access_hint:
671
+ 'Only properties you have access to can be assigned. Each property can only belong to one brand.',
670
672
  properties_placeholder: 'Select properties',
673
+ property_no_access_tooltip: "You don't have access to this property",
671
674
  property_taken_tooltip: 'Already linked to "{brand}"',
672
675
  upload_logo: 'Upload logo',
673
676
  },
@@ -675,7 +675,10 @@ export default {
675
675
  name: 'Nombre',
676
676
  name_placeholder: 'Introduce el nombre de la marca',
677
677
  properties: 'Propiedades',
678
+ properties_access_hint:
679
+ 'Solo puedes asignar propiedades a las que tengas acceso. Cada propiedad solo puede pertenecer a una marca.',
678
680
  properties_placeholder: 'Seleccionar propiedades',
681
+ property_no_access_tooltip: 'No tienes acceso a esta propiedad',
679
682
  property_taken_tooltip: 'Ya vinculada a "{brand}"',
680
683
  upload_logo: 'Subir logo',
681
684
  },
@@ -679,7 +679,10 @@ export default {
679
679
  name: 'Nom',
680
680
  name_placeholder: 'Saisir le nom de la marque',
681
681
  properties: 'Établissements',
682
+ properties_access_hint:
683
+ "Seuls les établissements auxquels vous avez accès peuvent être attribués. Chaque établissement ne peut appartenir qu'à une seule marque.",
682
684
  properties_placeholder: 'Sélectionner les établissements',
685
+ property_no_access_tooltip: "Vous n'avez pas accès à cet établissement",
683
686
  property_taken_tooltip: 'Déjà associé à « {brand} »',
684
687
  upload_logo: 'Importer le logo',
685
688
  },
@@ -673,7 +673,10 @@ export default {
673
673
  name: 'Nome',
674
674
  name_placeholder: 'Inserisci il nome del brand',
675
675
  properties: 'Strutture',
676
+ properties_access_hint:
677
+ 'Puoi assegnare solo le strutture a cui hai accesso. Ogni struttura può appartenere a un solo brand.',
676
678
  properties_placeholder: 'Seleziona le strutture',
679
+ property_no_access_tooltip: 'Non hai accesso a questa struttura',
677
680
  property_taken_tooltip: 'Già collegata a "{brand}"',
678
681
  upload_logo: 'Carica logo',
679
682
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev.smartpricing/message-composer-layer",
3
- "version": "4.2.6-brands.1",
3
+ "version": "4.2.6-brands.2",
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.6-brands.1"
39
+ "@dev.smartpricing/message-composer-utils": "4.2.6-brands.2"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@nuxt/eslint": "^1.15.2",