8144-devToTest_2444 #852

Merged
carlossa merged 86 commits from 8144-devToTest_2444 into test 2024-10-22 08:55:44 +00:00
10 changed files with 84 additions and 32 deletions
Showing only changes of commit 6b9dc8f3a6 - Show all commits

View File

@ -0,0 +1,29 @@
<script setup>
const model = defineModel({ type: [String, Number], required: true });
</script>
<template>
<QDate v-model="model" :today-btn="true" :options="$attrs.options" />
</template>
<style lang="scss" scoped>
.q-date {
width: 245px;
min-width: unset;
:deep(.q-date__calendar) {
padding-bottom: 0;
}
:deep(.q-date__view) {
min-height: 245px;
padding: 8px;
}
:deep(.q-date__calendar-days-container) {
min-height: 160px;
height: unset;
}
:deep(.q-date__header) {
padding: 2px 2px 5px 12px;
height: 60px;
}
}
</style>

View File

@ -3,6 +3,7 @@ import { onMounted, watch, computed, ref } from 'vue';
import { date } from 'quasar'; import { date } from 'quasar';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useAttrs } from 'vue'; import { useAttrs } from 'vue';
import VnDate from './VnDate.vue';
const model = defineModel({ type: [String, Date] }); const model = defineModel({ type: [String, Date] });
const $props = defineProps({ const $props = defineProps({
@ -87,6 +88,11 @@ const styleAttrs = computed(() => {
} }
: {}; : {};
}); });
const manageDate = (date) => {
formattedDate.value = date;
isPopupOpen.value = false;
};
</script> </script>
<template> <template>
@ -129,6 +135,7 @@ const styleAttrs = computed(() => {
/> />
</template> </template>
<QMenu <QMenu
v-if="$q.screen.gt.xs"
transition-show="scale" transition-show="scale"
transition-hide="scale" transition-hide="scale"
v-model="isPopupOpen" v-model="isPopupOpen"
@ -137,19 +144,11 @@ const styleAttrs = computed(() => {
:no-focus="true" :no-focus="true"
:no-parent-event="true" :no-parent-event="true"
> >
<QDate <VnDate v-model="popupDate" @update:model-value="manageDate" />
v-model="popupDate"
:landscape="true"
:today-btn="true"
:options="$attrs.options"
@update:model-value="
(date) => {
formattedDate = date;
isPopupOpen = false;
}
"
/>
</QMenu> </QMenu>
<QDialog v-else v-model="isPopupOpen">
<VnDate v-model="popupDate" @update:model-value="manageDate" />
</QDialog>
</QInput> </QInput>
</div> </div>
</template> </template>

View File

@ -3,6 +3,8 @@ import { computed, ref, useAttrs } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { date } from 'quasar'; import { date } from 'quasar';
import { useValidator } from 'src/composables/useValidator'; import { useValidator } from 'src/composables/useValidator';
import VnTime from './VnTime.vue';
const { validations } = useValidator(); const { validations } = useValidator();
const $attrs = useAttrs(); const $attrs = useAttrs();
const model = defineModel({ type: String }); const model = defineModel({ type: String });
@ -107,6 +109,7 @@ function dateToTime(newDate) {
/> />
</template> </template>
<QMenu <QMenu
v-if="$q.screen.gt.xs"
transition-show="scale" transition-show="scale"
transition-hide="scale" transition-hide="scale"
v-model="isPopupOpen" v-model="isPopupOpen"
@ -115,8 +118,11 @@ function dateToTime(newDate) {
:no-focus="true" :no-focus="true"
:no-parent-event="true" :no-parent-event="true"
> >
<QTime v-model="formattedTime" mask="HH:mm" landscape now-btn /> <VnTime v-model="formattedTime" />
</QMenu> </QMenu>
<QDialog v-else v-model="isPopupOpen">
<VnTime v-model="formattedTime" />
</QDialog>
</QInput> </QInput>
</div> </div>
</template> </template>

View File

@ -0,0 +1,16 @@
<script setup>
const model = defineModel({ type: [String, Number], required: true });
</script>
<template>
<QTime v-model="model" now-btn mask="HH:mm" />
</template>
<style lang="scss" scoped>
.q-time {
width: 230px;
min-width: unset;
:deep(.q-time__header) {
min-height: unset;
height: 50px;
}
}
</style>

View File

@ -58,7 +58,7 @@ defineExpose({
:class="{ zoomIn: zoom }" :class="{ zoomIn: zoom }"
:src="getUrl()" :src="getUrl()"
v-bind="$attrs" v-bind="$attrs"
@click.stop="show = $props.zoom ? true : false" @click.stop="show = $props.zoom"
spinner-color="primary" spinner-color="primary"
/> />
<QDialog v-if="$props.zoom" v-model="show"> <QDialog v-if="$props.zoom" v-model="show">

View File

@ -124,6 +124,12 @@ defineExpose({ states });
lazy-rules lazy-rules
is-outlined is-outlined
/> />
<VnInput
:label="t('travel.travelList.tableVisibleColumns.daysOnward')"
v-model="params.daysOnward"
lazy-rules
is-outlined
/>
</div> </div>
</template> </template>
</VnFilterPanel> </VnFilterPanel>

View File

@ -161,15 +161,6 @@ const columns = computed(() => [
cardVisible: true, cardVisible: true,
create: true, create: true,
}, },
{
align: 'left',
name: 'daysOnward',
label: t('travel.travelList.tableVisibleColumns.daysOnward'),
visible: false,
columnFilter: {
inWhere: false,
},
},
{ {
align: 'right', align: 'right',
label: '', label: '',

View File

@ -11,7 +11,7 @@ describe('EntryMy when is supplier', () => {
it('should open buyLabel when is supplier', () => { it('should open buyLabel when is supplier', () => {
cy.get( cy.get(
'[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon' '[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
).click(); ).click();
cy.get('.q-card__actions > .q-btn').click(); cy.get('.q-card__actions > .q-btn').click();
cy.window().its('open').should('be.called'); cy.window().its('open').should('be.called');

View File

@ -1,7 +1,8 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Ticket descriptor', () => { describe('Ticket descriptor', () => {
const toCloneOpt = '[role="menu"] .q-list > :nth-child(8)'; const listItem = '[role="menu"] .q-list .q-item';
const setWeightOpt = '[role="menu"] .q-list > :nth-child(13)'; const toCloneOpt = 'To clone ticket';
const setWeightOpt = 'Set weight';
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span'; const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
const summaryHeader = '.summaryHeader > div'; const summaryHeader = '.summaryHeader > div';
const weight = 25; const weight = 25;
@ -14,7 +15,7 @@ describe('Ticket descriptor', () => {
it('should clone the ticket without warehouse', () => { it('should clone the ticket without warehouse', () => {
cy.visit('/#/ticket/1/summary'); cy.visit('/#/ticket/1/summary');
cy.openActionsDescriptor(); cy.openActionsDescriptor();
cy.get(toCloneOpt).click(); cy.contains(listItem, toCloneOpt).click();
cy.clickConfirm(); cy.clickConfirm();
cy.get(warehouseValue).contains('Warehouse One'); cy.get(warehouseValue).contains('Warehouse One');
cy.get(summaryHeader) cy.get(summaryHeader)
@ -28,7 +29,7 @@ describe('Ticket descriptor', () => {
it('should set the weight of the ticket', () => { it('should set the weight of the ticket', () => {
cy.visit('/#/ticket/10/summary'); cy.visit('/#/ticket/10/summary');
cy.openActionsDescriptor(); cy.openActionsDescriptor();
cy.get(setWeightOpt).click(); cy.contains(listItem, setWeightOpt).click();
cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight'); cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight');
cy.get('.q-dialog input').type(weight); cy.get('.q-dialog input').type(weight);
cy.clickConfirm(); cy.clickConfirm();

View File

@ -64,7 +64,7 @@ describe('VnLocation', () => {
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon` `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon`
).click(); ).click();
cy.get( cy.get(
`#q-portal--dialog--4 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input` `#q-portal--dialog--5 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
).should('have.value', province); ).should('have.value', province);
}); });
}); });
@ -133,6 +133,8 @@ describe('VnLocation', () => {
); );
cy.get('.q-mt-lg > .q-btn--standard').click(); cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get(`${createForm.prefix}`).should('not.exist'); cy.get(`${createForm.prefix}`).should('not.exist');
cy.waitForElement('.q-form');
checkVnLocation(postCode, province); checkVnLocation(postCode, province);
}); });
it('Create city', () => { it('Create city', () => {
@ -144,10 +146,12 @@ describe('VnLocation', () => {
cy.get( cy.get(
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon` `${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
).click(); ).click();
cy.selectOption('#q-portal--dialog--2 .q-select', 'one'); cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
cy.get('#q-portal--dialog--2 .q-input').type(province); cy.get('#q-portal--dialog--3 .q-input').type(province);
cy.get('#q-portal--dialog--2 .q-btn--standard').click(); cy.get('#q-portal--dialog--3 .q-btn--standard').click();
cy.get('#q-portal--dialog--1 .q-btn--standard').click(); cy.get('#q-portal--dialog--1 .q-btn--standard').click();
cy.waitForElement('.q-form');
checkVnLocation(postCode, province); checkVnLocation(postCode, province);
}); });