Merge branch 'dev' into 8717-reviewAndFixAgencySection
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jose Antonio Tubau 2025-03-26 08:38:49 +00:00
commit 1e89bdfe95
4 changed files with 36 additions and 28 deletions

View File

@ -1,15 +1,15 @@
<script setup> <script setup>
import {useDialogPluginComponent} from 'quasar'; import { useDialogPluginComponent } from 'quasar';
import {useI18n} from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import {computed, ref} from 'vue'; import { computed, ref } from 'vue';
import VnInput from 'components/common/VnInput.vue'; import VnInput from 'components/common/VnInput.vue';
import axios from 'axios'; import axios from 'axios';
import useNotify from "composables/useNotify"; import useNotify from 'composables/useNotify';
const MESSAGE_MAX_LENGTH = 160; const MESSAGE_MAX_LENGTH = 160;
const {t} = useI18n(); const { t } = useI18n();
const {notify} = useNotify(); const { notify } = useNotify();
const props = defineProps({ const props = defineProps({
title: { title: {
type: String, type: String,
@ -34,7 +34,7 @@ const props = defineProps({
}); });
const emit = defineEmits([...useDialogPluginComponent.emits, 'sent']); const emit = defineEmits([...useDialogPluginComponent.emits, 'sent']);
const {dialogRef, onDialogHide} = useDialogPluginComponent(); const { dialogRef, onDialogHide } = useDialogPluginComponent();
const smsRules = [ const smsRules = [
(val) => (val && val.length > 0) || t("The message can't be empty"), (val) => (val && val.length > 0) || t("The message can't be empty"),
@ -43,10 +43,10 @@ const smsRules = [
t("The message it's too long"), t("The message it's too long"),
]; ];
const message = ref(''); const message = ref(t('routeDelay'));
const charactersRemaining = computed( const charactersRemaining = computed(
() => MESSAGE_MAX_LENGTH - new Blob([message.value]).size () => MESSAGE_MAX_LENGTH - new Blob([message.value]).size,
); );
const charactersChipColor = computed(() => { const charactersChipColor = computed(() => {
@ -114,7 +114,7 @@ const onSubmit = async () => {
<QTooltip> <QTooltip>
{{ {{
t( t(
'Special characters like accents counts as a multiple' 'Special characters like accents counts as a multiple',
) )
}} }}
</QTooltip> </QTooltip>
@ -144,7 +144,10 @@ const onSubmit = async () => {
max-width: 450px; max-width: 450px;
} }
</style> </style>
<i18n> <i18n>
en:
routeDelay: "Your order has been delayed in transit.\nDelivery will take place throughout the day.\nWe apologize for the inconvenience and appreciate your patience."
es: es:
Message: Mensaje Message: Mensaje
Send: Enviar Send: Enviar
@ -153,4 +156,5 @@ es:
The destination can't be empty: El destinatario no puede estar vacio The destination can't be empty: El destinatario no puede estar vacio
The message can't be empty: El mensaje no puede estar vacio The message can't be empty: El mensaje no puede estar vacio
The message it's too long: El mensaje es demasiado largo The message it's too long: El mensaje es demasiado largo
</i18n> routeDelay: "Retraso en ruta.\nInformamos que la ruta que lleva su pedido ha sufrido un retraso y la entrega se hará a lo largo del día.\nDisculpe las molestias."
</i18n>

View File

@ -561,9 +561,7 @@ watch(
}}: }}:
</span> </span>
<VnLogValue <VnLogValue
:value=" :value="value.val"
value.val.val
"
:name="value.name" :name="value.name"
/> />
</QItem> </QItem>
@ -616,7 +614,7 @@ watch(
{{ prop.nameI18n }}: {{ prop.nameI18n }}:
</span> </span>
<VnLogValue <VnLogValue
:value="prop.val.val" :value="prop.val"
:name="prop.name" :name="prop.name"
/> />
<span <span
@ -647,7 +645,7 @@ watch(
</span> </span>
<span v-if="log.action == 'update'"> <span v-if="log.action == 'update'">
<VnLogValue <VnLogValue
:value="prop.old.val" :value="prop.old"
:name="prop.name" :name="prop.name"
/> />
<span <span
@ -658,7 +656,7 @@ watch(
</span> </span>
<VnLogValue <VnLogValue
:value="prop.val.val" :value="prop.val"
:name="prop.name" :name="prop.name"
/> />
<span <span
@ -670,7 +668,7 @@ watch(
</span> </span>
<span v-else="prop.old.val"> <span v-else="prop.old.val">
<VnLogValue <VnLogValue
:value="prop.val.val" :value="prop.val"
:name="prop.name" :name="prop.name"
/> />
<span <span

View File

@ -5,18 +5,24 @@ import { computed } from 'vue';
const descriptorStore = useDescriptorStore(); const descriptorStore = useDescriptorStore();
const $props = defineProps({ const $props = defineProps({
name: { type: [String], default: undefined }, value: { type: Object, default: () => {} },
name: { type: String, default: undefined },
}); });
const descriptor = computed(() => descriptorStore.has($props.name)); const descriptor = computed(() => descriptorStore.has($props.name));
</script> </script>
<template> <template>
<VnJsonValue v-bind="$attrs" /> <VnJsonValue :value="value.val" />
<QIcon <span
name="launch" v-if="(value.id || typeof value.val == 'number') && descriptor"
class="link" style="margin-left: 2px"
v-if="$attrs.value && descriptor" >
:data-cy="'iconLaunch-' + $props.name" <QIcon
/> name="launch"
<component :is="descriptor" :id="$attrs.value" v-if="$attrs.value && descriptor" /> class="link"
:data-cy="'iconLaunch-' + $props.name"
style="padding-bottom: 2px"
/>
<component :is="descriptor" :id="value.id ?? value.val" />
</span>
</template> </template>

View File

@ -11,7 +11,7 @@ export const useDescriptorStore = defineStore('descriptorStore', () => {
const files = import.meta.glob(`/src/**/*DescriptorProxy.vue`); const files = import.meta.glob(`/src/**/*DescriptorProxy.vue`);
const moduleParser = { const moduleParser = {
account: 'user', account: 'user',
client: 'customer', customer: 'client',
}; };
for (const file in files) { for (const file in files) {
const name = file.split('/').at(-1).slice(0, -19).toLowerCase(); const name = file.split('/').at(-1).slice(0, -19).toLowerCase();