8355-testToMaster #1177

Merged
alexm merged 326 commits from 8355-testToMaster into master 2025-01-07 06:46:55 +00:00
9 changed files with 22 additions and 11 deletions
Showing only changes of commit 266eccb814 - Show all commits

View File

@ -14,6 +14,7 @@ defineProps({
hide-dropdown-icon hide-dropdown-icon
focus-on-mount focus-on-mount
@update:model-value="promise" @update:model-value="promise"
data-cy="vnBtnSelect_select"
/> />
</QBtnDropdown> </QBtnDropdown>
</template> </template>

View File

@ -297,7 +297,7 @@ defineExpose({
ref="dmsRef" ref="dmsRef"
:data-key="$props.model" :data-key="$props.model"
:url="$props.model" :url="$props.model"
:filter="dmsFilter" :user-filter="dmsFilter"
:order="['dmsFk DESC']" :order="['dmsFk DESC']"
:auto-load="true" :auto-load="true"
@on-fetch="setData" @on-fetch="setData"

View File

@ -20,16 +20,15 @@ const hasContent = ref();
let observer; let observer;
onMounted(() => { onMounted(() => {
if (teleportRef.value) { if (!teleportRef.value) return;
const checkContent = () => { const checkContent = () => {
hasContent.value = teleportRef.value.innerHTML.trim() !== ''; hasContent.value = teleportRef.value?.innerHTML?.trim() !== '';
}; };
observer = new MutationObserver(checkContent); observer = new MutationObserver(checkContent);
observer.observe(teleportRef.value, { childList: true, subtree: true }); observer.observe(teleportRef.value, { childList: true, subtree: true });
checkContent(); checkContent();
}
}); });
</script> </script>

View File

@ -39,6 +39,10 @@ const $props = defineProps({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
keepData: {
type: Boolean,
default: true,
},
}); });
const route = useRoute(); const route = useRoute();
@ -56,6 +60,7 @@ onBeforeMount(() => {
if ($props.dataKey) if ($props.dataKey)
arrayData = useArrayData($props.dataKey, { arrayData = useArrayData($props.dataKey, {
searchUrl: 'table', searchUrl: 'table',
keepData: $props.keepData,
...$props.arrayDataProps, ...$props.arrayDataProps,
navigate: $props.redirect, navigate: $props.redirect,
}); });

View File

@ -111,6 +111,7 @@ onMounted(async () => {
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
if (!store.keepData) arrayData.reset(['data']);
arrayData.resetPagination(); arrayData.resetPagination();
}); });

View File

@ -53,6 +53,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
'searchUrl', 'searchUrl',
'navigate', 'navigate',
'mapKey', 'mapKey',
'keepData',
]; ];
if (typeof userOptions === 'object') { if (typeof userOptions === 'object') {
for (const option in userOptions) { for (const option in userOptions) {
@ -302,7 +303,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
for (const row of data) { for (const row of data) {
const key = row[store.mapKey]; const key = row[store.mapKey];
const val = { ...row, key }; const val = { ...row, key };
if (store.map.has(key)) { if (key && store.map.has(key)) {
const { position } = store.map.get(key); const { position } = store.map.get(key);
val.position = position; val.position = position;
store.map.set(key, val); store.map.set(key, val);

View File

@ -18,6 +18,7 @@ export const useArrayDataStore = defineStore('arrayDataStore', () => {
navigate: null, navigate: null,
page: 1, page: 1,
mapKey: 'id', mapKey: 'id',
keepData: false,
}; };
function get(key) { function get(key) {

View File

@ -16,7 +16,9 @@ describe('Ticket expedtion', () => {
cy.wait('@show'); cy.wait('@show');
cy.selectRows([1, 2]); cy.selectRows([1, 2]);
cy.selectOption('[data-cy="change-state"]', 'Perdida');
cy.dataCy('change-state').click();
cy.selectOption('[data-cy="vnBtnSelect_select"]', 'Perdida');
cy.wait('@add'); cy.wait('@add');
cy.get(`${tableContent} tr:nth-child(-n+2) ${stateTd}`).each(($el) => { cy.get(`${tableContent} tr:nth-child(-n+2) ${stateTd}`).each(($el) => {

View File

@ -16,6 +16,7 @@ describe('VnBreadcrumbs', () => {
cy.visit('#/customer/list'); cy.visit('#/customer/list');
cy.get('.q-breadcrumbs__el').should('have.length', 2); cy.get('.q-breadcrumbs__el').should('have.length', 2);
cy.writeSearchbar('{enter}');
cy.get(firstCard).click(); cy.get(firstCard).click();
cy.get(`${lastBreadcrumb} > .q-icon`).should('have.text', 'launch'); cy.get(`${lastBreadcrumb} > .q-icon`).should('have.text', 'launch');
}); });