Merge pull request 'fix(VnLog): refs #6994 simplify value binding and improve descriptor handling' (!1636) from 6994-fix_vnLogValue_whenIsString into dev
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #1636
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
Alex Moreno 2025-03-26 08:29:35 +00:00
commit 382432636f
3 changed files with 21 additions and 17 deletions

View File

@ -561,9 +561,7 @@ watch(
}}: }}:
</span> </span>
<VnLogValue <VnLogValue
:value=" :value="value.val"
value.val.val
"
:name="value.name" :name="value.name"
/> />
</QItem> </QItem>
@ -616,7 +614,7 @@ watch(
{{ prop.nameI18n }}: {{ prop.nameI18n }}:
</span> </span>
<VnLogValue <VnLogValue
:value="prop.val.val" :value="prop.val"
:name="prop.name" :name="prop.name"
/> />
<span <span
@ -647,7 +645,7 @@ watch(
</span> </span>
<span v-if="log.action == 'update'"> <span v-if="log.action == 'update'">
<VnLogValue <VnLogValue
:value="prop.old.val" :value="prop.old"
:name="prop.name" :name="prop.name"
/> />
<span <span
@ -658,7 +656,7 @@ watch(
</span> </span>
<VnLogValue <VnLogValue
:value="prop.val.val" :value="prop.val"
:name="prop.name" :name="prop.name"
/> />
<span <span
@ -670,7 +668,7 @@ watch(
</span> </span>
<span v-else="prop.old.val"> <span v-else="prop.old.val">
<VnLogValue <VnLogValue
:value="prop.val.val" :value="prop.val"
:name="prop.name" :name="prop.name"
/> />
<span <span

View File

@ -5,18 +5,24 @@ import { computed } from 'vue';
const descriptorStore = useDescriptorStore(); const descriptorStore = useDescriptorStore();
const $props = defineProps({ const $props = defineProps({
name: { type: [String], default: undefined }, value: { type: Object, default: () => {} },
name: { type: String, default: undefined },
}); });
const descriptor = computed(() => descriptorStore.has($props.name)); const descriptor = computed(() => descriptorStore.has($props.name));
</script> </script>
<template> <template>
<VnJsonValue v-bind="$attrs" /> <VnJsonValue :value="value.val" />
<QIcon <span
name="launch" v-if="(value.id || typeof value.val == 'number') && descriptor"
class="link" style="margin-left: 2px"
v-if="$attrs.value && descriptor" >
:data-cy="'iconLaunch-' + $props.name" <QIcon
/> name="launch"
<component :is="descriptor" :id="$attrs.value" v-if="$attrs.value && descriptor" /> class="link"
:data-cy="'iconLaunch-' + $props.name"
style="padding-bottom: 2px"
/>
<component :is="descriptor" :id="value.id ?? value.val" />
</span>
</template> </template>

View File

@ -11,7 +11,7 @@ export const useDescriptorStore = defineStore('descriptorStore', () => {
const files = import.meta.glob(`/src/**/*DescriptorProxy.vue`); const files = import.meta.glob(`/src/**/*DescriptorProxy.vue`);
const moduleParser = { const moduleParser = {
account: 'user', account: 'user',
client: 'customer', customer: 'client',
}; };
for (const file in files) { for (const file in files) {
const name = file.split('/').at(-1).slice(0, -19).toLowerCase(); const name = file.split('/').at(-1).slice(0, -19).toLowerCase();