Compare commits

...

88 Commits

Author SHA1 Message Date
Alex Moreno 8b61d1a4c7 Merge pull request 'feat(ExtraCommunity): refs #8105 add data-cy attribute for testing and create integration tests' (!1786) from 8105-travels_bySupplier into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1786
Reviewed-by: Jon Elias <jon@verdnatura.es>
2025-05-09 08:01:24 +00:00
Alex Moreno 8f3621efc6 Merge branch 'dev' into 8105-travels_bySupplier
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-09 08:00:05 +00:00
Jon Elias 50f1b5b326 Merge pull request 'fix: fixed label and increased test coverage' (!1777) from Fix-VnBankDetail into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1777
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-09 07:59:48 +00:00
Jon Elias 7cacdbdf94 Merge branch 'dev' into Fix-VnBankDetail
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-09 07:54:25 +00:00
Alex Moreno 7afd6b3dcd Merge branch 'dev' into 8105-travels_bySupplier
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-09 06:39:10 +00:00
Alex Moreno 51402f9f3f test: enable OrderCatalog tests by removing skip
gitea/salix-front/pipeline/head This commit looks good Details
2025-05-09 08:09:52 +02:00
Alex Moreno a4c4d987c7 Merge pull request 'test: refs #8862 add Cypress isolation tests for various ticket and zone components' (!1698) from 8862-testIsolationFalse into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1698
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-09 06:05:14 +00:00
Alex Moreno b1bde7be97 fix: refs #8862 skip OrderCatalog tests to prevent isolation issues
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-09 07:18:01 +02:00
Alex Moreno 5c927cec4b Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details
2025-05-09 05:08:19 +00:00
Pau Rovira ab0d2e60b7 Merge pull request 'feat: #8406 upgraded CrudModel' (!1627) from 8406-crudModelUpdate into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1627
Reviewed-by: Jorge Penadés <jorgep@verdnatura.es>
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-08 14:44:15 +00:00
Pau Rovira 0502abfca5 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-08 14:17:54 +00:00
Alex Moreno b1ef9b1bd3 Merge pull request 'feat: refs #7248 modify VnNotes' (!1336) from 7248-tablesObservation into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #1336
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2025-05-08 13:04:24 +00:00
Benjamin Esteve 68d1f3cb18 Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-08 12:58:01 +00:00
Alex Moreno debae747db Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-08 10:53:36 +00:00
Alex Moreno 671f0c1e67 Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-08 10:21:53 +00:00
Alex Moreno beeeedbb84 feat(ExtraCommunity): refs #8105 add data-cy attribute for testing and create integration tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-08 10:21:32 +02:00
Benjamin Esteve 34fc2d403d Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-08 07:07:24 +00:00
Alex Moreno 5bb452186e fix: refs #7248 update user filter property name in VehicleNotes component
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 15:04:02 +02:00
Benjamin Esteve 148e49b153 Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-05-07 11:32:03 +00:00
Alex Moreno 7dd6cc71e2 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation 2025-05-07 13:29:54 +02:00
Benjamin Esteve cfe64d644e Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 11:35:54 +02:00
Benjamin Esteve 91c627324a Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 10:23:56 +02:00
Benjamin Esteve 5cad6103a5 feat: refs #8862 enable test isolation for multiple spec files
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 10:13:03 +02:00
Alex Moreno d5fc3423d6 Merge branch '7248-tablesObservation' of https://gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 09:56:04 +02:00
Alex Moreno e064f9e706 fix: refs #7248 rename workerFk to userFk in CustomerDefaulter component 2025-05-07 09:55:48 +02:00
Alex Moreno cb47858f65 Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev Build queued... Details
2025-05-07 07:49:56 +00:00
Alex Moreno 686edc0b51 Revert "fix: refs #7248 update exprBuilder for workerFk and calculate total amount in CustomerBalanceDueTotal"
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details
This reverts commit 5f9d498700.
2025-05-07 09:49:17 +02:00
Alex Moreno 876f40b4a3 Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-07 05:36:55 +00:00
Benjamin Esteve 53cea184cc Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-06 10:40:01 +00:00
Jon Elias 7f7c86def2 Merge branch 'dev' into Fix-VnBankDetail
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-06 09:34:21 +00:00
Jon Elias 5e17117db3 fix: fixed label and increased test coverage
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-05-06 11:24:45 +02:00
Alex Moreno 494369c8f7 Merge branch 'dev' of https: refs #8862//gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-06 09:38:43 +02:00
Pau Rovira b213ffca3e Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-05-05 05:54:10 +00:00
Alex Moreno 334d39eeef Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-30 12:21:21 +00:00
Alex Moreno 5f9d498700 fix: refs #7248 update exprBuilder for workerFk and calculate total amount in CustomerBalanceDueTotal
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-30 10:53:04 +02:00
Alex Moreno 98c73f8462 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation 2025-04-30 09:38:45 +02:00
Pau Rovira 0efa72e4a8 Merge branch '8406-crudModelUpdate' of https://gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-29 10:25:00 +02:00
Pau Rovira 81d50bb118 fix: refs #8406 removed duplicated filter 2025-04-29 10:24:58 +02:00
Alex Moreno 160ff54a66 Merge branch 'dev' of https: refs #8862//gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-29 09:04:28 +02:00
Pau Rovira 8a2e301bb7 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-29 06:16:24 +00:00
Pau Rovira 004890a3a9 Merge branch '8406-crudModelUpdate' of https://gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev Build queued... Details
2025-04-29 08:14:50 +02:00
Pau Rovira 7424d7eb9a fix: refs #8406 remove unused code 2025-04-29 08:14:42 +02:00
Pau Rovira 4cc46e5181 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-28 07:07:45 +00:00
Pau Rovira bb59be3023 Merge branch 'dev' of https: refs #8406//gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-25 13:16:49 +02:00
Pau Rovira 971194c0f6 Merge branch 'dev' of https: refs #8406//gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev Build queued... Details
2025-04-25 13:15:29 +02:00
Alex Moreno 1ceb6b1aef refactor: refs #7248 remove unused state management and simplify body structure in ClaimNotes component
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-24 12:51:23 +02:00
Alex Moreno 4f12a31b1a Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-24 10:38:13 +00:00
Alex Moreno 9c6ffc76cb Merge branch 'dev' of https: refs #7248//gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-24 09:39:08 +02:00
Alex Moreno 442f3dbd48 Merge branch 'dev' of https: refs #7248//gitea.verdnatura.es/verdnatura/salix-front into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details
2025-04-24 09:38:31 +02:00
Pau Rovira 092a29d555 Merge branch '8406-crudModelUpdate' of https://gitea.verdnatura.es/verdnatura/salix-front into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-23 13:53:37 +02:00
Pau Rovira 8e08f65173 feat: refs #8406 add empty row on loading InvoiceInVat 2025-04-23 13:53:34 +02:00
Pau Rovira e4003c6116 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details
2025-04-23 10:09:52 +00:00
Pau Rovira aedcda4799 refactor: refs #8406 simplified code
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-23 11:19:55 +02:00
Pau Rovira 10d8db6de3 feat: refs #8406 make tabulation to ignore selection checkbox
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-23 08:58:23 +02:00
Pau Rovira d36be31927 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-23 05:20:47 +00:00
Pau Rovira 5c6fc94dd6 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-22 11:43:13 +00:00
Pau Rovira 35914be54a Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-17 11:31:28 +00:00
Pau Rovira 0fa1b6ee9d Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-17 08:40:11 +00:00
Pau Rovira d838d9b55a feat: refs #8406 "add" button on a bottom bar in CrudModel
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-16 14:58:18 +02:00
Benjamin Esteve 03cced3ac6 Merge branch '8862-testIsolationFalse' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-16 10:44:43 +02:00
Benjamin Esteve 1cf9d08a90 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse 2025-04-16 10:44:39 +02:00
Alex Moreno 00ed2b2f6e Merge branch '8862-testIsolationFalse' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 14:11:24 +02:00
Alex Moreno 1a27833081 test: refs #8862 disable test isolation for InvoiceOut list spec 2025-04-15 14:11:22 +02:00
Benjamin Esteve 8dd6926ab7 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-15 13:33:27 +02:00
Benjamin Esteve 608086bd8d test: refs #8862 enable test isolation for Cmr list spec
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-15 12:59:10 +02:00
Benjamin Esteve 395c3a8ec9 test: refs #8862 enable test isolation for multiple account and invoice specs
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 12:29:49 +02:00
Benjamin Esteve 8d6a15eefd test: refs #8862 enable test isolation for InvoiceInDescriptor and VnLog specs
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 12:12:16 +02:00
Benjamin Esteve 2bfd2b09f2 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 11:37:17 +02:00
Benjamin Esteve b7cfabd1a2 test: refs #8862 add Cypress integration tests for ticket and zone functionalities
gitea/salix-front/pipeline/pr-dev Build queued... Details
2025-04-15 11:36:37 +02:00
Benjamin Esteve 19550188b8 test: refs #8862 enable test isolation for VnLocation tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 11:16:15 +02:00
Benjamin Esteve d477b6c477 test: refs #8862 enable test isolation for TicketSale tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 10:23:15 +02:00
Benjamin Esteve 4d9912e9b5 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 09:13:50 +02:00
Benjamin Esteve 97c63c2689 refactor: refs #8862 enable test isolation for Cmr list tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 09:08:44 +02:00
Pau Rovira 36d306e827 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-14 11:38:13 +00:00
Benjamin Esteve 3a8f6455d3 refactor: refs #8862 update timeout settings for Cypress tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 12:43:27 +02:00
Benjamin Esteve f3f1ec8039 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 12:38:25 +02:00
Benjamin Esteve 01744012bc Merge branch '8862-testIsolationFalse' of https://gitea.verdnatura.es/verdnatura/salix-front into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 12:13:11 +02:00
Benjamin Esteve 0f17aa13ae refactor: refs #8862 update timeout settings for Cypress tests 2025-04-11 12:13:08 +02:00
Benjamin Esteve d5a2c880cc Merge branch 'dev' into 8862-testIsolationFalse
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 09:53:28 +00:00
Benjamin Esteve b22d693a44 test: refs #8862 add Cypress isolation tests for various ticket and zone components
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-10 12:57:09 +02:00
Pau Rovira 5703798781 fix: refs #8406 fixed front test
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-03 09:56:46 +02:00
Pau Rovira c075f39576 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-03 06:52:24 +00:00
Pau Rovira 87c1c16d26 feat: refs #8406 added new insertion with tabulation
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-03 08:38:03 +02:00
Pau Rovira 5b42e97d83 Merge branch 'dev' into 8406-crudModelUpdate
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-03-24 10:07:01 +00:00
Pau Rovira e874375276 feat: refs #8406 upgraded CrudModel 2025-03-24 11:05:36 +01:00
Robert Ferrús be69781e17 Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-02-07 06:05:37 +00:00
Robert Ferrús 523cacbffe Merge branch 'dev' into 7248-tablesObservation
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-02-05 12:35:23 +00:00
Robert Ferrús 9c8aaf65d1 feat: refs #7248 modify VnNotes
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-02-05 13:32:01 +01:00
57 changed files with 260 additions and 124 deletions

View File

@ -64,5 +64,6 @@ export default defineConfig({
...timeouts, ...timeouts,
includeShadowDom: true, includeShadowDom: true,
waitForAnimations: true, waitForAnimations: true,
testIsolation: false,
}, },
}); });

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import axios from 'axios'; import axios from 'axios';
import { computed, ref, useAttrs, watch } from 'vue'; import { computed, ref, useAttrs, watch, nextTick } from 'vue';
import { useRouter, onBeforeRouteLeave } from 'vue-router'; import { useRouter, onBeforeRouteLeave } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
@ -42,7 +42,15 @@ const $props = defineProps({
}, },
dataRequired: { dataRequired: {
type: Object, type: Object,
default: () => {}, default: () => ({}),
},
dataDefault: {
type: Object,
default: () => ({}),
},
insertOnLoad: {
type: Boolean,
default: false,
}, },
defaultSave: { defaultSave: {
type: Boolean, type: Boolean,
@ -87,6 +95,7 @@ const formData = ref();
const saveButtonRef = ref(null); const saveButtonRef = ref(null);
const watchChanges = ref(); const watchChanges = ref();
const formUrl = computed(() => $props.url); const formUrl = computed(() => $props.url);
const rowsContainer = ref(null);
const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']); const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']);
@ -122,9 +131,11 @@ async function fetch(data) {
const rows = keyData ? data[keyData] : data; const rows = keyData ? data[keyData] : data;
resetData(rows); resetData(rows);
emit('onFetch', rows); emit('onFetch', rows);
$props.insertOnLoad && await insert();
return rows; return rows;
} }
function resetData(data) { function resetData(data) {
if (!data) return; if (!data) return;
if (data && Array.isArray(data)) { if (data && Array.isArray(data)) {
@ -135,9 +146,16 @@ function resetData(data) {
formData.value = JSON.parse(JSON.stringify(data)); formData.value = JSON.parse(JSON.stringify(data));
if (watchChanges.value) watchChanges.value(); //destroy watcher if (watchChanges.value) watchChanges.value(); //destroy watcher
watchChanges.value = watch(formData, () => (hasChanges.value = true), { deep: true }); watchChanges.value = watch(formData, (nVal) => {
} hasChanges.value = false;
const filteredNewData = nVal.filter(row => !isRowEmpty(row) || row[$props.primaryKey]);
const filteredOriginal = originalData.value.filter(row => row[$props.primaryKey]);
const changes = getDifferences(filteredOriginal, filteredNewData);
hasChanges.value = !isEmpty(changes);
}, { deep: true });
}
async function reset() { async function reset() {
await fetch(originalData.value); await fetch(originalData.value);
hasChanges.value = false; hasChanges.value = false;
@ -165,7 +183,9 @@ async function onSubmit() {
}); });
} }
isLoading.value = true; isLoading.value = true;
await saveChanges($props.saveFn ? formData.value : null); await saveChanges($props.saveFn ? formData.value : null);
} }
async function onSubmitAndGo() { async function onSubmitAndGo() {
@ -174,6 +194,10 @@ async function onSubmitAndGo() {
} }
async function saveChanges(data) { async function saveChanges(data) {
formData.value = formData.value.filter(row =>
row[$props.primaryKey] || !isRowEmpty(row)
);
if ($props.saveFn) { if ($props.saveFn) {
$props.saveFn(data, getChanges); $props.saveFn(data, getChanges);
isLoading.value = false; isLoading.value = false;
@ -203,14 +227,32 @@ async function saveChanges(data) {
}); });
} }
async function insert(pushData = $props.dataRequired) { async function insert(pushData = { ...$props.dataRequired, ...$props.dataDefault }) {
const $index = formData.value.length formData.value = formData.value.filter(row => !isRowEmpty(row));
? formData.value[formData.value.length - 1].$index + 1
: 0; const lastRow = formData.value.at(-1);
formData.value.push(Object.assign({ $index }, pushData)); const isLastRowEmpty = lastRow ? isRowEmpty(lastRow) : false;
hasChanges.value = true;
if (formData.value.length && isLastRowEmpty) return;
const $index = formData.value.length ? formData.value.at(-1).$index + 1 : 0;
const nRow = Object.assign({ $index }, pushData);
formData.value.push(nRow);
const hasChange = Object.keys(nRow).some(key => !isChange(nRow, key));
if (hasChange) hasChanges.value = true;
} }
function isRowEmpty(row) {
return Object.keys(row).every(key => isChange(row, key));
}
function isChange(row,key){
return !row[key] || key == '$index' || Object.hasOwn($props.dataRequired || {}, key);
}
async function remove(data) { async function remove(data) {
if (!data.length) if (!data.length)
return quasar.notify({ return quasar.notify({
@ -227,10 +269,8 @@ async function remove(data) {
newData = newData.filter( newData = newData.filter(
(form) => !preRemove.some((index) => index == form.$index), (form) => !preRemove.some((index) => index == form.$index),
); );
const changes = getChanges(); formData.value = newData;
if (!changes.creates?.length && !changes.updates?.length) hasChanges.value = JSON.stringify(removeIndexField(formData.value)) !== JSON.stringify(removeIndexField(originalData.value));
hasChanges.value = false;
fetch(newData);
} }
if (ids.length) { if (ids.length) {
quasar quasar
@ -248,9 +288,8 @@ async function remove(data) {
newData = newData.filter((form) => !ids.some((id) => id == form[pk])); newData = newData.filter((form) => !ids.some((id) => id == form[pk]));
fetch(newData); fetch(newData);
}); });
} else {
reset();
} }
emit('update:selected', []); emit('update:selected', []);
} }
@ -261,7 +300,7 @@ function getChanges() {
const pk = $props.primaryKey; const pk = $props.primaryKey;
for (const [i, row] of formData.value.entries()) { for (const [i, row] of formData.value.entries()) {
if (!row[pk]) { if (!row[pk]) {
creates.push(row); creates.push(Object.assign(row, { ...$props.dataRequired }));
} else if (originalData.value[i]) { } else if (originalData.value[i]) {
const data = getDifferences(originalData.value[i], row); const data = getDifferences(originalData.value[i], row);
if (!isEmpty(data)) { if (!isEmpty(data)) {
@ -287,6 +326,33 @@ function isEmpty(obj) {
return !Object.keys(obj).length; return !Object.keys(obj).length;
} }
function removeIndexField(data) {
if (Array.isArray(data)) {
return data.map(({ $index, ...rest }) => rest);
} else if (typeof data === 'object' && data !== null) {
const { $index, ...rest } = data;
return rest;
}
}
async function handleTab(event) {
event.preventDefault();
const { shiftKey, target } = event;
const focusableSelector = `tbody tr td:not(:first-child) :is(a, button, input, textarea, select, details):not([disabled])`;
const focusableElements = rowsContainer.value?.querySelectorAll(focusableSelector);
const currentIndex = Array.prototype.indexOf.call(focusableElements, target);
const index = shiftKey ? currentIndex - 1 : currentIndex + 1;
const isLast = target === focusableElements[focusableElements.length - 1];
const isFirst = currentIndex === 0;
if ((shiftKey && !isFirst) || (!shiftKey && !isLast))
focusableElements[index]?.focus();
else if (isLast) {
await insert();
await nextTick();
}
}
async function reload(params) { async function reload(params) {
const data = await vnPaginateRef.value.fetch(params); const data = await vnPaginateRef.value.fetch(params);
fetch(data); fetch(data);
@ -312,12 +378,14 @@ watch(formUrl, async () => {
v-bind="$attrs" v-bind="$attrs"
> >
<template #body v-if="formData"> <template #body v-if="formData">
<div ref="rowsContainer" @keydown.tab="handleTab">
<slot <slot
name="body" name="body"
:rows="formData" :rows="formData"
:validate="validate" :validate="validate"
:filter="filter" :filter="filter"
></slot> ></slot>
</div>
</template> </template>
</VnPaginate> </VnPaginate>
<Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown() && hasSubToolbar"> <Teleport to="#st-actions" v-if="stateStore?.isSubToolbarShown() && hasSubToolbar">

View File

@ -193,11 +193,11 @@ describe('CrudModel', () => {
}); });
it('should set originalData and formatData with data and generate watchChanges', async () => { it('should set originalData and formatData with data and generate watchChanges', async () => {
data = { data = [{
name: 'Tony', name: 'Tony',
lastName: 'Stark', lastName: 'Stark',
age: 42, age: 42,
}; }];
vm.resetData(data); vm.resetData(data);

View File

@ -72,7 +72,7 @@ const getBankEntities = (data) => {
:acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]" :acls="[{ model: 'BankEntity', props: '*', accessType: 'WRITE' }]"
:options="bankEntities" :options="bankEntities"
hide-selected hide-selected
option-label="name" option-label="bic"
option-value="id" option-value="id"
v-model="bankEntityFk" v-model="bankEntityFk"
@update:model-value="$emit('updateBic', { iban, bankEntityFk })" @update:model-value="$emit('updateBic', { iban, bankEntityFk })"

View File

@ -40,4 +40,11 @@ describe('VnBankDetail Component', () => {
await vm.autofillBic('ES1234567891324567891234'); await vm.autofillBic('ES1234567891324567891234');
expect(vm.bankEntityFk).toBe(null); expect(vm.bankEntityFk).toBe(null);
}); });
it('should not update bankEntityFk if IBAN country is not ES', async () => {
vm.bankEntities = bankEntities;
await vm.autofillBic('FR1420041010050500013M02606');
expect(vm.bankEntityFk).toBe(null);
});
}); });

View File

@ -35,6 +35,7 @@ const $props = defineProps({
selectType: { type: Boolean, default: false }, selectType: { type: Boolean, default: false },
justInput: { type: Boolean, default: false }, justInput: { type: Boolean, default: false },
goTo: { type: String, default: '' }, goTo: { type: String, default: '' },
useUserRelation: { type: Boolean, default: true },
}); });
const { t } = useI18n(); const { t } = useI18n();
@ -54,6 +55,26 @@ const defaultObservationType = computed(
let savedNote = false; let savedNote = false;
let originalText; let originalText;
onBeforeRouteLeave((to, from, next) => {
if (
(newNote.text && !$props.justInput) ||
(newNote.text !== originalText && $props.justInput)
)
quasar.dialog({
component: VnConfirm,
componentProps: {
title: t('globals.unsavedPopup.title'),
message: t('globals.unsavedPopup.subtitle'),
promise: () => next(),
},
});
else next();
});
onMounted(() => {
nextTick(() => (componentIsRendered.value = true));
});
function handleClick(e) { function handleClick(e) {
if (e.shiftKey && e.key === 'Enter') return; if (e.shiftKey && e.key === 'Enter') return;
if ($props.justInput) confirmAndUpdate(); if ($props.justInput) confirmAndUpdate();
@ -108,22 +129,6 @@ async function update() {
); );
} }
onBeforeRouteLeave((to, from, next) => {
if (
(newNote.text && !$props.justInput) ||
(newNote.text !== originalText && $props.justInput)
)
quasar.dialog({
component: VnConfirm,
componentProps: {
title: t('globals.unsavedPopup.title'),
message: t('globals.unsavedPopup.subtitle'),
promise: () => next(),
},
});
else next();
});
function fetchData([data]) { function fetchData([data]) {
newNote.text = data?.notes; newNote.text = data?.notes;
originalText = data?.notes; originalText = data?.notes;
@ -137,16 +142,38 @@ const handleObservationTypes = (data) => {
} }
}; };
onMounted(() => {
nextTick(() => (componentIsRendered.value = true));
});
async function saveAndGo() { async function saveAndGo() {
savedNote = false; savedNote = false;
await insert(); await insert();
await savedNote;
router.push({ path: $props.goTo }); router.push({ path: $props.goTo });
} }
function getUserFilter() {
const newUserFilter = $props.userFilter ?? {};
const userInclude = {
relation: 'user',
scope: {
fields: ['id', 'nickname', 'name'],
},
};
if (newUserFilter.include) {
if (Array.isArray(newUserFilter.include)) {
newUserFilter.include.push(userInclude);
} else {
newUserFilter.include = [userInclude, newUserFilter.include];
}
} else {
newUserFilter.include = userInclude;
}
if ($props.useUserRelation) {
return {
...newUserFilter,
...$props.userFilter,
};
}
return $props.filter;
}
</script> </script>
<template> <template>
<Teleport <Teleport
@ -242,7 +269,7 @@ async function saveAndGo() {
:url="$props.url" :url="$props.url"
order="created DESC" order="created DESC"
:limit="0" :limit="0"
:user-filter="userFilter" :user-filter="getUserFilter()"
:filter="filter" :filter="filter"
auto-load auto-load
ref="vnPaginateRef" ref="vnPaginateRef"
@ -261,15 +288,15 @@ async function saveAndGo() {
<QCardSection horizontal> <QCardSection horizontal>
<VnAvatar <VnAvatar
:descriptor="false" :descriptor="false"
:worker-id="note.workerFk" :worker-id="note.user?.id"
size="md" size="md"
:title="note.worker?.user.nickname" :title="note.user?.nickname"
/> />
<div class="full-width row justify-between q-pa-xs"> <div class="full-width row justify-between q-pa-xs">
<div> <div>
<VnUserLink <VnUserLink
:name="`${note.worker.user.name}`" :name="`${note.user?.name}`"
:worker-id="note.worker.id" :worker-id="note.user?.id"
/> />
<QBadge <QBadge
class="q-ml-xs" class="q-ml-xs"

View File

@ -138,6 +138,7 @@ const columns = computed(() => [
:filter="developmentsFilter" :filter="developmentsFilter"
ref="claimDevelopmentForm" ref="claimDevelopmentForm"
:data-required="{ claimFk: route.params.id }" :data-required="{ claimFk: route.params.id }"
:insert-on-load="true"
v-model:selected="selected" v-model:selected="selected"
@save-changes="$router.push(`/claim/${route.params.id}/action`)" @save-changes="$router.push(`/claim/${route.params.id}/action`)"
:default-save="false" :default-save="false"

View File

@ -1,12 +1,9 @@
<script setup> <script setup>
import { computed } from 'vue'; import { computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useState } from 'src/composables/useState';
import VnNotes from 'src/components/ui/VnNotes.vue'; import VnNotes from 'src/components/ui/VnNotes.vue';
const route = useRoute(); const route = useRoute();
const state = useState();
const user = state.getUser();
const $props = defineProps({ const $props = defineProps({
id: { type: [Number, String], default: null }, id: { type: [Number, String], default: null },
@ -15,24 +12,13 @@ const $props = defineProps({
const claimId = computed(() => $props.id || route.params.id); const claimId = computed(() => $props.id || route.params.id);
const claimFilter = { const claimFilter = {
fields: ['id', 'created', 'workerFk', 'text'], fields: ['id', 'created', 'userFk', 'text'],
include: {
relation: 'worker',
scope: {
fields: ['id', 'firstName', 'lastName'],
include: { include: {
relation: 'user', relation: 'user',
scope: { scope: {
fields: ['id', 'nickname', 'name'], fields: ['id', 'nickname', 'name'],
}, },
}, },
},
},
};
const body = {
claimFk: claimId.value,
workerFk: user.value.id,
}; };
</script> </script>
@ -43,7 +29,9 @@ const body = {
:add-note="$props.addNote" :add-note="$props.addNote"
:user-filter="claimFilter" :user-filter="claimFilter"
:filter="{ where: { claimFk: claimId } }" :filter="{ where: { claimFk: claimId } }"
:body="body" :body="{
claimFk: claimId,
}"
v-bind="$attrs" v-bind="$attrs"
style="overflow-y: auto" style="overflow-y: auto"
/> />

View File

@ -1,12 +1,15 @@
<script setup> <script setup>
import VnNotes from 'src/components/ui/VnNotes.vue'; import VnNotes from 'src/components/ui/VnNotes.vue';
import { useState } from 'src/composables/useState';
const state = useState();
const user = state.getUser();
</script> </script>
<template> <template>
<VnNotes <VnNotes
url="clientObservations" url="clientObservations"
:add-note="true" :add-note="true"
:filter="{ where: { clientFk: $route.params.id } }" :filter="{ where: { clientFk: $route.params.id } }"
:body="{ clientFk: $route.params.id }" :body="{ clientFk: $route.params.id, userFk: user.id }"
style="overflow-y: auto" style="overflow-y: auto"
:select-type="true" :select-type="true"
required required

View File

@ -76,7 +76,7 @@ const columns = computed(() => [
}, },
{ {
align: 'left', align: 'left',
name: 'workerFk', name: 'userFk',
label: t('Author'), label: t('Author'),
tooltip: t('Worker who made the last observation'), tooltip: t('Worker who made the last observation'),
columnFilter: { columnFilter: {
@ -155,7 +155,7 @@ function exprBuilder(param, value) {
return { [`c.${param}`]: value }; return { [`c.${param}`]: value };
case 'payMethod': case 'payMethod':
return { [`c.payMethodFk`]: value }; return { [`c.payMethodFk`]: value };
case 'workerFk': case 'userFk':
return { [`co.${param}`]: value }; return { [`co.${param}`]: value };
case 'departmentFk': case 'departmentFk':
return { [`c.${param}`]: value }; return { [`c.${param}`]: value };
@ -229,10 +229,10 @@ function exprBuilder(param, value) {
<DepartmentDescriptorProxy :id="row.departmentFk" /> <DepartmentDescriptorProxy :id="row.departmentFk" />
</span> </span>
</template> </template>
<template #column-workerFk="{ row }"> <template #column-userFk="{ row }">
<span class="link" @click.stop> <span class="link" @click.stop>
{{ row.workerName }} {{ row.workerName }}
<WorkerDescriptorProxy :id="row.workerFk" /> <WorkerDescriptorProxy :id="row.userFk" />
</span> </span>
</template> </template>
</VnTable> </VnTable>

View File

@ -90,6 +90,7 @@ const columns = computed(() => [
auto-load auto-load
:data-required="{ invoiceInFk: invoiceInId }" :data-required="{ invoiceInFk: invoiceInId }"
:filter="filter" :filter="filter"
:insert-on-load="true"
v-model:selected="rowsSelected" v-model:selected="rowsSelected"
@on-fetch="(data) => (invoceInIntrastat = data)" @on-fetch="(data) => (invoceInIntrastat = data)"
> >

View File

@ -187,6 +187,7 @@ function setCursor(ref) {
url="InvoiceInTaxes" url="InvoiceInTaxes"
:filter="filter" :filter="filter"
:data-required="{ invoiceInFk: $route.params.id }" :data-required="{ invoiceInFk: $route.params.id }"
:insert-on-load="true"
auto-load auto-load
v-model:selected="rowsSelected" v-model:selected="rowsSelected"
:go-to="`/invoice-in/${$route.params.id}/due-day`" :go-to="`/invoice-in/${$route.params.id}/due-day`"

View File

@ -51,6 +51,7 @@ const submit = async (rows) => {
<CrudModel <CrudModel
:data-required="{ itemFk: route.params.id }" :data-required="{ itemFk: route.params.id }"
:default-remove="false" :default-remove="false"
:insert-on-load="true"
:filter="{ :filter="{
fields: ['id', 'itemFk', 'code'], fields: ['id', 'itemFk', 'code'],
where: { itemFk: route.params.id }, where: { itemFk: route.params.id },

View File

@ -76,15 +76,22 @@ const insertTag = (rows) => {
model="ItemTags" model="ItemTags"
url="ItemTags" url="ItemTags"
:data-required="{ :data-required="{
$index: undefined,
itemFk: route.params.id, itemFk: route.params.id,
priority: undefined,
tag: { tag: {
isFree: undefined, isFree: true,
value: undefined,
name: undefined,
},
}"
:data-default="{
tag: {
isFree: true,
value: undefined, value: undefined,
name: undefined, name: undefined,
}, },
tagFk: undefined, tagFk: undefined,
priority: undefined,
}" }"
:default-remove="false" :default-remove="false"
:user-filter="{ :user-filter="{

View File

@ -18,7 +18,7 @@ const noteFilter = computed(() => {
const body = { const body = {
vehicleFk: vehicleId.value, vehicleFk: vehicleId.value,
workerFk: user.value.id, userFk: user.value.id,
}; };
</script> </script>

View File

@ -24,10 +24,10 @@ const crudModelFilter = reactive({
where: { ticketFk: route.params.id }, where: { ticketFk: route.params.id },
}); });
const crudModelRequiredData = computed(() => ({ const crudModelDefaultData = computed(() => ({
created: Date.vnNew(),
packagingFk: null, packagingFk: null,
quantity: 0, quantity: 0,
created: Date.vnNew(),
ticketFk: route.params.id, ticketFk: route.params.id,
})); }));
@ -63,7 +63,7 @@ watch(
url="TicketPackagings" url="TicketPackagings"
model="TicketPackagings" model="TicketPackagings"
:filter="crudModelFilter" :filter="crudModelFilter"
:data-required="crudModelRequiredData" :data-default="crudModelDefaultData"
:default-remove="false" :default-remove="false"
auto-load auto-load
> >

View File

@ -719,6 +719,7 @@ watch(
:create-as-dialog="false" :create-as-dialog="false"
:crud-model="{ :crud-model="{
disableInfiniteScroll: true, disableInfiniteScroll: true,
insertOnLoad: false,
}" }"
:default-remove="false" :default-remove="false"
:default-reset="false" :default-reset="false"

View File

@ -181,6 +181,7 @@ const setUserParams = (params) => {
:create="false" :create="false"
:crud-model="{ :crud-model="{
disableInfiniteScroll: true, disableInfiniteScroll: true,
insertOnLoad: false,
}" }"
:table="{ :table="{
'row-key': 'itemFk', 'row-key': 'itemFk',

View File

@ -547,6 +547,7 @@ watch(route, () => {
}, },
]" ]"
v-text="col.value" v-text="col.value"
:data-cy="`extra-community-${col.name}`"
/> />
<TravelDescriptorProxy <TravelDescriptorProxy
v-if="col.name === 'id'" v-if="col.name === 'id'"

View File

@ -99,6 +99,10 @@ const columns = computed(() => [
workerFk: entityId, workerFk: entityId,
}, },
}" }"
:crud-model="{
insertOnLoad: false,
}"
order="paymentDate DESC" order="paymentDate DESC"
:columns="columns" :columns="columns"
auto-load auto-load

View File

@ -128,6 +128,9 @@ const columns = computed(() => [
workerFk: entityId, workerFk: entityId,
}, },
}" }"
:crud-model="{
insertOnLoad: false,
}"
order="id DESC" order="id DESC"
:columns="columns" :columns="columns"
auto-load auto-load

View File

@ -109,6 +109,9 @@ const columns = [
workerFk: entityId, workerFk: entityId,
}, },
}" }"
:crud-model="{
insertOnLoad: false,
}"
order="date DESC" order="date DESC"
:columns="columns" :columns="columns"
auto-load auto-load

View File

@ -1,28 +1,26 @@
<script setup> <script setup>
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useState } from 'src/composables/useState';
import VnNotes from 'src/components/ui/VnNotes.vue'; import VnNotes from 'src/components/ui/VnNotes.vue';
const route = useRoute(); const route = useRoute();
const state = useState();
const user = state.getUser();
const userFilter = { const userFilter = {
order: 'created DESC', order: 'created DESC',
include: {
relation: 'worker',
scope: {
fields: ['id', 'firstName', 'lastName'],
include: { include: {
relation: 'user', relation: 'user',
scope: { scope: {
fields: ['id', 'nickname', 'name'], fields: ['id', 'nickname', 'name'],
}, },
}, },
},
},
}; };
const body = { workerFk: route.params.id }; const body = {
workerFk: route.params.id,
userFk: user.value.id,
};
</script> </script>
<template> <template>

View File

@ -170,6 +170,9 @@ function isSigned(row) {
'row-key': 'deviceProductionFk', 'row-key': 'deviceProductionFk',
selection: 'multiple', selection: 'multiple',
}" }"
:crud-model="{
insertOnLoad: false,
}"
:table-filter="{ hiddenTags: ['userFk'] }" :table-filter="{ hiddenTags: ['userFk'] }"
> >
<template #moreBeforeActions> <template #moreBeforeActions>

View File

@ -1,4 +1,4 @@
describe('Account descriptor', () => { describe('Account descriptor', { testIsolation: true }, () => {
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list'; const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
const url = '/#/account/1/summary'; const url = '/#/account/1/summary';

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('ClaimDevelopment', () => { describe('ClaimDevelopment', { testIsolation: true }, () => {
const claimId = 1; const claimId = 1;
const firstLineReason = 'tbody > :nth-child(1) > :nth-child(2)'; const firstLineReason = 'tbody > :nth-child(1) > :nth-child(2)';
const thirdRow = 'tbody > :nth-child(3)'; const thirdRow = 'tbody > :nth-child(3)';

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Client fiscal data', () => { describe('Client fiscal data', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1280, 720); cy.viewport(1280, 720);
cy.login('developer'); cy.login('developer');

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Client list', () => { describe('Client list', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.visit('/#/customer/list', { cy.visit('/#/customer/list', {

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Entry PreAccount Functionality', () => { describe('Entry PreAccount Functionality', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.login('administrative'); cy.login('administrative');
cy.visit('/#/entry/pre-account'); cy.visit('/#/entry/pre-account');

View File

@ -1,6 +1,6 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
import moment from 'moment'; import moment from 'moment';
describe('InvoiceInBasicData', () => { describe('InvoiceInBasicData', { testIsolation: true }, () => {
const dialogInputs = '.q-dialog input'; const dialogInputs = '.q-dialog input';
const getDocumentBtns = (opt) => `[data-cy="dms-buttons"] > :nth-child(${opt})`; const getDocumentBtns = (opt) => `[data-cy="dms-buttons"] > :nth-child(${opt})`;
const futureDate = moment().add(1, 'days').format('DD-MM-YYYY'); const futureDate = moment().add(1, 'days').format('DD-MM-YYYY');

View File

@ -1,4 +1,4 @@
describe('invoiceInCorrective', () => { describe('invoiceInCorrective', { testIsolation: true }, () => {
beforeEach(() => cy.login('administrative')); beforeEach(() => cy.login('administrative'));
it('should modify the invoice', () => { it('should modify the invoice', () => {

View File

@ -1,4 +1,4 @@
describe('InvoiceInDescriptor', () => { describe('InvoiceInDescriptor', { testIsolation: true }, () => {
beforeEach(() => cy.login('administrative')); beforeEach(() => cy.login('administrative'));
describe('more options', () => { describe('more options', () => {

View File

@ -24,6 +24,7 @@ describe('InvoiceOut list', () => {
}); });
it.skip('should download all pdfs', () => { it.skip('should download all pdfs', () => {
cy.get(columnCheckbox).click();
cy.get(columnCheckbox).click(); cy.get(columnCheckbox).click();
cy.dataCy('InvoiceOutDownloadPdfBtn').click(); cy.dataCy('InvoiceOutDownloadPdfBtn').click();
}); });

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('InvoiceOut summary', () => { describe('InvoiceOut summary', { testIsolation: true }, () => {
const transferInvoice = { const transferInvoice = {
Client: { val: 'employee', type: 'select' }, Client: { val: 'employee', type: 'select' },
Type: { val: 'Error in customer data', type: 'select' }, Type: { val: 'Error in customer data', type: 'select' },

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('ItemBarcodes', () => { describe('ItemBarcodes', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.visit(`/#/item/1/barcode`); cy.visit(`/#/item/1/barcode`);

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Item summary', () => { describe('Item summary', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.visit(`/#/item/1/summary`); cy.visit(`/#/item/1/summary`);

View File

@ -1,4 +1,4 @@
describe('Item tag', () => { describe('Item tag', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.visit(`/#/item/1/tags`); cy.visit(`/#/item/1/tags`);

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Login', () => { describe('Login', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.visit('/#/login'); cy.visit('/#/login');
cy.get('#switchLanguage').click(); cy.get('#switchLanguage').click();

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Logout', () => { describe('Logout', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.visit(`/#/dashboard`); cy.visit(`/#/dashboard`);

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Monitor Tickets Table', () => { describe('Monitor Tickets Table', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('salesPerson'); cy.login('salesPerson');

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe.skip('OrderCatalog', () => { describe('OrderCatalog', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.viewport(1920, 1080); cy.viewport(1920, 1080);

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('OrderList', () => { describe('OrderList', { testIsolation: true }, () => {
const clientCreateSelect = '#formModel [data-cy="Client_select"]'; const clientCreateSelect = '#formModel [data-cy="Client_select"]';
const addressCreateSelect = '#formModel [data-cy="Address_select"]'; const addressCreateSelect = '#formModel [data-cy="Address_select"]';
const agencyCreateSelect = '#formModel [data-cy="Agency_select"]'; const agencyCreateSelect = '#formModel [data-cy="Agency_select"]';

View File

@ -1,4 +1,4 @@
describe('Cmr list', () => { describe('Cmr list', { testIsolation: true }, () => {
const getLinkSelector = (colField) => const getLinkSelector = (colField) =>
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`; `tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;

View File

@ -1,4 +1,4 @@
describe('RouteAutonomous', () => { describe('RouteAutonomous', { testIsolation: true }, () => {
const getLinkSelector = (colField, link = true) => const getLinkSelector = (colField, link = true) =>
`tr:first-child > [data-col-field="${colField}"] > .no-padding${ `tr:first-child > [data-col-field="${colField}"] > .no-padding${
link ? ' > .link' : '' link ? ' > .link' : ''

View File

@ -1,4 +1,4 @@
describe('Route', () => { describe('Route', { testIsolation: true }, () => {
const getSelector = (colField) => const getSelector = (colField) =>
`tr:last-child > [data-col-field="${colField}"] > .no-padding > .link`; `tr:last-child > [data-col-field="${colField}"] > .no-padding > .link`;

View File

@ -1,4 +1,4 @@
describe('Vehicle DMS', () => { describe('Vehicle DMS', { testIsolation: true }, () => {
const getSelector = (btnPosition) => const getSelector = (btnPosition) =>
`tr:last-child > .text-right > .no-wrap > :nth-child(${btnPosition}) > .q-btn > .q-btn__content > .q-icon`; `tr:last-child > .text-right > .no-wrap > :nth-child(${btnPosition}) > .q-btn > .q-btn__content > .q-icon`;

View File

@ -1,7 +1,7 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
const firstRow = 'tbody > :nth-child(1)'; const firstRow = 'tbody > :nth-child(1)';
describe('TicketSale', () => { describe('TicketSale', { testIsolation: true }, () => {
describe('Ticket #23', () => { describe('Ticket #23', () => {
beforeEach(() => { beforeEach(() => {
cy.login('claimManager'); cy.login('claimManager');

View File

@ -0,0 +1,16 @@
describe('Travel Extracommunity', () => {
it('Should show travels', () => {
cy.login('logistic');
cy.visit(`/#/travel/extra-community`);
cy.get('.q-page').should('be.visible');
});
it('Should show travels when user is supplier', () => {
cy.login('petterparker');
cy.visit(`/#/travel/extra-community`);
cy.get('[data-cy="vnFilterPanelChip_continent"] > .q-chip__icon--remove').click();
cy.dataCy('extra-community-cargoSupplierNickname').each(($el) => {
cy.wrap($el).should('contain.text', 'The farmer');
});
});
});

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('UserPanel', () => { describe('UserPanel', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1280, 720); cy.viewport(1280, 720);
cy.login('developer'); cy.login('developer');

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('VnBreadcrumbs', () => { describe('VnBreadcrumbs', { testIsolation: true }, () => {
const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el'; const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el';
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');

View File

@ -1,6 +1,6 @@
const { randomNumber, randomString } = require('../../support'); const { randomNumber, randomString } = require('../../support');
describe('VnLocation', () => { describe('VnLocation', { testIsolation: true }, () => {
const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item'; const locationOptions = '[role="listbox"] > div.q-virtual-scroll__content > .q-item';
const dialogInputs = '.q-dialog label input'; const dialogInputs = '.q-dialog label input';
const createLocationButton = '.q-form > .q-card > .vn-row:nth-child(6) .--add-icon'; const createLocationButton = '.q-form > .q-card > .vn-row:nth-child(6) .--add-icon';

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('VnLog', () => { describe('VnLog', { testIsolation: true }, () => {
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
cy.visit(`/#/claim/${1}/log`); cy.visit(`/#/claim/${1}/log`);

View File

@ -1,4 +1,4 @@
describe('WorkerCreate', () => { describe('WorkerCreate', { testIsolation: true }, () => {
const externalRadio = '.q-radio:nth-child(2)'; const externalRadio = '.q-radio:nth-child(2)';
const developerBossId = 120; const developerBossId = 120;
const payMethodCross = const payMethodCross =

View File

@ -1,4 +1,4 @@
describe('WorkerManagement', () => { describe('WorkerManagement', { testIsolation: true }, () => {
const nif = '12091201A'; const nif = '12091201A';
const searchButton = '.q-scrollarea__content > .q-btn--standard > .q-btn__content'; const searchButton = '.q-scrollarea__content > .q-btn--standard > .q-btn__content';
const url = '/#/worker/management'; const url = '/#/worker/management';

View File

@ -1,4 +1,4 @@
describe('WorkerNotificationsManager', () => { describe('WorkerNotificationsManager', { testIsolation: true }, () => {
const salesPersonId = 18; const salesPersonId = 18;
const developerId = 9; const developerId = 9;

View File

@ -1,4 +1,4 @@
describe('ZoneBasicData', () => { describe('ZoneBasicData', { testIsolation: true }, () => {
const priceBasicData = '[data-cy="ZoneBasicDataPrice"]'; const priceBasicData = '[data-cy="ZoneBasicDataPrice"]';
const saveBtn = '.q-btn-group > .q-btn--standard'; const saveBtn = '.q-btn-group > .q-btn--standard';

View File

@ -1,4 +1,4 @@
describe('ZoneCreate', () => { describe('ZoneCreate', { testIsolation: true }, () => {
const data = { const data = {
Name: { val: 'Zone pickup D' }, Name: { val: 'Zone pickup D' },
Price: { val: '3' }, Price: { val: '3' },