Merge branch 'dev' into Fix-InvoiceOutLostCode
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jon Elias 2025-02-26 07:51:02 +00:00
commit 6bb9c43fa5
18 changed files with 230 additions and 147 deletions

View File

@ -91,7 +91,6 @@ const components = {
event: updateEvent, event: updateEvent,
attrs: { attrs: {
...defaultAttrs, ...defaultAttrs,
style: 'min-width: 150px',
}, },
forceAttrs, forceAttrs,
}, },

View File

@ -31,6 +31,7 @@ import VnLv from 'components/ui/VnLv.vue';
import VnTableOrder from 'src/components/VnTable/VnOrder.vue'; import VnTableOrder from 'src/components/VnTable/VnOrder.vue';
import VnTableFilter from './VnTableFilter.vue'; import VnTableFilter from './VnTableFilter.vue';
import { getColAlign } from 'src/composables/getColAlign'; import { getColAlign } from 'src/composables/getColAlign';
import RightMenu from '../common/RightMenu.vue';
const arrayData = useArrayData(useAttrs()['data-key']); const arrayData = useArrayData(useAttrs()['data-key']);
const $props = defineProps({ const $props = defineProps({
@ -50,10 +51,6 @@ const $props = defineProps({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
rightSearchIcon: {
type: Boolean,
default: true,
},
rowClick: { rowClick: {
type: [Function, Boolean], type: [Function, Boolean],
default: null, default: null,
@ -165,7 +162,6 @@ const app = inject('app');
const editingRow = ref(null); const editingRow = ref(null);
const editingField = ref(null); const editingField = ref(null);
const isTableMode = computed(() => mode.value == TABLE_MODE); const isTableMode = computed(() => mode.value == TABLE_MODE);
const showRightIcon = computed(() => $props.rightSearch || $props.rightSearchIcon);
const selectRegex = /select/; const selectRegex = /select/;
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']); const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
const tableModes = [ const tableModes = [
@ -414,20 +410,13 @@ async function renderInput(rowId, field, clickedElement) {
eventHandlers: { eventHandlers: {
'update:modelValue': async (value) => { 'update:modelValue': async (value) => {
if (isSelect && value) { if (isSelect && value) {
row[column.name] = value[column.attrs?.optionValue ?? 'id']; await updateSelectValue(value, column, row, oldValue);
row[column?.name + 'TextValue'] =
value[column.attrs?.optionLabel ?? 'name'];
await column?.cellEvent?.['update:modelValue']?.(
value,
oldValue,
row,
);
} else row[column.name] = value; } else row[column.name] = value;
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row); await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
}, },
keyup: async (event) => { keyup: async (event) => {
if (event.key === 'Enter') if (event.key === 'Enter')
await destroyInput(rowIndex, field, clickedElement); await destroyInput(rowId, field, clickedElement);
}, },
keydown: async (event) => { keydown: async (event) => {
switch (event.key) { switch (event.key) {
@ -458,6 +447,17 @@ async function renderInput(rowId, field, clickedElement) {
node.el?.querySelector('span > div > div').focus(); node.el?.querySelector('span > div > div').focus();
} }
async function updateSelectValue(value, column, row, oldValue) {
row[column.name] = value[column.attrs?.optionValue ?? 'id'];
row[column?.name + 'VnTableTextValue'] = value[column.attrs?.optionLabel ?? 'name'];
if (column?.attrs?.find?.label)
row[column?.attrs?.find?.label] = value[column.attrs?.optionLabel ?? 'name'];
await column?.cellEvent?.['update:modelValue']?.(value, oldValue, row);
}
async function destroyInput(rowIndex, field, clickedElement) { async function destroyInput(rowIndex, field, clickedElement) {
if (!clickedElement) if (!clickedElement)
clickedElement = document.querySelector( clickedElement = document.querySelector(
@ -520,9 +520,9 @@ function getToggleIcon(value) {
} }
function formatColumnValue(col, row, dashIfEmpty) { function formatColumnValue(col, row, dashIfEmpty) {
if (col?.format || row[col?.name + 'TextValue']) { if (col?.format || row[col?.name + 'VnTableTextValue']) {
if (selectRegex.test(col?.component) && row[col?.name + 'TextValue']) { if (selectRegex.test(col?.component) && row[col?.name + 'VnTableTextValue']) {
return dashIfEmpty(row[col?.name + 'TextValue']); return dashIfEmpty(row[col?.name + 'VnTableTextValue']);
} else { } else {
return col.format(row, dashIfEmpty); return col.format(row, dashIfEmpty);
} }
@ -555,19 +555,33 @@ function formatColumnValue(col, row, dashIfEmpty) {
} }
return dashIfEmpty(row[col?.name]); return dashIfEmpty(row[col?.name]);
} }
function cardClick(_, row) { function cardClick(_, row) {
if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` }); if ($props.redirect) router.push({ path: `/${$props.redirect}/${row.id}` });
} }
function removeTextValue(data, getChanges) {
let changes = data.updates;
if (!changes) return data;
for (const change of changes) {
for (const key in change.data) {
if (key.endsWith('VnTableTextValue')) {
delete change.data[key];
}
}
}
data.updates = changes.filter((change) => Object.keys(change.data).length > 0);
if ($attrs?.beforeSaveFn) data = $attrs.beforeSaveFn(data, getChanges);
return data;
}
</script> </script>
<template> <template>
<QDrawer <RightMenu v-if="$props.rightSearch">
v-if="$props.rightSearch" <template #right-panel>
v-model="stateStore.rightDrawer"
side="right"
:width="256"
:overlay="$props.overlay"
>
<QScrollArea class="fit">
<VnTableFilter <VnTableFilter
:data-key="$attrs['data-key']" :data-key="$attrs['data-key']"
:columns="columns" :columns="columns"
@ -581,8 +595,8 @@ function cardClick(_, row) {
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" /> <slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
</template> </template>
</VnTableFilter> </VnTableFilter>
</QScrollArea> </template>
</QDrawer> </RightMenu>
<CrudModel <CrudModel
v-bind="$attrs" v-bind="$attrs"
:class="$attrs['class'] ?? 'q-px-md'" :class="$attrs['class'] ?? 'q-px-md'"
@ -591,6 +605,7 @@ function cardClick(_, row) {
@on-fetch="(...args) => emit('onFetch', ...args)" @on-fetch="(...args) => emit('onFetch', ...args)"
:search-url="searchUrl" :search-url="searchUrl"
:disable-infinite-scroll="isTableMode" :disable-infinite-scroll="isTableMode"
:before-save-fn="removeTextValue"
@save-changes="reload" @save-changes="reload"
:has-sub-toolbar="$props.hasSubToolbar ?? isEditable" :has-sub-toolbar="$props.hasSubToolbar ?? isEditable"
:auto-load="hasParams || $attrs['auto-load']" :auto-load="hasParams || $attrs['auto-load']"
@ -635,6 +650,7 @@ function cardClick(_, row) {
:skip="columnsVisibilitySkipped" :skip="columnsVisibilitySkipped"
/> />
<QBtnToggle <QBtnToggle
v-if="!tableModes.some((mode) => mode.disable)"
v-model="mode" v-model="mode"
toggle-color="primary" toggle-color="primary"
class="bg-vn-section-color" class="bg-vn-section-color"

View File

@ -76,6 +76,15 @@ onBeforeMount(async () => {
); );
}); });
const routeName = computed(() => {
const DESCRIPTOR_PROXY = 'DescriptorProxy';
let name = $props.dataKey;
if ($props.dataKey.includes(DESCRIPTOR_PROXY)) {
name = name.split(DESCRIPTOR_PROXY)[0];
}
return `${name}Summary`;
});
async function getData() { async function getData() {
store.url = $props.url; store.url = $props.url;
store.filter = $props.filter ?? {}; store.filter = $props.filter ?? {};
@ -154,9 +163,7 @@ const toModule = computed(() =>
{{ t('components.smartCard.openSummary') }} {{ t('components.smartCard.openSummary') }}
</QTooltip> </QTooltip>
</QBtn> </QBtn>
<RouterLink <RouterLink :to="{ name: routeName, params: { id: entity.id } }">
:to="{ name: `${dataKey}Summary`, params: { id: entity.id } }"
>
<QBtn <QBtn
class="link" class="link"
color="white" color="white"

View File

@ -153,6 +153,7 @@ globals:
maxTemperature: Max maxTemperature: Max
minTemperature: Min minTemperature: Min
changePass: Change password changePass: Change password
setPass: Set password
deleteConfirmTitle: Delete selected elements deleteConfirmTitle: Delete selected elements
changeState: Change state changeState: Change state
raid: 'Raid {daysInForward} days' raid: 'Raid {daysInForward} days'

View File

@ -157,6 +157,7 @@ globals:
maxTemperature: Máx maxTemperature: Máx
minTemperature: Mín minTemperature: Mín
changePass: Cambiar contraseña changePass: Cambiar contraseña
setPass: Establecer contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados deleteConfirmTitle: Eliminar los elementos seleccionados
changeState: Cambiar estado changeState: Cambiar estado
raid: 'Redada {daysInForward} días' raid: 'Redada {daysInForward} días'

View File

@ -25,12 +25,13 @@ const $props = defineProps({
const { t } = useI18n(); const { t } = useI18n();
const { hasAccount } = toRefs($props); const { hasAccount } = toRefs($props);
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
const arrayData = useArrayData('Account');
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
const state = useState(); const state = useState();
const user = state.getUser(); const user = state.getUser();
const { notify } = useQuasar(); const { notify } = useQuasar();
const account = computed(() => useArrayData('Account').store.data[0]); const account = computed(() => arrayData.store.data);
account.value.hasAccount = hasAccount.value; account.value.hasAccount = hasAccount.value;
const entityId = computed(() => +route.params.id); const entityId = computed(() => +route.params.id);
const hasitManagementAccess = ref(); const hasitManagementAccess = ref();
@ -39,7 +40,7 @@ const isHimself = computed(() => user.value.id === account.value.id);
const url = computed(() => const url = computed(() =>
isHimself.value isHimself.value
? 'Accounts/change-password' ? 'Accounts/change-password'
: `Accounts/${entityId.value}/setPassword` : `Accounts/${entityId.value}/setPassword`,
); );
async function updateStatusAccount(active) { async function updateStatusAccount(active) {
@ -153,6 +154,7 @@ onMounted(() => {
t('account.card.actions.disableAccount.title'), t('account.card.actions.disableAccount.title'),
t('account.card.actions.disableAccount.subtitle'), t('account.card.actions.disableAccount.subtitle'),
() => deleteAccount(), () => deleteAccount(),
() => deleteAccount(),
) )
" "
> >
@ -172,6 +174,7 @@ onMounted(() => {
t('account.card.actions.enableAccount.title'), t('account.card.actions.enableAccount.title'),
t('account.card.actions.enableAccount.subtitle'), t('account.card.actions.enableAccount.subtitle'),
() => updateStatusAccount(true), () => updateStatusAccount(true),
() => updateStatusAccount(true),
) )
" "
> >
@ -186,6 +189,7 @@ onMounted(() => {
t('account.card.actions.disableAccount.title'), t('account.card.actions.disableAccount.title'),
t('account.card.actions.disableAccount.subtitle'), t('account.card.actions.disableAccount.subtitle'),
() => updateStatusAccount(false), () => updateStatusAccount(false),
() => updateStatusAccount(false),
) )
" "
> >
@ -201,6 +205,7 @@ onMounted(() => {
t('account.card.actions.activateUser.title'), t('account.card.actions.activateUser.title'),
t('account.card.actions.activateUser.title'), t('account.card.actions.activateUser.title'),
() => updateStatusUser(true), () => updateStatusUser(true),
() => updateStatusUser(true),
) )
" "
> >
@ -215,6 +220,7 @@ onMounted(() => {
t('account.card.actions.deactivateUser.title'), t('account.card.actions.deactivateUser.title'),
t('account.card.actions.deactivateUser.title'), t('account.card.actions.deactivateUser.title'),
() => updateStatusUser(false), () => updateStatusUser(false),
() => updateStatusUser(false),
) )
" "
> >

View File

@ -639,7 +639,7 @@ onMounted(() => {
'flex-wrap': 'wrap', 'flex-wrap': 'wrap',
gap: '16px', gap: '16px',
position: 'relative', position: 'relative',
height: '450px', height: '500px',
}, },
columnGridStyle: { columnGridStyle: {
'max-width': '50%', 'max-width': '50%',
@ -650,7 +650,7 @@ onMounted(() => {
:is-editable="editableMode" :is-editable="editableMode"
:without-header="!editableMode" :without-header="!editableMode"
:with-filters="editableMode" :with-filters="editableMode"
:right-search="true" :right-search="editableMode"
:right-search-icon="true" :right-search-icon="true"
:row-click="false" :row-click="false"
:columns="columns" :columns="columns"

View File

@ -274,7 +274,7 @@ onBeforeMount(async () => {
:array-data-props="{ :array-data-props="{
url: 'Entries/filter', url: 'Entries/filter',
order: 'landed DESC', order: 'landed DESC',
userFilter: EntryFilter, userFilter: entryQueryFilter,
}" }"
> >
<template #advanced-menu> <template #advanced-menu>

View File

@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { dashIfEmpty, toDate, toHour } from 'src/filters'; import { toDate, toHour } from 'src/filters';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { usePrintService } from 'src/composables/usePrintService'; import { usePrintService } from 'src/composables/usePrintService';

View File

@ -45,8 +45,6 @@ const filter = {
:label="t('parking.sector')" :label="t('parking.sector')"
:value="entity.sector?.description" :value="entity.sector?.description"
/> />
<VnLv :label="t('parking.row')" :value="entity.row" />
<VnLv :label="t('parking.column')" :value="entity.column" />
</QCard> </QCard>
</template> </template>
</CardSummary> </CardSummary>

View File

@ -1,19 +1,15 @@
<script setup> <script setup>
import { onMounted, onUnmounted } from 'vue'; import { computed, onMounted, onUnmounted } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import VnPaginate from 'components/ui/VnPaginate.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import CardList from 'components/ui/CardList.vue';
import VnLv from 'components/ui/VnLv.vue';
import ParkingFilter from './ParkingFilter.vue';
import ParkingSummary from './Card/ParkingSummary.vue';
import exprBuilder from './ParkingExprBuilder.js';
import VnSection from 'src/components/common/VnSection.vue'; import VnSection from 'src/components/common/VnSection.vue';
import ParkingFilter from './ParkingFilter.vue';
import exprBuilder from './ParkingExprBuilder.js';
import ParkingSummary from './Card/ParkingSummary.vue';
const stateStore = useStateStore(); const stateStore = useStateStore();
const { push } = useRouter();
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const dataKey = 'ParkingList'; const dataKey = 'ParkingList';
@ -24,7 +20,48 @@ onUnmounted(() => (stateStore.rightDrawer = false));
const filter = { const filter = {
fields: ['id', 'sectorFk', 'code', 'pickingOrder'], fields: ['id', 'sectorFk', 'code', 'pickingOrder'],
}; };
const columns = computed(() => [
{
align: 'left',
name: 'code',
label: t('globals.code'),
isId: true,
isTitle: true,
columnFilter: false,
sortable: true,
},
{
align: 'left',
name: 'sector',
label: t('parking.sector'),
format: (val) => val.sector.description ?? '',
sortable: true,
cardVisible: true,
},
{
align: 'left',
name: 'pickingOrder',
label: t('parking.pickingOrder'),
sortable: true,
cardVisible: true,
},
{
align: 'right',
label: '',
name: 'tableActions',
actions: [
{
title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, ParkingSummary),
isPrimary: true,
},
],
},
]);
</script> </script>
<template> <template>
<VnSection <VnSection
:data-key="dataKey" :data-key="dataKey"
@ -40,41 +77,24 @@ const filter = {
<ParkingFilter data-key="ParkingList" /> <ParkingFilter data-key="ParkingList" />
</template> </template>
<template #body> <template #body>
<QPage class="column items-center q-pa-md"> <VnTable
<div class="vn-card-list"> :data-key="dataKey"
<VnPaginate :data-key="dataKey"> :columns="columns"
<template #body="{ rows }"> is-editable="false"
<CardList :right-search="false"
v-for="row of rows" :use-model="true"
:key="row.id" :disable-option="{ table: true }"
:id="row.id" redirect="shelving/parking"
:title="row.code" default-mode="card"
@click="
push({ path: `/shelving/parking/${row.id}/summary` })
"
> >
<template #list-items> <template #actions="{ row }">
<VnLv
label="Sector"
:value="row.sector?.description"
/>
<VnLv
:label="t('parking.pickingOrder')"
:value="row.pickingOrder"
/>
</template>
<template #actions>
<QBtn <QBtn
:label="t('components.smartCard.openSummary')" :label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, ParkingSummary)" @click.stop="viewSummary(row.id, ParkingSummary)"
color="primary" color="primary"
/> />
</template> </template>
</CardList> </VnTable>
</template>
</VnPaginate>
</div>
</QPage>
</template> </template>
</VnSection> </VnSection>
</template> </template>

View File

@ -17,6 +17,12 @@ const maritalStatus = [
{ code: 'M', name: t('Married') }, { code: 'M', name: t('Married') },
{ code: 'S', name: t('Single') }, { code: 'S', name: t('Single') },
]; ];
async function setAdvancedSummary(data) {
const advanced = (await useAdvancedSummary('Workers', data.id)) ?? {};
Object.assign(form.value.formData, advanced);
await nextTick();
if (form.value) form.value.hasChanges = false;
}
</script> </script>
<template> <template>
<FetchData <FetchData
@ -36,13 +42,7 @@ const maritalStatus = [
:url-update="`Workers/${$route.params.id}`" :url-update="`Workers/${$route.params.id}`"
auto-load auto-load
model="Worker" model="Worker"
@on-fetch=" @on-fetch="setAdvancedSummary"
async (data) => {
Object.assign(data, (await useAdvancedSummary('Workers', data.id)) ?? {});
await $nextTick();
if (form) form.hasChanges = false;
}
"
> >
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>

View File

@ -12,6 +12,11 @@ const $props = defineProps({
<template> <template>
<QPopupProxy> <QPopupProxy>
<WorkerDescriptor v-if="$props.id" :id="$props.id" :summary="WorkerSummary" /> <WorkerDescriptor
v-if="$props.id"
:id="$props.id"
:summary="WorkerSummary"
data-key="WorkerDescriptorProxy"
/>
</QPopupProxy> </QPopupProxy>
</template> </template>

View File

@ -0,0 +1,24 @@
describe('ClaimNotes', () => {
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
const url = '/#/account/1/summary';
it('should see all the account options', () => {
cy.login('itManagement');
cy.visit(url);
cy.dataCy('descriptor-more-opts').click();
cy.get(descriptorOptions)
.find('.q-item')
.its('length')
.then((count) => {
cy.log('Número de opciones:', count);
expect(count).to.equal(5);
});
});
it('should not see any option', () => {
cy.login('salesPerson');
cy.visit(url);
cy.dataCy('descriptor-more-opts').click();
cy.get(descriptorOptions).should('not.be.visible');
});
});

View File

@ -1,23 +0,0 @@
/// <reference types="cypress" />
describe('ParkingBasicData', () => {
const codeInput = 'form .q-card .q-input input';
const sectorSelect = 'form .q-card .q-select input';
const sectorOpt = '.q-menu .q-item';
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/shelving/parking/1/basic-data`);
});
it('should edit the code and sector', () => {
cy.get(sectorSelect).type('Second');
cy.get(sectorOpt).click();
cy.get(codeInput).eq(0).clear();
cy.get(codeInput).eq(0).type('900-001');
cy.saveCard();
cy.get(sectorSelect).should('have.value', 'Second sector');
cy.get(codeInput).should('have.value', '900-001');
});
});

View File

@ -1,33 +0,0 @@
/// <reference types="cypress" />
describe('ParkingList', () => {
const searchbar = '#searchbar input';
const firstCard = '.q-card:nth-child(1)';
const firstChipId =
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
const firstDetailBtn =
':nth-child(1) > :nth-child(1) > .card-list-body > .actions > .q-btn';
const summaryHeader = '.summaryBody .header';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/shelving/parking/list`);
});
it('should redirect on clicking a parking', () => {
cy.get(searchbar).type('{enter}');
cy.get(firstChipId)
.invoke('text')
.then((content) => {
const id = content.substring(4);
cy.get(firstCard).click();
cy.url().should('include', `/parking/${id}/summary`);
});
});
it('should open the details', () => {
cy.get(searchbar).type('{enter}');
cy.get(firstDetailBtn).click();
cy.get(summaryHeader).contains('Basic data');
});
});

View File

@ -0,0 +1,32 @@
/// <reference types="cypress" />
describe('ParkingBasicData', () => {
const codeInput = 'form .q-card .q-input input';
const sectorSelect = 'form .q-card .q-select input';
const sectorOpt = '.q-menu .q-item';
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/shelving/parking/1/basic-data`);
});
it('should give an error if the code aldready exists', () => {
cy.get(codeInput).eq(0).should('have.value', '700-01').clear();
cy.get(codeInput).eq(0).type('700-02');
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'The code already exists');
});
it('should edit the code and sector', () => {
cy.get(sectorSelect).type('First');
cy.get(sectorOpt).click();
cy.get(codeInput).eq(0).clear();
cy.get(codeInput).eq(0).type('700-01');
cy.dataCy('Picking order_input').clear().type(80230);
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'Data saved');
cy.get(sectorSelect).should('have.value', 'First sector');
cy.get(codeInput).should('have.value', '700-01');
cy.dataCy('Picking order_input').should('have.value', 80230);
});
});

View File

@ -0,0 +1,30 @@
/// <reference types="cypress" />
describe('ParkingList', () => {
const searchbar = '#searchbar input';
const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none';
const summaryHeader = '.summaryBody .header';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/shelving/parking/list`);
});
it('should redirect on clicking a parking', () => {
cy.get(searchbar).type('{enter}');
cy.get(firstCard).click();
cy.get(summaryHeader).contains('Basic data');
});
it('should filter and redirect if there is only one result', () => {
cy.dataCy('Code_input').type('1{enter}');
cy.dataCy('Sector_select').type('Normal{enter}');
cy.get(summaryHeader).contains('Basic data');
});
it('should filter and redirect to summary if only one result', () => {
cy.dataCy('Code_input').type('A{enter}');
cy.dataCy('Sector_select').type('First Sector{enter}');
cy.url().should('match', /\/shelving\/parking\/\d+\/summary/);
});
});