ref #6104 fix validations,css and tests
This commit is contained in:
parent
9a06a1296c
commit
288a50b296
|
@ -373,7 +373,7 @@ function filterFn(val, update, abortFn, type) {
|
||||||
const needle = val.toLowerCase();
|
const needle = val.toLowerCase();
|
||||||
if (type === 'actions')
|
if (type === 'actions')
|
||||||
filteredActions.value = actions.value.filter((item) =>
|
filteredActions.value = actions.value.filter((item) =>
|
||||||
t(`models.${item}`).toLowerCase().includes(needle)
|
validations[item].locale.name.includes(needle)
|
||||||
);
|
);
|
||||||
if (type === 'workers') {
|
if (type === 'workers') {
|
||||||
if (isNaN(needle))
|
if (isNaN(needle))
|
||||||
|
@ -507,7 +507,7 @@ setLogTree();
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
:title="t('pointRecord')"
|
:title="t('pointRecord')"
|
||||||
padding="xs"
|
padding="none"
|
||||||
v-if="log.action != 'insert'"
|
v-if="log.action != 'insert'"
|
||||||
@click.stop="
|
@click.stop="
|
||||||
openPointRecord(log.id, modelLog)
|
openPointRecord(log.id, modelLog)
|
||||||
|
@ -571,8 +571,8 @@ setLogTree();
|
||||||
size="sm"
|
size="sm"
|
||||||
@click="log.expand = !log.expand"
|
@click="log.expand = !log.expand"
|
||||||
/>
|
/>
|
||||||
<QList v-if="log.props.length" class="attributes">
|
<span v-if="log.props.length" class="attributes">
|
||||||
<QItem v-if="!log.expand" class="q-pa-none text-grey">
|
<span v-if="!log.expand" class="q-pa-none text-grey">
|
||||||
<span
|
<span
|
||||||
v-for="(prop, propIndex) in log.props"
|
v-for="(prop, propIndex) in log.props"
|
||||||
:key="propIndex"
|
:key="propIndex"
|
||||||
|
@ -582,12 +582,12 @@ setLogTree();
|
||||||
{{ prop.nameI18n }}:
|
{{ prop.nameI18n }}:
|
||||||
</span>
|
</span>
|
||||||
<VnJsonValue :value="prop.val.val" />
|
<VnJsonValue :value="prop.val.val" />
|
||||||
<span v-if="propIndex < log.props.length - 1">
|
<span v-if="propIndex < log.props.length - 1"
|
||||||
,
|
>,
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</QItem>
|
</span>
|
||||||
<QItem
|
<span
|
||||||
v-if="log.expand"
|
v-if="log.expand"
|
||||||
class="expanded-json column q-pa-none"
|
class="expanded-json column q-pa-none"
|
||||||
>
|
>
|
||||||
|
@ -611,8 +611,8 @@ setLogTree();
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</QItem>
|
</span>
|
||||||
</QList>
|
</span>
|
||||||
<span v-if="!log.props.length" class="description">
|
<span v-if="!log.props.length" class="description">
|
||||||
{{ log.description }}
|
{{ log.description }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -678,11 +678,11 @@ setLogTree();
|
||||||
>
|
>
|
||||||
<template #option="{ opt, index, itemProps }">
|
<template #option="{ opt, index, itemProps }">
|
||||||
<QItem :index="index" v-bind="itemProps">
|
<QItem :index="index" v-bind="itemProps">
|
||||||
{{ t(`models.${opt}`) }}
|
{{ useFirstUpper(validations[opt].locale.name) }}
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
<template #selected-item="{ opt }">
|
<template #selected-item="{ opt }">
|
||||||
{{ t(`models.${opt}`) }}
|
{{ useFirstUpper(validations[opt].locale.name) }}
|
||||||
</template>
|
</template>
|
||||||
</QSelect>
|
</QSelect>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
@ -943,11 +943,21 @@ setLogTree();
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
.q-btn {
|
.q-btn {
|
||||||
|
visibility: hidden;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.model-info {
|
||||||
|
.q-btn {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.changes-log {
|
.changes-log {
|
||||||
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
|
@ -983,11 +993,18 @@ setLogTree();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.q-btn.pit {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
&:hover .q-btn.pit {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
& > .change-detail {
|
& > .change-detail {
|
||||||
background-color: var(--vn-gray);
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
background-color: var(--vn-gray);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
& > .q-icon {
|
& > .q-icon {
|
||||||
|
@ -1042,11 +1059,6 @@ en:
|
||||||
Edits: Edits
|
Edits: Edits
|
||||||
Deletes: Deletes
|
Deletes: Deletes
|
||||||
Accesses: Accesses
|
Accesses: Accesses
|
||||||
models:
|
|
||||||
Claim: Reclamación
|
|
||||||
ClaimDms: Documento
|
|
||||||
ClaimBeginning: Comienzo
|
|
||||||
ClaimObservation: Observación
|
|
||||||
Users:
|
Users:
|
||||||
User: Usuario
|
User: Usuario
|
||||||
All: Todo
|
All: Todo
|
||||||
|
|
|
@ -1,31 +1,21 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('ClaimNotes', () => {
|
describe('VnLog', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/claim/${1}/log`);
|
cy.visit(`/#/claim/${1}/log`);
|
||||||
});
|
cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
|
|
||||||
it('should have just one record', () => {
|
|
||||||
cy.get('.model-info .q-btn').eq(1).click();
|
|
||||||
cy.get('.user-log .model-log').its('length').should('eq', 1);
|
|
||||||
cy.get('.q-page-sticky .q-btn').click();
|
|
||||||
cy.get('.user-log .model-log').its('length').should('eq', 4);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should filter by insert actions', () => {
|
it('should filter by insert actions', () => {
|
||||||
cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
|
|
||||||
cy.get('.q-checkbox__inner').eq(0).click();
|
cy.get('.q-checkbox__inner').eq(0).click();
|
||||||
cy.get('.q-page > .q-drawer-container > .fullscreen').click();
|
cy.get('.q-page').click();
|
||||||
cy.get('.model-info .q-chip__content').eq(0).should('have.text', 'Document');
|
cy.get('.model-info .q-chip__content').eq(0).should('have.text', 'Document');
|
||||||
cy.get('.model-info .q-chip__content').eq(1).should('have.text', 'Beginning');
|
cy.get('.model-info .q-chip__content').eq(1).should('have.text', 'Beginning');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show the point record', () => {
|
it('should filter by entity', () => {
|
||||||
cy.get('.pit').eq(0).click();
|
cy.get('.q-scrollarea .q-list .q-item .q-select').eq(0).click();
|
||||||
cy.get('.q-menu .q-card .header').should('have.text', 'Observation #1');
|
cy.get('.q-scrollarea .q-list .q-item .q-select').eq(0).type('mien');
|
||||||
cy.get('.q-menu .q-card .json-string').should(
|
cy.get('[role="listbox"] .q-item').should('have.text', 'Comienzo');
|
||||||
'have.text',
|
|
||||||
'Waiting for customer'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,31 +2,30 @@ import { vi, describe, expect, it, beforeAll, afterEach } from 'vitest';
|
||||||
import { createWrapper } from 'app/test/vitest/helper';
|
import { createWrapper } from 'app/test/vitest/helper';
|
||||||
import VnLog from 'src/components/common/VnLog.vue';
|
import VnLog from 'src/components/common/VnLog.vue';
|
||||||
|
|
||||||
const mockValidations = {
|
|
||||||
Claim: {
|
|
||||||
locale: {
|
|
||||||
name: 'reclamación',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
ClaimObservation: {
|
|
||||||
locale: {
|
|
||||||
name: 'observación',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
ClaimDms: {
|
|
||||||
locale: {
|
|
||||||
name: 'documento',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
ClaimBeginning: {
|
|
||||||
locale: {
|
|
||||||
name: 'comienzo',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
describe('VnLog', () => {
|
describe('VnLog', () => {
|
||||||
let vm;
|
let vm;
|
||||||
|
const mockValidations = {
|
||||||
|
Claim: {
|
||||||
|
locale: {
|
||||||
|
name: 'reclamación',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ClaimObservation: {
|
||||||
|
locale: {
|
||||||
|
name: 'observación',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ClaimDms: {
|
||||||
|
locale: {
|
||||||
|
name: 'documento',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ClaimBeginning: {
|
||||||
|
locale: {
|
||||||
|
name: 'comienzo',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
vm = createWrapper(VnLog, {
|
vm = createWrapper(VnLog, {
|
||||||
|
@ -38,6 +37,7 @@ describe('VnLog', () => {
|
||||||
model: 'Claim',
|
model: 'Claim',
|
||||||
},
|
},
|
||||||
}).vm;
|
}).vm;
|
||||||
|
vm.validations = mockValidations;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
@ -100,7 +100,6 @@ describe('VnLog', () => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
vm.validations = mockValidations;
|
|
||||||
vm.logTree = vm.getLogs(fakeLogTreeData);
|
vm.logTree = vm.getLogs(fakeLogTreeData);
|
||||||
expect(vm.logTree[0].originFk).toEqual(1);
|
expect(vm.logTree[0].originFk).toEqual(1);
|
||||||
expect(vm.logTree[0].logs[0].user.name).toEqual('salesPerson');
|
expect(vm.logTree[0].logs[0].user.name).toEqual('salesPerson');
|
||||||
|
@ -121,11 +120,11 @@ describe('VnLog', () => {
|
||||||
expect(vm.selectedFilters.action).toEqual({ inq: ['insert', 'update'] });
|
expect(vm.selectedFilters.action).toEqual({ inq: ['insert', 'update'] });
|
||||||
});
|
});
|
||||||
|
|
||||||
/*it('should correctly set the date from', () => {
|
it('should correctly set the date from', () => {
|
||||||
vm.date = '18-09-2023';
|
vm.date = '18-09-2023';
|
||||||
vm.selectFilter('date', 'from');
|
vm.selectFilter('date', 'from');
|
||||||
expect(vm.selectedFilters.creationDate).toEqual({
|
expect(vm.selectedFilters.creationDate).toEqual({
|
||||||
between: ['2023-09-18T00:00:00.000Z', '2023-09-18T19:59:59.999Z'],
|
between: ['2023-09-18T00:00:00.000Z', '2023-09-18T19:59:59.999Z'],
|
||||||
});
|
});
|
||||||
}); */
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue