diff --git a/CHANGELOG.md b/CHANGELOG.md index 03812d252..e110e4cd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,87 @@ +# Version 24.50 - 2024-12-10 + +### Added 🆕 + +- feat: add reportFileName option by:Javier Segarra +- feat: all clients just with global series by:jgallego +- feat: improve Merge branch 'test' into dev by:Javier Segarra +- feat: manual invoice in two lines by:jgallego +- feat: manualInvoice with address by:jgallego +- feat: randomize functions and example by:Javier Segarra +- feat: refs #6999 added search when user tabs on a filter with value by:Jon +- feat: refs #6999 added tab to search in VnTable filter by:Jon +- feat: refs #7346 #7346 improve form by:Javier Segarra +- feat: refs #7346 address ordered by:jgallego +- feat: refs #7346 radioButton by:jgallego +- feat: refs #7346 style radioButton by:jgallego +- feat: refs #7346 traducciones en cammelCase (7346-manualInvoice) by:jgallego +- feat: refs #8038 added new functionality in VnSelect and refactor styles by:Jon +- feat: refs #8061 #8061 updates by:Javier Segarra +- feat: refs #8087 reactive data by:jorgep +- feat: refs #8087 refs#8087 Redadas en travel by:Carlos Andrés +- feat: refs #8138 add component ticket problems by:pablone +- feat: refs #8163 add max length and more tests by:wbuezas +- feat: refs #8163 add prop by:wbuezas +- feat: refs #8163 add VnInput insert functionality and e2e test by:wbuezas +- feat: refs #8163 limit with maxLength by:Javier Segarra +- feat: refs #8163 maxLength SupplierFD account by:Javier Segarra +- feat: refs #8163 maxLengthVnInput by:Javier Segarra +- feat: refs #8163 use VnAccountNumber in VnAccountNumber by:Javier Segarra +- feat: refs #8166 show notification by:jorgep + +### Changed 📦 + +- feat: refs #8038 added new functionality in VnSelect and refactor styles by:Jon +- perf: add dataCy by:Javier Segarra +- perf: refs #7346 #7346 Imrpove interface dialog by:Javier Segarra +- perf: refs #7346 #7346 use v-show instead v-if by:Javier Segarra +- perf: refs #8036 currentFilter by:alexm +- perf: refs #8061 filter autonomy by:Javier Segarra +- perf: refs #8061 solve conflicts and random posCode it by:Javier Segarra +- perf: refs #8061 use opts from VnSelect by:Javier Segarra +- perf: refs #8163 #8061 createNewPostCodeForm by:Javier Segarra +- perf: remove console by:Javier Segarra +- perf: remove timeout by:Javier Segarra +- perf: test command fillInForm by:Javier Segarra +- refactor: refs #8162 remove comment by:wbuezas +- refactor: remove unnecesary things by:wbuezas + +### Fixed 🛠️ + +- fix: #8016 fetching data by:Javier Segarra +- fix: icons by:jgallego +- fix: refs #7229 download file by:jorgep +- fix: refs #7229 remove catch by:jorgep +- fix: refs #7229 set url by:jorgep +- fix: refs #7229 test by:jorgep +- fix: refs #7229 url by:jorgep +- fix: refs #7229 url + test by:jorgep +- fix: refs #7304 7304 clean warning by:carlossa +- fix: refs #7304 fix list by:carlossa +- fix: refs #7304 fix warning by:carlossa +- fix: refs #7346 traslations by:jgallego +- fix: refs #7529 add save by:carlossa +- fix: refs #7529 fix e2e by:carlossa +- fix: refs #7529 fix front by:carlossa +- fix: refs #7529 fix scss by:carlossa +- fix: refs #7529 fix te2e by:carlossa +- fix: refs #7529 fix workerPit e2e by:carlossa +- fix: refs #7529 front by:carlossa +- fix: refs #8036 apply exprBuilder after save filters by:alexm +- fix: refs #8036 only add where when required by:alexm +- fix: refs #8038 solve conflicts by:Jon +- fix: refs #8061 improve code dependencies (origin/8061_improve_newCP) by:Javier Segarra +- fix: refs #8138 move component from ui folder by:pablone +- fix: refs #8138 sme minor issues by:pablone +- fix: refs #8163 #8061 createNewPostCodeForm by:Javier Segarra +- fix: refs #8163 minor problem when keypress by:Javier Segarra +- fix: refs #8166 show zone error by:jorgep +- fix: removed selectedClient by:jgallego +- refs #7529 fix workerPit by:carlossa +- revert: refs #8061 test #8061 updates by:Javier Segarra +- test: fix own test by:Javier Segarra +- test: refs #8162 #8162 fix TicketList spec by:Javier Segarra + # Version 24.48 - 2024-11-25 ### Added 🆕 diff --git a/src/components/CreateNewPostcodeForm.vue b/src/components/CreateNewPostcodeForm.vue index d3d6708f0..c656fcb2f 100644 --- a/src/components/CreateNewPostcodeForm.vue +++ b/src/components/CreateNewPostcodeForm.vue @@ -25,7 +25,6 @@ const townsFetchDataRef = ref(false); const townFilter = ref({}); const countriesRef = ref(false); -const provincesFetchDataRef = ref(false); const provincesOptions = ref([]); const townsOptions = ref([]); const town = ref({}); @@ -71,9 +70,6 @@ async function setProvince(id, data) { await fetchTowns(); } async function onProvinceCreated(data) { - await provincesFetchDataRef.value.fetch({ - where: { countryFk: postcodeFormData.countryFk }, - }); postcodeFormData.provinceFk = data.id; } function provinceByCountry(countryFk = postcodeFormData.countryFk) { @@ -92,7 +88,6 @@ function setTown(newTown, data) { data.countryFk = newTown?.province?.countryFk ?? newTown; } async function onCityCreated(newTown, formData) { - await provincesFetchDataRef.value.fetch(); newTown.province = provincesOptions.value.find( (province) => province.id === newTown.provinceFk ); @@ -125,14 +120,6 @@ async function filterTowns(name) { - setProvince(value, data)" + @update:options=" + (data) => { + provincesOptions = data; + } + " v-model="data.provinceFk" @on-province-created="onProvinceCreated" required diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index e992334b5..7fdb54bc4 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -249,7 +249,7 @@ function getChanges() { for (const [i, row] of formData.value.entries()) { if (!row[pk]) { creates.push(row); - } else if (originalData.value) { + } else if (originalData.value[i]) { const data = getDifferences(originalData.value[i], row); if (!isEmpty(data)) { updates.push({ diff --git a/src/components/EditTableCellValueForm.vue b/src/components/EditTableCellValueForm.vue index 7755df9ab..172866191 100644 --- a/src/components/EditTableCellValueForm.vue +++ b/src/components/EditTableCellValueForm.vue @@ -85,12 +85,14 @@ const closeForm = () => { hide-selected option-label="label" v-model="selectedField" + data-cy="field-to-edit" /> diff --git a/src/components/FormModelPopup.vue b/src/components/FormModelPopup.vue index d91f07535..afdc6efca 100644 --- a/src/components/FormModelPopup.vue +++ b/src/components/FormModelPopup.vue @@ -62,6 +62,7 @@ defineExpose({ @click="emit('onDataCanceled')" v-close-popup data-cy="FormModelPopup_cancel" + z-max /> diff --git a/src/components/ItemsFilterPanel.vue b/src/components/ItemsFilterPanel.vue index 405577095..084feb377 100644 --- a/src/components/ItemsFilterPanel.vue +++ b/src/components/ItemsFilterPanel.vue @@ -9,6 +9,8 @@ import VnSelect from 'components/common/VnSelect.vue'; import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue'; import axios from 'axios'; +import { getParamWhere } from 'src/filters'; +import { useRoute } from 'vue-router'; const { t } = useI18n(); const props = defineProps({ @@ -26,28 +28,21 @@ const props = defineProps({ }, }); -const itemCategories = ref([]); -const selectedCategoryFk = ref(null); -const selectedTypeFk = ref(null); +const route = useRoute(); + const itemTypesOptions = ref([]); const suppliersOptions = ref([]); const tagOptions = ref([]); const tagValues = ref([]); +const categoryList = ref(null); +const selectedCategoryFk = ref(getParamWhere(route.query.table, 'categoryFk', false)); +const selectedTypeFk = ref(getParamWhere(route.query.table, 'typeFk', false)); -const categoryList = computed(() => { - return (itemCategories.value || []) - .filter((category) => category.display) - .map((category) => ({ - ...category, - icon: `vn:${(category.icon || '').split('-')[1]}`, - })); -}); - -const selectedCategory = computed(() => - (itemCategories.value || []).find( +const selectedCategory = computed(() => { + return (categoryList.value || []).find( (category) => category?.id === selectedCategoryFk.value - ) -); + ); +}); const selectedType = computed(() => { return (itemTypesOptions.value || []).find( @@ -87,7 +82,7 @@ const applyTags = (params, search) => { search(); }; -const fetchItemTypes = async (id) => { +const fetchItemTypes = async (id = selectedCategoryFk.value) => { const filter = { fields: ['id', 'name', 'categoryFk'], where: { categoryFk: id }, @@ -126,15 +121,19 @@ const removeTag = (index, params, search) => { (tagValues.value || []).splice(index, 1); applyTags(params, search); }; +const setCategoryList = (data) => { + categoryList.value = (data || []) + .filter((category) => category.display) + .map((category) => ({ + ...category, + icon: `vn:${(category.icon || '').split('-')[1]}`, + })); + fetchItemTypes(); +}; - (itemCategories = data)" - /> + = 0 && currentIndex < focusableElements.length - 1) { + focusableElements[currentIndex + 1].focus(); + } } } diff --git a/src/components/common/VnSelectWorker.vue b/src/components/common/VnSelectWorker.vue new file mode 100644 index 000000000..b0fef4443 --- /dev/null +++ b/src/components/common/VnSelectWorker.vue @@ -0,0 +1,85 @@ + + + + + + + + + + {{ $t($props.hasInfo) }} + + + + + + + {{ scope.opt.name }} + + + {{ scope.opt.nickname }} + + + {{ scope.opt.nickname }}, {{ scope.opt.code }} + + + + + + + + +es: + Responsible for approving invoices: Responsable de aprobar las facturas + diff --git a/src/components/ui/CatalogItem.vue b/src/components/ui/CatalogItem.vue index 7dca19770..74a36ff2e 100644 --- a/src/components/ui/CatalogItem.vue +++ b/src/components/ui/CatalogItem.vue @@ -67,7 +67,7 @@ const dialog = ref(null); {{ t('globals.add') }} dialog.hide()" /> diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 76dfd574f..67f6f387b 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -61,6 +61,7 @@ const emit = defineEmits([ 'update:modelValue', 'refresh', 'clear', + 'search', 'init', 'remove', 'setUserParams', diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue index bcbf0945e..e308ea9bb 100644 --- a/src/components/ui/VnNotes.vue +++ b/src/components/ui/VnNotes.vue @@ -6,7 +6,6 @@ import { useI18n } from 'vue-i18n'; import { useQuasar } from 'quasar'; import { toDateHourMin } from 'src/filters'; -import { useState } from 'src/composables/useState'; import VnPaginate from 'components/ui/VnPaginate.vue'; import VnUserLink from 'components/ui/VnUserLink.vue'; @@ -26,9 +25,7 @@ const $props = defineProps({ }); const { t } = useI18n(); -const state = useState(); const quasar = useQuasar(); -const currentUser = ref(state.getUser()); const newNote = reactive({ text: null, observationTypeFk: null }); const observationTypes = ref([]); const vnPaginateRef = ref(); diff --git a/src/composables/useRole.js b/src/composables/useRole.js index d1a6d6ef3..3ec65dd0a 100644 --- a/src/composables/useRole.js +++ b/src/composables/useRole.js @@ -20,7 +20,7 @@ export function useRole() { function hasAny(roles) { const roleStore = state.getRoles(); - + if (typeof roles === 'string') roles = [roles]; for (const role of roles) { if (roleStore.value.indexOf(role) !== -1) return true; } diff --git a/src/filters/getParamWhere.js b/src/filters/getParamWhere.js index ef00a93ae..baba46f69 100644 --- a/src/filters/getParamWhere.js +++ b/src/filters/getParamWhere.js @@ -1,4 +1,3 @@ -// parsing JSON safely function parseJSON(str, fallback) { try { return JSON.parse(str ?? '{}'); diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index db48219f8..c9f590565 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -403,8 +403,8 @@ entry: buys: Buys stickers: Stickers package: Package - packing: Packing - grouping: Grouping + packing: Pack. + grouping: Group. buyingValue: Buying value import: Import pvp: PVP diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 16e96d2aa..61a5984cb 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -406,8 +406,8 @@ entry: buys: Compras stickers: Etiquetas package: Embalaje - packing: Packing - grouping: Grouping + packing: Pack. + grouping: Group. buyingValue: Coste import: Importe pvp: PVP diff --git a/src/pages/Account/AccountFilter.vue b/src/pages/Account/AccountFilter.vue index 46fac875a..50c3ee1ac 100644 --- a/src/pages/Account/AccountFilter.vue +++ b/src/pages/Account/AccountFilter.vue @@ -31,7 +31,6 @@ const rolesOptions = ref([]); diff --git a/src/pages/Account/Acls/AclFilter.vue b/src/pages/Account/Acls/AclFilter.vue index 8609672b6..8035f92b8 100644 --- a/src/pages/Account/Acls/AclFilter.vue +++ b/src/pages/Account/Acls/AclFilter.vue @@ -37,11 +37,7 @@ onBeforeMount(() => { @on-fetch="(data) => (rolesOptions = data)" auto-load /> - + {{ t(`acls.aclFilter.${tag.label}`) }}: diff --git a/src/pages/Account/Card/AccountDescriptorMenu.vue b/src/pages/Account/Card/AccountDescriptorMenu.vue index 6f1d2ca1f..1780b4247 100644 --- a/src/pages/Account/Card/AccountDescriptorMenu.vue +++ b/src/pages/Account/Card/AccountDescriptorMenu.vue @@ -8,7 +8,7 @@ import { useAcl } from 'src/composables/useAcl'; import { useArrayData } from 'src/composables/useArrayData'; import VnConfirm from 'src/components/ui/VnConfirm.vue'; import VnChangePassword from 'src/components/common/VnChangePassword.vue'; -import useNotify from 'src/composables/useNotify.js'; +import { useQuasar } from 'quasar'; const $props = defineProps({ hasAccount: { @@ -21,7 +21,7 @@ const { t } = useI18n(); const { hasAccount } = toRefs($props); const { openConfirmationModal } = useVnConfirm(); const route = useRoute(); -const { notify } = useNotify(); +const { notify } = useQuasar(); const account = computed(() => useArrayData('AccountId').store.data[0]); account.value.hasAccount = hasAccount.value; const entityId = computed(() => +route.params.id); diff --git a/src/pages/Account/Role/AccountRolesFilter.vue b/src/pages/Account/Role/AccountRolesFilter.vue index ff4411897..cbe7a70c8 100644 --- a/src/pages/Account/Role/AccountRolesFilter.vue +++ b/src/pages/Account/Role/AccountRolesFilter.vue @@ -13,12 +13,7 @@ const props = defineProps({ - + {{ t(`role.${tag.label}`) }}: diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index 1a86d9f31..768c66f32 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -8,7 +8,7 @@ import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; -import VnAvatar from 'src/components/ui/VnAvatar.vue'; +import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; import { getDifferences, getUpdatedValues } from 'src/filters'; const route = useRoute(); @@ -16,7 +16,6 @@ const { t } = useI18n(); const businessTypes = ref([]); const contactChannels = ref([]); -const title = ref(); const handleSalesModelValue = (val) => ({ or: [ { id: val }, @@ -117,41 +116,17 @@ function onBeforeSave(formData, originalData) { /> - - - - - - - - {{ scope.opt?.name }} - {{ scope.opt?.nickname }}, - {{ scope.opt?.code }} - - - - + /> -import { computed, ref, onMounted } from 'vue'; +import { computed, ref } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; import VnUserLink from 'src/components/ui/VnUserLink.vue'; import { toCurrency, toPercentage, toDate, dashOrCurrency } from 'src/filters'; import CardSummary from 'components/ui/CardSummary.vue'; -import { getUrl } from 'src/composables/getUrl'; import VnLv from 'src/components/ui/VnLv.vue'; import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; import VnLinkMail from 'src/components/ui/VnLinkMail.vue'; @@ -102,7 +101,7 @@ const sumRisk = ({ clientRisks }) => { {{ t('globals.params.email') }} - { - { outlined rounded :input-debounce="0" - > - - - - {{ opt.name }} - - {{ opt.nickname }},{{ opt.code }} - - - - + /> diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index 865287aeb..e86e35966 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -2,7 +2,6 @@ import { ref, computed, markRaw } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; -import VnSelect from 'src/components/common/VnSelect.vue'; import VnTable from 'components/VnTable/VnTable.vue'; import VnLocation from 'src/components/common/VnLocation.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue'; @@ -12,7 +11,7 @@ import RightMenu from 'src/components/common/RightMenu.vue'; import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; import { toDate } from 'src/filters'; import CustomerFilter from './CustomerFilter.vue'; -import VnAvatar from 'src/components/ui/VnAvatar.vue'; +import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; const { t } = useI18n(); const router = useRouter(); @@ -422,40 +421,17 @@ function handleLocation(data, location) { auto-load > - - - - - - - - {{ scope.opt?.name }} - {{ scope.opt?.nickname }}, - {{ scope.opt?.code }} - - - - - + /> - { if (lastInput) lastInput.focus(); }); }; + +const removeRow = (row) => { + itemBarcodeRef.value.remove([row]); +}; + +const submit = async (rows) => { + const params = rows[rows.length - 1]; + let { data } = await axios.get('ItemBarcodes'); + const code = params.code; + + if (data.some((codes) => codes.code === code)) { + notify(t('Codes can not be repeated'), 'negative'); + itemBarcodeRef.value.reset(); + return; + } + await axios.patch(`ItemBarcodes`, params); + notify(t('globals.dataSaved'), 'positive'); +}; @@ -39,6 +60,7 @@ const focusLastInput = () => { ref="itemBarcodeRef" url="ItemBarcodes" auto-load + :save-fn="submit" > @@ -54,7 +76,7 @@ const focusLastInput = () => { focusable-input /> diff --git a/src/pages/Item/Card/ItemBasicData.vue b/src/pages/Item/Card/ItemBasicData.vue index 1b0342668..a1788617f 100644 --- a/src/pages/Item/Card/ItemBasicData.vue +++ b/src/pages/Item/Card/ItemBasicData.vue @@ -70,6 +70,7 @@ const onIntrastatCreated = (response, formData) => { option-label="name" hide-selected map-options + required > diff --git a/src/pages/Item/Card/ItemBotanical.vue b/src/pages/Item/Card/ItemBotanical.vue index c4b561772..57774f75e 100644 --- a/src/pages/Item/Card/ItemBotanical.vue +++ b/src/pages/Item/Card/ItemBotanical.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/Item/Card/ItemShelving.vue b/src/pages/Item/Card/ItemShelving.vue index 27e265e6b..7ad60c9e0 100644 --- a/src/pages/Item/Card/ItemShelving.vue +++ b/src/pages/Item/Card/ItemShelving.vue @@ -1,19 +1,15 @@ @@ -203,7 +152,7 @@ onMounted(async () => { { - - - - - - - - - - - - {{ row.longName }} + + + {{ row.longName }} - + - + diff --git a/src/pages/Item/Card/ItemSummary.vue b/src/pages/Item/Card/ItemSummary.vue index db90ba06f..7606e6a22 100644 --- a/src/pages/Item/Card/ItemSummary.vue +++ b/src/pages/Item/Card/ItemSummary.vue @@ -89,7 +89,7 @@ const getUrl = (id, param) => `#/Item/${id}/${param}`; { itemTagsRef.value.formData[itemTagsRef.value.formData.length - 1].priority = getHighestPriority(rows); }; + +const submitTags = async (data) => { + itemTagsRef.value.onSubmit(data); +}; @@ -77,7 +80,6 @@ const insertTag = (rows) => { data-key="ItemTags" model="ItemTags" url="ItemTags" - update-url="Tags/onSubmit" :data-required="{ $index: undefined, itemFk: route.params.id, @@ -147,6 +149,7 @@ const insertTag = (rows) => { v-model="row.value" :label="t('itemTags.value')" :is-clearable="false" + @keyup.enter.stop="submitTags(row)" /> { v-model="row.priority" :required="true" :rules="validate('itemTag.priority')" + @keyup.enter.stop="submitTags(row)" /> { + + +es: + Tags can not be repeated: Las etiquetas no pueden repetirse + diff --git a/src/pages/Item/Card/ItemTax.vue b/src/pages/Item/Card/ItemTax.vue index 84b5f63f4..8060481f0 100644 --- a/src/pages/Item/Card/ItemTax.vue +++ b/src/pages/Item/Card/ItemTax.vue @@ -28,7 +28,7 @@ const taxesFilter = { ], }; -const ItemTaxRef = ref(null); +const ItemTaxRef = ref(); const taxesOptions = ref([]); const submitTaxes = async (data) => { @@ -36,7 +36,10 @@ const submitTaxes = async (data) => { id: tax.id, taxClassFk: tax.taxClassFk, })); - + if (payload.some((item) => item.taxClassFk === null)) { + notify(t('Tax class cannot be blank'), 'negative'); + return; + } await axios.post(`Items/updateTaxes`, payload); notify(t('globals.dataSaved'), 'positive'); }; diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue index 8bf5d33bd..09fccfd6d 100644 --- a/src/pages/Item/ItemFixedPrice.vue +++ b/src/pages/Item/ItemFixedPrice.vue @@ -1,5 +1,5 @@ + + + + + { auto-load :disable-option="{ card: true }" chip-locale="item.params" + :right-search="false" > @@ -306,30 +315,28 @@ onMounted(async () => { /> - - - - {{ row.response }} - - - - - {{ t('Discard') }} - - - + + + {{ row.response }} + + + + + {{ t('Discard') }} + + diff --git a/src/pages/Item/ItemRequestFilter.vue b/src/pages/Item/ItemRequestFilter.vue index 64bc0e575..ea1a6e760 100644 --- a/src/pages/Item/ItemRequestFilter.vue +++ b/src/pages/Item/ItemRequestFilter.vue @@ -1,5 +1,5 @@ @@ -145,33 +161,17 @@ const decrement = (paramsObj, key) => { - - - - - {{ scope.opt?.name }} - {{ scope.opt?.nickname }}, - {{ scope.opt?.code }} - - - - + /> diff --git a/src/pages/Item/ItemType/ItemTypeSearchbar.vue b/src/pages/Item/ItemType/ItemTypeSearchbar.vue index 87903a517..749033d43 100644 --- a/src/pages/Item/ItemType/ItemTypeSearchbar.vue +++ b/src/pages/Item/ItemType/ItemTypeSearchbar.vue @@ -10,7 +10,6 @@ const { t } = useI18n(); url="ItemTypes" :label="t('Search item type')" :info="t('Search itemType by id, name or code')" - search-url="table" /> diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue index 149de482d..4cea931e2 100644 --- a/src/pages/Item/ItemTypeList.vue +++ b/src/pages/Item/ItemTypeList.vue @@ -6,6 +6,7 @@ import VnTable from 'components/VnTable/VnTable.vue'; import FetchData from 'components/FetchData.vue'; import RightMenu from 'src/components/common/RightMenu.vue'; import ItemTypeFilter from './ItemType/ItemTypeFilter.vue'; +import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue'; const { t } = useI18n(); const tableRef = ref(); @@ -31,13 +32,14 @@ const columns = computed(() => [ { align: 'left', name: 'name', - label: t('name'), + label: t('globals.name'), cardVisible: true, create: true, }, { align: 'left', label: t('worker'), + name: 'workerFk', create: true, component: 'select', attrs: { @@ -45,20 +47,20 @@ const columns = computed(() => [ optionLabel: 'nickname', optionValue: 'id', }, + format: (row) => row.worker?.user?.name, cardVisible: true, - visible: true, - columnField: { - component: 'userLink', - attrs: ({ row }) => { - return { - workerId: row?.worker?.id, - name: row.worker?.user?.name, - defaultName: true, - }; - }, - }, + columnField: { component: null }, columnFilter: { - name: 'workerFk', + attrs: { + url: 'Workers/activeWithInheritedRole', + fields: ['id', 'name'], + where: { role: 'buyer' }, + optionFilter: 'firstName', + optionLabel: 'name', + optionValue: 'id', + useLike: false, + }, + inWhere: true, }, }, { @@ -135,24 +137,27 @@ const columns = computed(() => [ :columns="columns" auto-load :right-search="false" - :is-editable="false" - :use-model="true" redirect="item/item-type" - /> + > + + + {{ row.worker?.user?.name }} + + + + es: id: Id code: Código - name: Nombre worker: Trabajador ItemCategory: Reino Temperature: Temperatura Create ItemTypes: Crear familia en: code: Code - name: Name worker: Worker ItemCategory: ItemCategory Temperature: Temperature diff --git a/src/pages/Item/locale/en.yml b/src/pages/Item/locale/en.yml index 78a1c3ff0..9b667fcaa 100644 --- a/src/pages/Item/locale/en.yml +++ b/src/pages/Item/locale/en.yml @@ -95,6 +95,15 @@ item: mine: For me state: State myTeam: My team + shipped: Shipped + description: Description + quantity: Quantity + price: Price + item: Item + achieved: Achieved + concept: Concept + denyOptions: Deny + scopeDays: Scope days searchbar: label: Search item descriptor: @@ -112,7 +121,7 @@ item: title: All its properties will be copied subTitle: Do you want to clone this item? list: - id: Identifier + id: Id grouping: Grouping packing: Packing description: Description @@ -122,8 +131,9 @@ item: intrastat: Intrastat isActive: Active size: Size - origin: Origin + origin: Orig. userName: Buyer + weight: Weight weightByPiece: Weight/Piece stemMultiplier: Multiplier producer: Producer diff --git a/src/pages/Item/locale/es.yml b/src/pages/Item/locale/es.yml index 5498f4458..eb3ddd4de 100644 --- a/src/pages/Item/locale/es.yml +++ b/src/pages/Item/locale/es.yml @@ -97,6 +97,15 @@ item: mine: Para mi state: Estado myTeam: Mi equipo + shipped: Enviado + description: Descripción + quantity: Cantidad + price: Precio + item: Artículo + achieved: Conseguido + concept: Concepto + denyOptions: Denegado + scopeDays: Días en adelante searchbar: label: Buscar artículo descriptor: @@ -114,7 +123,7 @@ item: title: Todas sus propiedades serán copiadas subTitle: ¿Desea clonar este artículo? list: - id: Identificador + id: Id grouping: Grouping packing: Packing description: Descripción @@ -124,7 +133,8 @@ item: intrastat: Intrastat isActive: Activo size: Medida - origin: Origen + origin: Orig. + weight: Peso weightByPiece: Peso (gramos)/tallo userName: Comprador stemMultiplier: Multiplicador diff --git a/src/pages/Monitor/Ticket/MonitorTicketFilter.vue b/src/pages/Monitor/Ticket/MonitorTicketFilter.vue index 2205666ec..8377d73ef 100644 --- a/src/pages/Monitor/Ticket/MonitorTicketFilter.vue +++ b/src/pages/Monitor/Ticket/MonitorTicketFilter.vue @@ -9,6 +9,7 @@ import VnInput from 'src/components/common/VnInput.vue'; import VnInputNumber from 'src/components/common/VnInputNumber.vue'; import FetchData from 'src/components/FetchData.vue'; import { dateRange } from 'src/filters'; +import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; defineProps({ dataKey: { type: String, required: true } }); const { t, te } = useI18n(); @@ -112,33 +113,16 @@ const getLocale = (label) => { - - - - - {{ opt.name }} - - {{ `${opt.nickname}, ${opt.code}` }} - - - - - + diff --git a/src/pages/Order/Card/OrderCatalog.vue b/src/pages/Order/Card/OrderCatalog.vue index a71065521..453037f15 100644 --- a/src/pages/Order/Card/OrderCatalog.vue +++ b/src/pages/Order/Card/OrderCatalog.vue @@ -1,7 +1,7 @@ @@ -115,6 +127,7 @@ watch( -import toCurrency from '../../../filters/toCurrency'; -import { ref } from 'vue'; +import toCurrency from 'src/filters/toCurrency'; +import { inject, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import axios from 'axios'; import { useRoute } from 'vue-router'; import useNotify from 'composables/useNotify'; import { useArrayData } from 'composables/useArrayData'; +import VnInputNumber from 'src/components/common/VnInputNumber.vue'; const { t } = useI18n(); const { notify } = useNotify(); const emit = defineEmits(['added']); const route = useRoute(); const props = defineProps({ - prices: { + item: { type: Array, required: true, }, }); - -const fields = ref((props.prices || []).map((item) => ({ ...item, quantity: 0 }))); +const onItemSaved = inject('onItemSaved'); +const prices = ref((props.item.prices || []).map((item) => ({ ...item, quantity: 0 }))); const descriptorData = useArrayData('orderData'); const isLoading = ref(false); const addToOrder = async () => { if (isLoading.value) return; isLoading.value = true; - const items = (fields.value || []).filter((item) => Number(item.quantity) > 0); + const items = (prices.value || []).filter((item) => Number(item.quantity) > 0); await axios.post('/OrderRows/addToOrder', { items, orderFk: Number(route.params.id), }); notify(t('globals.dataSaved'), 'positive'); - emit('added'); - descriptorData.fetch({}); + await descriptorData.fetch({}); + onItemSaved({ ...props, items, saved: true }); + emit('added', items); isLoading.value = false; }; const canAddToOrder = () => { - return (fields.value || []).some((item) => Number(item.quantity) > 0); + let canAddToOrder = (prices.value || []).some((price) => Number(price.quantity) > 0); + if (canAddToOrder) { + const excedQuantity = prices.value.reduce( + (acc, { quantity }) => acc + quantity, + 0 + ); + if (excedQuantity > props.item.available) { + canAddToOrder = false; + } + } + return canAddToOrder; }; @@ -44,30 +56,33 @@ const canAddToOrder = () => { - + - {{ item.warehouse }} + {{ price.warehouse }} { - item.quantity += item.grouping; + price.quantity -= price.grouping; + } + " + @click.exact=" + () => { + price.quantity += price.grouping; } " > - {{ item.grouping }} + {{ price.grouping }} - x {{ toCurrency(item.price) }} + x {{ toCurrency(price.price) }} - diff --git a/src/pages/Order/Card/OrderFilter.vue b/src/pages/Order/Card/OrderFilter.vue index 917369919..dc86600ac 100644 --- a/src/pages/Order/Card/OrderFilter.vue +++ b/src/pages/Order/Card/OrderFilter.vue @@ -6,6 +6,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnSelect from 'components/common/VnSelect.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import VnInput from 'components/common/VnInput.vue'; +import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; const { t } = useI18n(); const props = defineProps({ @@ -61,28 +62,16 @@ const sourceList = ref([]); outlined rounded /> - - - - - {{ opt.name }} - - {{ opt.nickname }},{{ opt.code }} - - - - - + /> - - - - - {{ opt.name }} - - {{ opt.nickname }},{{ opt.code }} - - - - - + /> diff --git a/src/pages/Route/Card/RouteForm.vue b/src/pages/Route/Card/RouteForm.vue index 8c89718fa..aa5caf1ef 100644 --- a/src/pages/Route/Card/RouteForm.vue +++ b/src/pages/Route/Card/RouteForm.vue @@ -11,6 +11,7 @@ import VnInputDate from 'components/common/VnInputDate.vue'; import VnInput from 'components/common/VnInput.vue'; import axios from 'axios'; import VnInputTime from 'components/common/VnInputTime.vue'; +import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; const { t } = useI18n(); const route = useRoute(); @@ -94,26 +95,7 @@ const onSave = (data, response) => { > - - - - - {{ opt.name }} - - {{ opt.nickname }}, {{ opt.code }} - - - - - + { +const cloneRoutes = async () => { if (!selectedRows.value.length || !startingDate.value) return; - axios.post('Routes/clone', { - created: startingDate.value, + await axios.post('Routes/clone', { + dated: startingDate.value, ids: selectedRows.value.map((row) => row?.id), }); startingDate.value = null; @@ -274,7 +274,6 @@ const openTicketsDialog = (id) => { {{ t('route.Select the starting date') }} - (stateStore.rightDrawer = true)); -onUnmounted(() => (stateStore.rightDrawer = false)); function navigate(id) { router.push({ path: `/shelving/${id}` }); diff --git a/src/pages/Supplier/Card/SupplierBasicData.vue b/src/pages/Supplier/Card/SupplierBasicData.vue index 70f6432dd..842109656 100644 --- a/src/pages/Supplier/Card/SupplierBasicData.vue +++ b/src/pages/Supplier/Card/SupplierBasicData.vue @@ -5,6 +5,7 @@ import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; +import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; const route = useRoute(); const { t } = useI18n(); @@ -30,31 +31,11 @@ const companySizes = [ :rules="validate('supplier.nickname')" clearable /> - - - - {{ - t('Responsible for approving invoices') - }} - - - - - - {{ scope.opt?.name }} - - {{ scope.opt?.nickname }}, {{ scope.opt?.id }} - - - - - + /> es: - Responsible for approving invoices: Responsable de aprobar las facturas Small(1-5), Medium(6-50), Big(> 50): Pequeño(1-5), Mediano(6-50), Grande(> 50) diff --git a/src/pages/Ticket/Card/BasicData/TicketBasicData.vue b/src/pages/Ticket/Card/BasicData/TicketBasicData.vue index ab96a6e75..0f6cc5772 100644 --- a/src/pages/Ticket/Card/BasicData/TicketBasicData.vue +++ b/src/pages/Ticket/Card/BasicData/TicketBasicData.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/Ticket/Card/TicketComponents.vue b/src/pages/Ticket/Card/TicketComponents.vue index b88dd89e8..8fab1968b 100644 --- a/src/pages/Ticket/Card/TicketComponents.vue +++ b/src/pages/Ticket/Card/TicketComponents.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/Ticket/Card/TicketCreateTracking.vue b/src/pages/Ticket/Card/TicketCreateTracking.vue index 3ea762c6c..5c1e916f2 100644 --- a/src/pages/Ticket/Card/TicketCreateTracking.vue +++ b/src/pages/Ticket/Card/TicketCreateTracking.vue @@ -9,6 +9,7 @@ import VnSelect from 'src/components/common/VnSelect.vue'; import FetchData from 'components/FetchData.vue'; import { useState } from 'src/composables/useState'; +import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; const emit = defineEmits(['onRequestCreated']); @@ -46,29 +47,7 @@ const onStateFkChange = (formData) => (formData.userFk = user.value.id); option-label="name" option-value="id" /> - - - - - - {{ opt.name }} - - - {{ opt.nickname }}, {{ opt.code }} - - - - + diff --git a/src/pages/Ticket/Card/TicketExpedition.vue b/src/pages/Ticket/Card/TicketExpedition.vue index b7f1f4dd0..38010a997 100644 --- a/src/pages/Ticket/Card/TicketExpedition.vue +++ b/src/pages/Ticket/Card/TicketExpedition.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue index 19cfdee2c..a7e0f6171 100644 --- a/src/pages/Ticket/Card/TicketSale.vue +++ b/src/pages/Ticket/Card/TicketSale.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/Ticket/TicketAdvanceFilter.vue b/src/pages/Ticket/TicketAdvanceFilter.vue index a1d301f35..6528bf380 100644 --- a/src/pages/Ticket/TicketAdvanceFilter.vue +++ b/src/pages/Ticket/TicketAdvanceFilter.vue @@ -57,7 +57,6 @@ onMounted(async () => await getItemPackingTypes()); search-url="advanceTickets" :data-key="props.dataKey" :search-button="true" - :hidden-tags="['search']" :unremovable-params="['warehouseFk', 'dateFuture', 'dateToAdvance']" > diff --git a/src/pages/Ticket/TicketFutureFilter.vue b/src/pages/Ticket/TicketFutureFilter.vue index ffe967272..d28b0af71 100644 --- a/src/pages/Ticket/TicketFutureFilter.vue +++ b/src/pages/Ticket/TicketFutureFilter.vue @@ -59,7 +59,6 @@ onMounted(async () => { /> diff --git a/src/pages/Ticket/TicketWeekly.vue b/src/pages/Ticket/TicketWeekly.vue index 306f414df..0e18fe028 100644 --- a/src/pages/Ticket/TicketWeekly.vue +++ b/src/pages/Ticket/TicketWeekly.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/Worker/Card/WorkerBalance.vue b/src/pages/Worker/Card/WorkerBalance.vue index 25ab92c9b..95e0b986e 100644 --- a/src/pages/Worker/Card/WorkerBalance.vue +++ b/src/pages/Worker/Card/WorkerBalance.vue @@ -15,6 +15,9 @@ const columns = computed(() => [ name: 'paymentDate', label: t('worker.balance.tableVisibleColumns.paymentDate'), create: true, + columnCreate: { + required: true, + }, component: 'date', field: 'paymentDate', cardVisible: true, @@ -24,6 +27,9 @@ const columns = computed(() => [ name: 'incomeTypeFk', label: t('worker.balance.tableVisibleColumns.incomeType'), create: true, + columnCreate: { + required: true, + }, component: 'select', attrs: { options: payrollComponents, @@ -37,6 +43,9 @@ const columns = computed(() => [ name: 'debit', label: t('worker.balance.tableVisibleColumns.debit'), create: true, + columnCreate: { + required: true, + }, component: 'input', field: 'debit', cardVisible: true, @@ -46,6 +55,9 @@ const columns = computed(() => [ name: 'credit', label: t('worker.balance.tableVisibleColumns.credit'), create: true, + columnCreate: { + required: true, + }, component: 'input', field: 'credit', cardVisible: true, diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue index 13f9e9795..73ea34fe9 100644 --- a/src/pages/Worker/Card/WorkerDescriptor.vue +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -206,6 +206,8 @@ const handlePhotoUpdated = (evt = false) => { es: + Go to client: Ir a cliente + Go to user: Ir al usuario Click to allow the user to be disabled: Marcar para deshabilitar Click to exclude the user from getting disabled: Marcar para no deshabilitar diff --git a/src/pages/Worker/WorkerCreate.vue b/src/pages/Worker/WorkerCreate.vue index 5676837dd..a4c6c2a06 100644 --- a/src/pages/Worker/WorkerCreate.vue +++ b/src/pages/Worker/WorkerCreate.vue @@ -14,6 +14,7 @@ import FormModel from 'components/FormModel.vue'; import CreateBankEntityForm from 'src/components/CreateBankEntityForm.vue'; import VnRadio from 'src/components/common/VnRadio.vue'; import { useState } from 'src/composables/useState'; +import VnSelectWorker from 'src/components/common/VnSelectWorker.vue'; const { t } = useI18n(); const user = useState().getUser(); @@ -149,27 +150,11 @@ async function autofillBic(worker) { hide-selected :rules="validate('Worker.company')" /> - - - - - {{ scope.opt.name }} - {{ scope.opt.nickname }}, - {{ scope.opt.code }} - - - - - + /> - - - - - {{ scope.opt.name }} - {{ scope.opt.nickname }}, - {{ scope.opt.code }} - - - - - + /> @@ -376,6 +361,7 @@ async function autofillBic(worker) { es: + Create worker: Crear trabajador Search worker: Buscar trabajador You can search by worker id or name: Puedes buscar por id o nombre del trabajador diff --git a/src/pages/Zone/Card/ZoneEvents.vue b/src/pages/Zone/Card/ZoneEvents.vue index 6d5b37096..0685c264f 100644 --- a/src/pages/Zone/Card/ZoneEvents.vue +++ b/src/pages/Zone/Card/ZoneEvents.vue @@ -1,5 +1,5 @@ diff --git a/src/pages/Zone/ZoneFilterPanel.vue b/src/pages/Zone/ZoneFilterPanel.vue index 55d21756d..3a35527ab 100644 --- a/src/pages/Zone/ZoneFilterPanel.vue +++ b/src/pages/Zone/ZoneFilterPanel.vue @@ -28,11 +28,7 @@ const agencies = ref([]); @on-fetch="(data) => (agencies = data)" auto-load /> - + {{ t(`filterPanel.${tag.label}`) }}: diff --git a/test/cypress/integration/client/clientBasicData.spec.js b/test/cypress/integration/client/clientBasicData.spec.js index efaad33c2..bed28dc22 100644 --- a/test/cypress/integration/client/clientBasicData.spec.js +++ b/test/cypress/integration/client/clientBasicData.spec.js @@ -7,8 +7,8 @@ describe('Client basic data', () => { }); it('Should load layout', () => { cy.get('.q-card').should('be.visible'); - cy.dataCy('customerPhone').filter('input').should('be.visible'); - cy.dataCy('customerPhone').filter('input').type('123456789'); + cy.dataCy('customerPhone').find('input').should('be.visible'); + cy.dataCy('customerPhone').find('input').type('123456789'); cy.get('.q-btn-group > .q-btn--standard').click(); cy.intercept('PATCH', '/api/Clients/1102', (req) => { const { body } = req; diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js index e89b5fc77..ce07deb16 100644 --- a/test/cypress/integration/client/clientList.spec.js +++ b/test/cypress/integration/client/clientList.spec.js @@ -22,10 +22,10 @@ describe('Client list', () => { const data = { Name: { val: `Name ${randomInt}` }, 'Social name': { val: `TEST ${randomInt}` }, - 'Tax number': { val: `20852${randomInt.length}3Z` }, + 'Tax number': { val: `20852${randomInt}3Z` }, 'Web user': { val: `user_test_${randomInt}` }, Street: { val: `C/ STREET ${randomInt}` }, - Email: { val: 'user.test@1.com' }, + Email: { val: `user.test${randomInt}@cypress.com` }, 'Sales person': { val: 'employee', type: 'select' }, Location: { val: '46000, Valencia(Province one), España', type: 'select' }, 'Business type': { val: 'Otros', type: 'select' }, @@ -34,7 +34,7 @@ describe('Client list', () => { cy.get('.q-mt-lg > .q-btn--standard').click(); - cy.checkNotification('Data saved'); + cy.checkNotification('Data created'); cy.url().should('include', '/summary'); }); it('Client list search client', () => { diff --git a/test/cypress/integration/item/ItemFixedPrice.spec.js b/test/cypress/integration/item/ItemFixedPrice.spec.js new file mode 100644 index 000000000..824ecf7a0 --- /dev/null +++ b/test/cypress/integration/item/ItemFixedPrice.spec.js @@ -0,0 +1,63 @@ +/// +function goTo(n = 1) { + return `.q-virtual-scroll__content > :nth-child(${n})`; +} +const firstRow = goTo(); +`.q-virtual-scroll__content > :nth-child(2)`; +describe('Handle Items FixedPrice', () => { + beforeEach(() => { + cy.viewport(1280, 720); + cy.login('developer'); + cy.visit('/#/item/fixed-price', { timeout: 5000 }); + cy.waitForElement('.q-table'); + cy.get( + '.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon' + ).click(); + }); + it('filter', function () { + cy.get('.category-filter > :nth-child(1) > .q-btn__content > .q-icon').click(); + cy.selectOption('.list > :nth-child(2)', 'Alstroemeria'); + cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); + + cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); + cy.selectOption(`${firstRow} > :nth-child(2)`, '#13'); + cy.get(`${firstRow} > :nth-child(4)`).find('input').type(1); + cy.get(`${firstRow} > :nth-child(5)`).find('input').type('2'); + cy.selectOption(`${firstRow} > :nth-child(9)`, 'Warehouse One'); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + /* ==== End Cypress Studio ==== */ + }); + it('Create and delete ', function () { + cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); + cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); + cy.selectOption(`${firstRow} > :nth-child(2)`, '#11'); + cy.get(`${firstRow} > :nth-child(4)`).type('1'); + cy.get(`${firstRow} > :nth-child(5)`).type('2'); + cy.selectOption(`${firstRow} > :nth-child(9)`, 'Warehouse One'); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); + cy.get(`${firstRow} > .text-right > .q-btn > .q-btn__content > .q-icon`).click(); + cy.get( + '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block' + ).click(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + }); + + it('Massive edit', function () { + cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click(); + cy.get('#subToolbar > .q-btn--standard').click(); + cy.selectOption("[data-cy='field-to-edit']", 'Min price'); + cy.dataCy('value-to-edit').find('input').type('1'); + cy.get('.countLines').should('have.text', ' 1 '); + cy.get('.q-mt-lg > .q-btn--standard').click(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + }); + it('Massive remove', function () { + cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click(); + cy.get('#subToolbar > .q-btn--flat').click(); + cy.get( + '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block' + ).click(); + cy.get('.q-notification__message').should('have.text', 'Data saved'); + }); +}); diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js index bbdbcea92..c1d1a0655 100644 --- a/test/cypress/integration/ticket/ticketList.spec.js +++ b/test/cypress/integration/ticket/ticketList.spec.js @@ -37,7 +37,7 @@ describe('TicketList', () => { cy.dataCy('ticketSummary').should('exist'); }); - it('Client list create new client', () => { + it.only('Client list create new client', () => { cy.dataCy('vnTableCreateBtn').should('exist'); cy.dataCy('vnTableCreateBtn').click(); const data = { @@ -47,7 +47,8 @@ describe('TicketList', () => { Landed: { val: '01-01-2024', type: 'date' }, }; cy.fillInForm(data); - cy.get('.q-mt-lg > .q-btn--standard').click(); + cy.dataCy('Agency_select').click(); + cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data created'); cy.url().should('match', /\/ticket\/\d+\/summary/); }); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 21121d9df..2b13a7144 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -110,14 +110,14 @@ Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => { const { type, val } = field; switch (type) { case 'select': - cy.wrap(el).type(val); + cy.get(el).click(); cy.get('.q-menu .q-item').contains(val).click(); break; case 'date': - cy.wrap(el).type(val.split('-').join('')); + cy.get(el).type(val.split('-').join('')); break; case 'time': - cy.wrap(el).click(); + cy.get(el).click(); cy.get('.q-time .q-time__clock').contains(val.h).click(); cy.get('.q-time .q-time__clock').contains(val.m).click(); cy.get('.q-time .q-time__link').contains(val.x).click();
{{ t('route.Select the starting date') }}