diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 1032d4024..07992f616 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -314,7 +314,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) { show-if-above > - + + diff --git a/src/components/common/VnSection.vue b/src/components/common/VnSection.vue index e69e586b5..be7a3a121 100644 --- a/src/components/common/VnSection.vue +++ b/src/components/common/VnSection.vue @@ -4,11 +4,12 @@ import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnTableFilter from '../VnTable/VnTableFilter.vue'; import { onBeforeMount, computed } from 'vue'; import { useArrayData } from 'src/composables/useArrayData'; +import { useRoute } from 'vue-router'; const $props = defineProps({ section: { type: String, - required: true, + default: null, }, dataKey: { type: String, @@ -40,8 +41,17 @@ const $props = defineProps({ }, }); -const sectionValue = computed(() => $props.section ?? $props.dataKey); +const route = useRoute(); let arrayData; +const sectionValue = computed(() => $props.section ?? $props.dataKey); +const isMainSection = computed(() => { + const isSame = sectionValue.value == route.name; + if (!isSame && arrayData) { + arrayData.reset(['userParams', 'userFilter']); + } + return isSame; +}); + onBeforeMount(() => { if ($props.dataKey) arrayData = useArrayData($props.dataKey, { @@ -74,6 +84,6 @@ onBeforeMount(() => { - + diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 4e284d8e4..a2d3b9ee1 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -126,6 +126,7 @@ async function search() { delete filter.params.search; } await arrayData.applyFilter(filter); + searchText.value = undefined; } + + + - @@ -349,4 +342,13 @@ onMounted(async () => { background-color: red; } } +.accent-badge { + background-color: var(--vn-label-color); + color: var(--vn-text-color-contrast); +} +.simple-badge { + background-color: transparent; + color: var(--vn-text-color); + font-size: 14px; +} diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue index 74403d471..422adf55b 100644 --- a/src/pages/Item/ItemFixedPrice.vue +++ b/src/pages/Item/ItemFixedPrice.vue @@ -53,7 +53,6 @@ const columns = computed(() => [ name: 'itemFk', ...defaultColumnAttrs, isId: true, - cardVisible: true, columnField: { component: 'input', type: 'number', @@ -65,14 +64,12 @@ const columns = computed(() => [ name: 'name', ...defaultColumnAttrs, create: true, - cardVisible: true, }, { label: t('item.fixedPrice.groupingPrice'), field: 'rate2', name: 'rate2', ...defaultColumnAttrs, - cardVisible: true, component: 'input', type: 'number', }, @@ -81,7 +78,6 @@ const columns = computed(() => [ field: 'rate3', name: 'rate3', ...defaultColumnAttrs, - cardVisible: true, component: 'input', type: 'number', }, @@ -91,7 +87,6 @@ const columns = computed(() => [ field: 'minPrice', name: 'minPrice', ...defaultColumnAttrs, - cardVisible: true, component: 'input', type: 'number', }, @@ -100,7 +95,6 @@ const columns = computed(() => [ field: 'started', name: 'started', format: ({ started }) => toDate(started), - cardVisible: true, ...defaultColumnAttrs, columnField: { component: 'date', @@ -116,7 +110,6 @@ const columns = computed(() => [ field: 'ended', name: 'ended', ...defaultColumnAttrs, - cardVisible: true, columnField: { component: 'date', class: 'shrink', @@ -251,11 +244,14 @@ const upsertPrice = async (props, resetMinPrice = false) => { } if (!changes.updates && !changes.creates) return; const data = await upsertFixedPrice(row); - tableRef.value.CrudModelRef.formData[props.rowIndex] = data; + Object.assign(tableRef.value.CrudModelRef.formData[props.rowIndex], data); + notify(t('globals.dataSaved'), 'positive'); + tableRef.value.reload(); }; async function upsertFixedPrice(row) { const { data } = await axios.patch('FixedPrices/upsertFixedPrice', row); + data.hasMinPrice = data.hasMinPrice ? 1 : 0; return data; } @@ -395,18 +391,11 @@ function handleOnDataSave({ CrudModelRef }) { diff --git a/src/pages/Order/Card/OrderSummary.vue b/src/pages/Order/Card/OrderSummary.vue index b8016abac..ad06dfe43 100644 --- a/src/pages/Order/Card/OrderSummary.vue +++ b/src/pages/Order/Card/OrderSummary.vue @@ -221,7 +221,7 @@ async function handleConfirm() { - + {{ props.row.quantity }} diff --git a/src/pages/Zone/Card/ZoneEventExclusionForm.vue b/src/pages/Zone/Card/ZoneEventExclusionForm.vue index 0882036c1..4b6aa52bd 100644 --- a/src/pages/Zone/Card/ZoneEventExclusionForm.vue +++ b/src/pages/Zone/Card/ZoneEventExclusionForm.vue @@ -59,7 +59,7 @@ const arrayData = useArrayData('ZoneEvents'); const exclusionGeoCreate = async () => { const params = { zoneFk: parseInt(route.params.id), - date: dated.value, + date: dated, geoIds: tickedNodes.value, }; await axios.post('Zones/exclusionGeo', params); diff --git a/test/cypress/integration/item/itemLastEntries.spec.js b/test/cypress/integration/item/itemLastEntries.spec.js deleted file mode 100644 index c94cfa480..000000000 --- a/test/cypress/integration/item/itemLastEntries.spec.js +++ /dev/null @@ -1,20 +0,0 @@ -describe('ItemLastEntries', () => { - beforeEach(() => { - cy.viewport(1280, 720); - cy.login('buyer'); - cy.visit('/#/item/1/last-entries'); - cy.intercept('GET', /.*lastEntriesFilter/).as('item'); - cy.waitForElement('tbody'); - }); - - it('should filter by agency', () => { - cy.get('tbody > tr') - .its('length') - .then((rowCount) => { - cy.get('[data-cy="hideInventory"]').click(); - cy.wait('@item'); - cy.waitForElement('tbody'); - cy.get('tbody > tr').should('have.length.greaterThan', rowCount); - }); - }); -});