0
0
Fork 0

Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 6917-inputDate_inpuTime

This commit is contained in:
Alex Moreno 2024-07-01 09:30:24 +02:00
commit 938389de2e
5 changed files with 61 additions and 59 deletions

View File

@ -187,15 +187,10 @@ function existSummary(routes) {
color: lighten($primary, 20%); color: lighten($primary, 20%);
} }
.q-checkbox { .q-checkbox {
display: flex;
margin-bottom: 9px;
& .q-checkbox__label { & .q-checkbox__label {
margin-left: 31px;
color: var(--vn-text-color); color: var(--vn-text-color);
} }
& .q-checkbox__inner { & .q-checkbox__inner {
position: absolute;
left: 0;
color: var(--vn-label-color); color: var(--vn-label-color);
} }
} }

View File

@ -2,6 +2,7 @@
import { dashIfEmpty } from 'src/filters'; import { dashIfEmpty } from 'src/filters';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useClipboard } from 'src/composables/useClipboard'; import { useClipboard } from 'src/composables/useClipboard';
import { computed } from 'vue';
const $props = defineProps({ const $props = defineProps({
label: { type: String, default: null }, label: { type: String, default: null },
@ -24,52 +25,67 @@ function copyValueText() {
}, },
}); });
} }
const val = computed(() => $props.value);
</script> </script>
<style scoped>
.label,
.value {
white-space: pre-line;
word-wrap: break-word;
}
</style>
<template> <template>
<div class="vn-label-value"> <div class="vn-label-value">
<div v-if="$props.label || $slots.label" class="label"> <QCheckbox
v-if="typeof value === 'boolean'"
v-model="val"
:label="label"
disable
dense
/>
<template v-else>
<div v-if="label || $slots.label" class="label">
<slot name="label"> <slot name="label">
<span>{{ $props.label }}</span> <span>{{ label }}</span>
</slot> </slot>
</div> </div>
<div class="value"> <div class="value">
<slot name="value"> <slot name="value">
<span :title="$props.value"> <span :title="value">
{{ $props.dash ? dashIfEmpty($props.value) : $props.value }} {{ dash ? dashIfEmpty(value) : value }}
</span> </span>
</slot> </slot>
</div> </div>
<div class="info" v-if="$props.info"> <div class="info" v-if="info">
<QIcon name="info" class="cursor-pointer" size="xs" color="grey"> <QIcon name="info" class="cursor-pointer" size="xs" color="grey">
<QTooltip class="bg-dark text-white shadow-4" :offset="[10, 10]"> <QTooltip class="bg-dark text-white shadow-4" :offset="[10, 10]">
{{ $props.info }} {{ info }}
</QTooltip> </QTooltip>
</QIcon> </QIcon>
</div> </div>
<div class="copy" v-if="$props.copy && $props.value" @click="copyValueText()"> <div class="copy" v-if="copy && value" @click="copyValueText()">
<QIcon name="Content_Copy" color="primary"> <QIcon name="Content_Copy" color="primary">
<QTooltip>{{ t('globals.copyClipboard') }}</QTooltip> <QTooltip>{{ t('globals.copyClipboard') }}</QTooltip>
</QIcon> </QIcon>
</div> </div>
</template>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.vn-label-value:hover .copy { .vn-label-value {
&:hover .copy {
visibility: visible; visibility: visible;
cursor: pointer; cursor: pointer;
} }
.copy {
.label,
.value {
white-space: pre-line;
word-wrap: break-word;
}
.copy {
visibility: hidden; visibility: hidden;
} }
.info {
.info {
margin-left: 5px; margin-left: 5px;
}
}
:deep(.q-checkbox.disabled) {
opacity: 1 !important;
} }
</style> </style>

View File

@ -2,13 +2,10 @@ describe('AgencyWorkCenter', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
cy.visit(`/#/agency`); cy.visit(`/#/agency/11/workCenter`);
}); });
it('assign workCenter', () => { it('assign workCenter', () => {
cy.visit(`/#/agency`);
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
cy.get( cy.get(
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container' '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
@ -17,8 +14,6 @@ describe('AgencyWorkCenter', () => {
}); });
it('delete workCenter', () => { it('delete workCenter', () => {
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click(); cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click();
cy.get('.q-notification__message').should( cy.get('.q-notification__message').should(
'have.text', 'have.text',
@ -27,9 +22,6 @@ describe('AgencyWorkCenter', () => {
}); });
it('error on duplicate workCenter', () => { it('error on duplicate workCenter', () => {
cy.visit(`/#/agency`);
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
cy.get( cy.get(
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container' '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'

View File

@ -1,8 +1,7 @@
describe('InvoiceInDescriptor', () => { describe('InvoiceInDescriptor', () => {
const dialogBtns = '.q-card__actions button'; const dialogBtns = '.q-card__actions button';
const firstDescritorOpt = '.q-menu > .q-list > :nth-child(1) > .q-item__section'; const firstDescritorOpt = '.q-menu > .q-list > :nth-child(1) > .q-item__section';
const isBookedField = const isBookedField = '.q-card:nth-child(3) .vn-label-value:nth-child(5) .q-checkbox';
'.q-card:nth-child(3) .vn-label-value:nth-child(5) > .value > span';
it('should booking and unbooking the invoice properly', () => { it('should booking and unbooking the invoice properly', () => {
cy.viewport(1280, 720); cy.viewport(1280, 720);
@ -12,10 +11,10 @@ describe('InvoiceInDescriptor', () => {
cy.openActionsDescriptor(); cy.openActionsDescriptor();
cy.get(firstDescritorOpt).click(); cy.get(firstDescritorOpt).click();
cy.get(dialogBtns).eq(1).click(); cy.get(dialogBtns).eq(1).click();
cy.get(isBookedField).should('have.attr', 'title', 'true'); cy.get(isBookedField).should('have.attr', 'aria-checked', 'true');
cy.get(firstDescritorOpt).click(); cy.get(firstDescritorOpt).click();
cy.get(dialogBtns).eq(1).click(); cy.get(dialogBtns).eq(1).click();
cy.get(isBookedField).should('have.attr', 'title', 'false'); cy.get(isBookedField).should('have.attr', 'aria-checked', 'false');
}); });
}); });

View File

@ -31,6 +31,6 @@ describe('VnSearchBar', () => {
}; };
const checkTableLength = (expectedLength) => { const checkTableLength = (expectedLength) => {
cy.get(vnTableRow).find('tr').should('have.length', expectedLength) cy.get(vnTableRow).find('tr').should('have.length', expectedLength);
}; };
}); });