diff --git a/Jenkinsfile b/Jenkinsfile index 8efc2f880..c5424ee27 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,18 +12,18 @@ def BRANCH_ENV = [ node { stage('Setup') { env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev' - PROTECTED_BRANCH = [ 'dev', 'test', 'master', 'main', 'beta' - ].contains(env.BRANCH_NAME) + ] + IS_PROTECTED_BRANCH = PROTECTED_BRANCH.contains(env.BRANCH_NAME) IS_LATEST = ['master', 'main'].contains(env.BRANCH_NAME) - // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables + // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables echo "NODE_NAME: ${env.NODE_NAME}" echo "WORKSPACE: ${env.WORKSPACE}" @@ -36,7 +36,7 @@ node { props.each {key, value -> echo "${key}: ${value}" } } - if (PROTECTED_BRANCH) { + if (IS_PROTECTED_BRANCH) { configFileProvider([ configFile(fileId: "salix-front.branch.${env.BRANCH_NAME}", variable: 'BRANCH_PROPS_FILE') @@ -63,7 +63,7 @@ pipeline { stages { stage('Version') { when { - expression { PROTECTED_BRANCH } + expression { IS_PROTECTED_BRANCH } } steps { script { @@ -84,7 +84,7 @@ pipeline { } stage('Test') { when { - expression { !PROTECTED_BRANCH } + expression { !IS_PROTECTED_BRANCH } } environment { NODE_ENV = '' @@ -113,18 +113,19 @@ pipeline { } steps { script { + env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev' def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') sh "docker-compose ${env.COMPOSE_PARAMS} up -d" image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") { - sh 'cypress run --browser chromium' + sh 'cypress run --browser chromium || true' } } } post { always { - sh "docker-compose ${env.COMPOSE_PARAMS} down" + sh "docker-compose ${env.COMPOSE_PARAMS} down -v" junit( - testResults: 'junit/e2e.xml', + testResults: 'junit/e2e-*.xml', allowEmptyResults: true ) } @@ -134,10 +135,9 @@ pipeline { } stage('Build') { when { - expression { PROTECTED_BRANCH } + expression { IS_PROTECTED_BRANCH } } environment { - CREDENTIALS = credentials('docker-registry') VERSION = readFile 'VERSION.txt' } steps { @@ -156,7 +156,7 @@ pipeline { } stage('Deploy') { when { - expression { PROTECTED_BRANCH } + expression { IS_PROTECTED_BRANCH } } environment { VERSION = readFile 'VERSION.txt' diff --git a/cypress.config.js b/cypress.config.js index dfe963a12..5cf075e2a 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -6,7 +6,7 @@ if (process.env.CI) { urlHost = 'front'; reporter = 'junit'; reporterOptions = { - mochaFile: 'junit/e2e.xml', + mochaFile: 'junit/e2e-[hash].xml', toConsole: false, }; } else { diff --git a/src/components/FormModelPopup.vue b/src/components/FormModelPopup.vue index 672eeff7a..85943e91e 100644 --- a/src/components/FormModelPopup.vue +++ b/src/components/FormModelPopup.vue @@ -1,12 +1,13 @@ + { beforeEach(() => (vm.selected = [])); describe('handleSelection()', () => { - const rows = [{ $index: 0 }, { $index: 1 }, { $index: 2 }]; - const selectedRows = [{ $index: 1 }]; - it('should add rows to selected when shift key is pressed and rows are added except last one', () => { + const rows = [ + { $index: 0 }, + { $index: 1 }, + { $index: 2 }, + { $index: 3 }, + { $index: 4 }, + ]; + + it('should add rows to selected when shift key is pressed and rows are added in ascending order', () => { + const selectedRows = [{ $index: 1 }]; vm.handleSelection( { evt: { shiftKey: true }, added: true, rows: selectedRows }, - rows + rows, ); expect(vm.selected).toEqual([{ $index: 0 }]); }); + it('should add rows to selected when shift key is pressed and rows are added in descending order', () => { + const selectedRows = [{ $index: 3 }]; + vm.handleSelection( + { evt: { shiftKey: true }, added: true, rows: selectedRows }, + rows, + ); + expect(vm.selected).toEqual([{ $index: 0 }, { $index: 1 }, { $index: 2 }]); + }); + it('should not add rows to selected when shift key is not pressed', () => { + const selectedRows = [{ $index: 1 }]; vm.handleSelection( { evt: { shiftKey: false }, added: true, rows: selectedRows }, - rows + rows, ); expect(vm.selected).toEqual([]); }); it('should not add rows to selected when rows are not added', () => { + const selectedRows = [{ $index: 1 }]; vm.handleSelection( { evt: { shiftKey: true }, added: false, rows: selectedRows }, - rows + rows, ); expect(vm.selected).toEqual([]); }); + + it('should add all rows between the smallest and largest selected indexes', () => { + vm.selected = [{ $index: 1 }, { $index: 3 }]; + const selectedRows = [{ $index: 4 }]; + vm.handleSelection( + { evt: { shiftKey: true }, added: true, rows: selectedRows }, + rows, + ); + expect(vm.selected).toEqual([{ $index: 1 }, { $index: 3 }, { $index: 2 }]); + }); }); }); diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 72d255906..fa733baa5 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -77,6 +77,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 ?? {}; @@ -159,9 +168,7 @@ const toModule = computed( {{ t('components.smartCard.openSummary') }} - + #{{ getValueFromPath(subtitle) ?? entity.id }} - -
@@ -225,7 +230,7 @@ const toModule = computed(
-
+
diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index 30e4135e2..8607d9694 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -204,8 +204,9 @@ async function search() { } :deep(.q-field--focused) { - .q-icon { - color: black; + .q-icon, + .q-placeholder { + color: var(--vn-black-text-color); } } diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 9a60e9da1..9e46c54e3 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -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' diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 846c442ea..fd42d37c7 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -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' @@ -786,7 +787,7 @@ worker: notes: Notas operator: numberOfWagons: Número de vagones - train: tren + train: Tren itemPackingType: Tipo de embalaje warehouse: Almacén sector: Sector diff --git a/src/pages/Account/Card/AccountDescriptorMenu.vue b/src/pages/Account/Card/AccountDescriptorMenu.vue index 30584c61f..eafd62df6 100644 --- a/src/pages/Account/Card/AccountDescriptorMenu.vue +++ b/src/pages/Account/Card/AccountDescriptorMenu.vue @@ -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), ) " > diff --git a/src/pages/Claim/Card/ClaimAction.vue b/src/pages/Claim/Card/ClaimAction.vue index 8ac7c224f..baa36710c 100644 --- a/src/pages/Claim/Card/ClaimAction.vue +++ b/src/pages/Claim/Card/ClaimAction.vue @@ -27,6 +27,7 @@ const claimActionsForm = ref(); const rows = ref([]); const selectedRows = ref([]); const destinationTypes = ref([]); +const shelvings = ref([]); const totalClaimed = ref(null); const DEFAULT_MAX_RESPONSABILITY = 5; const DEFAULT_MIN_RESPONSABILITY = 1; @@ -56,6 +57,12 @@ const columns = computed(() => [ field: (row) => row.claimDestinationFk, align: 'left', }, + { + name: 'shelving', + label: t('shelvings.shelving'), + field: (row) => row.shelvingFk, + align: 'left', + }, { name: 'Landed', label: t('Landed'), @@ -125,6 +132,10 @@ async function updateDestination(claimDestinationFk, row, options = {}) { options.reload && claimActionsForm.value.reload(); } } +async function updateShelving(shelvingFk, row) { + await axios.patch(`ClaimEnds/${row.id}`, { shelvingFk }); + claimActionsForm.value.reload(); +} async function regularizeClaim() { await post(`Claims/${claimId}/regularizeClaim`); @@ -200,6 +211,7 @@ async function post(query, params) { auto-load @on-fetch="(data) => (destinationTypes = data)" /> + + + diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 67034da1a..43941d1dc 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -40,7 +40,7 @@ const workersOptions = ref([]); diff --git a/src/pages/Ticket/Card/TicketEditMana.vue b/src/pages/Ticket/Card/TicketEditMana.vue index 14eec9db9..ff40a6592 100644 --- a/src/pages/Ticket/Card/TicketEditMana.vue +++ b/src/pages/Ticket/Card/TicketEditMana.vue @@ -1,32 +1,26 @@