Merge branch 'dev' into 8655-scrollUpButton
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
5b3ef29294
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-front",
|
"name": "salix-front",
|
||||||
"version": "25.16.0",
|
"version": "25.18.0",
|
||||||
"description": "Salix frontend",
|
"description": "Salix frontend",
|
||||||
"productName": "Salix",
|
"productName": "Salix",
|
||||||
"author": "Verdnatura",
|
"author": "Verdnatura",
|
||||||
|
@ -89,4 +89,4 @@
|
||||||
"vite": "^6.0.11",
|
"vite": "^6.0.11",
|
||||||
"vitest": "^0.31.1"
|
"vitest": "^0.31.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -232,7 +232,7 @@ fr:
|
||||||
pt: Portugais
|
pt: Portugais
|
||||||
pt:
|
pt:
|
||||||
Send SMS: Enviar SMS
|
Send SMS: Enviar SMS
|
||||||
CustomerDefaultLanguage: Este cliente utiliza o <strong>{locale}</strong> como seu idioma padrão
|
CustomerDefaultLanguage: Este cliente utiliza o {locale} como seu idioma padrão
|
||||||
Language: Linguagem
|
Language: Linguagem
|
||||||
Phone: Móvel
|
Phone: Móvel
|
||||||
Subject: Assunto
|
Subject: Assunto
|
||||||
|
|
|
@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { QBtn, useQuasar } from 'quasar';
|
import { QBtn, useQuasar } from 'quasar';
|
||||||
|
|
||||||
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
|
||||||
import { toDateTimeFormat } from 'src/filters/date';
|
import { toDateTimeFormat } from 'src/filters/date';
|
||||||
import VnTable from 'src/components/VnTable/VnTable.vue';
|
import VnTable from 'src/components/VnTable/VnTable.vue';
|
||||||
|
@ -74,12 +73,11 @@ const tableRef = ref();
|
||||||
<template>
|
<template>
|
||||||
<VnTable
|
<VnTable
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
data-key="ClientSamples"
|
data-key="CustomerSamples"
|
||||||
auto-load
|
auto-load
|
||||||
:filter="filter"
|
:user-filter="filter"
|
||||||
url="ClientSamples"
|
url="ClientSamples"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="{ rowsPerPage: 12 }"
|
|
||||||
:disable-option="{ card: true }"
|
:disable-option="{ card: true }"
|
||||||
:right-search="false"
|
:right-search="false"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
|
|
|
@ -42,7 +42,11 @@ const groupedStates = ref([]);
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
||||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
<VnFilterPanel
|
||||||
|
:data-key="props.dataKey"
|
||||||
|
:search-button="true"
|
||||||
|
:unremovableParams="['from', 'to']"
|
||||||
|
>
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
||||||
|
|
|
@ -68,7 +68,7 @@ const arrayData = useArrayData('ZoneEvents');
|
||||||
const exclusionGeoCreate = async () => {
|
const exclusionGeoCreate = async () => {
|
||||||
const params = {
|
const params = {
|
||||||
zoneFk: parseInt(route.params.id),
|
zoneFk: parseInt(route.params.id),
|
||||||
date: dated,
|
date: dated.value,
|
||||||
geoIds: tickedNodes.value,
|
geoIds: tickedNodes.value,
|
||||||
};
|
};
|
||||||
await axios.post('Zones/exclusionGeo', params);
|
await axios.post('Zones/exclusionGeo', params);
|
||||||
|
@ -101,9 +101,17 @@ const exclusionCreate = async () => {
|
||||||
const existsEvent = data.events.find(
|
const existsEvent = data.events.find(
|
||||||
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
|
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
|
||||||
);
|
);
|
||||||
|
const existsGeoEvent = data.geoExclusions.find(
|
||||||
|
(event) => toDateFormat(event.dated) === toDateFormat(dated.value),
|
||||||
|
);
|
||||||
if (existsEvent) {
|
if (existsEvent) {
|
||||||
await axios.delete(`Zones/${existsEvent?.zoneFk}/events/${existsEvent?.id}`);
|
await axios.delete(`Zones/${existsEvent?.zoneFk}/events/${existsEvent?.id}`);
|
||||||
}
|
}
|
||||||
|
if (existsGeoEvent) {
|
||||||
|
await axios.delete(
|
||||||
|
`Zones/${existsGeoEvent?.zoneFk}/exclusions/${existsGeoEvent?.zoneExclusionFk}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (isNew.value || props.event?.type) await axios.post(`${url}`, [body]);
|
if (isNew.value || props.event?.type) await axios.post(`${url}`, [body]);
|
||||||
else await axios.put(`${url}/${props.event?.id}`, body);
|
else await axios.put(`${url}/${props.event?.id}`, body);
|
||||||
|
@ -122,8 +130,21 @@ const onSubmit = async () => {
|
||||||
|
|
||||||
const deleteEvent = async () => {
|
const deleteEvent = async () => {
|
||||||
if (!props.event) return;
|
if (!props.event) return;
|
||||||
const exclusionId = props.event?.zoneExclusionFk || props.event?.id;
|
if (!props.event.created) {
|
||||||
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`);
|
const filter = {
|
||||||
|
where: {
|
||||||
|
dated: dated.value,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const params = { filter: JSON.stringify(filter) };
|
||||||
|
const { data: res } = await axios.get(`Zones/${route.params.id}/exclusions`, {
|
||||||
|
params,
|
||||||
|
});
|
||||||
|
if (res) await axios.delete(`Zones/${route.params.id}/exclusions/${res[0].id}`);
|
||||||
|
} else {
|
||||||
|
const exclusionId = props.event?.zoneExclusionFk || props.event?.id;
|
||||||
|
await axios.delete(`Zones/${route.params.id}/exclusions/${exclusionId}`);
|
||||||
|
}
|
||||||
await refetchEvents();
|
await refetchEvents();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -135,7 +156,7 @@ const refetchEvents = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.event) {
|
if (props.event && props.event.dated) {
|
||||||
dated.value = props.event?.dated;
|
dated.value = props.event?.dated;
|
||||||
excludeType.value =
|
excludeType.value =
|
||||||
props.eventType === 'geoExclusion' ? 'specificLocations' : 'all';
|
props.eventType === 'geoExclusion' ? 'specificLocations' : 'all';
|
||||||
|
|
|
@ -56,6 +56,7 @@ const isNew = computed(() => props.isNewMode);
|
||||||
const eventInclusionFormData = ref({ wdays: [] });
|
const eventInclusionFormData = ref({ wdays: [] });
|
||||||
const dated = ref(props.date || Date.vnNew());
|
const dated = ref(props.date || Date.vnNew());
|
||||||
const _inclusionType = ref('indefinitely');
|
const _inclusionType = ref('indefinitely');
|
||||||
|
const hasDeletedEvent = ref(false);
|
||||||
const inclusionType = computed({
|
const inclusionType = computed({
|
||||||
get: () => _inclusionType.value,
|
get: () => _inclusionType.value,
|
||||||
set: (val) => {
|
set: (val) => {
|
||||||
|
@ -84,7 +85,7 @@ const createEvent = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const zoneIds = props.zoneIds?.length ? props.zoneIds : [route.params.id];
|
const zoneIds = props.zoneIds?.length ? props.zoneIds : [route.params.id];
|
||||||
for (const id of zoneIds) {
|
for (const zoneId of zoneIds) {
|
||||||
let today = eventInclusionFormData.value.dated
|
let today = eventInclusionFormData.value.dated
|
||||||
? moment(eventInclusionFormData.value.dated)
|
? moment(eventInclusionFormData.value.dated)
|
||||||
: moment(dated.value);
|
: moment(dated.value);
|
||||||
|
@ -92,7 +93,7 @@ const createEvent = async () => {
|
||||||
|
|
||||||
const { data } = await axios.get(`Zones/getEventsFiltered`, {
|
const { data } = await axios.get(`Zones/getEventsFiltered`, {
|
||||||
params: {
|
params: {
|
||||||
zoneFk: id,
|
zoneFk: zoneId,
|
||||||
started: today,
|
started: today,
|
||||||
ended: lastDay,
|
ended: lastDay,
|
||||||
},
|
},
|
||||||
|
@ -106,15 +107,19 @@ const createEvent = async () => {
|
||||||
await axios.delete(
|
await axios.delete(
|
||||||
`Zones/${existsExclusion?.zoneFk}/exclusions/${existsExclusion?.id}`,
|
`Zones/${existsExclusion?.zoneFk}/exclusions/${existsExclusion?.id}`,
|
||||||
);
|
);
|
||||||
|
await refetchEvents();
|
||||||
|
hasDeletedEvent.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNew.value)
|
delete eventInclusionFormData.value.id;
|
||||||
await axios.post(`Zones/${id}/events`, eventInclusionFormData.value);
|
if (isNew.value || hasDeletedEvent.value)
|
||||||
|
await axios.post(`Zones/${zoneId}/events`, eventInclusionFormData.value);
|
||||||
else
|
else
|
||||||
await axios.put(
|
await axios.put(
|
||||||
`Zones/${id}/events/${props.event?.id}`,
|
`Zones/${zoneId}/events/${props.event?.id}`,
|
||||||
eventInclusionFormData.value,
|
eventInclusionFormData.value,
|
||||||
);
|
);
|
||||||
|
hasDeletedEvent.value = false;
|
||||||
}
|
}
|
||||||
quasar.notify({
|
quasar.notify({
|
||||||
message: t('globals.dataSaved'),
|
message: t('globals.dataSaved'),
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
const firstRow = 'tbody > :nth-child(1)';
|
const firstRow = 'tbody > :nth-child(1)';
|
||||||
|
|
||||||
describe('TicketSale', () => {
|
describe('TicketSale', () => {
|
||||||
describe.skip('#23', () => {
|
describe.skip('Ticket #23', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('claimManager');
|
cy.login('claimManager');
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
|
|
Loading…
Reference in New Issue