fix: refs #8004 more list style issues
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Pablo Natek 2024-10-13 11:20:51 +02:00
parent 1ff7d55644
commit b32c8dd9f0
18 changed files with 48 additions and 61 deletions

View File

@ -149,6 +149,7 @@ const tableModes = [
disable: $props.disableOption?.card, disable: $props.disableOption?.card,
}, },
]; ];
onBeforeMount(() => { onBeforeMount(() => {
setUserParams(route.query[$props.searchUrl]); setUserParams(route.query[$props.searchUrl]);
hasParams.value = params.value && Object.keys(params.value).length !== 0; hasParams.value = params.value && Object.keys(params.value).length !== 0;

View File

@ -4,6 +4,8 @@ import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore'; import { useStateStore } from 'stores/useStateStore';
import isMobile from 'src/composables/isMobile'; import isMobile from 'src/composables/isMobile';
const { t } = useI18n();
const stateStore = useStateStore();
const slots = useSlots(); const slots = useSlots();
const hasContent = ref(false); const hasContent = ref(false);
const rightPanel = ref(null); const rightPanel = ref(null);
@ -21,13 +23,9 @@ onMounted(() => {
childList: true, childList: true,
attributes: true, attributes: true,
}); });
if ((!slots['right-panel'] && !hasContent.value) || isMobile) if ((!slots['right-panel'] && !hasContent.value) || isMobile)
stateStore.rightDrawer = false; stateStore.rightDrawer = false;
}); });
const { t } = useI18n();
const stateStore = useStateStore();
</script> </script>
<template> <template>
<Teleport to="#actions-append" v-if="stateStore.isHeaderMounted()"> <Teleport to="#actions-append" v-if="stateStore.isHeaderMounted()">
@ -46,12 +44,7 @@ const stateStore = useStateStore();
</QBtn> </QBtn>
</div> </div>
</Teleport> </Teleport>
<QDrawer <QDrawer v-model="stateStore.rightDrawer" side="right" :width="256">
v-model="stateStore.rightDrawer"
side="right"
:width="256"
:show-if-above="!isMobile"
>
<QScrollArea class="fit"> <QScrollArea class="fit">
<div id="right-panel"></div> <div id="right-panel"></div>
<slot v-if="!hasContent" name="right-panel" /> <slot v-if="!hasContent" name="right-panel" />

View File

@ -1,9 +1,9 @@
<script setup> <script setup>
import { ref, computed, watch, onBeforeMount } from 'vue'; import { ref, computed, watch, onBeforeMount, onMounted } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import SkeletonSummary from 'components/ui/SkeletonSummary.vue'; import SkeletonSummary from 'components/ui/SkeletonSummary.vue';
import VnLv from 'src/components/ui/VnLv.vue';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import { useStateStore } from 'src/stores/useStateStore';
const props = defineProps({ const props = defineProps({
url: { url: {
@ -39,6 +39,7 @@ const { store } = arrayData;
const entity = computed(() => (Array.isArray(store.data) ? store.data[0] : store.data)); const entity = computed(() => (Array.isArray(store.data) ? store.data[0] : store.data));
const isLoading = ref(false); const isLoading = ref(false);
const stateStore = useStateStore();
defineExpose({ defineExpose({
entity, entity,
fetch, fetch,
@ -50,6 +51,10 @@ onBeforeMount(async () => {
watch(props, async () => await fetch()); watch(props, async () => await fetch());
}); });
onMounted(() => {
stateStore.rightMenu = false;
console.log('useStateStore: ', useStateStore.rightMenu);
});
async function fetch() { async function fetch() {
store.url = props.url; store.url = props.url;
store.filter = props.filter ?? {}; store.filter = props.filter ?? {};
@ -75,7 +80,6 @@ function existSummary(routes) {
} }
} }
</script> </script>
<template> <template>
<div class="summary container"> <div class="summary container">
<QCard class="cardSummary"> <QCard class="cardSummary">
@ -96,7 +100,7 @@ function existSummary(routes) {
<span v-else></span> <span v-else></span>
</slot> </slot>
<slot name="header" :entity="entity" dense> <slot name="header" :entity="entity" dense>
<VnLv :label="`${entity.id} -`" :value="entity.name" /> {{ entity.id + ' - ' + entity.name }}
</slot> </slot>
<slot name="header-right"> <slot name="header-right">
<span></span> <span></span>
@ -109,7 +113,6 @@ function existSummary(routes) {
</QCard> </QCard>
</div> </div>
</template> </template>
<style lang="scss"> <style lang="scss">
.summary.container { .summary.container {
display: flex; display: flex;

View File

@ -2,22 +2,21 @@
import { ref, computed, markRaw } from 'vue'; import { ref, computed, markRaw } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { toDate } from 'src/filters';
import RightMenu from 'src/components/common/RightMenu.vue';
import CustomerSummary from './Card/CustomerSummary.vue';
import CustomerFilter from './CustomerFilter.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import VnTable from 'components/VnTable/VnTable.vue'; import VnTable from 'components/VnTable/VnTable.vue';
import VnLocation from 'src/components/common/VnLocation.vue'; import VnLocation from 'src/components/common/VnLocation.vue';
import VnSearchbar from 'components/ui/VnSearchbar.vue'; import VnSearchbar from 'components/ui/VnSearchbar.vue';
import CustomerSummary from './Card/CustomerSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import RightMenu from 'src/components/common/RightMenu.vue';
import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue';
import { toDate } from 'src/filters';
import CustomerFilter from './CustomerFilter.vue';
const { t } = useI18n(); const { t } = useI18n();
const router = useRouter(); const router = useRouter();
const tableRef = ref(); const tableRef = ref();
const columns = computed(() => [ const columns = computed(() => [
{ {
align: 'left', align: 'left',
@ -406,6 +405,7 @@ function handleLocation(data, location) {
ref="tableRef" ref="tableRef"
data-key="Customer" data-key="Customer"
url="Clients/filter" url="Clients/filter"
order="id DESC"
:create="{ :create="{
urlCreate: 'Clients/createWithUser', urlCreate: 'Clients/createWithUser',
title: t('globals.pageTitles.customerCreate'), title: t('globals.pageTitles.customerCreate'),
@ -415,10 +415,9 @@ function handleLocation(data, location) {
isEqualizated: false, isEqualizated: false,
}, },
}" }"
order="id DESC"
:columns="columns" :columns="columns"
redirect="customer"
:right-search="false" :right-search="false"
redirect="customer"
> >
<template #more-create-dialog="{ data }"> <template #more-create-dialog="{ data }">
<VnSelect <VnSelect
@ -453,7 +452,6 @@ function handleLocation(data, location) {
</QItem> </QItem>
</template> </template>
</VnSelect> </VnSelect>
<VnLocation <VnLocation
:acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]" :acls="[{ model: 'Province', props: '*', accessType: 'WRITE' }]"
v-model="data.location" v-model="data.location"
@ -474,7 +472,7 @@ function handleLocation(data, location) {
</template> </template>
<i18n> <i18n>
es: es:
Web user: Usuario Web Web user: Usuario web
</i18n> </i18n>
<style lang="scss" scoped> <style lang="scss" scoped>
.col-content { .col-content {

View File

@ -1,8 +1,6 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { onMounted } from 'vue';
import { useStateStore } from 'stores/useStateStore';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
@ -20,11 +18,6 @@ const props = defineProps({
const currenciesOptions = ref([]); const currenciesOptions = ref([]);
const companiesOptions = ref([]); const companiesOptions = ref([]);
const stateStore = useStateStore();
onMounted(async () => {
stateStore.rightDrawer = true;
});
</script> </script>
<template> <template>

View File

@ -1,21 +1,22 @@
<script setup> <script setup>
import axios from 'axios';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { computed, ref } from 'vue'; import { computed, ref, onMounted } from 'vue';
import { dashIfEmpty, toCurrency, toDate } from 'src/filters'; import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
import OrderSummary from 'pages/Order/Card/OrderSummary.vue'; import { toDateTimeFormat } from 'src/filters/date';
import { useSummaryDialog } from 'src/composables/useSummaryDialog'; import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import { useRoute } from 'vue-router';
import axios from 'axios';
import OrderSummary from 'pages/Order/Card/OrderSummary.vue';
import OrderSearchbar from './Card/OrderSearchbar.vue';
import OrderFilter from './Card/OrderFilter.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
import VnTable from 'src/components/VnTable/VnTable.vue'; import VnTable from 'src/components/VnTable/VnTable.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import OrderSearchbar from './Card/OrderSearchbar.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
import OrderFilter from './Card/OrderFilter.vue';
import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
import { toDateTimeFormat } from 'src/filters/date';
import { onMounted } from 'vue';
import { useRoute } from 'vue-router';
const { t } = useI18n(); const { t } = useI18n();
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
@ -166,9 +167,9 @@ const getDateColor = (date) => {
today.setHours(0, 0, 0, 0); today.setHours(0, 0, 0, 0);
const timeTicket = new Date(date); const timeTicket = new Date(date);
timeTicket.setHours(0, 0, 0, 0); timeTicket.setHours(0, 0, 0, 0);
const comparation = today - timeTicket; const difference = today - timeTicket;
if (comparation == 0) return 'bg-warning'; if (difference == 0) return 'bg-warning';
if (comparation < 0) return 'bg-success'; if (difference < 0) return 'bg-success';
}; };
onMounted(() => { onMounted(() => {
@ -203,8 +204,8 @@ onMounted(() => {
}, },
}" }"
:user-params="{ showEmpty: false }" :user-params="{ showEmpty: false }"
:right-search="false"
:columns="columns" :columns="columns"
:right-search="false"
redirect="order" redirect="order"
> >
<template #column-clientFk="{ row }"> <template #column-clientFk="{ row }">

View File

@ -43,7 +43,7 @@ const filter = {
data-key="ShelvingSummary" data-key="ShelvingSummary"
> >
<template #header="{ entity }"> <template #header="{ entity }">
<div>{{ entity.code }}</div> <div>{{ entity.id }} - {{ entity.code }}</div>
</template> </template>
<template #body="{ entity }"> <template #body="{ entity }">
<QCard class="vn-one"> <QCard class="vn-one">

View File

@ -41,7 +41,7 @@ const getUrl = (section) => `#/supplier/${entityId.value}/${section}`;
data-key="SupplierSummary" data-key="SupplierSummary"
> >
<template #header> <template #header>
<span>{{ supplier.name }} - {{ supplier.id }}</span> <span>{{ supplier.id }} - {{ supplier.name }}</span>
</template> </template>
<template #body> <template #body>

View File

@ -36,8 +36,9 @@ const filter = {
data-key="Travel" data-key="Travel"
base-url="Travels" base-url="Travels"
search-data-key="TravelList" search-data-key="TravelList"
:filter="filter"
:descriptor="TravelDescriptor" :descriptor="TravelDescriptor"
:filter-panel="TravelFilter"
:filter="filter"
:searchbar-props="{ :searchbar-props="{
url: 'Travels', url: 'Travels',
label: 'Search travel', label: 'Search travel',

View File

@ -252,7 +252,7 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
data-key="TravelSummary" data-key="TravelSummary"
> >
<template #header> <template #header>
<span>{{ travel.ref }} - {{ travel.id }}</span> <span>{{ travel.id }} - {{ travel.ref }}</span>
</template> </template>
<template #body> <template #body>

View File

@ -10,6 +10,7 @@ import { toDate } from 'src/filters';
import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js'; import { getDateQBadgeColor } from 'src/composables/getDateQBadgeColor.js';
import RightMenu from 'src/components/common/RightMenu.vue'; import RightMenu from 'src/components/common/RightMenu.vue';
import TravelFilter from './TravelFilter.vue'; import TravelFilter from './TravelFilter.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
const { viewSummary } = useSummaryDialog(); const { viewSummary } = useSummaryDialog();
const router = useRouter(); const router = useRouter();

View File

@ -99,7 +99,6 @@ async function remove(row) {
:filter="filter" :filter="filter"
:columns="columns" :columns="columns"
order="id DESC" order="id DESC"
:right-search="false"
:column-search="false" :column-search="false"
:default-mode="'card'" :default-mode="'card'"
:disable-option="{ table: true }" :disable-option="{ table: true }"

View File

@ -1,6 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('VnBreadcrumbs', () => { describe('VnBreadcrumbs', () => {
const firstCard = '.q-infinite-scroll > :nth-child(1)';
const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el'; const lastBreadcrumb = '.q-breadcrumbs--last > .q-breadcrumbs__el';
beforeEach(() => { beforeEach(() => {
cy.login('developer'); cy.login('developer');
@ -12,10 +11,7 @@ describe('VnBreadcrumbs', () => {
}); });
it('should get the correct breadcrumbs', () => { it('should get the correct breadcrumbs', () => {
cy.visit('#/customer/list'); cy.visit('#/customer/1/summary');
cy.get('.q-breadcrumbs__el').should('have.length', 2);
cy.get(firstCard).click();
cy.get(`${lastBreadcrumb} > .q-icon`).should('have.text', 'launch'); cy.get(`${lastBreadcrumb} > .q-icon`).should('have.text', 'launch');
}); });
}); });

View File

@ -5,6 +5,7 @@ describe('VnSearchBar', () => {
const idGap = '.q-item > .q-item__label'; const idGap = '.q-item > .q-item__label';
const vnTableRow = '.q-virtual-scroll__content'; const vnTableRow = '.q-virtual-scroll__content';
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
cy.visit('#/customer/list'); cy.visit('#/customer/list');
}); });

View File

@ -22,6 +22,7 @@ describe('ZoneCreate', () => {
...data, ...data,
}); });
cy.get('input[aria-label="Close"]').type('10:00'); cy.get('input[aria-label="Close"]').type('10:00');
cy.get('body').click();
cy.get('.q-mt-lg > .q-btn--standard').click(); cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get(notification).should('contains.text', 'Agency cannot be blank'); cy.get(notification).should('contains.text', 'Agency cannot be blank');
}); });
@ -32,6 +33,7 @@ describe('ZoneCreate', () => {
Agency: { val: 'inhouse pickup', type: 'select' }, Agency: { val: 'inhouse pickup', type: 'select' },
}); });
cy.get('input[aria-label="Close"]').type('10:00'); cy.get('input[aria-label="Close"]').type('10:00');
cy.get('body').click();
cy.get('.q-mt-lg > .q-btn--standard').click(); cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get(notification).should('contains.text', 'Data created'); cy.get(notification).should('contains.text', 'Data created');
}); });

View File

@ -6,9 +6,7 @@ describe('ZoneList', () => {
}); });
it('should filter by agency', () => { it('should filter by agency', () => {
cy.get( cy.get('input[aria-label="Agency"]').type('{downArrow}{enter}');
':nth-child(1) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
).type('{downArrow}{enter}');
}); });
it('should open the zone summary', () => { it('should open the zone summary', () => {