feat: refs #8593 changed parking to VnTable and modified e2e tests
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:
parent
aabff80b82
commit
c49a72e5e5
|
@ -45,8 +45,6 @@ const filter = {
|
|||
:label="t('parking.sector')"
|
||||
:value="entity.sector?.description"
|
||||
/>
|
||||
<VnLv :label="t('parking.row')" :value="entity.row" />
|
||||
<VnLv :label="t('parking.column')" :value="entity.column" />
|
||||
</QCard>
|
||||
</template>
|
||||
</CardSummary>
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
<script setup>
|
||||
import { onMounted, onUnmounted } from 'vue';
|
||||
import { computed, onMounted, onUnmounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useStateStore } from 'stores/useStateStore';
|
||||
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
|
||||
import VnPaginate from 'components/ui/VnPaginate.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 VnTable from 'components/VnTable/VnTable.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 { push } = useRouter();
|
||||
const router = useRouter();
|
||||
const { t } = useI18n();
|
||||
const { viewSummary } = useSummaryDialog();
|
||||
const dataKey = 'ParkingList';
|
||||
|
@ -24,7 +22,35 @@ onUnmounted(() => (stateStore.rightDrawer = false));
|
|||
const filter = {
|
||||
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,
|
||||
},
|
||||
]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnSection
|
||||
:data-key="dataKey"
|
||||
|
@ -40,41 +66,24 @@ const filter = {
|
|||
<ParkingFilter data-key="ParkingList" />
|
||||
</template>
|
||||
<template #body>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<div class="vn-card-list">
|
||||
<VnPaginate :data-key="dataKey">
|
||||
<template #body="{ rows }">
|
||||
<CardList
|
||||
v-for="row of rows"
|
||||
:key="row.id"
|
||||
:id="row.id"
|
||||
:title="row.code"
|
||||
@click="
|
||||
push({ path: `/shelving/parking/${row.id}/summary` })
|
||||
"
|
||||
>
|
||||
<template #list-items>
|
||||
<VnLv
|
||||
label="Sector"
|
||||
:value="row.sector?.description"
|
||||
/>
|
||||
<VnLv
|
||||
:label="t('parking.pickingOrder')"
|
||||
:value="row.pickingOrder"
|
||||
/>
|
||||
</template>
|
||||
<template #actions>
|
||||
<QBtn
|
||||
:label="t('components.smartCard.openSummary')"
|
||||
@click.stop="viewSummary(row.id, ParkingSummary)"
|
||||
color="primary"
|
||||
/>
|
||||
</template>
|
||||
</CardList>
|
||||
</template>
|
||||
</VnPaginate>
|
||||
</div>
|
||||
</QPage>
|
||||
<VnTable
|
||||
:data-key="dataKey"
|
||||
:columns="columns"
|
||||
is-editable="false"
|
||||
:right-search="false"
|
||||
:use-model="true"
|
||||
:disable-option="{ table: true }"
|
||||
redirect="shelving/parking"
|
||||
default-mode="card"
|
||||
>
|
||||
<template #actions="{ row }">
|
||||
<QBtn
|
||||
:label="t('components.smartCard.openSummary')"
|
||||
@click.stop="viewSummary(row.id, ParkingSummary)"
|
||||
color="primary"
|
||||
/>
|
||||
</template>
|
||||
</VnTable>
|
||||
</template>
|
||||
</VnSection>
|
||||
</template>
|
||||
|
|
|
@ -14,10 +14,12 @@ describe('ParkingBasicData', () => {
|
|||
|
||||
cy.get(codeInput).eq(0).clear();
|
||||
cy.get(codeInput).eq(0).type('900-002');
|
||||
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(sectorSelect).should('have.value', 'Second sector');
|
||||
cy.get(codeInput).should('have.value', '900-002');
|
||||
cy.dataCy('Picking order_input').should('have.value', 80230);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
/// <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 firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none';
|
||||
const summaryHeader = '.summaryBody .header';
|
||||
|
||||
beforeEach(() => {
|
||||
|
@ -16,18 +12,13 @@ describe('ParkingList', () => {
|
|||
|
||||
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`);
|
||||
});
|
||||
cy.get(firstCard).click();
|
||||
cy.get(summaryHeader).contains('Basic data');
|
||||
});
|
||||
|
||||
it('should open the details', () => {
|
||||
cy.get(searchbar).type('{enter}');
|
||||
cy.get(firstDetailBtn).click();
|
||||
it('should filter and redirect if there is only one result', () => {
|
||||
cy.dataCy('Code_input').type('01{enter}');
|
||||
cy.dataCy('Sector_select').type('First{enter}');
|
||||
cy.get(summaryHeader).contains('Basic data');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue