diff --git a/Jenkinsfile b/Jenkinsfile index ea3f1b439c..c527d96602 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,6 +26,7 @@ node { // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables echo "NODE_NAME: ${env.NODE_NAME}" echo "WORKSPACE: ${env.WORKSPACE}" + echo "CHANGE_TARGET: ${env.CHANGE_TARGET}" configFileProvider([ configFile(fileId: 'salix-front.properties', @@ -107,16 +108,19 @@ pipeline { } stage('E2E') { environment { - CREDENTIALS = credentials('docker-registry') + CREDS = credentials('docker-registry') COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}" COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ." } steps { script { - sh 'rm junit/e2e-*.xml || true' + sh 'rm -f junit/e2e-*.xml' 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 login --username $CREDS_USR --password $CREDS_PSW $REGISTRY' sh "docker-compose ${env.COMPOSE_PARAMS} up -d" + + def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs') image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") { sh 'cypress run --browser chromium || true' } diff --git a/package.json b/package.json index 1361d1fd81..80706f8955 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "25.10.0", + "version": "25.12.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", @@ -71,4 +71,4 @@ "vite": "^6.0.11", "vitest": "^0.31.1" } -} +} \ No newline at end of file diff --git a/src/components/FilterTravelForm.vue b/src/components/FilterTravelForm.vue index 765d97763f..c522d02696 100644 --- a/src/components/FilterTravelForm.vue +++ b/src/components/FilterTravelForm.vue @@ -124,7 +124,7 @@ const selectTravel = ({ id }) => { - {{ t('ticketSale.claim') }}: + {{ $t('ticketSale.claim') }}: {{ row.claim?.claimFk }} @@ -29,14 +29,14 @@ defineProps({ row: { type: Object, required: true } }); {{ $t('salesTicketsTable.risk') }}: - {{ toCurrency(row.risk - row.credit) }} + {{ toCurrency(row.risk - (row.credit ?? 0)) }} -import { nextTick, ref, watch } from 'vue'; -import { QInput } from 'quasar'; +import { nextTick, ref } from 'vue'; +import VnInput from './VnInput.vue'; +import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard'; const $props = defineProps({ - modelValue: { - type: String, - default: '', - }, insertable: { type: Boolean, default: false, @@ -14,70 +11,25 @@ const $props = defineProps({ }); const emit = defineEmits(['update:modelValue', 'accountShortToStandard']); +const model = defineModel({ prop: 'modelValue' }); +const inputRef = ref(false); -let internalValue = ref($props.modelValue); - -watch( - () => $props.modelValue, - (newVal) => { - internalValue.value = newVal; - } -); - -watch( - () => internalValue.value, - (newVal) => { - emit('update:modelValue', newVal); - accountShortToStandard(); - } -); - -const handleKeydown = (e) => { - if (e.key === 'Backspace') return; - if (e.key === '.') { - accountShortToStandard(); - // TODO: Fix this setTimeout, with nextTick doesn't work - setTimeout(() => { - setCursorPosition(0, e.target); - }, 1); - return; - } - - if ($props.insertable && e.key.match(/[0-9]/)) { - handleInsertMode(e); - } -}; -function setCursorPosition(pos, el = vnInputRef.value) { - el.focus(); - el.setSelectionRange(pos, pos); +function setCursorPosition(pos) { + const input = inputRef.value.vnInputRef.$el.querySelector('input'); + input.focus(); + input.setSelectionRange(pos, pos); } -const vnInputRef = ref(false); -const handleInsertMode = (e) => { - e.preventDefault(); - const input = e.target; - const cursorPos = input.selectionStart; - const { maxlength } = vnInputRef.value; - let currentValue = internalValue.value; - if (!currentValue) currentValue = e.key; - const newValue = e.key; - if (newValue && !isNaN(newValue) && cursorPos < maxlength) { - internalValue.value = - currentValue.substring(0, cursorPos) + - newValue + - currentValue.substring(cursorPos + 1); - } - nextTick(() => { - input.setSelectionRange(cursorPos + 1, cursorPos + 1); - }); -}; -function accountShortToStandard() { - internalValue.value = internalValue.value?.replace( - '.', - '0'.repeat(11 - internalValue.value.length) - ); + +async function handleUpdateModel(val) { + model.value = val?.at(-1) === '.' ? useAccountShortToStandard(val) : val; + await nextTick(() => setCursorPosition(0)); } - diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index aeb4a31fd4..9821992cbf 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -83,7 +83,7 @@ const mixinRules = [ requiredFieldRule, ...($attrs.rules ?? []), (val) => { - const { maxlength } = vnInputRef.value; + const maxlength = $props.maxlength; if (maxlength && +val.length > maxlength) return t(`maxLength`, { value: maxlength }); const { min, max } = vnInputRef.value.$attrs; @@ -108,7 +108,7 @@ const handleInsertMode = (e) => { e.preventDefault(); const input = e.target; const cursorPos = input.selectionStart; - const { maxlength } = vnInputRef.value; + const maxlength = $props.maxlength; let currentValue = value.value; if (!currentValue) currentValue = e.key; const newValue = e.key; @@ -143,7 +143,7 @@ const handleUppercase = () => { :rules="mixinRules" :lazy-rules="true" hide-bottom-space - :data-cy="$attrs.dataCy ?? $attrs.label + '_input'" + :data-cy="($attrs['data-cy'] ?? $attrs.label) + '_input'" > diff --git a/src/pages/Ticket/Card/TicketDescriptor.vue b/src/pages/Ticket/Card/TicketDescriptor.vue index c5f3233b1d..1e585592f3 100644 --- a/src/pages/Ticket/Card/TicketDescriptor.vue +++ b/src/pages/Ticket/Card/TicketDescriptor.vue @@ -93,9 +93,9 @@ function ticketFilter(ticket) { -