diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 6303f48ae..e0182a6b5 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -83,7 +83,7 @@ const isLoading = ref(false); const hasChanges = ref(false); const originalData = ref(); const vnPaginateRef = ref(); -const formData = ref([]); +const formData = ref(); const saveButtonRef = ref(null); const watchChanges = ref(); const formUrl = computed(() => $props.url); @@ -298,6 +298,10 @@ watch(formUrl, async () => { }); - diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 32a8db16f..8c70cbef7 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -183,7 +183,7 @@ const arrayData = useArrayData(arrayDataKey, { searchUrl: false, mapKey: $attrs['map-key'], }); - +const someIsLoading = computed(() => isLoading.value || arrayData.isLoading); function findKeyInOptions() { if (!$props.options) return; return filter($props.modelValue, $props.options)?.length; @@ -366,7 +366,8 @@ function getCaption(opt) { virtual-scroll-slice-size="options.length" hide-bottom-space :input-debounce="useURL ? '300' : '0'" - :loading="isLoading" + :loading="someIsLoading" + :disable="someIsLoading" @virtual-scroll="onScroll" @keydown="handleKeyDown" :data-cy="$attrs.dataCy ?? $attrs.label + '_select'" diff --git a/src/pages/Item/Card/ItemTags.vue b/src/pages/Item/Card/ItemTags.vue index ab26b9cae..87d42e25b 100644 --- a/src/pages/Item/Card/ItemTags.vue +++ b/src/pages/Item/Card/ItemTags.vue @@ -89,7 +89,6 @@ const insertTag = (rows) => { :default-remove="false" :user-filter="{ fields: ['id', 'itemFk', 'tagFk', 'value', 'priority'], - where: { itemFk: route.params.id }, include: { relation: 'tag', scope: { @@ -97,6 +96,7 @@ const insertTag = (rows) => { }, }, }" + :filter="{ where: { itemFk: route.params.id } }" order="priority" auto-load @on-fetch="onItemTagsFetched" diff --git a/src/pages/Item/composables/cloneItem.js b/src/pages/Item/composables/cloneItem.js index 2421c0808..4e19661ca 100644 --- a/src/pages/Item/composables/cloneItem.js +++ b/src/pages/Item/composables/cloneItem.js @@ -11,26 +11,19 @@ export function cloneItem() { const router = useRouter(); const cloneItem = async (entityId) => { const { id } = entityId; - try { - const { data } = await axios.post(`Items/${id ?? entityId}/clone`); - router.push({ name: 'ItemTags', params: { id: data.id } }); - } catch (err) { - console.error('Error cloning item'); - } + const { data } = await axios.post(`Items/${id ?? entityId}/clone`); + router.push({ name: 'ItemTags', params: { id: data.id } }); }; const openCloneDialog = async (entityId) => { - quasar - .dialog({ - component: VnConfirm, - componentProps: { - title: t('item.descriptor.clone.title'), - message: t('item.descriptor.clone.subTitle'), - }, - }) - .onOk(async () => { - await cloneItem(entityId); - }); + quasar.dialog({ + component: VnConfirm, + componentProps: { + title: t('item.descriptor.clone.title'), + message: t('item.descriptor.clone.subTitle'), + promise: () => cloneItem(entityId), + }, + }); }; return { openCloneDialog }; }