Merge pull request 'Warmifx[CardDescriptor]: Fixed department descriptor icon' (!1612) from Warmfix-DepartmentIcon into test
gitea/salix-front/pipeline/head This commit looks good Details

Reviewed-on: #1612
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
Jon Elias 2025-03-20 11:19:10 +00:00
commit 0d63c4ec2c
2 changed files with 12 additions and 1 deletions

View File

@ -38,6 +38,10 @@ const $props = defineProps({
type: String,
default: 'md-width',
},
toModule: {
type: String,
default: null,
},
});
const state = useState();
@ -129,6 +133,11 @@ const emit = defineEmits(['onFetch']);
const iconModule = computed(() => {
moduleName.value = getName();
if ($props.toModule) {
return router
.getRoutes()
.find((r) => r.name && r.name.includes($props.toModule.name)).meta.icon;
}
if (isSameModuleName) {
return router.options.routes[1].children.find((r) => r.name === moduleName.value)
?.meta?.icon;
@ -139,9 +148,10 @@ const iconModule = computed(() => {
const toModule = computed(() => {
moduleName.value = getName();
if ($props.toModule) return $props.toModule;
if (isSameModuleName) {
return router.options.routes[1].children.find((r) => r.name === moduleName.value)
?.children[0]?.redirect;
?.redirect;
} else {
return route.matched[1].path.split('/').length > 2
? route.matched[1].redirect

View File

@ -37,6 +37,7 @@ const removeRole = async () => {
:filter="{ where: { id: entityId } }"
data-key="Role"
:summary="$props.summary"
:to-module="{ name: 'AccountRoles' }"
>
<template #menu>
<QItem v-ripple clickable @click="removeRole()">