Add tooltips in pending orders cards action buttons

This commit is contained in:
William Buezas 2024-09-16 09:13:17 -03:00
parent 59e8285bd2
commit 79ddbe4916
2 changed files with 21 additions and 8 deletions

View File

@ -9,14 +9,14 @@ import VnSearchBar from 'src/components/ui/VnSearchBar.vue';
import { useAppStore } from 'stores/app'; import { useAppStore } from 'stores/app';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { useUserStore } from 'stores/user'; import { useUserStore } from 'stores/user';
import useNotify from 'src/composables/useNotify.js'; // import useNotify from 'src/composables/useNotify.js';
const { t } = useI18n(); const { t } = useI18n();
const router = useRouter(); const router = useRouter();
const userStore = useUserStore(); const userStore = useUserStore();
const appStore = useAppStore(); const appStore = useAppStore();
const { isHeaderMounted } = storeToRefs(appStore); const { isHeaderMounted } = storeToRefs(appStore);
const { notify } = useNotify(); // const { notify } = useNotify();
const loading = ref(false); const loading = ref(false);
const users = ref([]); const users = ref([]);
@ -32,12 +32,13 @@ const onSearch = data => (users.value = data || []);
const supplantUser = async user => { const supplantUser = async user => {
try { try {
console.log('supplant user');
await userStore.supplantUser(user); await userStore.supplantUser(user);
await appStore.getMenuLinks(); await appStore.getMenuLinks();
router.push({ name: 'confirmedOrders' }); router.push({ name: 'confirmedOrders' });
} catch (error) { } catch (error) {
console.error('Error supplanting user:', error); console.error('Error supplanting user:', error);
notify(error.message, 'negative'); // notify(error.message, 'negative');
} }
}; };
</script> </script>

View File

@ -85,9 +85,7 @@ onMounted(async () => {
> >
<template #content> <template #content>
<QItemLabel class="text-bold q-mb-sm"> <QItemLabel class="text-bold q-mb-sm">
{{ {{ formatDateTitle(order.sent) }}
formatDateTitle(order.sent)
}}
</QItemLabel> </QItemLabel>
<QItemLabel> #{{ order.id }} </QItemLabel> <QItemLabel> #{{ order.id }} </QItemLabel>
<QItemLabel>{{ order.nickname }}</QItemLabel> <QItemLabel>{{ order.nickname }}</QItemLabel>
@ -106,13 +104,17 @@ onMounted(async () => {
() => removeOrder(order.id, index) () => removeOrder(order.id, index)
) )
" "
/> >
<QTooltip>{{ t('deleteOrder') }}</QTooltip>
</QBtn>
<QBtn <QBtn
icon="shopping_bag" icon="shopping_bag"
flat flat
rounded rounded
@click.stop.prevent="loadOrder(order.id)" @click.stop.prevent="loadOrder(order.id)"
/> >
<QTooltip>{{ t('loadOrderIntoCart') }}</QTooltip>
</QBtn>
</template> </template>
</CardList> </CardList>
</QPage> </QPage>
@ -124,16 +126,26 @@ onMounted(async () => {
en-US: en-US:
newOrder: New order newOrder: New order
areYouSureDeleteOrder: Are you sure you want to delete the order? areYouSureDeleteOrder: Are you sure you want to delete the order?
deleteOrder: Delete order
loadOrderIntoCart: Load order into cart
es-ES: es-ES:
newOrder: Nuevo pedido newOrder: Nuevo pedido
areYouSureDeleteOrder: ¿Seguro que quieres borrar el pedido? areYouSureDeleteOrder: ¿Seguro que quieres borrar el pedido?
deleteOrder: Eliminar pedido
loadOrderIntoCart: Cargar pedido en la cesta
ca-ES: ca-ES:
newOrder: Nova comanda newOrder: Nova comanda
areYouSureDeleteOrder: Segur que vols esborrar la comanda? areYouSureDeleteOrder: Segur que vols esborrar la comanda?
deleteOrder: Eliminar comanda
loadOrderIntoCart: Carregar comanda a la cistella
fr-FR: fr-FR:
newOrder: Nouvelle commande newOrder: Nouvelle commande
areYouSureDeleteOrder: Êtes-vous sûr de vouloir supprimer la commande? areYouSureDeleteOrder: Êtes-vous sûr de vouloir supprimer la commande?
deleteOrder: Supprimer la commande
loadOrderIntoCart: Charger la commande dans le panier
pt-PT: pt-PT:
newOrder: Novo pedido newOrder: Novo pedido
areYouSureDeleteOrder: Tem certeza de que deseja excluir o pedido? areYouSureDeleteOrder: Tem certeza de que deseja excluir o pedido?
deleteOrder: Excluir pedido
loadOrderIntoCart: Carregar pedido no carrinho
</i18n> </i18n>