diff --git a/src/pages/Item/ItemList.vue b/src/pages/Item/ItemList.vue index 30454a0c3..6cd603795 100644 --- a/src/pages/Item/ItemList.vue +++ b/src/pages/Item/ItemList.vue @@ -14,6 +14,9 @@ import ItemDescriptorProxy from './Card/ItemDescriptorProxy.vue'; import { cloneItem } from 'src/pages/Item/composables/cloneItem'; import RightMenu from 'src/components/common/RightMenu.vue'; import ItemListFilter from './ItemListFilter.vue'; +import VnInput from 'src/components/common/VnInput.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; +import FetchData from 'src/components/FetchData.vue'; const entityId = computed(() => route.params.id); const { openCloneDialog } = cloneItem(); @@ -21,7 +24,11 @@ const { viewSummary } = useSummaryDialog(); const { t } = useI18n(); const tableRef = ref(); const route = useRoute(); - +const validPriorities = ref([]); +const itemConfigs = (data) => { + const dataRow = data[0]; + validPriorities.value = dataRow.validPriorities; +}; const itemFilter = { include: [ { @@ -90,7 +97,6 @@ const columns = computed(() => [ label: t('globals.description'), name: 'description', align: 'left', - create: true, columnFilter: { name: 'search', }, @@ -135,7 +141,6 @@ const columns = computed(() => [ columnField: { component: null, }, - create: true, }, { label: t('item.list.category'), @@ -158,6 +163,11 @@ const columns = computed(() => [ name: 'intrastat', align: 'left', component: 'select', + attrs: { + url: 'Intrastats', + optionValue: 'description', + optionLabel: 'description', + }, columnFilter: { name: 'intrastat', attrs: { @@ -169,7 +179,6 @@ const columns = computed(() => [ columnField: { component: null, }, - create: true, cardVisible: true, }, { @@ -195,7 +204,6 @@ const columns = computed(() => [ columnField: { component: null, }, - create: true, cardVisible: true, }, { @@ -298,6 +306,7 @@ const columns = computed(() => [ + diff --git a/test/cypress/integration/item/itemList.spec.js b/test/cypress/integration/item/itemList.spec.js new file mode 100644 index 000000000..0a1f803aa --- /dev/null +++ b/test/cypress/integration/item/itemList.spec.js @@ -0,0 +1,34 @@ +/// + +describe('Item list', () => { + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/item/list`); + cy.get('#searchbar input').type('{enter}'); + }); + + it('should filter the items and redirect to the summary', () => { + cy.dataCy('ItemFilterCategorySelect').type('Plant'); + cy.get('.q-menu .q-item').contains('Plant').click(); + cy.dataCy('ItemFilterTypeSelect').type('Anthurium'); + cy.get('.q-menu .q-item').contains('Anthurium').click(); + cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click(); + }); + + it('should create an item', () => { + const data = { + Description: { val: `Test item` }, + Type: { val: `Crisantemo`, type: 'select' }, + Intrastat: { val: `Coral y materiales similares`, type: 'select' }, + Origin: { val: `SPA`, type: 'select' }, + }; + cy.dataCy('vnTableCreateBtn').click(); + cy.fillInForm(data); + cy.dataCy('FormModelPopup_save').click(); + cy.checkNotification('Data created'); + cy.get( + ':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content' + ).should('be.visible'); + }); +});