From 79ddbe49169713ff5a8e4dbb6558834ebafabd96 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 16 Sep 2024 09:13:17 -0300 Subject: [PATCH 01/12] Add tooltips in pending orders cards action buttons --- src/pages/Admin/UsersView.vue | 7 ++++--- src/pages/Ecomerce/PendingOrders.vue | 22 +++++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/pages/Admin/UsersView.vue b/src/pages/Admin/UsersView.vue index b999cb97..e2394560 100644 --- a/src/pages/Admin/UsersView.vue +++ b/src/pages/Admin/UsersView.vue @@ -9,14 +9,14 @@ import VnSearchBar from 'src/components/ui/VnSearchBar.vue'; import { useAppStore } from 'stores/app'; import { storeToRefs } from 'pinia'; import { useUserStore } from 'stores/user'; -import useNotify from 'src/composables/useNotify.js'; +// import useNotify from 'src/composables/useNotify.js'; const { t } = useI18n(); const router = useRouter(); const userStore = useUserStore(); const appStore = useAppStore(); const { isHeaderMounted } = storeToRefs(appStore); -const { notify } = useNotify(); +// const { notify } = useNotify(); const loading = ref(false); const users = ref([]); @@ -32,12 +32,13 @@ const onSearch = data => (users.value = data || []); const supplantUser = async user => { try { + console.log('supplant user'); await userStore.supplantUser(user); await appStore.getMenuLinks(); router.push({ name: 'confirmedOrders' }); } catch (error) { console.error('Error supplanting user:', error); - notify(error.message, 'negative'); + // notify(error.message, 'negative'); } }; diff --git a/src/pages/Ecomerce/PendingOrders.vue b/src/pages/Ecomerce/PendingOrders.vue index dbf7acca..38053da8 100644 --- a/src/pages/Ecomerce/PendingOrders.vue +++ b/src/pages/Ecomerce/PendingOrders.vue @@ -85,9 +85,7 @@ onMounted(async () => { > @@ -124,16 +126,26 @@ onMounted(async () => { en-US: newOrder: New order areYouSureDeleteOrder: Are you sure you want to delete the order? + deleteOrder: Delete order + loadOrderIntoCart: Load order into cart es-ES: newOrder: Nuevo pedido areYouSureDeleteOrder: ¿Seguro que quieres borrar el pedido? + deleteOrder: Eliminar pedido + loadOrderIntoCart: Cargar pedido en la cesta ca-ES: newOrder: Nova comanda areYouSureDeleteOrder: Segur que vols esborrar la comanda? + deleteOrder: Eliminar comanda + loadOrderIntoCart: Carregar comanda a la cistella fr-FR: newOrder: Nouvelle commande areYouSureDeleteOrder: Êtes-vous sûr de vouloir supprimer la commande? + deleteOrder: Supprimer la commande + loadOrderIntoCart: Charger la commande dans le panier pt-PT: newOrder: Novo pedido areYouSureDeleteOrder: Tem certeza de que deseja excluir o pedido? + deleteOrder: Excluir pedido + loadOrderIntoCart: Carregar pedido no carrinho From 67847e798b54ddddb9bc0374a1931530ebcf82e6 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 16 Sep 2024 09:29:25 -0300 Subject: [PATCH 02/12] In pending orders the price of the order is not in the end of the card --- src/components/ui/CardList.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ui/CardList.vue b/src/components/ui/CardList.vue index b8d5c6c6..7f68b155 100644 --- a/src/components/ui/CardList.vue +++ b/src/components/ui/CardList.vue @@ -22,7 +22,10 @@ const handleClick = () => { :class="{ 'cursor-pointer': clickable, 'no-radius': !rounded }" @click="handleClick()" > -
+
From f56d4cca145a6d95756874af7de37a5c73467875 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 16 Sep 2024 09:30:42 -0300 Subject: [PATCH 03/12] Avoid supplant user error to appear 2 times --- src/pages/Admin/UsersView.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/Admin/UsersView.vue b/src/pages/Admin/UsersView.vue index e2394560..d6773043 100644 --- a/src/pages/Admin/UsersView.vue +++ b/src/pages/Admin/UsersView.vue @@ -38,7 +38,6 @@ const supplantUser = async user => { router.push({ name: 'confirmedOrders' }); } catch (error) { console.error('Error supplanting user:', error); - // notify(error.message, 'negative'); } }; From be868b60ab53174c6bc825709927a69345307210 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 16 Sep 2024 09:32:14 -0300 Subject: [PATCH 04/12] Remove unused imports --- src/pages/Admin/UsersView.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/Admin/UsersView.vue b/src/pages/Admin/UsersView.vue index d6773043..e3fd7c2c 100644 --- a/src/pages/Admin/UsersView.vue +++ b/src/pages/Admin/UsersView.vue @@ -9,14 +9,12 @@ import VnSearchBar from 'src/components/ui/VnSearchBar.vue'; import { useAppStore } from 'stores/app'; import { storeToRefs } from 'pinia'; import { useUserStore } from 'stores/user'; -// import useNotify from 'src/composables/useNotify.js'; const { t } = useI18n(); const router = useRouter(); const userStore = useUserStore(); const appStore = useAppStore(); const { isHeaderMounted } = storeToRefs(appStore); -// const { notify } = useNotify(); const loading = ref(false); const users = ref([]); From 2a43ab023aa447fe850e7dc22537b65d3ba4aaba Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 16 Sep 2024 09:32:33 -0300 Subject: [PATCH 05/12] Remove console.log --- src/pages/Admin/UsersView.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/Admin/UsersView.vue b/src/pages/Admin/UsersView.vue index e3fd7c2c..705cedbd 100644 --- a/src/pages/Admin/UsersView.vue +++ b/src/pages/Admin/UsersView.vue @@ -30,7 +30,6 @@ const onSearch = data => (users.value = data || []); const supplantUser = async user => { try { - console.log('supplant user'); await userStore.supplantUser(user); await appStore.getMenuLinks(); router.push({ name: 'confirmedOrders' }); From 85eee7bb7a34a5042d925fb6e0fc86b215e69289 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 16 Sep 2024 09:43:44 -0300 Subject: [PATCH 06/12] Admin users add disabled badge when user is disabled --- src/components/ui/CardList.vue | 4 ++-- src/pages/Admin/UsersView.vue | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/ui/CardList.vue b/src/components/ui/CardList.vue index 7f68b155..10bb4c69 100644 --- a/src/components/ui/CardList.vue +++ b/src/components/ui/CardList.vue @@ -24,14 +24,14 @@ const handleClick = () => { >
-
+
diff --git a/src/pages/Admin/UsersView.vue b/src/pages/Admin/UsersView.vue index 705cedbd..4b1131aa 100644 --- a/src/pages/Admin/UsersView.vue +++ b/src/pages/Admin/UsersView.vue @@ -74,14 +74,17 @@ const supplantUser = async user => { From cc44041e31b13cd9a345639d208063223136cf70 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 16 Sep 2024 13:24:43 -0300 Subject: [PATCH 07/12] Create access log view --- src/components/ui/CardList.vue | 9 ++- src/i18n/ca-ES/index.js | 1 + src/i18n/en-US/index.js | 1 + src/i18n/es-ES/index.js | 1 + src/i18n/fr-FR/index.js | 1 + src/i18n/pt-PT/index.js | 1 + src/lib/filters.js | 12 +++- src/pages/Admin/AccessLogView.vue | 106 ++++++++++++++++++++++++++++ src/pages/Admin/ConnectionsView.vue | 2 + src/pages/Admin/UsersView.vue | 2 +- src/router/routes.js | 10 ++- 11 files changed, 139 insertions(+), 7 deletions(-) create mode 100644 src/pages/Admin/AccessLogView.vue diff --git a/src/components/ui/CardList.vue b/src/components/ui/CardList.vue index 10bb4c69..fe247274 100644 --- a/src/components/ui/CardList.vue +++ b/src/components/ui/CardList.vue @@ -1,7 +1,7 @@ + + diff --git a/src/pages/Admin/ConnectionsView.vue b/src/pages/Admin/ConnectionsView.vue index befdfeb5..98dc6eb1 100644 --- a/src/pages/Admin/ConnectionsView.vue +++ b/src/pages/Admin/ConnectionsView.vue @@ -91,6 +91,7 @@ onBeforeUnmount(() => clearInterval(intervalId.value)); v-else v-for="(connection, index) in connections" :key="index" + :to="{ name: 'accessLog', params: { id: connection.userId } }" > +
{{ connections }}
diff --git a/src/pages/Admin/UsersView.vue b/src/pages/Admin/UsersView.vue index 4b1131aa..6021a536 100644 --- a/src/pages/Admin/UsersView.vue +++ b/src/pages/Admin/UsersView.vue @@ -64,7 +64,7 @@ const supplantUser = async user => { v-else v-for="(user, index) in users" :key="index" - :clickable="false" + :to="{ name: 'accessLog', params: { id: user.id } }" >