0
0
Fork 0

feat: AccountDescriptorMenu

This commit is contained in:
Javier Segarra 2024-05-18 11:40:32 +02:00
parent 474e2c3a48
commit bbd51c5773
3 changed files with 83 additions and 40 deletions

View File

@ -12,57 +12,84 @@ const $props = defineProps({
required: true, required: true,
}, },
}); });
import { useVnConfirm } from 'composables/useVnConfirm';
const { t } = useI18n(); const { t } = useI18n();
const { openReport } = usePrintService(); const { openReport } = usePrintService();
const { openConfirmationModal } = useVnConfirm();
const account = ref($props.account); const account = ref($props.account);
function setPassword() {
const id = account.value.id;
openReport(`Accounts/${id}/account-pickup-pdf`, {
recipientId: account.value.clientFk,
});
}
function disableAccount() {
const id = account.value.id;
openReport(`Accounts/${id}/account-pickup-pdf`, {
recipientId: account.value.clientFk,
});
}
function disableUser() {
const id = account.value.id;
openReport(`Accounts/${id}/account-pickup-pdf`, {
recipientId: account.value.clientFk,
});
}
function sync() {
const id = account.value.id;
openReport(`Accounts/${id}/account-pickup-pdf`, {
recipientId: account.value.clientFk,
});
}
</script> </script>
<template> <template>
<QItem v-ripple clickable @click="setPassword(entity)"> <QItem
v-ripple
clickable
@click="
openConfirmationModal(
t('Confirm deletion'),
t('Are you sure...TODO'),
setPassword
)
"
>
<QItemSection>{{ t('account.card.actions.setPassword') }}</QItemSection> <QItemSection>{{ t('account.card.actions.setPassword') }}</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable @click="disableAccount(entity)"> <QItem
<QItemSection>{{ t('account.card.actions.disableAccount') }}</QItemSection> v-ripple
clickable
@click="
openConfirmationModal(
t('account.card.actions.disableAccount.title'),
t('account.card.actions.disableAccount.subtitle'),
disableAccount
)
"
>
<QItemSection>{{ t('account.card.actions.disableAccount.name') }}</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable @click="disableUser(entity)"> <QItem
<QItemSection>{{ t('account.card.actions.disableUser') }}</QItemSection> v-ripple
clickable
@click="
openConfirmationModal(
t('account.card.actions.disableUser.title'),
t('account.card.actions.disableUser.title'),
actiondisableUser
)
"
>
<QItemSection>{{ t('account.card.actions.disableUser.name') }}</QItemSection>
</QItem> </QItem>
<QItem v-ripple clickable @click="sync(entity)"> <QItem
<QItemSection>{{ t('account.card.actions.sync') }}</QItemSection> v-ripple
clickable
@click="
openConfirmationModal(
t('account.card.actions.sync.title'),
t('account.card.actions.sync.subtitle'),
sync
)
"
>
<QItemSection>{{ t('account.card.actions.sync.name') }}</QItemSection>
</QItem> </QItem>
<QSeparator /> <QSeparator />
<QItem @click="confirmRemove()" v-ripple clickable> <QItem
@click="
openConfirmationModal(
t('account.card.actions.delete.title'),
t('account.card.actions.delete.subTitle'),
removeAccount
)
"
v-ripple
clickable
>
<QItemSection avatar> <QItemSection avatar>
<QIcon name="delete" /> <QIcon name="delete" />
</QItemSection> </QItemSection>
<QItemSection>{{ t('account.card.actions.delete') }}</QItemSection> <QItemSection>{{ t('account.card.actions.delete.name') }}</QItemSection>
</QItem> </QItem>
</template> </template>

View File

@ -18,8 +18,12 @@ account:
nickname: Usuario nickname: Usuario
role: Rol role: Rol
actions: actions:
setPassword: Se password setPassword: Set password
disableAccount: Disable account
disableAccount:
name: Disable account
title: La cuenta será deshabilitada
subtitle: ¿Seguro que quieres continuar?
disableUser: Disable user disableUser: Disable user
sync: Sync sync: Sync
delete: Delete delete: Delete

View File

@ -19,10 +19,22 @@ account:
role: Rol role: Rol
actions: actions:
setPassword: Establecer contraseña setPassword: Establecer contraseña
disableAccount: Deshabilitar cuenta disableAccount:
disableUser: Desactivar usuario name: Deshabilitar cuenta
sync: Sincronizar title: La cuenta será deshabilitada
delete: Eliminar 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 search: Buscar usuario
role: role: