diff --git a/.vscode/settings.json b/.vscode/settings.json index 5026b7d3b..8f601aa77 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,5 +14,5 @@ "[vue]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, - "cSpell.words": ["axios"] + "cSpell.words": ["axios", "composables"] } diff --git a/package.json b/package.json index 4668d2d56..71d80d401 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.28.1", + "version": "24.30.1", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/src/boot/axios.js b/src/boot/axios.js index 4fd83ddea..fa8a08003 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -55,10 +55,10 @@ const onResponseError = (error) => { } if (session.isLoggedIn() && response?.status === 401) { - session.destroy(); + session.destroy(false); const hash = window.location.hash; const url = hash.slice(1); - Router.push({ path: url }); + Router.push(`/login?redirect=${url}`); } else if (!session.isLoggedIn()) { return Promise.reject(error); } diff --git a/src/components/CreateManualInvoiceForm.vue b/src/components/CreateManualInvoiceForm.vue index 92399c20c..1aa95011f 100644 --- a/src/components/CreateManualInvoiceForm.vue +++ b/src/components/CreateManualInvoiceForm.vue @@ -46,22 +46,6 @@ const onDataSaved = async (formData, requestResponse) => { @on-fetch="(data) => (taxAreasOptions = data)" auto-load /> - - { option-value="id" v-model="data.ticketFk" @update:model-value="data.clientFk = null" + url="Tickets" + :where="{ refFk: null }" + :fields="['id', 'nickname']" + :filter-options="{ order: 'shipped DESC' }" > - - + + + + diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue index cc904f9cc..589524258 100644 --- a/src/components/UserPanel.vue +++ b/src/components/UserPanel.vue @@ -19,6 +19,7 @@ const session = useSession(); const router = useRouter(); const { t, locale } = useI18n(); const { copyText } = useClipboard(); + const userLocale = computed({ get() { return locale.value; diff --git a/src/components/VnTable/VnColumn.vue b/src/components/VnTable/VnColumn.vue index 6cd62d83e..3af58226f 100644 --- a/src/components/VnTable/VnColumn.vue +++ b/src/components/VnTable/VnColumn.vue @@ -5,8 +5,10 @@ import { dashIfEmpty } from 'src/filters'; /* basic input */ import VnSelect from 'components/common/VnSelect.vue'; +import VnSelectCache from 'components/common/VnSelectCache.vue'; import VnInput from 'components/common/VnInput.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; +import VnInputTime from 'components/common/VnInputTime.vue'; import VnComponent from 'components/common/VnComponent.vue'; const model = defineModel(undefined, { required: true }); @@ -41,11 +43,23 @@ const $props = defineProps({ }, }); +const defaultSelect = { + attrs: { + row: $props.row, + disable: !$props.isEditable, + class: 'fit', + }, + forceAttrs: { + label: $props.showLabel && $props.column.label, + }, +}; + const defaultComponents = { input: { component: markRaw(VnInput), attrs: { disable: !$props.isEditable, + class: 'fit', }, forceAttrs: { label: $props.showLabel && $props.column.label, @@ -55,6 +69,7 @@ const defaultComponents = { component: markRaw(VnInput), attrs: { disable: !$props.isEditable, + class: 'fit', }, forceAttrs: { label: $props.showLabel && $props.column.label, @@ -63,9 +78,19 @@ const defaultComponents = { date: { component: markRaw(VnInputDate), attrs: { - readonly: true, + readonly: !$props.isEditable, disable: !$props.isEditable, style: 'min-width: 125px', + class: 'fit', + }, + forceAttrs: { + label: $props.showLabel && $props.column.label, + }, + }, + time: { + component: markRaw(VnInputTime), + attrs: { + disable: !$props.isEditable, }, forceAttrs: { label: $props.showLabel && $props.column.label, @@ -77,7 +102,7 @@ const defaultComponents = { const defaultAttrs = { disable: !$props.isEditable, 'model-value': Boolean(prop), - class: 'no-padding', + class: 'no-padding fit', }; if (typeof prop == 'number') { @@ -91,13 +116,12 @@ const defaultComponents = { }, }, select: { + component: markRaw(VnSelectCache), + ...defaultSelect, + }, + rawSelect: { component: markRaw(VnSelect), - attrs: { - disable: !$props.isEditable, - }, - forceAttrs: { - label: $props.showLabel && $props.column.label, - }, + ...defaultSelect, }, icon: { component: markRaw(QIcon), @@ -134,7 +158,7 @@ const col = computed(() => { const components = computed(() => $props.components ?? defaultComponents);