diff --git a/src/boot/axios.js b/src/boot/axios.js
index 2f454188e..cbd5e7213 100644
--- a/src/boot/axios.js
+++ b/src/boot/axios.js
@@ -58,9 +58,12 @@ const onResponseError = (error) => {
break;
}
- if (session.isLoggedIn && response.status === 401) {
+ if (session.isLoggedIn() && response.status === 401) {
session.destroy();
Router.push({ path: '/login' });
+ } else if(!session.isLoggedIn())
+ {
+ message = 'login.loginError';
}
Notify.create({
diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue
index 6bc00d5ce..a7504705a 100644
--- a/src/components/UserPanel.vue
+++ b/src/components/UserPanel.vue
@@ -70,7 +70,7 @@ async function saveDarkMode(value) {
}
async function saveLanguage(value) {
- const query = `/Accounts/${user.value.id}`;
+ const query = `/VnUsers/${user.value.id}`;
await axios.patch(query, {
lang: value,
});
diff --git a/src/composables/useRole.js b/src/composables/useRole.js
index b8da153d3..a781785a0 100644
--- a/src/composables/useRole.js
+++ b/src/composables/useRole.js
@@ -5,7 +5,7 @@ export function useRole() {
const state = useState();
async function fetch() {
- const { data } = await axios.get('Accounts/acl');
+ const { data } = await axios.get('VnUsers/acl');
const roles = data.roles.map((userRoles) => userRoles.role.name);
const userData = {
diff --git a/src/pages/Login/LoginMain.vue b/src/pages/Login/LoginMain.vue
index 7fb0ee408..747fe8b14 100644
--- a/src/pages/Login/LoginMain.vue
+++ b/src/pages/Login/LoginMain.vue
@@ -48,25 +48,29 @@ const password = ref('');
const keepLogin = ref(true);
async function onSubmit() {
- const { data } = await axios.post('Accounts/login', {
- user: username.value,
- password: password.value,
- });
+ try {
+ const { data } = await axios.post('Accounts/login', {
+ user: username.value,
+ password: password.value,
+ });
- if (!data) return;
+ if (!data) return;
- await session.login(data.token, keepLogin.value);
+ await session.login(data.token, keepLogin.value);
- quasar.notify({
- message: t('login.loginSuccess'),
- type: 'positive',
- });
+ quasar.notify({
+ message: t('login.loginSuccess'),
+ type: 'positive',
+ });
- const currentRoute = router.currentRoute.value;
- if (currentRoute.query && currentRoute.query.redirect) {
- router.push(currentRoute.query.redirect);
- } else {
- router.push({ name: 'Dashboard' });
+ const currentRoute = router.currentRoute.value;
+ if (currentRoute.query && currentRoute.query.redirect) {
+ router.push(currentRoute.query.redirect);
+ } else {
+ router.push({ name: 'Dashboard' });
+ }
+ } catch (e) {
+ //
}
}
diff --git a/src/pages/Ticket/Card/TicketBoxing.vue b/src/pages/Ticket/Card/TicketBoxing.vue
index 9d46ddba2..05bde8977 100644
--- a/src/pages/Ticket/Card/TicketBoxing.vue
+++ b/src/pages/Ticket/Card/TicketBoxing.vue
@@ -1,9 +1,9 @@
-
-
-
-
-
-
-
- {{ t('ticket.boxing.selectTime') }} ({{ time.min }}-{{
- time.max
- }})
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #{{ expedition.id }}
-
-
- {{
- t('ticket.boxing.created')
- }}
-
- {{
- date.formatDate(
- expedition.created,
- 'YYYY-MM-DD HH:mm:ss'
- )
- }}
-
- {{ t('ticket.boxing.item') }}
- {{ expedition.packagingItemFk }}
- {{
- t('ticket.boxing.worker')
- }}
- {{ expedition.userName }}
-
-
-
-
-
-
+
+
+
+
+
+
+ {{ t('ticket.boxing.selectTime') }} ({{ time.min }}-{{
+ time.max
+ }})
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #{{ expedition.id }}
+
+
+ {{ t('ticket.boxing.created') }}
+
+ {{
+ date.formatDate(expedition.created, 'YYYY-MM-DD HH:mm:ss')
+ }}
+
+ {{ t('ticket.boxing.item') }}
+ {{ expedition.packagingItemFk }}
+ {{ t('ticket.boxing.worker') }}
+ {{ expedition.userName }}
+
+
+
+
+
diff --git a/test/cypress/integration/claimPhoto.spec.js b/test/cypress/integration/claimPhoto.spec.js
index e5ea2ce25..ec41e92a3 100755
--- a/test/cypress/integration/claimPhoto.spec.js
+++ b/test/cypress/integration/claimPhoto.spec.js
@@ -43,13 +43,13 @@ describe('ClaimPhoto', () => {
cy.get(
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
).click();
- cy.get('.q-btn--standard > .q-btn__content > .block').click();
+ cy.get('.q-btn--unelevated > .q-btn__content > .block').click();
cy.get('.q-notification__message').should('have.text', 'Data deleted');
cy.get(
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
).click();
- cy.get('.q-btn--standard > .q-btn__content > .block').click();
+ cy.get('.q-btn--unelevated > .q-btn__content > .block').click();
cy.get('.q-notification__message').should('have.text', 'Data deleted');
});
});
diff --git a/test/cypress/integration/ticketBoxing.spec.js b/test/cypress/integration/ticketBoxing.spec.js
index 7a1ed669d..7b3bd36cc 100755
--- a/test/cypress/integration/ticketBoxing.spec.js
+++ b/test/cypress/integration/ticketBoxing.spec.js
@@ -1,5 +1,5 @@
///
-xdescribe('TicketBoxing', () => {
+describe('TicketBoxing', () => {
beforeEach(() => {
const ticketId = 1;
cy.viewport(1280, 720);
@@ -26,9 +26,9 @@ xdescribe('TicketBoxing', () => {
},
['2022-01-01T01-01-00.mp4', '2022-02-02T02-02-00.mp4', '2022-03-03T03-03-00.mp4']
).as('getVideoList');
- cy.get('.q-list > :nth-child(3)').click();
+ cy.get('.q-list').eq(3).find('.q-item').eq(2).click();
- cy.get('.q-list > :nth-child(1)').should('be.visible');
- cy.get('.q-list > :nth-child(2)').should('be.visible');
+ cy.get('.q-list').eq(3).find('.q-item').eq(0).find('.q-range');
+ cy.get('.q-list').eq(3).find('.q-item').eq(1).find('.q-select');
});
});
diff --git a/test/cypress/integration/workerList.spec.js b/test/cypress/integration/workerList.spec.js
index 9f3d62448..79f2400bf 100644
--- a/test/cypress/integration/workerList.spec.js
+++ b/test/cypress/integration/workerList.spec.js
@@ -12,7 +12,10 @@ describe('WorkerList', () => {
});
it('should open the worker summary', () => {
- cy.get('div[class="q-item__section column q-item__section--side justify-center q-pa-md"]').eq(0).click();
+ cy.get('div.text-h6')
+ .parentsUntil('div.q-card')
+ .find('div.q-card__actions')
+ .find('button').first().click();
cy.get('div[class="header bg-primary q-pa-sm q-mb-md"').should('have.text', '1110 - Jessica Jones');
cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(0).should('have.text', 'Basic data');
cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(1).should('have.text', 'User data');
diff --git a/test/cypress/integration/workerSummary.spec.js b/test/cypress/integration/workerSummary.spec.js
index ae01378f6..cef26d061 100644
--- a/test/cypress/integration/workerSummary.spec.js
+++ b/test/cypress/integration/workerSummary.spec.js
@@ -6,10 +6,10 @@ describe('WorkerSummary', () => {
});
it('should load worker summary', () => {
- cy.get('div[class="header bg-primary q-pa-sm q-mb-md"').should('have.text', '19 - salesBoss');
+ cy.get('div[class="header bg-primary q-pa-sm q-mb-md"').should('have.text', '19 - salesBoss salesBoss');
cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(0).should('have.text', 'Basic data');
cy.get('div[class="q-item__label q-item__label--header text-h6"]').eq(1).should('have.text', 'User data');
cy.get('div[class="q-item__section column q-item__section--main justify-center"]').eq(0).should('have.text', 'NamesalesBossNick');
});
-});
\ No newline at end of file
+});
diff --git a/test/vitest/__tests__/boot/axios.spec.js b/test/vitest/__tests__/boot/axios.spec.js
index a95c57fba..feb0d93ea 100644
--- a/test/vitest/__tests__/boot/axios.spec.js
+++ b/test/vitest/__tests__/boot/axios.spec.js
@@ -1,15 +1,15 @@
-import { vi, describe, expect, it } from 'vitest';
+import { Notify } from 'quasar';
import { onRequest, onResponseError } from 'src/boot/axios';
-import { Notify } from 'quasar'
+import { describe, expect, it, vi } from 'vitest';
vi.mock('src/composables/useSession', () => ({
useSession: () => ({
- getToken: () => 'DEFAULT_TOKEN'
- }),
+ getToken: () => 'DEFAULT_TOKEN',
+ isLoggedIn: () => vi.fn(),
+ destroy: () => vi.fn(),
+ })
}));
-vi.mock('src/router', () => ({}));
-
describe('Axios boot', () => {
describe('onRequest()', async () => {
diff --git a/test/vitest/__tests__/pages/Tickets/TicketBoxing.spec.js b/test/vitest/__tests__/pages/Tickets/TicketBoxing.spec.js
index b731cf2cf..8fd62d8c2 100644
--- a/test/vitest/__tests__/pages/Tickets/TicketBoxing.spec.js
+++ b/test/vitest/__tests__/pages/Tickets/TicketBoxing.spec.js
@@ -4,7 +4,7 @@ import TicketBoxing from 'pages/Ticket/Card/TicketBoxing.vue';
// #4836 - Investigate how to test q-drawer outside
// q-layout or how to teleport q-drawer inside
-describe.skip('TicketBoxing', () => {
+describe('TicketBoxing', () => {
let vm;
beforeAll(() => {
vm = createWrapper(TicketBoxing).vm;