From f453f42b06759902cfd6a04b911d0752169265ed Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 5 Jun 2024 19:37:53 +0200 Subject: [PATCH] feat: New and edit ACL from Popup --- src/components/FormModelPopup.vue | 1 + src/pages/Account/AccountAcls.vue | 24 +++- src/pages/Account/Acls/AclFormView.vue | 174 ++++++++++++------------- 3 files changed, 106 insertions(+), 93 deletions(-) diff --git a/src/components/FormModelPopup.vue b/src/components/FormModelPopup.vue index 25213a8b7..06aa1d891 100644 --- a/src/components/FormModelPopup.vue +++ b/src/components/FormModelPopup.vue @@ -65,6 +65,7 @@ defineExpose({ :observe-form-changes="false" :default-actions="false" :url-create="urlCreate" + :url="url" :model="model" @on-data-saved="onDataSaved" > diff --git a/src/pages/Account/AccountAcls.vue b/src/pages/Account/AccountAcls.vue index ac21861a7..5be6be1d4 100644 --- a/src/pages/Account/AccountAcls.vue +++ b/src/pages/Account/AccountAcls.vue @@ -13,6 +13,7 @@ import { useVnConfirm } from 'composables/useVnConfirm'; import { useStateStore } from 'stores/useStateStore'; import axios from 'axios'; import useNotify from 'src/composables/useNotify.js'; +import AclFormView from './Acls/AclFormView.vue'; defineProps({ id: { @@ -28,6 +29,7 @@ const stateStore = useStateStore(); const { openConfirmationModal } = useVnConfirm(); const paginateRef = ref(null); +const formDialog = ref(false); const exprBuilder = (param, value) => { switch (param) { @@ -48,8 +50,16 @@ const deleteAcl = async (id) => { } }; -const redirectToAclsForm = (id = undefined) => - router.push({ name: 'AccountAclForm', query: { id } }); +function showFormDialog(id = null) { + formDialog.value = { + show: true, + id, + ur: `ACLs/${id}`, + }; +} + +const redirectToAclsForm = (id = undefined) => showFormDialog(id); +// router.push({ name: 'AccountAclForm', query: { id } }); + + + - + {{ t('New ACL') }} diff --git a/src/pages/Account/Acls/AclFormView.vue b/src/pages/Account/Acls/AclFormView.vue index 2e3c28b71..e14744564 100644 --- a/src/pages/Account/Acls/AclFormView.vue +++ b/src/pages/Account/Acls/AclFormView.vue @@ -1,6 +1,6 @@