Merge branch 'dev' into 8440-createVehicleNotes
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
gitea/salix-front/pipeline/pr-dev This commit is unstable
Details
This commit is contained in:
commit
2f88e97e2e
|
@ -25,6 +25,8 @@ RUN apt-get update \
|
||||||
libnss3 \
|
libnss3 \
|
||||||
libxss1 \
|
libxss1 \
|
||||||
libxtst6 \
|
libxtst6 \
|
||||||
|
mesa-vulkan-drivers \
|
||||||
|
vulkan-tools \
|
||||||
xauth \
|
xauth \
|
||||||
xvfb \
|
xvfb \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
|
|
21147
pnpm-lock.yaml
21147
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -80,6 +80,7 @@ async function deleteWorCenter(id) {
|
||||||
color="primary"
|
color="primary"
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
|
data-cy="removeWorkCenterBtn"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
|
|
@ -11,6 +11,7 @@ import AgencyDescriptorProxy from 'src/pages/Route/Agency/Card/AgencyDescriptorP
|
||||||
import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue';
|
import VehicleDescriptorProxy from 'src/pages/Route/Vehicle/Card/VehicleDescriptorProxy.vue';
|
||||||
import VnSection from 'src/components/common/VnSection.vue';
|
import VnSection from 'src/components/common/VnSection.vue';
|
||||||
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
|
||||||
|
import RouteTickets from './RouteTickets.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -26,6 +27,12 @@ const routeFilter = {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function redirectToTickets(id) {
|
||||||
|
const url = `#/route/${id}/tickets`;
|
||||||
|
window.open(url, '_blank');
|
||||||
|
}
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
@ -141,6 +148,12 @@ const columns = computed(() => [
|
||||||
align: 'right',
|
align: 'right',
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
actions: [
|
actions: [
|
||||||
|
{
|
||||||
|
title: t('globals.pageTitles.tickets'),
|
||||||
|
icon: 'vn:ticket',
|
||||||
|
action: (row) => redirectToTickets(row?.id),
|
||||||
|
isPrimary: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t('components.smartCard.viewSummary'),
|
title: t('components.smartCard.viewSummary'),
|
||||||
icon: 'preview',
|
icon: 'preview',
|
||||||
|
|
|
@ -37,9 +37,9 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'city',
|
name: 'client',
|
||||||
label: t('City'),
|
label: t('Client'),
|
||||||
field: (row) => row?.city,
|
field: (row) => row?.nickname,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
@ -51,9 +51,9 @@ const columns = computed(() => [
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'client',
|
name: 'city',
|
||||||
label: t('Client'),
|
label: t('City'),
|
||||||
field: (row) => row?.nickname,
|
field: (row) => row?.city,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
align: 'left',
|
align: 'left',
|
||||||
},
|
},
|
||||||
|
|
|
@ -73,6 +73,7 @@ const onNodeExpanded = async (nodeKeysArray) => {
|
||||||
const response = await axios.get(`Zones/${route.params.id}/getLeaves`, {
|
const response = await axios.get(`Zones/${route.params.id}/getLeaves`, {
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
response.data = JSON.parse(response.data);
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
node.childs = response.data.map((n) => {
|
node.childs = response.data.map((n) => {
|
||||||
if (n.sons > 0) n.childs = [{}];
|
if (n.sons > 0) n.childs = [{}];
|
||||||
|
@ -126,14 +127,17 @@ watch(
|
||||||
async (val) => {
|
async (val) => {
|
||||||
if (!val) return;
|
if (!val) return;
|
||||||
// // Se triggerea cuando se actualiza el store.data, el cual es el resultado del fetch de la searchbar
|
// // Se triggerea cuando se actualiza el store.data, el cual es el resultado del fetch de la searchbar
|
||||||
|
val = JSON.parse(val);
|
||||||
if (!nodes.value[0]) nodes.value = [defaultNode];
|
if (!nodes.value[0]) nodes.value = [defaultNode];
|
||||||
nodes.value[0].childs = [...val];
|
nodes.value[0].childs = [...val];
|
||||||
const fetchedNodeKeys = val.flatMap(getNodeIds);
|
const fetchedNodeKeys = val.flatMap(getNodeIds);
|
||||||
state.set('Tree', [...fetchedNodeKeys]);
|
state.set('Tree', [...fetchedNodeKeys]);
|
||||||
expanded.value = [null, ...fetchedNodeKeys];
|
expanded.value = [null, ...fetchedNodeKeys];
|
||||||
|
const fetchs = [];
|
||||||
for (let n of state.get('Tree')) {
|
for (let n of state.get('Tree')) {
|
||||||
await fetchNodeLeaves(n);
|
fetchs.push(fetchNodeLeaves(n));
|
||||||
}
|
}
|
||||||
|
await Promise.all(fetchs);
|
||||||
previousExpandedNodes.value = new Set(expanded.value);
|
previousExpandedNodes.value = new Set(expanded.value);
|
||||||
},
|
},
|
||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
describe('Client balance', () => {
|
describe('Client balance', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit('#/customer/1101/balance');
|
cy.visit('#/customer/1101/balance');
|
||||||
});
|
});
|
||||||
it('Should create a mandate', () => {
|
it('Should create a mandate', () => {
|
||||||
cy.get('.q-page-sticky > div > .q-btn').click();
|
cy.get('.q-page-sticky > div > .q-btn').click();
|
||||||
cy.selectOption('[data-cy="paymentBank"]', 2);
|
cy.selectOption('[data-cy="paymentBank"]', 2);
|
||||||
cy.dataCy('paymentAmount_input').type('100');
|
cy.dataCy('paymentAmount_input').clear().type('100');
|
||||||
cy.saveCard();
|
cy.saveCard();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,27 +1,34 @@
|
||||||
describe.skip('AgencyWorkCenter', () => {
|
describe('AgencyWorkCenter', () => {
|
||||||
|
const selectors = {
|
||||||
|
workCenter: 'workCenter_select',
|
||||||
|
popupSave: 'FormModelPopup_save',
|
||||||
|
popupCancel: 'FormModelPopup_cancel',
|
||||||
|
remove: 'removeWorkCenterBtn',
|
||||||
|
};
|
||||||
|
|
||||||
|
const messages = {
|
||||||
|
dataCreated: 'Data created',
|
||||||
|
alreadyAssigned: 'This workCenter is already assigned to this agency',
|
||||||
|
removed: 'WorkCenter removed successfully',
|
||||||
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1920, 1080);
|
cy.viewport(1920, 1080);
|
||||||
cy.login('developer');
|
cy.login('developer');
|
||||||
cy.visit(`/#/route/agency/11/workCenter`);
|
cy.visit(`/#/route/agency/11/workCenter`);
|
||||||
});
|
});
|
||||||
const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
|
|
||||||
const workCenterCombobox = 'input[role="combobox"]';
|
|
||||||
|
|
||||||
it('check workCenter crud', () => {
|
it('Should add work center, check already assigned and remove work center', () => {
|
||||||
// create
|
cy.addBtnClick();
|
||||||
cy.get(createButton).click();
|
cy.selectOption('[data-cy="workCenter_select"]', 'workCenterOne');
|
||||||
cy.get(workCenterCombobox).type('workCenterOne{enter}');
|
cy.dataCy(selectors.popupSave).click();
|
||||||
cy.checkNotification('Data created');
|
cy.checkNotification('Data created');
|
||||||
|
cy.addBtnClick();
|
||||||
// expect error when duplicate
|
cy.selectOption('[data-cy="workCenter_select"]', 'workCenterOne');
|
||||||
cy.get(createButton).click();
|
cy.dataCy(selectors.popupSave).click();
|
||||||
cy.selectOption(workCenterCombobox, 'workCenterOne');
|
cy.checkNotification(messages.alreadyAssigned);
|
||||||
cy.get('[data-cy="FormModelPopup_save"]').click();
|
cy.dataCy(selectors.popupCancel).click();
|
||||||
cy.checkNotification('This workCenter is already assigned to this agency');
|
cy.dataCy(selectors.remove).click();
|
||||||
cy.get('[data-cy="FormModelPopup_cancel"]').click();
|
cy.checkNotification(messages.removed);
|
||||||
|
|
||||||
// delete
|
|
||||||
cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click();
|
|
||||||
cy.checkNotification('WorkCenter removed successfully');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -62,12 +62,7 @@ Cypress.Commands.overwrite('visit', (originalFn, url, options, waitRequest = tru
|
||||||
originalFn(url, options);
|
originalFn(url, options);
|
||||||
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
|
cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'));
|
||||||
cy.waitUntil(() => cy.get('main').should('exist'));
|
cy.waitUntil(() => cy.get('main').should('exist'));
|
||||||
if (waitRequest)
|
if (waitRequest) cy.waitSpinner();
|
||||||
cy.get('body').then(($body) => {
|
|
||||||
if ($body.find('[data-cy="loading-spinner"]').length) {
|
|
||||||
cy.get('[data-cy="loading-spinner"]').should('not.be.visible');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('waitForElement', (element) => {
|
Cypress.Commands.add('waitForElement', (element) => {
|
||||||
|
@ -99,6 +94,14 @@ Cypress.Commands.add('getValue', (selector) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('waitSpinner', () => {
|
||||||
|
cy.get('body').then(($body) => {
|
||||||
|
if ($body.find('[data-cy="loading-spinner"]').length) {
|
||||||
|
cy.get('[data-cy="loading-spinner"]').should('not.be.visible');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Fill Inputs
|
// Fill Inputs
|
||||||
Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
|
Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
|
||||||
cy.waitForElement(selector, timeout);
|
cy.waitForElement(selector, timeout);
|
||||||
|
@ -116,6 +119,7 @@ Cypress.Commands.add('selectOption', (selector, option, timeout = 2500) => {
|
||||||
|
|
||||||
function selectItem(selector, option, ariaControl, hasWrite = true) {
|
function selectItem(selector, option, ariaControl, hasWrite = true) {
|
||||||
if (!hasWrite) cy.wait(100);
|
if (!hasWrite) cy.wait(100);
|
||||||
|
cy.waitSpinner();
|
||||||
|
|
||||||
getItems(ariaControl).then((items) => {
|
getItems(ariaControl).then((items) => {
|
||||||
const matchingItem = items
|
const matchingItem = items
|
||||||
|
@ -135,6 +139,7 @@ function getItems(ariaControl, startTime = Cypress._.now(), timeout = 2500) {
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.find('.q-item')
|
.find('.q-item')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
|
.should('be.visible')
|
||||||
.then(($items) => {
|
.then(($items) => {
|
||||||
if (!$items?.length || $items.first().text().trim() === '') {
|
if (!$items?.length || $items.first().text().trim() === '') {
|
||||||
if (Cypress._.now() - startTime > timeout) {
|
if (Cypress._.now() - startTime > timeout) {
|
||||||
|
|
Loading…
Reference in New Issue