style: remove proposal
gitea/salix-front/pipeline/pr-test This commit looks good Details

This commit is contained in:
Javier Segarra 2025-02-16 23:46:05 +01:00
parent 33d6662f97
commit 443a2747cc
5 changed files with 6 additions and 30 deletions

View File

@ -14,10 +14,6 @@ const $props = defineProps({
type: Object,
default: () => {},
},
searchBarRef: {
type: Object,
default: () => {},
},
dataKey: {
type: String,
required: true,
@ -65,10 +61,6 @@ const $props = defineProps({
type: Object,
default: null,
},
requiredParams: {
type: [Array, Object],
default: () => [],
},
useSearchbar: {
type: [Boolean, Function],
default: false,

View File

@ -17,10 +17,6 @@ const props = defineProps({
type: String,
required: true,
},
searchBarRef: {
type: Object,
default: () => ({}),
},
});
const provinces = ref([]);
@ -45,11 +41,6 @@ from.setDate(from.getDate() - 7);
const to = Date.vnNew();
to.setHours(23, 59, 0, 0);
to.setDate(to.getDate() + 1);
const userParams = computed(() => {
from.value = from.toISOString();
to.value = to.toISOString();
return { from, to };
});
function validateDateRange(params) {
const hasFrom = 'from' in params;
const hasTo = 'to' in params;
@ -79,11 +70,9 @@ function validateDateRange(params) {
<FetchData url="AgencyModes" @on-fetch="(data) => (agencies = data)" auto-load />
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
<VnFilterPanel
:searchBarRef="$props.searchBarRef"
:data-key="props.dataKey"
:search-button="true"
:use-searchbar="validateDateRange"
:requiredParams="{ ...userParams }"
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">

View File

@ -491,10 +491,7 @@ watch(
}"
>
<template #advanced-menu>
<TicketFilter
data-key="TicketList"
:searchbarRef="$refs.sectionRef?.$refs.searchbarRef"
/>
<TicketFilter data-key="TicketList" />
</template>
<template #body>
<VnTable

View File

@ -1,7 +1,5 @@
/// <reference types="cypress" />
describe('TicketFilter', () => {
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);

View File

@ -48,8 +48,8 @@ describe('TicketList', () => {
expect(query).to.not.have.property('clientFk');
});
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
cy.get('[data-cy="Customer ID_input"]').clear('1');
cy.get('[data-cy="Customer ID_input"]').type('1101{enter}');
cy.dataCy('Customer ID_input').clear('1');
cy.dataCy('Customer ID_input').type('1101{enter}');
cy.wait('@ticketFilter').then(({ request }) => {
const { query } = request;
expect(query).to.not.have.property('from');
@ -57,11 +57,11 @@ describe('TicketList', () => {
expect(query).to.have.property('clientFk');
});
cy.get('[data-cy="vnTableCreateBtn"] > .q-btn__content > .q-icon').click();
cy.get('[data-cy="Customer_select"]').should('have.value', 'Bruce Wayne');
cy.get('[data-cy="Address_select"]').click();
cy.dataCy('Customer_select').should('have.value', 'Bruce Wayne');
cy.dataCy('Address_select').click();
cy.selectOptionBeta().click();
cy.get('[data-cy="Address_select"]').should('have.value', 'Bruce Wayne');
cy.dataCy('Address_select').should('have.value', 'Bruce Wayne');
});
it('Client list create new client', () => {
cy.dataCy('vnTableCreateBtn').should('exist');