From de488169b7bf58dce5675f052c5f4b9f74af7447 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 5 Jun 2024 15:09:43 +0200 Subject: [PATCH] feat: AccountDescriptor --- src/components/ui/VnConfirm.vue | 1 + src/pages/Account/Card/AccountDescriptor.vue | 38 ++-- .../Account/Card/AccountDescriptorMenu.vue | 188 +++++++++--------- src/pages/Account/locale/en.yml | 9 + src/pages/Account/locale/es.yml | 9 + src/pages/Customer/Card/CustomerWebAccess.vue | 7 - .../components/CustomerChangePassword.vue | 19 +- 7 files changed, 139 insertions(+), 132 deletions(-) diff --git a/src/components/ui/VnConfirm.vue b/src/components/ui/VnConfirm.vue index f8715f685..0480650db 100644 --- a/src/components/ui/VnConfirm.vue +++ b/src/components/ui/VnConfirm.vue @@ -67,6 +67,7 @@ async function confirm() { + diff --git a/src/pages/Account/Card/AccountDescriptorMenu.vue b/src/pages/Account/Card/AccountDescriptorMenu.vue index b67ac6309..60510394d 100644 --- a/src/pages/Account/Card/AccountDescriptorMenu.vue +++ b/src/pages/Account/Card/AccountDescriptorMenu.vue @@ -1,73 +1,109 @@ - - -{ - "en": { - "pickupOrder": "Pickup order", - "openPickupOrder": "Open pickup order", - "sendPickupOrder": "Send pickup order", - "deleteAccount": "Delete account", - "confirmDeletion": "Confirm deletion", - "confirmDeletionMessage": "Are you sure you want to delete this account?" - }, - "es": { - "pickupOrder": "Orden de recogida", - "openPickupOrder": "Abrir orden de recogida", - "sendPickupOrder": "Enviar orden de recogida", - "deleteAccount": "Eliminar reclamación", - "confirmDeletion": "Confirmar eliminación", - "confirmDeletionMessage": "Seguro que quieres eliminar esta reclamación?" - } -} - diff --git a/src/pages/Account/locale/en.yml b/src/pages/Account/locale/en.yml index 567588186..215273de8 100644 --- a/src/pages/Account/locale/en.yml +++ b/src/pages/Account/locale/en.yml @@ -40,26 +40,35 @@ account: name: Disable account title: The account will be disabled subtitle: Are you sure you want to continue? + success: 'Account disabled!' enableAccount: name: Enable account title: The account will be enabled subtitle: Are you sure you want to continue? + success: 'Account enabled!' deactivateUser: name: Deactivate user title: The user will be deactivated subtitle: Are you sure you want to continue? + success: 'User deactivated!' activateUser: name: Activate user title: The user will be disabled subtitle: Are you sure you want to continue? + success: 'User activated!' sync: name: Sync title: The account will be sync subtitle: Are you sure you want to continue? + success: 'User synchronized!' + checkbox: Synchronize password + message: Do you want to synchronize user? + tooltip: If password is not specified, just user attributes are synchronized delete: name: Delete title: The account will be deleted subtitle: Are you sure you want to continue? + success: '' search: Search user searchInfo: You can search by id, name or nickname create: diff --git a/src/pages/Account/locale/es.yml b/src/pages/Account/locale/es.yml index 65c54d9dd..9739473cd 100644 --- a/src/pages/Account/locale/es.yml +++ b/src/pages/Account/locale/es.yml @@ -39,26 +39,35 @@ account: name: Deshabilitar cuenta title: La cuenta será deshabilitada subtitle: ¿Seguro que quieres continuar? + success: '¡Cuenta deshabilitada!' enableAccount: name: Habilitar cuenta title: La cuenta será habilitada subtitle: ¿Seguro que quieres continuar? + success: '¡Cuenta habilitada!' deactivateUser: name: Desactivar usuario title: El usuario será deshabilitado subtitle: ¿Seguro que quieres continuar? + success: '¡Usuario desactivado!' activateUser: name: Activar usuario title: El usuario será activado subtitle: ¿Seguro que quieres continuar? + success: '¡Usuario activado!' sync: name: Sincronizar title: El usuario será sincronizado subtitle: ¿Seguro que quieres continuar? + success: '¡Usuario sincronizado!' + checkbox: Sincronizar contraseña + message: ¿Quieres sincronizar el usuario? + tooltip: Si la contraseña no se especifica solo se sincronizarán lo atributos del usuario delete: name: Eliminar title: El usuario será eliminado subtitle: ¿Seguro que quieres continuar? + success: '' search: Buscar usuario searchInfo: Puedes buscar por id, nombre o usuario create: diff --git a/src/pages/Customer/Card/CustomerWebAccess.vue b/src/pages/Customer/Card/CustomerWebAccess.vue index 9e534235c..33659dd77 100644 --- a/src/pages/Customer/Card/CustomerWebAccess.vue +++ b/src/pages/Customer/Card/CustomerWebAccess.vue @@ -28,7 +28,6 @@ const isLoading = ref(false); const name = ref(null); const usersPreviewRef = ref(null); const user = ref([]); -const userPasswords = ref(0); const dataChanges = computed(() => { return ( @@ -45,7 +44,6 @@ const showChangePasswordDialog = () => { component: CustomerChangePassword, componentProps: { id: route.params.id, - userPasswords: userPasswords.value, promise: usersPreviewRef.value.fetch(), }, }); @@ -97,11 +95,6 @@ const onSubmit = async () => { @on-fetch="(data) => (canChangePassword = data)" auto-load /> - diff --git a/src/pages/Customer/components/CustomerChangePassword.vue b/src/pages/Customer/components/CustomerChangePassword.vue index f0be5e510..1bfc5e103 100644 --- a/src/pages/Customer/components/CustomerChangePassword.vue +++ b/src/pages/Customer/components/CustomerChangePassword.vue @@ -9,6 +9,7 @@ import useNotify from 'src/composables/useNotify'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; +import FetchData from 'src/components/FetchData.vue'; const { dialogRef } = useDialogPluginComponent(); const { notify } = useNotify(); @@ -19,15 +20,12 @@ const $props = defineProps({ type: String, required: true, }, - userPasswords: { - type: Object, - required: true, - }, promise: { type: Function, required: true, }, }); +const userPasswords = ref({}); const closeButton = ref(null); const isLoading = ref(false); @@ -60,6 +58,11 @@ const onSubmit = async () => {