forked from verdnatura/salix-front
refs #7355 account fixes
This commit is contained in:
parent
df1b63da98
commit
3eaa5c864d
|
@ -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,
|
||||||
|
@ -195,8 +195,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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
},
|
},
|
||||||
|
@ -162,4 +167,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>
|
||||||
|
|
|
@ -25,9 +25,8 @@ const searchBarDataKeys = {
|
||||||
<VnCard
|
<VnCard
|
||||||
data-key="Account"
|
data-key="Account"
|
||||||
:descriptor="AccountDescriptor"
|
:descriptor="AccountDescriptor"
|
||||||
:search-data-key="searchBarDataKeys[routeName]"
|
search-data-key="AccountUsers"
|
||||||
:search-custom-route-redirect="customRouteRedirectName"
|
search-url="VnUsers/preview"
|
||||||
:search-redirect="!!customRouteRedirectName"
|
|
||||||
:searchbar-label="t('account.search')"
|
:searchbar-label="t('account.search')"
|
||||||
:searchbar-info="t('account.searchInfo')"
|
:searchbar-info="t('account.searchInfo')"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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()"
|
||||||
|
|
|
@ -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) {
|
||||||
|
@ -89,6 +103,5 @@ const exprBuilder = (param, value) => {
|
||||||
default-mode="table"
|
default-mode="table"
|
||||||
auto-load
|
auto-load
|
||||||
redirect="account/role"
|
redirect="account/role"
|
||||||
:is-editable="true"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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',
|
||||||
|
|
Loading…
Reference in New Issue