#8606: Fix Zone module #1402

Merged
jon merged 7 commits from 8606-FixZoneModule into dev 2025-02-19 06:53:40 +00:00
8 changed files with 113 additions and 69 deletions

View File

@ -335,3 +335,7 @@ input::-webkit-inner-spin-button {
border: 1px solid; border: 1px solid;
box-shadow: 0 4px 6px #00000000; box-shadow: 0 4px 6px #00000000;
} }
.containerShrinked {
width: 80%;
}

View File

@ -38,7 +38,12 @@ const agencies = ref([]);
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput :label="t('list.name')" v-model="params.name" is-outlined /> <VnInput
:label="t('list.name')"
v-model="params.name"
is-outlined
data-cy="zoneFilterPanelNameInput"
/>
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>
@ -53,6 +58,7 @@ const agencies = ref([]);
dense dense
outlined outlined
rounded rounded
data-cy="zoneFilterPanelAgencySelect"
> >
</VnSelect> </VnSelect>
</QItemSection> </QItemSection>

View File

@ -65,7 +65,6 @@ const tableFilter = {
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left',
name: 'id', name: 'id',
label: t('list.id'), label: t('list.id'),
chip: { chip: {
@ -75,6 +74,8 @@ const columns = computed(() => [
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
columnClass: 'shrink-column',
component: 'number',
}, },
{ {
align: 'left', align: 'left',
@ -106,7 +107,6 @@ const columns = computed(() => [
format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name), format: (row, dashIfEmpty) => dashIfEmpty(row?.agencyMode?.name),
}, },
{ {
align: 'left',
name: 'price', name: 'price',
label: t('list.price'), label: t('list.price'),
cardVisible: true, cardVisible: true,
@ -114,9 +114,11 @@ const columns = computed(() => [
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
columnClass: 'shrink-column',
component: 'number',
}, },
{ {
align: 'left', align: 'center',
name: 'hour', name: 'hour',
label: t('list.close'), label: t('list.close'),
cardVisible: true, cardVisible: true,
@ -177,6 +179,8 @@ function formatRow(row) {
<ZoneFilterPanel data-key="ZonesList" /> <ZoneFilterPanel data-key="ZonesList" />
</template> </template>
</RightMenu> </RightMenu>
<div class="table-container">
<div class="column items-center">
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="ZonesList" data-key="ZonesList"
@ -191,6 +195,8 @@ function formatRow(row) {
:columns="columns" :columns="columns"
redirect="zone" redirect="zone"
:right-search="false" :right-search="false"
table-height="85vh"
order="id ASC"
> >
<template #column-addressFk="{ row }"> <template #column-addressFk="{ row }">
{{ dashIfEmpty(formatRow(row)) }} {{ dashIfEmpty(formatRow(row)) }}
@ -238,6 +244,8 @@ function formatRow(row) {
/> />
</template> </template>
</VnTable> </VnTable>
</div>
</div>
</template> </template>
<i18n> <i18n>
@ -245,3 +253,20 @@ es:
Search zone: Buscar zona Search zone: Buscar zona
You can search zones by id or name: Puedes buscar zonas por id o nombre You can search zones by id or name: Puedes buscar zonas por id o nombre
</i18n> </i18n>
<style lang="scss" scoped>
.table-container {
display: flex;
justify-content: center;
}
.column {
display: flex;
flex-direction: column;
align-items: center;
min-width: 70%;
}
:deep(.shrink-column) {
width: 8%;
}
</style>

View File

@ -56,7 +56,7 @@ onMounted(() => weekdayStore.initStore());
<ZoneSearchbar /> <ZoneSearchbar />
<VnSubToolbar /> <VnSubToolbar />
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QCard class="full-width q-pa-md"> <QCard class="containerShrinked q-pa-md">
<div <div
v-for="(detail, index) in details" v-for="(detail, index) in details"
:key="index" :key="index"

View File

@ -44,6 +44,8 @@ summary:
filterPanel: filterPanel:
name: Name name: Name
agencyModeFk: Agency agencyModeFk: Agency
id: ID
price: Price
deliveryPanel: deliveryPanel:
pickup: Pick up pickup: Pick up
delivery: Delivery delivery: Delivery

View File

@ -45,6 +45,8 @@ summary:
filterPanel: filterPanel:
name: Nombre name: Nombre
agencyModeFk: Agencia agencyModeFk: Agencia
id: ID
price: Precio
deliveryPanel: deliveryPanel:
pickup: Recogida pickup: Recogida
delivery: Entrega delivery: Entrega

View File

@ -1,4 +1,5 @@
describe('ZoneList', () => { describe('ZoneList', () => {
const agency = 'inhouse pickup';
beforeEach(() => { beforeEach(() => {
cy.viewport(1280, 720); cy.viewport(1280, 720);
cy.login('developer'); cy.login('developer');
@ -6,11 +7,15 @@ describe('ZoneList', () => {
}); });
it('should filter by agency', () => { it('should filter by agency', () => {
cy.get('input[aria-label="Agency"]').type('{downArrow}{enter}'); cy.dataCy('zoneFilterPanelNameInput').type('{downArrow}{enter}');
}); });
it('should open the zone summary', () => { it('should open the zone summary', () => {
cy.get('input[aria-label="Name"]').type('zone refund'); cy.dataCy('zoneFilterPanelAgencySelect').type(agency);
cy.get('.q-scrollarea__content > .q-btn--standard > .q-btn__content').click(); cy.get('.q-menu .q-item').contains(agency).click();
cy.get(':nth-child(1) > [data-col-field="agencyModeFk"]').should(
'include.text',
agency,
);
}); });
}); });