0
0
Fork 0

feat: newRole

This commit is contained in:
Javier Segarra 2024-05-23 08:52:57 +02:00
parent dc14116717
commit 06664cc2d0
6 changed files with 68 additions and 22 deletions

View File

@ -1249,12 +1249,6 @@ zone:
zonesList: Zones zonesList: Zones
deliveryList: Delivery days deliveryList: Delivery days
upcomingList: Upcoming deliveries upcomingList: Upcoming deliveries
role:
pageTitles:
role: Zones
zonesList: Zones
deliveryList: Delivery days
upcomingList: Upcoming deliveries
components: components:
topbar: {} topbar: {}

View File

@ -70,10 +70,15 @@ function navigate(event, id) {
</VnPaginate> </VnPaginate>
</div> </div>
<QPageSticky :offset="[20, 20]"> <QPageSticky :offset="[20, 20]">
<QBtn @click="redirectToCreateView()" color="primary" fab icon="add" /> <RouterLink :to="{ name: 'RoleCreate' }">
<QTooltip> <QBtn fab icon="add" color="primary" />
{{ t('New client') }} <QTooltip>
</QTooltip> {{ t('role.pageTitles.roleCreate') }}
</QTooltip></RouterLink
>
</QPageSticky> </QPageSticky>
</QPage> </QPage>
</template> </template>
<i18n>
New rol: Nuevo role
</i18n>

View File

@ -0,0 +1,44 @@
<script setup>
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnInput from 'src/components/common/VnInput.vue';
const route = useRoute();
const { t } = useI18n();
const shelvingId = route.params?.id || null;
const isNew = Boolean(!shelvingId);
const defaultInitialData = {
name: null,
description: null,
};
</script>
<template>
<VnSubToolbar />
<FormModel
:url="isNew ? null : `VnRoles/${route.params.id}`"
:url-create="isNew ? 'VnRoles' : null"
:observe-form-changes="!isNew"
model="VnRole"
:auto-load="!isNew"
:form-initial-data="defaultInitialData"
@on-data-saved="onSave"
>
<template #form="{ data }">
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnInput v-model="data.name" :label="t('role.card.name')" />
</div>
</VnRow>
<VnRow class="row q-gutter-md q-mb-md">
<div class="col">
<VnInput
v-model="data.description"
:label="t('role.card.description')"
/>
</div>
</VnRow>
</template>
</FormModel>
</template>

View File

@ -11,6 +11,7 @@ account:
connections: Connections connections: Connections
inheritedRoles: Inherited Roles inheritedRoles: Inherited Roles
subRoles: Sub Roles subRoles: Sub Roles
roleCreate: New role
privileges: Privileges privileges: Privileges
mailAlias: Mail Alias mailAlias: Mail Alias
mailForwarding: Mail Forwarding mailForwarding: Mail Forwarding
@ -35,6 +36,7 @@ role:
pageTitles: pageTitles:
inheritedRoles: Inherited Roles inheritedRoles: Inherited Roles
subRoles: Sub Roles subRoles: Sub Roles
card: card:
description: Description description: Description
id: Id id: Id

View File

@ -10,6 +10,7 @@ account:
acls: ACLs acls: ACLs
connections: Conexiones connections: Conexiones
inheritedRoles: Roles heredados inheritedRoles: Roles heredados
roleCreate: Nuevo rol
subRoles: Subroles subRoles: Subroles
privileges: Privilegios privileges: Privilegios
mailAlias: Alias de correo mailAlias: Alias de correo
@ -45,6 +46,7 @@ role:
pageTitles: pageTitles:
inheritedRoles: Roles heredados inheritedRoles: Roles heredados
subRoles: Subroles subRoles: Subroles
roleCreate: Nuevo rol
card: card:
description: Descripción description: Descripción
id: Idd id: Idd

View File

@ -53,19 +53,18 @@ export default {
icon: 'group', icon: 'group',
}, },
component: () => import('src/pages/Account/Role/AccountRoles.vue'), component: () => import('src/pages/Account/Role/AccountRoles.vue'),
children: [
{
name: 'RoleCreate',
path: 'create',
meta: {
title: 'RoleCreate',
icon: 'add',
},
component: () =>
import('src/pages/Account/Role/AccountRoles.vue'),
},
],
}, },
{
name: 'RoleCreate',
path: 'create',
meta: {
title: 'roleCreate',
icon: 'add',
},
component: () => import('src/pages/Account/Role/Card/RoleForm.vue'),
},
{ {
path: 'alias', path: 'alias',
name: 'AccountAlias', name: 'AccountAlias',