($props.useLike ? { like: `%${val}%` } : val);
.q-field--outlined {
max-width: 100%;
}
+.q-field__inner {
+ .q-field__control {
+ min-height: auto !important;
+
+ display: flex;
+ align-items: flex-end;
+ .q-field__native.row {
+ min-height: auto !important;
+ }
+ }
+}
diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue
index ef07b7bef..43d634ad9 100644
--- a/src/components/ui/VnFilterPanel.vue
+++ b/src/components/ui/VnFilterPanel.vue
@@ -3,7 +3,6 @@ import { onMounted, ref, computed, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useArrayData } from 'composables/useArrayData';
import { useRoute } from 'vue-router';
-import { date } from 'quasar';
import toDate from 'filters/toDate';
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
@@ -59,7 +58,6 @@ const $props = defineProps({
});
defineExpose({ search, sanitizer });
-
const emit = defineEmits([
'update:modelValue',
'refresh',
@@ -114,9 +112,9 @@ watch(
);
const isLoading = ref(false);
-async function search() {
+async function search(evt) {
try {
- if ($props.disableSubmitEvent) return;
+ if (evt && $props.disableSubmitEvent) return;
store.filter.where = {};
isLoading.value = true;
@@ -167,7 +165,7 @@ const tagsList = computed(() => {
for (const key of Object.keys(userParams.value)) {
const value = userParams.value[key];
if (value == null || ($props.hiddenTags || []).includes(key)) continue;
- tagList.push({ label: aliasField(key), value });
+ tagList.push({ label: key, value });
}
return tagList;
});
@@ -187,7 +185,6 @@ async function remove(key) {
}
function formatValue(value) {
- if (value instanceof Date) return date.formatDate(value, 'DD/MM/YYYY');
if (typeof value === 'boolean') return value ? t('Yes') : t('No');
if (isNaN(value) && !isNaN(Date.parse(value))) return toDate(value);
@@ -203,11 +200,6 @@ function sanitizer(params) {
}
return params;
}
-
-function aliasField(field) {
- const split = field.split('.');
- return split[1] ?? split[0];
-}
@@ -219,7 +211,7 @@ function aliasField(field) {
icon="search"
@click="search()"
>
-
+
diff --git a/src/components/ui/VnRow.vue b/src/components/ui/VnRow.vue
index 16bcfab7d..0df1fb7d4 100644
--- a/src/components/ui/VnRow.vue
+++ b/src/components/ui/VnRow.vue
@@ -9,6 +9,7 @@ defineProps({ wrap: { type: Boolean, default: false } });
diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue
index e750d95f0..17e5e3c49 100644
--- a/src/pages/InvoiceOut/InvoiceOutList.vue
+++ b/src/pages/InvoiceOut/InvoiceOutList.vue
@@ -27,13 +27,16 @@ const { openReport } = usePrintService();
const columns = computed(() => [
{
- align: 'left',
+ align: 'center',
name: 'id',
label: t('invoiceOutList.tableVisibleColumns.id'),
chip: {
condition: () => true,
},
isId: true,
+ columnFilter: {
+ name: 'search',
+ },
},
{
align: 'left',
diff --git a/src/pages/Item/ItemFixedPrice.vue b/src/pages/Item/ItemFixedPrice.vue
index 2158065bd..7d4d6b896 100644
--- a/src/pages/Item/ItemFixedPrice.vue
+++ b/src/pages/Item/ItemFixedPrice.vue
@@ -514,7 +514,7 @@ function handleOnDataSave({ CrudModelRef }) {
-
+
import RouteDescriptorProxy from 'pages/Route/Card/RouteDescriptorProxy.vue';
import { onMounted, ref, computed } from 'vue';
-import { useRoute, useRouter } from 'vue-router';
+import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import axios from 'axios';
import { dashIfEmpty, toDate, toCurrency } from 'src/filters';
@@ -12,6 +12,8 @@ import InvoiceOutDescriptorProxy from 'pages/InvoiceOut/Card/InvoiceOutDescripto
import VnLv from 'src/components/ui/VnLv.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import { getUrl } from 'src/composables/getUrl';
+import useNotify from 'src/composables/useNotify.js';
+import { useArrayData } from 'composables/useArrayData';
import VnUserLink from 'src/components/ui/VnUserLink.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
@@ -19,8 +21,7 @@ import ZoneDescriptorProxy from 'src/pages/Zone/Card/ZoneDescriptorProxy.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
const route = useRoute();
-const router = useRouter();
-
+const { notify } = useNotify();
const { t } = useI18n();
const $props = defineProps({
@@ -38,6 +39,8 @@ const ticket = computed(() => summaryRef.value?.entity);
const editableStates = ref([]);
const ticketUrl = ref();
const grafanaUrl = 'https://grafana.verdnatura.es';
+const stateBtnDropdownRef = ref();
+const descriptorData = useArrayData('ticketData');
onMounted(async () => {
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
@@ -64,15 +67,19 @@ function isEditable() {
}
async function changeState(value) {
- if (!ticket.value.id) return;
-
- const formData = {
- ticketFk: ticket.value.id,
- code: value,
- };
-
- await axios.post(`Tickets/state`, formData);
- router.go(route.fullPath);
+ try {
+ stateBtnDropdownRef.value.hide();
+ const formData = {
+ ticketFk: entityId.value,
+ code: value,
+ };
+ await axios.post(`Tickets/state`, formData);
+ notify('globals.dataSaved', 'positive');
+ summaryRef.value?.fetch();
+ descriptorData.fetch({});
+ } catch (err) {
+ console.error('Error changing ticket state', err);
+ }
}
function getNoteValue(description) {
@@ -125,6 +132,7 @@ function toTicketUrl(section) {
diff --git a/src/pages/Worker/WorkerList.vue b/src/pages/Worker/WorkerList.vue
index 4c9964c0b..f4ae20591 100644
--- a/src/pages/Worker/WorkerList.vue
+++ b/src/pages/Worker/WorkerList.vue
@@ -214,6 +214,7 @@ async function autofillBic(worker) {
@@ -262,6 +263,7 @@ async function autofillBic(worker) {
handleLocation(data, location)"
diff --git a/src/pages/Zone/Card/ZoneEvents.vue b/src/pages/Zone/Card/ZoneEvents.vue
index 32a7db4c4..3452849bc 100644
--- a/src/pages/Zone/Card/ZoneEvents.vue
+++ b/src/pages/Zone/Card/ZoneEvents.vue
@@ -44,23 +44,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
-
-
-
-
-
- {{ t('globals.collapseMenu') }}
-
-
-
-
-
import { onMounted, ref, computed, watch, onUnmounted } from 'vue';
import { useRoute } from 'vue-router';
-
+import VnInput from 'src/components/common/VnInput.vue';
import { useState } from 'src/composables/useState';
import axios from 'axios';
import { useArrayData } from 'composables/useArrayData';
@@ -144,7 +144,8 @@ watch(storeData, async (val) => {
});
const reFetch = async () => {
- await arrayData.fetch({ append: false });
+ const { data } = await arrayData.fetch({ append: false });
+ nodes.value = data;
};
onMounted(async () => {
@@ -182,6 +183,16 @@ onUnmounted(() => {
+
+
+
+
+
+describe('UserPanel', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#dashboard`);
+ cy.waitForElement('.q-page', 6000);
+ });
+
+ it('should notify when update user warehouse', () => {
+ const userWarehouse =
+ '.q-menu .q-gutter-xs > :nth-child(3) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input';
+
+ // Abro el panel
+ cy.openUserPanel();
+
+ // Compruebo la opcion inicial
+ cy.get(userWarehouse).should('have.value', 'VNL').click();
+
+ // Actualizo la opción
+ getOption(3);
+
+ //Compruebo la notificación
+ cy.get('.q-notification').should('be.visible');
+ cy.get(userWarehouse).should('have.value', 'VNH');
+
+ //Restauro el valor
+ cy.get(userWarehouse).click();
+ getOption(2);
+ });
+ it('should notify when update user company', () => {
+ const userCompany =
+ '.q-menu .q-gutter-xs > :nth-child(2) > .q-field--float > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native> .q-field__input';
+
+ // Abro el panel
+ cy.openUserPanel();
+
+ // Compruebo la opcion inicial
+ cy.get(userCompany).should('have.value', 'Warehouse One').click();
+
+ //Actualizo la opción
+ getOption(2);
+
+ //Compruebo la notificación
+ cy.get('.q-notification').should('be.visible');
+ cy.get(userCompany).should('have.value', 'Warehouse Two');
+
+ //Restauro el valor
+ cy.get(userCompany).click();
+ getOption(1);
+ });
+});
+
+function getOption(index) {
+ cy.waitForElement('[role="listbox"]');
+ const option = `[role="listbox"] .q-item:nth-child(${index})`;
+ cy.get(option).click();
+}
diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/vnLocation.spec.js
index 88919e41c..78dc38899 100644
--- a/test/cypress/integration/vnComponent/vnLocation.spec.js
+++ b/test/cypress/integration/vnComponent/vnLocation.spec.js
@@ -48,6 +48,25 @@ describe('VnLocation', () => {
`${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
).should('have.length', 1);
});
+ it('should pass selected country', () => {
+ // Select a country
+ const country = 'Ecuador';
+ const province = 'Province five';
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
+ country
+ );
+ cy.selectOption(
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
+ province
+ );
+ cy.get(
+ `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon`
+ ).click();
+ cy.get(
+ `#q-portal--dialog--4 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
+ ).should('have.value', province);
+ });
});
describe('Worker Create', () => {
beforeEach(() => {
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 43788f59f..83f45b721 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -248,3 +248,9 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click();
});
+
+Cypress.Commands.add('openUserPanel', () => {
+ cy.get(
+ '.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
+ ).click();
+});