8713-testToMaster #1539
|
@ -76,6 +76,15 @@ onBeforeMount(async () => {
|
|||
);
|
||||
});
|
||||
|
||||
const routeName = computed(() => {
|
||||
const DESCRIPTOR_PROXY = 'DescriptorProxy';
|
||||
|
||||
let name = $props.dataKey;
|
||||
if ($props.dataKey.includes(DESCRIPTOR_PROXY)) {
|
||||
name = name.split(DESCRIPTOR_PROXY)[0];
|
||||
}
|
||||
return `${name}Summary`;
|
||||
});
|
||||
async function getData() {
|
||||
store.url = $props.url;
|
||||
store.filter = $props.filter ?? {};
|
||||
|
@ -154,9 +163,7 @@ const toModule = computed(() =>
|
|||
{{ t('components.smartCard.openSummary') }}
|
||||
</QTooltip>
|
||||
</QBtn>
|
||||
<RouterLink
|
||||
:to="{ name: `${dataKey}Summary`, params: { id: entity.id } }"
|
||||
>
|
||||
<RouterLink :to="{ name: routeName, params: { id: entity.id } }">
|
||||
<QBtn
|
||||
class="link"
|
||||
color="white"
|
||||
|
|
|
@ -153,6 +153,7 @@ globals:
|
|||
maxTemperature: Max
|
||||
minTemperature: Min
|
||||
changePass: Change password
|
||||
setPass: Set password
|
||||
deleteConfirmTitle: Delete selected elements
|
||||
changeState: Change state
|
||||
raid: 'Raid {daysInForward} days'
|
||||
|
|
|
@ -157,6 +157,7 @@ globals:
|
|||
maxTemperature: Máx
|
||||
minTemperature: Mín
|
||||
changePass: Cambiar contraseña
|
||||
setPass: Establecer contraseña
|
||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||
changeState: Cambiar estado
|
||||
raid: 'Redada {daysInForward} días'
|
||||
|
|
|
@ -25,12 +25,13 @@ const $props = defineProps({
|
|||
const { t } = useI18n();
|
||||
const { hasAccount } = toRefs($props);
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
const arrayData = useArrayData('Account');
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const state = useState();
|
||||
const user = state.getUser();
|
||||
const { notify } = useQuasar();
|
||||
const account = computed(() => useArrayData('Account').store.data[0]);
|
||||
const account = computed(() => arrayData.store.data);
|
||||
account.value.hasAccount = hasAccount.value;
|
||||
const entityId = computed(() => +route.params.id);
|
||||
const hasitManagementAccess = ref();
|
||||
|
@ -39,7 +40,7 @@ const isHimself = computed(() => user.value.id === account.value.id);
|
|||
const url = computed(() =>
|
||||
isHimself.value
|
||||
? 'Accounts/change-password'
|
||||
: `Accounts/${entityId.value}/setPassword`
|
||||
: `Accounts/${entityId.value}/setPassword`,
|
||||
);
|
||||
|
||||
async function updateStatusAccount(active) {
|
||||
|
@ -153,6 +154,7 @@ onMounted(() => {
|
|||
t('account.card.actions.disableAccount.title'),
|
||||
t('account.card.actions.disableAccount.subtitle'),
|
||||
() => deleteAccount(),
|
||||
() => deleteAccount(),
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -172,6 +174,7 @@ onMounted(() => {
|
|||
t('account.card.actions.enableAccount.title'),
|
||||
t('account.card.actions.enableAccount.subtitle'),
|
||||
() => updateStatusAccount(true),
|
||||
() => updateStatusAccount(true),
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -186,6 +189,7 @@ onMounted(() => {
|
|||
t('account.card.actions.disableAccount.title'),
|
||||
t('account.card.actions.disableAccount.subtitle'),
|
||||
() => updateStatusAccount(false),
|
||||
() => updateStatusAccount(false),
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -201,6 +205,7 @@ onMounted(() => {
|
|||
t('account.card.actions.activateUser.title'),
|
||||
t('account.card.actions.activateUser.title'),
|
||||
() => updateStatusUser(true),
|
||||
() => updateStatusUser(true),
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -215,6 +220,7 @@ onMounted(() => {
|
|||
t('account.card.actions.deactivateUser.title'),
|
||||
t('account.card.actions.deactivateUser.title'),
|
||||
() => updateStatusUser(false),
|
||||
() => updateStatusUser(false),
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
|
@ -97,16 +97,19 @@ const columns = computed(() => [
|
|||
align: 'left',
|
||||
name: 'isActive',
|
||||
label: t('invoiceOut.negativeBases.active'),
|
||||
component: 'checkbox',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'hasToInvoice',
|
||||
label: t('invoiceOut.negativeBases.hasToInvoice'),
|
||||
component: 'checkbox',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'hasVerifiedData',
|
||||
name: 'isTaxDataChecked',
|
||||
label: t('invoiceOut.negativeBases.verifiedData'),
|
||||
component: 'checkbox',
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -142,7 +145,7 @@ const downloadCSV = async () => {
|
|||
await invoiceOutGlobalStore.getNegativeBasesCsv(
|
||||
userParams.from,
|
||||
userParams.to,
|
||||
filterParams
|
||||
filterParams,
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -17,6 +17,12 @@ const maritalStatus = [
|
|||
{ code: 'M', name: t('Married') },
|
||||
{ code: 'S', name: t('Single') },
|
||||
];
|
||||
async function setAdvancedSummary(data) {
|
||||
const advanced = (await useAdvancedSummary('Workers', data.id)) ?? {};
|
||||
Object.assign(form.value.formData, advanced);
|
||||
await nextTick();
|
||||
if (form.value) form.value.hasChanges = false;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -36,13 +42,7 @@ const maritalStatus = [
|
|||
:url-update="`Workers/${$route.params.id}`"
|
||||
auto-load
|
||||
model="Worker"
|
||||
@on-fetch="
|
||||
async (data) => {
|
||||
Object.assign(data, (await useAdvancedSummary('Workers', data.id)) ?? {});
|
||||
await $nextTick();
|
||||
if (form) form.hasChanges = false;
|
||||
}
|
||||
"
|
||||
@on-fetch="setAdvancedSummary"
|
||||
>
|
||||
<template #form="{ data }">
|
||||
<VnRow>
|
||||
|
|
|
@ -12,6 +12,11 @@ const $props = defineProps({
|
|||
|
||||
<template>
|
||||
<QPopupProxy>
|
||||
<WorkerDescriptor v-if="$props.id" :id="$props.id" :summary="WorkerSummary" />
|
||||
<WorkerDescriptor
|
||||
v-if="$props.id"
|
||||
:id="$props.id"
|
||||
:summary="WorkerSummary"
|
||||
data-key="WorkerDescriptorProxy"
|
||||
/>
|
||||
</QPopupProxy>
|
||||
</template>
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
describe('ClaimNotes', () => {
|
||||
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
|
||||
const url = '/#/account/1/summary';
|
||||
|
||||
it('should see all the account options', () => {
|
||||
cy.login('itManagement');
|
||||
cy.visit(url);
|
||||
cy.dataCy('descriptor-more-opts').click();
|
||||
cy.get(descriptorOptions)
|
||||
.find('.q-item')
|
||||
.its('length')
|
||||
.then((count) => {
|
||||
cy.log('Número de opciones:', count);
|
||||
expect(count).to.equal(5);
|
||||
});
|
||||
});
|
||||
|
||||
it('should not see any option', () => {
|
||||
cy.login('salesPerson');
|
||||
cy.visit(url);
|
||||
cy.dataCy('descriptor-more-opts').click();
|
||||
cy.get(descriptorOptions).should('not.be.visible');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue