7355-accountMigration2 #619

Merged
carlossa merged 9 commits from 7355-accountMigration2 into dev 2024-08-13 13:10:39 +00:00
14 changed files with 129 additions and 107 deletions

View File

@ -37,7 +37,7 @@ const $props = defineProps({
}, },
hiddenTags: { hiddenTags: {
type: Array, type: Array,
default: () => ['filter'], default: () => ['filter', 'search', 'or', 'and'],
}, },
customTags: { customTags: {
type: Array, type: Array,
@ -198,8 +198,10 @@ function formatValue(value) {
function sanitizer(params) { function sanitizer(params) {
for (const [key, value] of Object.entries(params)) { for (const [key, value] of Object.entries(params)) {
if (typeof value == 'object') if (typeof value == 'object') {
params[key] = Object.values(value)[0].replaceAll('%', ''); const param = Object.values(value)[0];
if (typeof param == 'string') params[key] = param.replaceAll('%', '');
}
} }
return params; return params;
} }

View File

@ -876,7 +876,7 @@ worker:
card: card:
workerId: ID Trabajador workerId: ID Trabajador
name: Nombre name: Nombre
email: Email email: Correo personal
phone: Teléfono phone: Teléfono
mobile: Móvil mobile: Móvil
active: Activo active: Activo

View File

@ -41,14 +41,12 @@ const columns = computed(() => [
name: 'id', name: 'id',
label: t('id'), label: t('id'),
isId: true, isId: true,
field: 'id',
cardVisible: true, cardVisible: true,
}, },
{ {
align: 'left', align: 'left',
name: 'model', name: 'model',
label: t('model'), label: t('model'),
field: 'model',
cardVisible: true, cardVisible: true,
create: true, create: true,
}, },
@ -56,15 +54,19 @@ const columns = computed(() => [
align: 'left', align: 'left',
name: 'principalId', name: 'principalId',
label: t('principalId'), label: t('principalId'),
field: 'principalId',
cardVisible: true, cardVisible: true,
component: 'select',
attrs: {
url: 'VnRoles',
optionLabel: 'name',
optionValue: 'name',
},
create: true, create: true,
}, },
{ {
align: 'left', align: 'left',
name: 'property', name: 'property',
label: t('property'), label: t('property'),
field: 'property',
cardVisible: true, cardVisible: true,
create: true, create: true,
}, },
@ -72,7 +74,10 @@ const columns = computed(() => [
align: 'left', align: 'left',
name: 'accessType', name: 'accessType',
label: t('accessType'), label: t('accessType'),
field: 'accessType', component: 'select',
attrs: {
options: ['READ', 'WRITE', '*'],
},
cardVisible: true, cardVisible: true,
create: true, create: true,
}, },
@ -118,13 +123,6 @@ const deleteAcl = async ({ id }) => {
</script> </script>
<template> <template>
<FetchData
url="VnRoles"
:filter="{ fields: ['name'], order: 'name ASC' }"
@on-fetch="(data) => (rolesOptions = data)"
auto-load
/>
<VnSearchbar <VnSearchbar
data-key="AccountAcls" data-key="AccountAcls"
url="ACLs" url="ACLs"
@ -147,7 +145,6 @@ const deleteAcl = async ({ id }) => {
order="id DESC" order="id DESC"
:columns="columns" :columns="columns"
default-mode="table" default-mode="table"
auto-load
:right-search="true" :right-search="true"
:is-editable="true" :is-editable="true"
:use-model="true" :use-model="true"
@ -162,4 +159,15 @@ es:
Are you sure you want to continue?: ¿Seguro que quieres continuar? Are you sure you want to continue?: ¿Seguro que quieres continuar?
Remove ACL: Eliminar Acl Remove ACL: Eliminar Acl
Do you want to remove this ACL?: ¿Quieres eliminar este ACL? Do you want to remove this ACL?: ¿Quieres eliminar este ACL?
principalId: Rol
model: Modelo
en:
New ACL: New ACL
ACL removed: ACL removed
ACL will be removed: ACL will be removed
Are you sure you want to continue?: Are you sure you want to continue?
Remove ACL: Remove ACL
Do you want to remove this ACL?: Do you want to remove this ACL?
principalId: Rol
model: Models
</i18n> </i18n>

View File

@ -60,7 +60,7 @@ const columns = computed(() => [
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="AccountAliasList" data-key="AccountAliasList"
:url="`MailAliases`" url="MailAliases"
:create="{ :create="{
urlCreate: 'MailAliases', urlCreate: 'MailAliases',
title: 'Create MailAlias', title: 'Create MailAlias',
@ -70,7 +70,6 @@ const columns = computed(() => [
order="id DESC" order="id DESC"
:columns="columns" :columns="columns"
default-mode="table" default-mode="table"
auto-load
redirect="account/alias" redirect="account/alias"
:is-editable="true" :is-editable="true"
:use-model="true" :use-model="true"

View File

@ -48,6 +48,14 @@ const columns = computed(() => [
cardVisible: true, cardVisible: true,
create: true, create: true,
}, },
{
align: 'left',
name: 'email',
label: t('email'),
component: 'input',
create: true,
visible: false,
},
{ {
align: 'right', align: 'right',
label: '', label: '',
@ -83,9 +91,9 @@ const exprBuilder = (param, value) => {
<template> <template>
<VnSearchbar <VnSearchbar
:label="t('account.search')"
data-key="AccountUsers" data-key="AccountUsers"
:expr-builder="exprBuilder" :expr-builder="exprBuilder"
:label="t('account.search')"
:info="t('account.searchInfo')" :info="t('account.searchInfo')"
/> />
@ -96,7 +104,6 @@ const exprBuilder = (param, value) => {
order="id DESC" order="id DESC"
:columns="columns" :columns="columns"
default-mode="table" default-mode="table"
auto-load
redirect="account" redirect="account"
:use-model="true" :use-model="true"
/> />

View File

@ -1,22 +1,8 @@
<script setup> <script setup>
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import { computed } from 'vue';
import VnCard from 'components/common/VnCard.vue'; import VnCard from 'components/common/VnCard.vue';
import AliasDescriptor from './AliasDescriptor.vue'; import AliasDescriptor from './AliasDescriptor.vue';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute();
const routeName = computed(() => route.name);
const customRouteRedirectName = computed(() => {
return routeName.value;
});
const searchBarDataKeys = {
AliasBasicData: 'AliasBasicData',
AliasUsers: 'AliasUsers',
};
</script> </script>
<template> <template>
@ -24,12 +10,12 @@ const searchBarDataKeys = {
data-key="Alias" data-key="Alias"
base-url="MailAliases" base-url="MailAliases"
:descriptor="AliasDescriptor" :descriptor="AliasDescriptor"
:search-data-key="searchBarDataKeys[routeName]" search-data-key="AccountAliasList"
:searchbar-props="{ :searchbar-props="{
redirect: !!customRouteRedirectName, url: 'MailAliases',
customRouteRedirectName,
info: t('mailAlias.searchInfo'), info: t('mailAlias.searchInfo'),
label: t('mailAlias.search'), label: t('mailAlias.search'),
searchUrl: 'table',
}" }"
/> />
</template> </template>

View File

@ -37,9 +37,11 @@ watch(
<VnInput v-model="data.nickname" :label="t('account.card.alias')" /> <VnInput v-model="data.nickname" :label="t('account.card.alias')" />
<VnInput v-model="data.email" :label="t('account.card.email')" /> <VnInput v-model="data.email" :label="t('account.card.email')" />
<VnSelect <VnSelect
url="Languages"
v-model="data.lang" v-model="data.lang"
:options="['es', 'en']"
:label="t('account.card.lang')" :label="t('account.card.lang')"
option-value="code"
option-label="code"
/> />
</div> </div>
</template> </template>

View File

@ -1,36 +1,21 @@
<script setup> <script setup>
import { computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnCard from 'components/common/VnCard.vue'; import VnCard from 'components/common/VnCard.vue';
import AccountDescriptor from './AccountDescriptor.vue'; import AccountDescriptor from './AccountDescriptor.vue';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute();
const routeName = computed(() => route.name);
const customRouteRedirectName = computed(() => routeName.value);
const searchBarDataKeys = {
AccountSummary: 'AccountSummary',
AccountInheritedRoles: 'AccountInheritedRoles',
AccountMailForwarding: 'AccountMailForwarding',
AccountMailAlias: 'AccountMailAlias',
AccountPrivileges: 'AccountPrivileges',
AccountLog: 'AccountLog',
};
</script> </script>
<template> <template>
<VnCard <VnCard
data-key="Account" data-key="Account"
:descriptor="AccountDescriptor" :descriptor="AccountDescriptor"
:search-data-key="searchBarDataKeys[routeName]" search-data-key="AccountUsers"
:searchbar-props="{ :searchbar-props="{
redirect: !!customRouteRedirectName, url: 'VnUsers/preview',
customRouteRedirectName,
label: t('account.search'), label: t('account.search'),
info: t('account.searchInfo'), info: t('account.searchInfo'),
searchUrl: 'table',
}" }"
/> />
</template> </template>

View File

@ -82,6 +82,54 @@ const removeAccount = async () => {
}; };
</script> </script>
<template> <template>
<VnConfirm
v-model="showSyncDialog"
:message="t('account.card.actions.sync.message')"
:title="t('account.card.actions.sync.title')"
:promise="sync"
>
<template #customHTML>
{{ shouldSyncPassword }}
<QCheckbox
:label="t('account.card.actions.sync.checkbox')"
v-model="shouldSyncPassword"
class="full-width"
clearable
clear-icon="close"
>
<QIcon style="padding-left: 10px" color="primary" name="info" size="sm">
<QTooltip>{{ t('account.card.actions.sync.tooltip') }}</QTooltip>
</QIcon></QCheckbox
>
<QInput
v-if="shouldSyncPassword"
:label="t('login.password')"
v-model="syncPassword"
class="full-width"
clearable
clear-icon="close"
type="password"
/>
</template>
</VnConfirm>
<!-- <QItem v-ripple clickable @click="setPassword">
<QItemSection>{{ t('account.card.actions.setPassword') }}</QItemSection>
</QItem>
<QItem
v-if="!account.hasAccount"
v-ripple
clickable
@click="
openConfirmationModal(
t('account.card.actions.enableAccount.title'),
t('account.card.actions.enableAccount.subtitle'),
() => updateStatusAccount(true)
)
"
>
<QItemSection>{{ t('account.card.actions.enableAccount.name') }}</QItemSection>
</QItem> -->
<QItem <QItem
v-if="account.hasAccount" v-if="account.hasAccount"
v-ripple v-ripple

View File

@ -14,16 +14,11 @@ const rolesOptions = ref([]);
const formModelRef = ref(); const formModelRef = ref();
</script> </script>
<template> <template>
<FetchData <FetchData url="VnRoles" auto-load @on-fetch="(data) => (rolesOptions = data)" />
url="VnRoles"
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
auto-load
@on-fetch="(data) => (rolesOptions = data)"
/>
<FormModel <FormModel
ref="formModelRef" ref="formModelRef"
model="AccountPrivileges" model="AccountPrivileges"
:url="`VnUsers/${route.params.id}`" :url="`VnUsers/${route.params.id}/privileges`"
:url-create="`VnUsers/${route.params.id}/privileges`" :url-create="`VnUsers/${route.params.id}/privileges`"
auto-load auto-load
@on-data-saved="formModelRef.fetch()" @on-data-saved="formModelRef.fetch()"

View File

@ -5,6 +5,8 @@ import VnTable from 'components/VnTable/VnTable.vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RoleSummary from './Card/RoleSummary.vue';
const route = useRoute(); const route = useRoute();
const stateStore = useStateStore(); const stateStore = useStateStore();
const { t } = useI18n(); const { t } = useI18n();
@ -16,7 +18,7 @@ const $props = defineProps({
}); });
const tableRef = ref(); const tableRef = ref();
const entityId = computed(() => $props.id || route.params.id); const entityId = computed(() => $props.id || route.params.id);
const { viewSummary } = useSummaryDialog();
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
@ -42,6 +44,18 @@ const columns = computed(() => [
cardVisible: true, cardVisible: true,
create: true, create: true,
}, },
{
align: 'right',
label: '',
name: 'tableActions',
actions: [
{
title: t('View Summary'),
icon: 'preview',
action: (row) => viewSummary(row.id, RoleSummary),
},
],
},
]); ]);
const exprBuilder = (param, value) => { const exprBuilder = (param, value) => {
switch (param) { switch (param) {
@ -62,16 +76,12 @@ const exprBuilder = (param, value) => {
</script> </script>
<template> <template>
<template v-if="stateStore.isHeaderMounted()"> <VnSearchbar
<Teleport to="#searchbar"> data-key="Roles"
<VnSearchbar :expr-builder="exprBuilder"
data-key="Roles" :label="t('role.searchRoles')"
:expr-builder="exprBuilder" :info="t('role.searchInfo')"
:label="t('role.searchRoles')" />
:info="t('role.searchInfo')"
/>
</Teleport>
</template>
<VnTable <VnTable
ref="tableRef" ref="tableRef"
data-key="Roles" data-key="Roles"
@ -87,8 +97,6 @@ const exprBuilder = (param, value) => {
order="id ASC" order="id ASC"
:columns="columns" :columns="columns"
default-mode="table" default-mode="table"
auto-load
redirect="account/role" redirect="account/role"
:is-editable="true"
/> />
</template> </template>

View File

@ -23,11 +23,6 @@ const { t } = useI18n();
/> />
</div> </div>
</VnRow> </VnRow>
<VnRow>
<div class="col">
<QCheckbox :label="t('mailAlias.isPublic')" v-model="data.isPublic" />
</div>
</VnRow>
</template> </template>
</FormModel> </FormModel>
</template> </template>

View File

@ -1,33 +1,20 @@
<script setup> <script setup>
import { computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import VnCard from 'components/common/VnCard.vue'; import VnCard from 'components/common/VnCard.vue';
import RoleDescriptor from './RoleDescriptor.vue'; import RoleDescriptor from './RoleDescriptor.vue';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute();
const routeName = computed(() => route.name);
const customRouteRedirectName = computed(() => routeName.value);
const searchBarDataKeys = {
RoleSummary: 'RoleSummary',
RoleBasicData: 'RoleBasicData',
SubRoles: 'SubRoles',
InheritedRoles: 'InheritedRoles',
RoleLog: 'RoleLog',
};
</script> </script>
<template> <template>
<VnCard <VnCard
data-key="Role" data-key="Role"
:descriptor="RoleDescriptor" :descriptor="RoleDescriptor"
:search-data-key="searchBarDataKeys[routeName]" search-data-key="AccountRoles"
:searchbar-props="{ :searchbar-props="{
redirect: !!customRouteRedirectName, url: 'VnRoles',
customRouteRedirectName,
label: t('role.searchRoles'), label: t('role.searchRoles'),
info: t('role.searchInfo'), info: t('role.searchInfo'),
searchUrl: 'table',
}" }"
/> />
</template> </template>

View File

@ -65,13 +65,13 @@ export default {
component: () => import('src/pages/Account/AccountAliasList.vue'), component: () => import('src/pages/Account/AccountAliasList.vue'),
}, },
{ {
path: 'connections', path: 'acls',
name: 'AccountConnections', name: 'AccountAcls',
meta: { meta: {
title: 'connections', title: 'acls',
icon: 'check', icon: 'check',
}, },
component: () => import('src/pages/Account/AccountConnections.vue'), component: () => import('src/pages/Account/AccountAcls.vue'),
}, },
{ {
path: 'accounts', path: 'accounts',
@ -104,13 +104,13 @@ export default {
component: () => import('src/pages/Account/AccountSamba.vue'), component: () => import('src/pages/Account/AccountSamba.vue'),
}, },
{ {
path: 'acls', path: 'connections',
name: 'AccountAcls', name: 'AccountConnections',
meta: { meta: {
title: 'acls', title: 'connections',
icon: 'check', icon: 'share',
}, },
component: () => import('src/pages/Account/AccountAcls.vue'), component: () => import('src/pages/Account/AccountConnections.vue'),
}, },
{ {
path: 'acl-form', path: 'acl-form',