diff --git a/CHANGELOG.md b/CHANGELOG.md index f1f911d62..119f702f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,100 @@ +# Version 24.24 - 2024-06-11 + +### Added 🆕 + +- feat: 6942 hashtag in key : value summary by:jgallego +- feat: #6957: Rename FetchedTags instance tag by:Javier Segarra +- feat: refactor template by:Javier Segarra +- feat: refs #6600 Add option to add comment for photo motivation by:jorgep +- feat: refs #6942 test e2e tobook & toUnbook by:jorgep +- feat: refs #6942 to book summary button & reactive value by:jorgep +- feat: refs #6942 to unbook by:jorgep +- feat: refs #6942 url update by:jorgep +- feat: refs #6942 use correct currency in InvoiceIn components by:jorgep +- feat: refs #6942 vat rate total by:jorgep +- feat: refs #7494 new icons (7494-icons) by:alexm +- feat: refs #7494 new icons by:alexm +- feat: refs #7542 drop space by:jorgep +- feat: refs #7542 empty by:jorgep +- fix: refs #6942 changes and new features by:jorgep +- fix: style by:Javier Segarra +- style: color transparent when is fetive by:Javier Segarra +- style: fix color when is empty by:Javier Segarra +- style: reset poc style (6957_refactorFetechedTags) by:Javier Segarra +- style: reset poc style by:Javier Segarra +- style updates by:Javier Segarra + +### Changed 📦 + +- feat: refactor template by:Javier Segarra +- perf: 6957 add color as new shared variable by:Javier Segarra +- perf: 6957 change fetchedTags color by:Javier Segarra +- perf: remove local tree variable by:Javier Segarra +- refactor: add flat by:alexm +- refactor: refs #6600 replace QInput to VnInput by:jorgep +- refactor: refs #6652 improved defaulter section by:Jon +- refactor: refs #6942 Fix getTotalAmount function to correctly calculate the total amount in InvoiceInDueDay.vue by:jorgep +- refactor: refs #6942 new summary layout by:jorgep +- refactor: refs #6942 store key & actions by:jorgep +- refactor: refs #6942 summary by:jorgep +- refactor: refs #6942 use router hook by:jorgep +- refactor: refs #6942 WIP summary layout by:jorgep + +### Fixed 🛠️ + +- fix: 9-12 by:Javier Segarra +- fix: defaulter icon by:alexm +- fix: refs #5186 validation by:jorgep +- fix: refs #6095 add reFfk null on search by:pablone +- fix: refs #6942 cardDescriptor use store if its popup or different source data by:jorgep +- fix: refs #6942 changes and new features by:jorgep +- fix: refs #6942 drop comments by:jorgep +- fix: refs #6942 drop console by:jorgep +- fix: refs #6942 drop console.log by:jorgep +- fix: refs #6942 e2e test (origin/6942-warmfix-fixFormModel) by:jorgep +- fix: refs #6942 e2e tests by:jorgep +- fix: refs #6942 e2e tests by:jorgep +- fix: refs #6942 fix emit on data saved by:jorgep +- fix: refs #6942 fix emit on reset by:jorgep +- fix: refs #6942 fix vncard by:jorgep +- fix: refs #6942 formModel & CardDescriptor by:jorgep +- fix: refs #6942 formModel watch changes & invoiceInCreate by:jorgep +- fix: refs #6942 import by:jorgep +- fix: refs #6942 reloading by:jorgep +- fix: refs #6942 rollback by:jorgep +- fix: refs #6942 selectable expense by:jorgep +- fix: refs #6942 skip e2e tests by:jorgep +- fix: refs #6942 table bottom highlight & drop isBooked field by:jorgep +- fix: refs #6942 tests e2e by:jorgep +- fix: refs #6942 tests & summary table spacing by:jorgep +- fix: refs #6942 unit tests by:jorgep +- fix: refs #6942 vnLocation by:jorgep +- fix: refs #6942 wip: formModel by:jorgep +- fix: refs #7542 use right panel by:jorgep +- fix: searchbar redirect by:alexm +- fix: style by:Javier Segarra +- fix: WorkerCalendarItem by:Javier Segarra +- mini fix by:wbuezas +- refs #6111 clean code fix changes by:carlossa +- refs #6111 fix merge, fix column by:carlossa +- refs #6111 fix qtable, actions, scroll by:carlossa +- refs #6111 fix routeList by:carlossa +- refs #6111 fix sticky by:carlossa +- refs #6111 fix trad remove logs by:carlossa +- refs #6111 fix visibleColumns by:carlossa +- refs #6111 routeList fix by:carlossa +- refs #6332 fix calendar by:carlossa +- refs #6332 fix colors by:carlossa +- refs #6332 fix festive by:carlossa +- refs #6820 fix BasicData Tickets by:carlossa +- refs #6820 fix error front by:carlossa +- refs #6820 fix traduction by:carlossa +- refs #7391 fix textarea by:carlossa +- refs #7396 fix summary by:carlossa +- Search childs fix by:wbuezas +- small fix by:wbuezas +- style: fix color when is empty by:Javier Segarra + # Changelog All notable changes to this project will be documented in this file. @@ -11,6 +108,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (Item) => Se añade la opción de añadir un comentario del motivo de hacer una foto - (Worker) => Se añade la opción de crear un trabajador ajeno a la empresa +- (Route) => Ahora se muestran todos los cmrs ## [2418.01] diff --git a/Jenkinsfile b/Jenkinsfile index 7cad5ef41..1766e3aea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -94,7 +94,7 @@ pipeline { sh 'quasar build' script { def packageJson = readJSON file: 'package.json' - env.VERSION = packageJson.version + env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" } dockerBuild() } @@ -106,7 +106,7 @@ pipeline { steps { script { def packageJson = readJSON file: 'package.json' - env.VERSION = packageJson.version + env.VERSION = "${packageJson.version}-build${env.BUILD_ID}" } withKubeConfig([ serverUrl: "$KUBERNETES_API", diff --git a/changelog.sh b/changelog.sh new file mode 100644 index 000000000..8cd7b4716 --- /dev/null +++ b/changelog.sh @@ -0,0 +1,34 @@ +features_types=(chore feat style) +changes_types=(refactor perf) +fix_types=(fix revert) +file="CHANGELOG.md" +file_tmp="temp_log.txt" +file_current_tmp="temp_current_log.txt" + +setType(){ + echo "### $1" >> $file_tmp + arr=("$@") + echo "" > $file_current_tmp + for i in "${arr[@]}" + do + git log --grep="$i" --oneline --no-merges --format="- %s %d by:%an" master..test >> $file_current_tmp + done + # remove duplicates + sort -o $file_current_tmp -u $file_current_tmp + cat $file_current_tmp >> $file_tmp + echo "" >> $file_tmp + # remove tmp current file + [ -e $file_current_tmp ] && rm $file_current_tmp +} + +echo "# Version XX.XX - XXXX-XX-XX" >> $file_tmp +echo "" >> $file_tmp + +setType "Added 🆕" "${features_types[@]}" +setType "Changed 📦" "${changes_types[@]}" +setType "Fixed 🛠️" "${fix_types[@]}" + +cat $file >> $file_tmp +mv $file_tmp $file + + diff --git a/package.json b/package.json index cdb185ba1..4668d2d56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.26.2", + "version": "24.28.1", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/src/boot/axios.js b/src/boot/axios.js index e3e7289af..4fd83ddea 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -1,11 +1,10 @@ import axios from 'axios'; -import { Notify } from 'quasar'; import { useSession } from 'src/composables/useSession'; import { Router } from 'src/router'; -import { i18n } from './i18n'; +import useNotify from 'src/composables/useNotify.js'; const session = useSession(); -const { t } = i18n.global; +const { notify } = useNotify(); axios.defaults.baseURL = '/api/'; @@ -27,10 +26,7 @@ const onResponse = (response) => { const isSaveRequest = method === 'patch'; if (isSaveRequest) { - Notify.create({ - message: t('globals.dataSaved'), - type: 'positive', - }); + notify('globals.dataSaved', 'positive'); } return response; @@ -67,10 +63,7 @@ const onResponseError = (error) => { return Promise.reject(error); } - Notify.create({ - message: t(message), - type: 'negative', - }); + notify(message, 'negative'); return Promise.reject(error); }; diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js index a809140b0..0bf1f9795 100644 --- a/src/boot/qformMixin.js +++ b/src/boot/qformMixin.js @@ -27,7 +27,6 @@ export default { this.$el.addEventListener('keyup', function (evt) { if (evt.key === 'Enter') { const input = evt.target; - console.log('input', input); if (input.type == 'textarea' && evt.shiftKey) { evt.preventDefault(); let { selectionStart, selectionEnd } = input; diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index fe15d2db1..d5d8e2a91 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -67,6 +67,10 @@ const $props = defineProps({ default: '', description: 'It is used for redirect on click "save and continue"', }, + hasSubtoolbar: { + type: Boolean, + default: true, + }, }); const isLoading = ref(false); @@ -75,6 +79,7 @@ const originalData = ref(); const vnPaginateRef = ref(); const formData = ref(); const saveButtonRef = ref(null); +const watchChanges = ref(); const formUrl = computed(() => $props.url); const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']); @@ -89,6 +94,7 @@ defineExpose({ saveChanges, getChanges, formData, + vnPaginateRef, }); async function fetch(data) { @@ -97,19 +103,26 @@ async function fetch(data) { data.map((d) => (d.$index = $index++)); } - originalData.value = data && JSON.parse(JSON.stringify(data)); - formData.value = data && JSON.parse(JSON.stringify(data)); - watch(formData, () => (hasChanges.value = true), { deep: true }); + resetData(data); emit('onFetch', data); return data; } +function resetData(data) { + if (!data) return; + originalData.value = JSON.parse(JSON.stringify(data)); + formData.value = JSON.parse(JSON.stringify(data)); + + if (watchChanges.value) watchChanges.value(); //destoy watcher + watchChanges.value = watch(formData, () => (hasChanges.value = true), { deep: true }); +} + async function reset() { await fetch(originalData.value); hasChanges.value = false; } -// eslint-disable-next-line vue/no-dupe-keys + function filter(value, update, filterOptions) { update( () => { @@ -135,7 +148,7 @@ async function onSubmit() { await saveChanges($props.saveFn ? formData.value : null); } -async function onSumbitAndGo() { +async function onSubmitAndGo() { await onSubmit(); push({ path: $props.goTo }); } @@ -271,8 +284,9 @@ function isEmpty(obj) { if (obj.length > 0) return false; } -async function reload() { - vnPaginateRef.value.fetch(); +async function reload(params) { + const data = await vnPaginateRef.value.fetch(params); + fetch(data); } watch(formUrl, async () => { @@ -284,10 +298,11 @@ watch(formUrl, async () => { - - + + { /> $props.model ?? `formModel_${route?.meta?.title ?? route.name}` +).value; const componentIsRendered = ref(false); -const arrayData = useArrayData($props.model); +const arrayData = useArrayData(modelValue); const isLoading = ref(false); // Si elegimos observar los cambios del form significa que inicialmente las actions estaran deshabilitadas const isResetting = ref(false); const hasChanges = ref(!$props.observeFormChanges); const originalData = ref({}); -const formData = computed(() => state.get($props.model)); +const formData = computed(() => state.get(modelValue)); const formUrl = computed(() => $props.url); const defaultButtons = computed(() => ({ save: { @@ -114,11 +121,12 @@ onMounted(async () => { nextTick(() => (componentIsRendered.value = true)); // Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla - state.set($props.model, $props.formInitialData); - - if ($props.autoLoad && !$props.formInitialData && $props.url) await fetch(); - else if (arrayData.store.data) updateAndEmit('onFetch', arrayData.store.data); + state.set(modelValue, $props.formInitialData); + if (!$props.formInitialData) { + if ($props.autoLoad && $props.url) await fetch(); + else if (arrayData.store.data) updateAndEmit('onFetch', arrayData.store.data); + } if ($props.observeFormChanges) { watch( () => formData.value, @@ -161,8 +169,8 @@ onBeforeRouteLeave((to, from, next) => { onUnmounted(() => { // Restauramos los datos originales en el store si se realizaron cambios en el formulario pero no se guardaron, evitando modificaciones erróneas. - if (hasChanges.value) return state.set($props.model, originalData.value); - if ($props.clearStoreOnUnmount) state.unset($props.model); + if (hasChanges.value) return state.set(modelValue, originalData.value); + if ($props.clearStoreOnUnmount) state.unset(modelValue); }); async function fetch() { @@ -174,7 +182,7 @@ async function fetch() { updateAndEmit('onFetch', data); } catch (e) { - state.set($props.model, {}); + state.set(modelValue, {}); originalData.value = {}; } } @@ -197,6 +205,7 @@ async function save() { if ($props.urlCreate) notify('globals.dataCreated', 'positive'); updateAndEmit('onDataSaved', formData.value, response?.data); + if ($props.reload) await arrayData.fetch({}); } catch (err) { console.error(err); notify('errors.writeRequest', 'negative'); @@ -235,14 +244,20 @@ function filter(value, update, filterOptions) { } function updateAndEmit(evt, val, res) { - state.set($props.model, val); + state.set(modelValue, val); originalData.value = val && JSON.parse(JSON.stringify(val)); if (!$props.url) arrayData.store.data = val; - emit(evt, state.get($props.model), res); + emit(evt, state.get(modelValue), res); } -defineExpose({ save, isLoading, hasChanges }); +defineExpose({ + save, + isLoading, + hasChanges, + reset, + fetch, +});