diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 03f75477d..28b42d498 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -196,13 +196,13 @@ async function save() { if ($props.urlCreate) notify('globals.dataCreated', 'positive'); - hasChanges.value = false; - isLoading.value = false; - updateAndEmit(response?.data, 'onDataSaved'); } catch (err) { console.error(err); notify('errors.writeRequest', 'negative'); + } finally { + hasChanges.value = false; + isLoading.value = false; } } diff --git a/src/components/LeftMenuItem.vue b/src/components/LeftMenuItem.vue index 5e0ee461f..d12fb8428 100644 --- a/src/components/LeftMenuItem.vue +++ b/src/components/LeftMenuItem.vue @@ -20,7 +20,13 @@ const itemComputed = computed(() => { }); + + diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 0e74016cd..b83cca3f4 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -242,6 +242,7 @@ const emit = defineEmits(['onFetch']); width: 256px; .header { display: flex; + align-items: center; } .icons { margin: 0 10px; diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 386594750..fd508cea3 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -46,6 +46,10 @@ const props = defineProps({ type: Array, default: () => [], }, + redirect: { + type: Boolean, + default: true, + }, }); const emit = defineEmits(['refresh', 'clear', 'search', 'init', 'remove']); @@ -93,7 +97,7 @@ async function search() { isLoading.value = false; emit('search'); - navigate(store.data, {}); + if (props.redirect) navigate(store.data, {}); } async function reload() { @@ -104,7 +108,7 @@ async function reload() { if (!props.showAll && !params.length) store.data = []; isLoading.value = false; emit('refresh'); - navigate(store.data, {}); + if (props.redirect) navigate(store.data, {}); } async function clearFilters() { diff --git a/src/css/app.scss b/src/css/app.scss index fd5f29600..79234b364 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -76,7 +76,7 @@ select:-webkit-autofill { } .color-vn-label { - color: var(--vn-label); + color: var(--vn-label-color); } .color-vn-text { diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 0ce21e9b2..85f78a7ee 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -17,6 +17,7 @@ globals: date: Date dataSaved: Data saved dataDeleted: Data deleted + delete: Delete search: Search changes: Changes dataCreated: Data created @@ -101,6 +102,9 @@ globals: zonesList: Zones deliveryList: Delivery days upcomingList: Upcoming deliveries + role: Role + subRoles: Subroles + inheritedRoles: Inherited Roles created: Created worker: Worker now: Now @@ -1254,6 +1258,13 @@ monitor: pageTitles: monitors: Monitors list: List +zone: + pageTitles: + zones: Zones + zonesList: Zones + deliveryList: Delivery days + upcomingList: Upcoming deliveries + components: topbar: {} itemsFilterPanel: diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index c2f61d001..ae3f24e51 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -17,6 +17,7 @@ globals: date: Fecha dataSaved: Datos guardados dataDeleted: Datos eliminados + delete: Eliminar search: Buscar changes: Cambios dataCreated: Datos creados @@ -101,6 +102,9 @@ globals: zonesList: Zonas deliveryList: Días de entrega upcomingList: Próximos repartos + role: Role + subRoles: Subroles + inheritedRoles: Roles heredados created: Fecha creación worker: Trabajador now: Ahora @@ -1241,8 +1245,14 @@ item/itemType: summary: Resumen zone: pageTitles: - zones: Zona - zonesList: Zonas + zones: Zonas + list: Zonas + deliveryList: Días de entrega + upcomingList: Próximos repartos +role: + pageTitles: + zones: Zonas + list: Zonas deliveryList: Días de entrega upcomingList: Próximos repartos monitor: diff --git a/src/pages/Account/AccountList.vue b/src/pages/Account/AccountList.vue new file mode 100644 index 000000000..40a017533 --- /dev/null +++ b/src/pages/Account/AccountList.vue @@ -0,0 +1 @@ + diff --git a/src/pages/Account/AccountMain.vue b/src/pages/Account/AccountMain.vue new file mode 100644 index 000000000..f0dc2e500 --- /dev/null +++ b/src/pages/Account/AccountMain.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/pages/Account/Card/AccountInheritedRoles.vue b/src/pages/Account/Card/AccountInheritedRoles.vue new file mode 100644 index 000000000..d8a43c623 --- /dev/null +++ b/src/pages/Account/Card/AccountInheritedRoles.vue @@ -0,0 +1,256 @@ + + + + + + +es: + Reason: Motivo + Result: Consecuencia + Responsible: Responsable + Worker: Trabajador + Redelivery: Devolución + diff --git a/src/pages/Account/Role/AccountRoles.vue b/src/pages/Account/Role/AccountRoles.vue new file mode 100644 index 000000000..f4197e433 --- /dev/null +++ b/src/pages/Account/Role/AccountRoles.vue @@ -0,0 +1,131 @@ + + + diff --git a/src/pages/Account/Role/AccountRolesFilter.vue b/src/pages/Account/Role/AccountRolesFilter.vue new file mode 100644 index 000000000..b1929b1de --- /dev/null +++ b/src/pages/Account/Role/AccountRolesFilter.vue @@ -0,0 +1,52 @@ + + + diff --git a/src/pages/Account/Role/Card/InheritedRoles.vue b/src/pages/Account/Role/Card/InheritedRoles.vue new file mode 100644 index 000000000..ee82375ae --- /dev/null +++ b/src/pages/Account/Role/Card/InheritedRoles.vue @@ -0,0 +1,96 @@ + + + + + +es: + Role removed. Changes will take a while to fully propagate.: Rol eliminado. Los cambios tardaran un tiempo en propagarse completamente. + Role added! Changes will take a while to fully propagate.: ¡Rol añadido! Los cambios tardaran un tiempo en propagarse completamente. + El rol va a ser eliminado: Role will be removed + ¿Seguro que quieres continuar?: Are you sure you want to continue? + diff --git a/src/pages/Account/Role/Card/RoleBasicData.vue b/src/pages/Account/Role/Card/RoleBasicData.vue new file mode 100644 index 000000000..4607ef15c --- /dev/null +++ b/src/pages/Account/Role/Card/RoleBasicData.vue @@ -0,0 +1,29 @@ + + diff --git a/src/pages/Account/Role/Card/RoleCard.vue b/src/pages/Account/Role/Card/RoleCard.vue new file mode 100644 index 000000000..c7b5c695d --- /dev/null +++ b/src/pages/Account/Role/Card/RoleCard.vue @@ -0,0 +1,32 @@ + + diff --git a/src/pages/Account/Role/Card/RoleDescriptor.vue b/src/pages/Account/Role/Card/RoleDescriptor.vue new file mode 100644 index 000000000..2df191950 --- /dev/null +++ b/src/pages/Account/Role/Card/RoleDescriptor.vue @@ -0,0 +1,93 @@ + + + + + + en: + accountRate: Claming rate + es: + accountRate: Ratio de reclamación + diff --git a/src/pages/Account/Role/Card/RoleForm.vue b/src/pages/Account/Role/Card/RoleForm.vue new file mode 100644 index 000000000..d6fc16598 --- /dev/null +++ b/src/pages/Account/Role/Card/RoleForm.vue @@ -0,0 +1,44 @@ + + + + + es: + Create role: Crear role + diff --git a/src/pages/Account/Role/Card/RoleLog.vue b/src/pages/Account/Role/Card/RoleLog.vue new file mode 100644 index 000000000..20b6dcccf --- /dev/null +++ b/src/pages/Account/Role/Card/RoleLog.vue @@ -0,0 +1,6 @@ + + diff --git a/src/pages/Account/Role/Card/RoleSummary.vue b/src/pages/Account/Role/Card/RoleSummary.vue new file mode 100644 index 000000000..d404fa2f0 --- /dev/null +++ b/src/pages/Account/Role/Card/RoleSummary.vue @@ -0,0 +1,52 @@ + + + diff --git a/src/pages/Account/Role/Card/SubRoleCreateForm.vue b/src/pages/Account/Role/Card/SubRoleCreateForm.vue new file mode 100644 index 000000000..89eceed62 --- /dev/null +++ b/src/pages/Account/Role/Card/SubRoleCreateForm.vue @@ -0,0 +1,51 @@ + + + diff --git a/src/pages/Account/Role/Card/SubRoles.vue b/src/pages/Account/Role/Card/SubRoles.vue new file mode 100644 index 000000000..1fb84fe4f --- /dev/null +++ b/src/pages/Account/Role/Card/SubRoles.vue @@ -0,0 +1,162 @@ + + + + + +es: + Role removed. Changes will take a while to fully propagate.: Rol eliminado. Los cambios tardaran un tiempo en propagarse completamente. + Role added! Changes will take a while to fully propagate.: ¡Rol añadido! Los cambios tardaran un tiempo en propagarse completamente. + El rol va a ser eliminado: Role will be removed + ¿Seguro que quieres continuar?: Are you sure you want to continue? + diff --git a/src/pages/Account/locale/en.yml b/src/pages/Account/locale/en.yml new file mode 100644 index 000000000..0a511888b --- /dev/null +++ b/src/pages/Account/locale/en.yml @@ -0,0 +1,67 @@ +account: + pageTitles: + users: Users + list: Users + roles: Roles + alias: Mail aliasses + accounts: Accounts + ldap: LDAP + samba: Samba + acls: ACLs + connections: Connections + inheritedRoles: Inherited Roles + subRoles: Sub Roles + newRole: New role + privileges: Privileges + mailAlias: Mail Alias + mailForwarding: Mail Forwarding + card: + name: Name + nickname: User + role: Rol + email: Email + alias: Alias + lang: Language + actions: + setPassword: Set password + disableAccount: + name: Disable account + title: La cuenta será deshabilitada + subtitle: ¿Seguro que quieres continuar? + disableUser: Disable user + sync: Sync + delete: Delete + search: Search user +role: + pageTitles: + inheritedRoles: Inherited Roles + subRoles: Sub Roles + card: + description: Description + id: Id + name: Name + newRole: New role + searchRoles: Search role + searchInfo: Search role by id or name + name: Name + description: Description +ldap: + enableSync: Enable synchronization + server: Server + rdn: RDN + userDN: User DN + filter: Filter + groupDN: Group DN + testConnection: Test connection + success: LDAP connection established! +samba: + enableSync: Enable synchronization + domainController: Domain controller + domainAD: AD domain + userAD: AD user + groupDN: Group DN + passwordAD: AD password + domainPart: User DN (without domain part) + verifyCertificate: Verify certificate + testConnection: Test connection + success: Samba connection established! diff --git a/src/pages/Account/locale/es.yml b/src/pages/Account/locale/es.yml new file mode 100644 index 000000000..f339f71ca --- /dev/null +++ b/src/pages/Account/locale/es.yml @@ -0,0 +1,78 @@ +account: + pageTitles: + users: Usuarios + list: Usuarios + roles: Roles + alias: Alias de correo + accounts: Cuentas + ldap: LDAP + samba: Samba + acls: ACLs + connections: Conexiones + inheritedRoles: Roles heredados + newRole: Nuevo rol + subRoles: Subroles + privileges: Privilegios + mailAlias: Alias de correo + mailForwarding: Reenvío de correo + card: + nickname: Usuario + name: Nombre + role: Rol + email: Mail + alias: Alias + lang: dioma + actions: + setPassword: Establecer contraseña + disableAccount: + name: Deshabilitar cuenta + title: La cuenta será deshabilitada + subtitle: ¿Seguro que quieres continuar? + disableUser: + name: Desactivar usuario + title: El usuario será deshabilitado + subtitle: ¿Seguro que quieres continuar? + sync: + name: Sincronizar + title: El usuario será sincronizado + subtitle: ¿Seguro que quieres continuar? + delete: + name: Eliminar + title: El usuario será eliminado + subtitle: ¿Seguro que quieres continuar? + + search: Buscar usuario +role: + pageTitles: + inheritedRoles: Roles heredados + subRoles: Subroles + newRole: Nuevo rol + card: + description: Descripción + id: Id + name: Nombre + newRole: Nuevo rol + searchRoles: Buscar roles + searchInfo: Buscar rol por id o nombre + name: Nombre + description: Descripción +ldap: + enableSync: Habilitar sincronización + server: Servidor + rdn: RDN + userDN: DN usuarios + filter: Filtro + groupDN: DN grupos + testConnection: Probar conexión + success: ¡Conexión con LDAP establecida! +samba: + enableSync: Habilitar sincronización + domainController: Controlador de dominio + domainAD: Dominio AD + groupDN: DN grupos + userAD: Usuario AD + passwordAD: Contraseña AD + domainPart: DN usuarios (sin la parte del dominio) + Verify certificate: Verificar certificado + testConnection: Probar conexión + success: ¡Conexión con Samba establecida! diff --git a/src/router/modules/account.js b/src/router/modules/account.js new file mode 100644 index 000000000..4bcf33d85 --- /dev/null +++ b/src/router/modules/account.js @@ -0,0 +1,185 @@ +import { RouterView } from 'vue-router'; + +export default { + path: '/account', + name: 'Account', + meta: { + title: 'users', + icon: 'face', + moduleName: 'Account', + }, + component: RouterView, + redirect: { name: 'AccountMain' }, + menus: { + main: ['AccountRoles'], + card: [], + }, + children: [ + { + path: '', + name: 'AccountMain', + component: () => import('src/pages/Account/AccountMain.vue'), + redirect: { name: 'AccountList' }, + children: [ + { + path: 'list', + name: 'AccountList', + meta: { + title: 'list', + icon: 'view_list', + }, + component: () => import('src/pages/Account/AccountList.vue'), + }, + { + path: 'role-list', + name: 'AccountRoles', + meta: { + title: 'roles', + icon: 'group', + }, + component: () => import('src/pages/Account/Role/AccountRoles.vue'), + }, + { + path: 'alias', + name: 'AccountAlias', + meta: { + title: 'alias', + icon: 'email', + }, + component: () => import('src/pages/Account/AccountAlias.vue'), + }, + { + path: 'accounts', + name: 'AccountAccounts', + meta: { + title: 'accounts', + icon: 'accessibility', + }, + component: () => import('src/pages/Account/AccountAccounts.vue'), + }, + { + path: 'ldap', + name: 'AccountLdap', + meta: { + title: 'ldap', + icon: 'account_tree', + }, + component: () => import('src/pages/Account/AccountLdap.vue'), + }, + { + path: 'samba', + name: 'AccountSamba', + meta: { + title: 'samba', + icon: 'preview', + }, + component: () => import('src/pages/Account/AccountSamba.vue'), + }, + { + path: 'acls', + name: 'AccountAcls', + meta: { + title: 'acls', + icon: 'check', + }, + component: () => import('src/pages/Account/AccountAcls.vue'), + }, + { + path: 'connections', + name: 'AccountConnections', + meta: { + title: 'connections', + icon: 'check', + }, + component: () => import('src/pages/Account/AccountConnections.vue'), + }, + + { + path: 'create', + name: 'AccountCreate', + meta: { + title: 'accountCreate', + icon: 'add', + }, + component: () => import('src/pages/Account/AccountCreate.vue'), + }, + ], + }, + { + name: 'AccountCard', + path: ':id', + component: () => import('src/pages/Account/Card/AccountCard.vue'), + redirect: { name: 'AccountSummary' }, + children: [ + { + name: 'AccountSummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'launch', + }, + component: () => import('src/pages/Account/Card/AccountSummary.vue'), + }, + { + name: 'AccountBasicData', + path: 'basic-data', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => + import('src/pages/Account/Card/AccountBasicData.vue'), + }, + { + name: 'AccountInheritedRoles', + path: 'inherited-oles', + meta: { + title: 'inheritedRoles', + icon: 'group', + }, + component: () => + import('src/pages/Account/Card/AccountInheritedRoles.vue'), + }, + { + name: 'AccountMailForwarding', + path: 'mail-forwarding', + meta: { + title: 'mailForwarding', + icon: 'forward', + }, + component: () => + import('src/pages/Account/Card/AccountMailForwarding.vue'), + }, + { + name: 'AccountMailAlias', + path: 'mail-alias', + meta: { + title: 'mailAlias', + icon: 'email', + }, + component: () => + import('src/pages/Account/Card/AccountMailAlias.vue'), + }, + { + name: 'AccountPrivileges', + path: 'privileges', + meta: { + title: 'privileges', + icon: 'badge', + }, + component: () => + import('src/pages/Account/Card/AccountPrivileges.vue'), + }, + { + name: 'AccountLog', + path: 'log', + meta: { + title: 'log', + icon: 'history', + }, + component: () => import('src/pages/Account/Card/AccountLog.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 38bcd54d5..ca60c78d8 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -12,12 +12,14 @@ import Supplier from './Supplier'; import Travel from './travel'; import Order from './order'; import Department from './department'; +import Role from './role'; import Entry from './entry'; import roadmap from './roadmap'; import Parking from './parking'; import Agency from './agency'; import ItemType from './itemType'; import Zone from './zone'; +import Account from './account'; import Monitor from './monitor'; export default [ @@ -35,11 +37,13 @@ export default [ Order, invoiceIn, Department, + Role, Entry, roadmap, Parking, Agency, ItemType, Zone, + Account, Monitor, ]; diff --git a/src/router/modules/role.js b/src/router/modules/role.js new file mode 100644 index 000000000..47cd10b18 --- /dev/null +++ b/src/router/modules/role.js @@ -0,0 +1,76 @@ +import { RouterView } from 'vue-router'; + +export default { + path: 'account/role', + name: 'Role', + meta: { + title: 'role', + icon: 'vn:greuge', + moduleName: 'Role', + }, + component: RouterView, + redirect: { name: 'AccountRoles' }, + menus: { + main: [], + card: ['RoleBasicData', 'SubRoles', 'InheritedRoles', 'RoleLog'], + }, + children: [ + { + name: 'RoleCard', + path: ':id', + component: () => import('src/pages/Account/Role/Card/RoleCard.vue'), + redirect: { name: 'RoleSummary' }, + children: [ + { + name: 'RoleSummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'launch', + }, + component: () => + import('src/pages/Account/Role/Card/RoleSummary.vue'), + }, + { + name: 'RoleBasicData', + path: 'basic-data', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => + import('src/pages/Account/Role/Card/RoleBasicData.vue'), + }, + { + name: 'SubRoles', + path: 'sub-roles', + meta: { + title: 'subRoles', + icon: 'group', + }, + component: () => import('src/pages/Account/Role/Card/SubRoles.vue'), + }, + + { + name: 'InheritedRoles', + path: 'inherited-roles', + meta: { + title: 'inheritedRoles', + icon: 'account_tree', + }, + component: () => + import('src/pages/Account/Role/Card/InheritedRoles.vue'), + }, + { + name: 'RoleLog', + path: 'log', + meta: { + title: 'log', + icon: 'history', + }, + component: () => import('src/pages/Account/Role/Card/RoleLog.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index 384978d13..927d11802 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -24,7 +24,6 @@ export default { 'WorkerTimeControl', 'WorkerLocker', ], - departmentCard: ['BasicData'], }, children: [ { diff --git a/src/router/routes.js b/src/router/routes.js index 6a0430d51..60cc24a75 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -10,6 +10,7 @@ import supplier from './modules/Supplier'; import route from './modules/route'; import travel from './modules/travel'; import department from './modules/department'; +import role from './modules/role'; import ItemType from './modules/itemType'; import shelving from 'src/router/modules/shelving'; import order from 'src/router/modules/order'; @@ -18,6 +19,7 @@ import roadmap from 'src/router/modules/roadmap'; import parking from 'src/router/modules/parking'; import agency from 'src/router/modules/agency'; import zone from 'src/router/modules/zone'; +import account from './modules/account'; import monitor from 'src/router/modules/monitor'; const routes = [ @@ -73,12 +75,14 @@ const routes = [ supplier, travel, department, + role, roadmap, entry, parking, agency, ItemType, zone, + account, { path: '/:catchAll(.*)*', name: 'NotFound', diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js index 263a9dec8..4dd5ed2ae 100644 --- a/src/stores/useNavigationStore.js +++ b/src/stores/useNavigationStore.js @@ -23,6 +23,7 @@ export const useNavigationStore = defineStore('navigationStore', () => { 'worker', 'wagon', 'zone', + 'account', ]; const pinnedModules = ref([]); const role = useRole();