From 48f10707400afd1ddedb843f236dd6fc28d5b8bd Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 5 Nov 2024 12:52:53 +0100 Subject: [PATCH 001/193] feat(VnLog): add descriptors --- src/components/common/VnJsonValue.vue | 63 ++++++++++++++++++--------- src/components/common/VnLog.vue | 59 +++++++++++-------------- src/stores/useDescriptorStore.js | 29 ++++++++++++ 3 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 src/stores/useDescriptorStore.js diff --git a/src/components/common/VnJsonValue.vue b/src/components/common/VnJsonValue.vue index a2e858d0d..408d16d1a 100644 --- a/src/components/common/VnJsonValue.vue +++ b/src/components/common/VnJsonValue.vue @@ -1,67 +1,86 @@ @@ -85,4 +104,8 @@ updateValue(); color: #cd7c7c; font-style: italic; } +.json-link { + text-decoration: underline; + cursor: pointer; +} diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 8c71c0997..7b65a8a88 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -598,33 +598,17 @@ watch( /> - - - {{ prop.nameI18n }}: - - - ,  - - - -
+ - {{ prop.nameI18n }}: + v-if=" + prop2Index < log.props.length + " + class="q-mr-xs" + >, - #{{ prop.val.id }} - + { + const descriptors = ref({}); + const loaded = ref(false); + + function set() { + const files = import.meta.glob(`src/**/*DescriptorProxy.vue`); + for (const file in files) { + descriptors.value[file.split('/').at(-1).slice(0, -19).toLowerCase() + 'Fk'] = + defineAsyncComponent(() => import(file)); + } + loaded.value = true; + } + + function get() { + if (!loaded.value) set(); + } + + function has(name) { + get(); + return descriptors.value[name]; + } + + return { + has, + }; +}); From a6a27237341f27db158378a45d064b6458d33139 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 27 Jan 2025 14:21:09 +0100 Subject: [PATCH 002/193] feat: refs #8463 cardDescriptorBeta --- src/components/common/VnCardBeta.vue | 75 +++-- src/components/ui/CardDescriptorBeta.vue | 262 ++++++++++++++++++ src/pages/Order/Card/OrderCard.vue | 30 ++ src/pages/Order/Card/OrderDescriptor.vue | 45 +-- src/pages/Order/Card/OrderDescriptorProxy.vue | 7 +- src/pages/Order/Card/OrderSummary.vue | 3 +- 6 files changed, 358 insertions(+), 64 deletions(-) create mode 100644 src/components/ui/CardDescriptorBeta.vue diff --git a/src/components/common/VnCardBeta.vue b/src/components/common/VnCardBeta.vue index a1f07ff17..2579bf623 100644 --- a/src/components/common/VnCardBeta.vue +++ b/src/components/common/VnCardBeta.vue @@ -1,5 +1,5 @@ diff --git a/src/components/ui/CardDescriptorBeta.vue b/src/components/ui/CardDescriptorBeta.vue new file mode 100644 index 000000000..b2bac234d --- /dev/null +++ b/src/components/ui/CardDescriptorBeta.vue @@ -0,0 +1,262 @@ + + + + + + + diff --git a/src/pages/Order/Card/OrderCard.vue b/src/pages/Order/Card/OrderCard.vue index 823815f59..b371509c6 100644 --- a/src/pages/Order/Card/OrderCard.vue +++ b/src/pages/Order/Card/OrderCard.vue @@ -1,12 +1,42 @@ diff --git a/src/pages/Order/Card/OrderDescriptor.vue b/src/pages/Order/Card/OrderDescriptor.vue index 0d5f0146f..4c2384f92 100644 --- a/src/pages/Order/Card/OrderDescriptor.vue +++ b/src/pages/Order/Card/OrderDescriptor.vue @@ -6,10 +6,11 @@ import { toCurrency, toDate } from 'src/filters'; import { useState } from 'src/composables/useState'; import useCardDescription from 'src/composables/useCardDescription'; -import CardDescriptor from 'components/ui/CardDescriptor.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import FetchData from 'components/FetchData.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; +import OrderCard from './OrderCard.vue'; +import CardDescriptorBeta from 'src/components/ui/CardDescriptorBeta.vue'; const DEFAULT_ITEMS = 0; @@ -26,37 +27,13 @@ const state = useState(); const { t } = useI18n(); const data = ref(useCardDescription()); const getTotalRef = ref(); +const total = ref(0); const entityId = computed(() => { return $props.id || route.params.id; }); -const filter = { - include: [ - { relation: 'agencyMode', scope: { fields: ['name'] } }, - { - relation: 'address', - scope: { fields: ['nickname'] }, - }, - { relation: 'rows', scope: { fields: ['id'] } }, - { - relation: 'client', - scope: { - fields: [ - 'salesPersonFk', - 'name', - 'isActive', - 'isFreezed', - 'isTaxDataChecked', - ], - include: { - relation: 'salesPersonUser', - scope: { fields: ['id', 'name'] }, - }, - }, - }, - ], -}; +const orderTotal = computed(() => state.get('orderTotal') ?? 0); const setData = (entity) => { if (!entity) return; @@ -68,9 +45,6 @@ const setData = (entity) => { const getConfirmationValue = (isConfirmed) => { return t(isConfirmed ? 'globals.confirmed' : 'order.summary.notConfirmed'); }; - -const orderTotal = computed(() => state.get('orderTotal') ?? 0); -const total = ref(0); diff --git a/src/pages/Order/Card/OrderDescriptorProxy.vue b/src/pages/Order/Card/OrderDescriptorProxy.vue index 04ebb054a..7b3d1a871 100644 --- a/src/pages/Order/Card/OrderDescriptorProxy.vue +++ b/src/pages/Order/Card/OrderDescriptorProxy.vue @@ -12,6 +12,11 @@ const $props = defineProps({ diff --git a/src/pages/Order/Card/OrderSummary.vue b/src/pages/Order/Card/OrderSummary.vue index a289688e4..bef97bc0f 100644 --- a/src/pages/Order/Card/OrderSummary.vue +++ b/src/pages/Order/Card/OrderSummary.vue @@ -13,6 +13,7 @@ import FetchedTags from 'components/ui/FetchedTags.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import OrderDescriptorMenu from 'pages/Order/Card/OrderDescriptorMenu.vue'; +import OrderDescriptorProxy from './OrderDescriptorProxy.vue'; const { t } = useI18n(); const route = useRoute(); @@ -106,7 +107,7 @@ async function handleConfirm() { From e0459f201604a7cdbca584752380ee5e7f8c797c Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 20 Feb 2025 12:22:58 +0100 Subject: [PATCH 003/193] fix: refs #8581 update data-cy attribute binding #7529 --- src/components/common/VnInput.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index aeb4a31fd..03f2294a1 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -143,7 +143,7 @@ const handleUppercase = () => { :rules="mixinRules" :lazy-rules="true" hide-bottom-space - :data-cy="$attrs.dataCy ?? $attrs.label + '_input'" + :data-cy="$attrs['data-cy'] ?? $attrs.label + '_input'" >