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

This commit is contained in:
Jose Antonio Tubau 2025-03-10 10:29:38 +00:00
commit 7f3e7e4c21
13 changed files with 44 additions and 30 deletions

2
Jenkinsfile vendored
View File

@ -123,7 +123,7 @@ pipeline {
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") {
sh 'sh test/cypress/cypressParallel.sh 3'
sh 'sh test/cypress/cypressParallel.sh 2'
}
}
}

View File

@ -1136,9 +1136,13 @@ es:
.grid-create {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, max-content));
grid-template-columns: 1fr 1fr;
max-width: 100%;
grid-gap: 20px;
margin: 0 auto;
.col-span-2 {
grid-column: span 2;
}
}
.flex-one {

View File

@ -149,14 +149,12 @@ const columns = computed(() => [
:right-search="false"
>
<template #more-create-dialog="{ data }">
<QCardSection>
<VnInputPassword
:label="t('Password')"
v-model="data.password"
:required="true"
autocomplete="new-password"
/>
</QCardSection>
</template>
</VnTable>
</template>

View File

@ -16,7 +16,6 @@ const filter = {
{ relation: 'mandateType', scope: { fields: ['id', 'code'] } },
{ relation: 'company', scope: { fields: ['id', 'code'] } },
],
where: { clientFk: route.params.id },
order: ['created DESC'],
limit: 20,
};
@ -65,7 +64,8 @@ const columns = computed(() => [
<VnTable
data-key="Mandates"
url="Mandates"
:filter="filter"
:user-filter="filter"
:filter="{ where: { clientFk: route.params.id } }"
auto-load
:columns="columns"
class="full-width q-mt-md"

View File

@ -146,9 +146,8 @@ async function deleteEntry() {
<template>
<CardDescriptor
ref="entryDescriptorRef"
:url="`Entries/${entityId}`"
:userFilter="entryFilter"
:filter="entryFilter"
title="supplier.nickname"
data-key="Entry"
width="lg-width"

View File

@ -283,7 +283,11 @@ onBeforeMount(async () => {
</script>
<template>
<VnSection :data-key="dataKey" prefix="entry">
<VnSection
:data-key="dataKey"
prefix="entry"
:array-data-props="{ url: 'Entries/filter' }"
>
<template #advanced-menu>
<EntryFilter :data-key="dataKey" />
</template>

View File

@ -230,7 +230,7 @@ watchEffect(selectedRows);
</span>
</template>
<template #more-create-dialog="{ data }">
<div class="row q-col-gutter-xs">
<div class="row q-col-gutter-xs col-span-2">
<div class="col-12">
<div class="q-col-gutter-xs">
<VnRow fixed>

View File

@ -156,9 +156,7 @@ const columns = computed(() => [
onMounted(async () => {
if (!route.query) return;
if (route.query?.createForm) {
const query = JSON.parse(route.query?.createForm);
formInitialData.value = query;
await onClientSelected({ ...formInitialData.value, clientFk: query?.clientFk });
await onClientSelected(JSON.parse(route.query?.createForm));
} else if (route.query?.table) {
const query = JSON.parse(route.query?.table);
const clientFk = query?.clientFk;
@ -177,7 +175,6 @@ watch(
tableRef.value.create.formInitialData = formInitialData.value;
}
},
{ immediate: true },
);
async function onClientSelected({ clientFk }, formData = {}) {
@ -191,13 +188,17 @@ async function onClientSelected({ clientFk }, formData = {}) {
addressOptions.value = data;
formData.defaultAddressFk = data[0].client.defaultAddressFk;
formData.addressId = formData.defaultAddressFk;
formInitialData.value = { addressId: formData.addressId, clientFk };
formInitialData.value = { ...formData, clientFk };
await fetchAgencies(formData);
}
async function fetchAgencies({ landed, addressId }) {
if (!landed || !addressId) return (agencyList.value = []);
async function fetchAgencies(formData) {
const { landed, addressId } = formData;
if (!landed || !addressId) {
formData.defaultAddressFk = formInitialData.value.defaultAddressFk;
return (agencyList.value = []);
}
const { data } = await axios.get('Agencies/landsThatDay', {
params: {
@ -220,6 +221,11 @@ const getDateColor = (date) => {
if (difference == 0) return 'bg-warning';
if (difference < 0) return 'bg-success';
};
const isDefaultAddress = (opt, data) => {
const addressId = data.defaultAddressFk ?? data.addressId;
return addressId === opt.id && opt.isActive;
};
</script>
<template>
@ -310,10 +316,7 @@ const getDateColor = (date) => {
>
<QItemSection style="min-width: min-content" avatar>
<QIcon
v-if="
scope.opt.isActive &&
data.defaultAddressFk === scope.opt.id
"
v-if="isDefaultAddress(scope.opt, data)"
size="sm"
color="grey"
name="star"

View File

@ -172,6 +172,7 @@ const filterColumns = computed(() => {
>
<template #more-create-dialog="{ data }">
<VnInput
class="col-span-2"
:label="t('globals.name')"
v-model="data.socialName"
:uppercase="true"

View File

@ -54,8 +54,7 @@ onBeforeMount(() => {
onMounted(async () => {
if (!route.query) return;
if (route.query?.createForm) {
formInitialData.value = JSON.parse(route.query?.createForm);
await onClientSelected(formInitialData.value);
await onClientSelected(JSON.parse(route.query?.createForm));
} else if (route.query?.table) {
const query = route.query?.table;
const clientId = +JSON.parse(query)?.clientFk;
@ -273,12 +272,18 @@ const fetchAddresses = async (formData) => {
return;
}
const { data } = await getAddresses(formData.clientId);
formInitialData.value = { clientId: formData.clientId };
if (!data) return;
if (!data) {
formInitialData.value = { clientId: formData.clientId };
return;
}
addressesOptions.value = data;
selectedClient.value = data[0].client;
formData.addressId = selectedClient.value.defaultAddressFk;
formInitialData.value.addressId = formData.addressId;
formInitialData.value = {
clientId: formData.clientId,
addressId: formData.addressId,
};
};
watch(
() => route.query.table,

View File

@ -223,7 +223,7 @@ async function autofillBic(worker) {
:right-search="false"
>
<template #more-create-dialog="{ data }">
<div class="q-pa-lg full-width">
<div class="col-span-2">
<VnRadio
v-model="data.isFreelance"
:val="false"

View File

@ -139,7 +139,7 @@ describe.skip('Ticket Lack detail', () => {
cy.wait('@getItemGetSimilar');
});
describe('Replace item if', () => {
it('Quantity is less than available', () => {
it.skip('Quantity is less than available', () => {
cy.get(':nth-child(1) > .text-right > .q-btn').click();
});
});

View File

@ -38,8 +38,8 @@ describe('TicketList', () => {
it('filter client and create ticket', () => {
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
searchResults();
cy.wait('@ticketSearchbar');
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
cy.dataCy('Customer ID_input').clear('1');
cy.dataCy('Customer ID_input').type('1101{enter}');