diff --git a/README.md b/README.md index a053cdff..d72bfd68 100644 --- a/README.md +++ b/README.md @@ -6,31 +6,30 @@ Hedera is the main web page for Verdnatura. Required dependencies. - * PHP >= 7.0 - * Node.js >= 18.0 +- PHP >= 7.0 +- Node.js >= 18.0 Launch application for development. + ``` $ quasar dev ``` Launch Salix backend. -``` -npm run salix + ``` -Launch legacy PHP backend. -``` -npm run back +pnpm run back ``` Run server side method from command line. + ``` php hedera-web.php -m method_path ``` ## Built with - * [Webpack](https://webpack.js.org/) - * [MooTools](https://mootools.net/) - * [TinyMCE](https://www.tinymce.com/) +- [Webpack](https://webpack.js.org/) +- [MooTools](https://mootools.net/) +- [TinyMCE](https://www.tinymce.com/) diff --git a/src/boot/axios.js b/src/boot/axios.js index b923ccdc..6a2db124 100644 --- a/src/boot/axios.js +++ b/src/boot/axios.js @@ -3,6 +3,7 @@ import { Connection } from '../js/db/connection'; import { useUserStore } from 'stores/user'; import axios from 'axios'; import useNotify from 'src/composables/useNotify.js'; +import { useAppStore } from 'src/stores/app'; const { notify } = useNotify(); // Be careful when using SSR for cross-request state pollution @@ -37,9 +38,11 @@ const onResponseError = error => { export default boot(({ app }) => { const userStore = useUserStore(); + const appStore = useAppStore(); function addToken(config) { if (userStore.token) { config.headers.Authorization = userStore.token; + config.headers['Accept-Language'] = appStore.siteLang; } return config; } diff --git a/src/components/common/VnForm.vue b/src/components/common/VnForm.vue index cd1a329c..51219af9 100644 --- a/src/components/common/VnForm.vue +++ b/src/components/common/VnForm.vue @@ -240,7 +240,7 @@ defineExpose({ flat :disabled="!showBottomActions && !updatedColumns.length" @click="submit()" - data-testid="formDefaultSaveButton" + data-cy="formDefaultSaveButton" > {{ t('save') }} diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 24b82017..c4a3e1df 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -129,17 +129,20 @@ async function filterHandler(val, update) { if (!$props.defaultFilter) return update(); const newOptions = filter(val, myOptionsOriginal.value); - update( - () => { - myOptions.value = newOptions; - }, - ref => { - if (val !== '' && ref.options.length > 0) { - ref.setOptionIndex(-1); - ref.moveOptionSelection(1, true); + + setTimeout(() => { + update( + () => { + myOptions.value = newOptions; + }, + ref => { + if (val !== '' && ref.options.length > 0) { + ref.setOptionIndex(-1); + ref.moveOptionSelection(1, true); + } } - } - ); + ); + }, 300); } @@ -178,6 +181,13 @@ async function filterHandler(val, update) { > + diff --git a/src/components/ui/ImageEditor.vue b/src/components/ui/ImageEditor.vue index 046c0ca7..8d1c610f 100644 --- a/src/components/ui/ImageEditor.vue +++ b/src/components/ui/ImageEditor.vue @@ -100,26 +100,21 @@ const onSubmit = async () => { en-US: name: Name file: File - send: Send imageAdded: Image added successfully es-ES: name: Nombre file: Archivo - send: Enviar imageAdded: Imagen añadida correctamente ca-ES: name: Nom file: Arxiu - send: Enviar imageAdded: Imatge afegida correctament fr-FR: name: Nom file: Fichier - send: Envoyer imageAdded: Image ajoutée correctement pt-PT: name: Nome file: Arquivo - send: Enviar imageAdded: Imagen adicionada corretamente diff --git a/src/components/ui/VnConfirm.vue b/src/components/ui/VnConfirm.vue index 40aa7eef..8e4b869d 100644 --- a/src/components/ui/VnConfirm.vue +++ b/src/components/ui/VnConfirm.vue @@ -91,7 +91,7 @@ async function confirm() { @click="confirm()" unelevated autofocus - data-testid="confirmDialogButton" + data-cy="confirmDialogButton" /> diff --git a/src/components/ui/VnImg.vue b/src/components/ui/VnImg.vue index fb468dc1..7c8addc3 100644 --- a/src/components/ui/VnImg.vue +++ b/src/components/ui/VnImg.vue @@ -67,6 +67,10 @@ const url = computed(() => { return `${props.baseURL ?? app.imageUrl}/${props.storage}/${props.size}/${props.id}`; }); +const zoomUrl = computed(() => { + return `${props.baseURL ?? app.imageUrl}/${props.storage}/${props.zoomSize}/${props.id}`; +}); + const rounded = computed(() => { const roundedMap = { none: '', @@ -114,7 +118,7 @@ const rounded = computed(() => { [] @@ -29,7 +25,6 @@ const { t } = useI18n(); v-if="!rows?.length" class="flex items-center q-pa-md justify-center items-center" > - {{ t(emptyMessage) }} diff --git a/src/components/ui/VnSearchBar.vue b/src/components/ui/VnSearchBar.vue index be15f6c9..894ee7b8 100644 --- a/src/components/ui/VnSearchBar.vue +++ b/src/components/ui/VnSearchBar.vue @@ -40,6 +40,11 @@ const search = async () => { query: searchTerm.value ? { search: searchTerm.value } : {} }); + if (!searchTerm.value) { + emit('onSearchError'); + return; + } + if (props.sqlQuery) { data = await jApi.query(props.sqlQuery, { [props.searchField]: searchTerm.value @@ -71,7 +76,7 @@ onMounted(() => { is-outlined :clearable="false" class="searchbar" - data-testid="searchBar" + data-cy="searchBar" > diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 3e9b3430..a2470964 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -47,7 +47,7 @@ const logoutSupplantedUser = async () => { diff --git a/src/pages/Account/AddressList.vue b/src/pages/Account/AddressList.vue index 47c2b7dc..a603715c 100644 --- a/src/pages/Account/AddressList.vue +++ b/src/pages/Account/AddressList.vue @@ -98,7 +98,7 @@ onMounted(async () => { @click="goToAddressDetails()" rounded no-caps - data-testid="newAddressBtn" + data-cy="newAddressBtn" > {{ t('addAddress') }} @@ -110,7 +110,7 @@ onMounted(async () => { class="rounded-borders shadow-1 shadow-transition" separator :rows="addresses" - data-testid="addressCardList" + data-cy="addressCardList" > { flat rounded @click.stop="goToAddressDetails(address.id)" - data-testid="editAddressBtn" + data-cy="editAddressBtn" > {{ t('editAddress') }} diff --git a/src/pages/Admin/ItemsView.vue b/src/pages/Admin/ItemsView.vue index 587e83cd..8fedd306 100644 --- a/src/pages/Admin/ItemsView.vue +++ b/src/pages/Admin/ItemsView.vue @@ -44,13 +44,13 @@ const onSearch = data => (items.value = data || []); empty-icon="refresh" :loading="loading" :rows="items" - data-testid="itemsViewList" + data-cy="itemsViewList" >