From c045b0d1f415617937430140ca53e76babc72b99 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 10 May 2024 17:47:34 +0200 Subject: [PATCH] feat accountRoutes --- src/pages/Account/Card/AccountDescriptor.vue | 67 +--- .../Account/Card/AccountInheritedRoles.vue | 256 +++++++++++++++ src/pages/Account/Card/AccountMailAlias.vue | 256 +++++++++++++++ src/pages/Account/Card/AccountSummary.vue | 306 ++---------------- src/pages/Account/locale/en.yml | 4 + src/pages/Account/locale/es.yml | 5 + src/router/modules/account.js | 36 ++- 7 files changed, 573 insertions(+), 357 deletions(-) create mode 100644 src/pages/Account/Card/AccountInheritedRoles.vue create mode 100644 src/pages/Account/Card/AccountMailAlias.vue diff --git a/src/pages/Account/Card/AccountDescriptor.vue b/src/pages/Account/Card/AccountDescriptor.vue index 3850ef210..b19c1f619 100644 --- a/src/pages/Account/Card/AccountDescriptor.vue +++ b/src/pages/Account/Card/AccountDescriptor.vue @@ -25,78 +25,19 @@ const salixUrl = ref(); const entityId = computed(() => { return $props.id || route.params.id; }); - const filter = { - include: [ - { - relation: 'client', - scope: { - include: [ - { relation: 'salesPersonUser' }, - { - relation: 'accountsRatio', - scope: { - fields: ['accountingRate'], - limit: 1, - }, - }, - ], - }, - }, - { - relation: 'accountState', - }, - { - relation: 'ticket', - scope: { - include: [ - { relation: 'zone' }, - { - relation: 'address', - scope: { - include: { relation: 'province' }, - }, - }, - ], - }, - }, - { - relation: 'worker', - scope: { - include: { relation: 'user' }, - }, - }, - ], + where: { id: entityId }, + fields: ['id', 'nickname', 'name', 'role'], + include: { relation: 'role', scope: { fields: ['id', 'name'] } }, }; - -const STATE_COLOR = { - pending: 'warning', - incomplete: 'info', - resolved: 'positive', - canceled: 'negative', -}; -function stateColor(code) { - return STATE_COLOR[code]; -} -const data = ref(useCardDescription()); -const setData = (entity) => { - if (!entity) return; - data.value = useCardDescription(entity.client.name, entity.id); - state.set('AccountDescriptor', entity); -}; -onMounted(async () => { - salixUrl.value = await getUrl(''); -});