Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix-front into test
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2025-04-17 08:01:06 +02:00
commit 53178d2429
9 changed files with 28 additions and 46 deletions

View File

@ -83,7 +83,7 @@ const isLoading = ref(false);
const hasChanges = ref(false); const hasChanges = ref(false);
const originalData = ref(); const originalData = ref();
const vnPaginateRef = ref(); const vnPaginateRef = ref();
const formData = ref([]); const formData = ref();
const saveButtonRef = ref(null); const saveButtonRef = ref(null);
const watchChanges = ref(); const watchChanges = ref();
const formUrl = computed(() => $props.url); const formUrl = computed(() => $props.url);
@ -298,6 +298,10 @@ watch(formUrl, async () => {
}); });
</script> </script>
<template> <template>
<SkeletonTable
v-if="!formData && ($attrs['auto-load'] === '' || $attrs['auto-load'])"
:columns="$attrs.columns?.length"
/>
<VnPaginate <VnPaginate
:url="url" :url="url"
:limit="limit" :limit="limit"
@ -316,10 +320,6 @@ watch(formUrl, async () => {
></slot> ></slot>
</template> </template>
</VnPaginate> </VnPaginate>
<SkeletonTable
v-if="!formData && $attrs.autoLoad"
:columns="$attrs.columns?.length"
/>
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown() && hasSubToolbar"> <Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown() && hasSubToolbar">
<QBtnGroup push style="column-gap: 10px"> <QBtnGroup push style="column-gap: 10px">
<slot name="moreBeforeActions" /> <slot name="moreBeforeActions" />

View File

@ -183,7 +183,7 @@ const arrayData = useArrayData(arrayDataKey, {
searchUrl: false, searchUrl: false,
mapKey: $attrs['map-key'], mapKey: $attrs['map-key'],
}); });
const someIsLoading = computed(() => isLoading.value || arrayData.isLoading);
function findKeyInOptions() { function findKeyInOptions() {
if (!$props.options) return; if (!$props.options) return;
return filter($props.modelValue, $props.options)?.length; return filter($props.modelValue, $props.options)?.length;
@ -366,7 +366,8 @@ function getCaption(opt) {
virtual-scroll-slice-size="options.length" virtual-scroll-slice-size="options.length"
hide-bottom-space hide-bottom-space
:input-debounce="useURL ? '300' : '0'" :input-debounce="useURL ? '300' : '0'"
:loading="isLoading" :loading="someIsLoading"
:disable="someIsLoading"
@virtual-scroll="onScroll" @virtual-scroll="onScroll"
@keydown="handleKeyDown" @keydown="handleKeyDown"
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'" :data-cy="$attrs.dataCy ?? $attrs.label + '_select'"

View File

@ -44,8 +44,7 @@ onBeforeMount(async () => {
}); });
// It enables to load data only once if the module is the same as the dataKey // It enables to load data only once if the module is the same as the dataKey
if (!isSameDataKey.value || !route.params.id || $props.id !== route.params.id) if (!isSameDataKey.value || !route.params.id) await getData();
await getData();
watch( watch(
() => [$props.url, $props.filter], () => [$props.url, $props.filter],
async () => { async () => {

View File

@ -89,7 +89,6 @@ const insertTag = (rows) => {
:default-remove="false" :default-remove="false"
:user-filter="{ :user-filter="{
fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'], fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'],
where: { itemFk: route.params.id },
include: { include: {
relation: 'tag', relation: 'tag',
scope: { scope: {
@ -97,6 +96,7 @@ const insertTag = (rows) => {
}, },
}, },
}" }"
:filter="{ where: { itemFk: route.params.id } }"
order="priority" order="priority"
auto-load auto-load
@on-fetch="onItemTagsFetched" @on-fetch="onItemTagsFetched"

View File

@ -11,25 +11,18 @@ export function cloneItem() {
const router = useRouter(); const router = useRouter();
const cloneItem = async (entityId) => { const cloneItem = async (entityId) => {
const { id } = entityId; const { id } = entityId;
try {
const { data } = await axios.post(`Items/${id ?? entityId}/clone`); const { data } = await axios.post(`Items/${id ?? entityId}/clone`);
router.push({ name: 'ItemTags', params: { id: data.id } }); router.push({ name: 'ItemTags', params: { id: data.id } });
} catch (err) {
console.error('Error cloning item');
}
}; };
const openCloneDialog = async (entityId) => { const openCloneDialog = async (entityId) => {
quasar quasar.dialog({
.dialog({
component: VnConfirm, component: VnConfirm,
componentProps: { componentProps: {
title: t('item.descriptor.clone.title'), title: t('item.descriptor.clone.title'),
message: t('item.descriptor.clone.subTitle'), message: t('item.descriptor.clone.subTitle'),
promise: () => cloneItem(entityId),
}, },
})
.onOk(async () => {
await cloneItem(entityId);
}); });
}; };
return { openCloneDialog }; return { openCloneDialog };

View File

@ -11,10 +11,10 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import VnLocation from 'src/components/common/VnLocation.vue'; import VnLocation from 'src/components/common/VnLocation.vue';
import VnAccountNumber from 'src/components/common/VnAccountNumber.vue'; import VnAccountNumber from 'src/components/common/VnAccountNumber.vue';
import VnCheckbox from 'src/components/common/VnCheckbox.vue'; import VnCheckbox from 'src/components/common/VnCheckbox.vue';
import { useArrayData } from 'src/composables/useArrayData';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
const arrayData = useArrayData('Supplier');
const sageTaxTypesOptions = ref([]); const sageTaxTypesOptions = ref([]);
const sageWithholdingsOptions = ref([]); const sageWithholdingsOptions = ref([]);
const sageTransactionTypesOptions = ref([]); const sageTransactionTypesOptions = ref([]);
@ -89,6 +89,7 @@ function handleLocation(data, location) {
}" }"
auto-load auto-load
:clear-store-on-unmount="false" :clear-store-on-unmount="false"
@on-data-saved="arrayData.fetch({})"
> >
<template #form="{ data, validate }"> <template #form="{ data, validate }">
<VnRow> <VnRow>

View File

@ -42,11 +42,7 @@ 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 <VnFilterPanel :data-key="props.dataKey" :search-button="true">
: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>
@ -188,16 +184,6 @@ const groupedStates = ref([]);
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem>
<QItemSection>
<QCheckbox
v-model="params.problems"
@update:model-value="searchFn()"
:label="t('With problems')"
toggle-indeterminate
/>
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection v-if="!provinces"> <QItemSection v-if="!provinces">
<QSkeleton type="QInput" class="full-width" /> <QSkeleton type="QInput" class="full-width" />

View File

@ -128,6 +128,7 @@ const columns = computed(() => [
columnFilter: false, columnFilter: false,
label: t('ticketList.hour'), label: t('ticketList.hour'),
format: (row) => toTimeFormat(row.shipped), format: (row) => toTimeFormat(row.shipped),
orderBy: false,
}, },
{ {
align: 'left', align: 'left',
@ -136,6 +137,7 @@ const columns = computed(() => [
columnFilter: false, columnFilter: false,
label: t('ticketList.closure'), label: t('ticketList.closure'),
format: (row, dashIfEmpty) => dashIfEmpty(toTimeFormat(row.zoneLanding)), format: (row, dashIfEmpty) => dashIfEmpty(toTimeFormat(row.zoneLanding)),
orderBy: false,
}, },
{ {
align: 'left', align: 'left',
@ -477,7 +479,7 @@ function setReference(data) {
prefix="card" prefix="card"
:array-data-props="{ :array-data-props="{
url: 'Tickets/filter', url: 'Tickets/filter',
order: ['shipped DESC', 'shippedHour ASC', 'zoneLanding ASC', 'id'], order: ['shipped DESC', 'id DESC'],
exprBuilder, exprBuilder,
}" }"
> >

View File

@ -1,5 +1,5 @@
import '../commands.js'; import '../commands.js';
describe('EntryDescriptor', () => { describe.skip('EntryDescriptor', () => {
beforeEach(() => { beforeEach(() => {
cy.login('buyer'); cy.login('buyer');
cy.visit(`/#/entry/list`); cy.visit(`/#/entry/list`);