Merge branch 'dev' into 8673-viewEntryNotesField
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Benjamin Esteve 2025-03-26 08:11:07 +00:00
commit 22deec8c40
1 changed files with 15 additions and 11 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>