diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue index d089717ef..27a7d4b10 100644 --- a/src/components/VnTable/VnFilter.vue +++ b/src/components/VnTable/VnFilter.vue @@ -46,7 +46,6 @@ const enterEvent = { const defaultAttrs = { filled: !$props.showTitle, - // class: 'q-px-xs q-pb-xs q-pt-none fit', dense: true, }; diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index b1f202647..49c3085d1 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -137,6 +137,7 @@ const $props = defineProps({ type: Object, }, }); + const { t } = useI18n(); const stateStore = useStateStore(); const route = useRoute(); @@ -165,6 +166,7 @@ const editingField = ref(null); const isTableMode = computed(() => mode.value == TABLE_MODE); const showRightIcon = computed(() => $props.rightSearch || $props.rightSearchIcon); const selectRegex = /select/; +const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']); const tableModes = [ { icon: 'view_column', @@ -184,6 +186,7 @@ onBeforeMount(() => { const urlParams = route.query[$props.searchUrl]; hasParams.value = urlParams && Object.keys(urlParams).length !== 0; }); + onMounted(async () => { if ($props.isEditable) document.addEventListener('click', clickHandler); mode.value = @@ -206,6 +209,7 @@ onMounted(async () => { }; } }); + onUnmounted(async () => { if ($props.isEditable) document.removeEventListener('click', clickHandler); }); @@ -216,6 +220,16 @@ watch( { immediate: true }, ); +defineExpose({ + create: createForm, + reload, + redirect: redirectFn, + selected, + CrudModelRef, + params, + tableRef, +}); + function splitColumns(columns) { splittedColumns.value = { columns: [], @@ -281,17 +295,6 @@ function columnName(col) { return name; } -const emit = defineEmits(['onFetch', 'update:selected', 'saveChanges']); -defineExpose({ - create: createForm, - reload, - redirect: redirectFn, - selected, - CrudModelRef, - params, - tableRef, -}); - function handleOnDataSaved(_) { if (_.onDataSaved) _.onDataSaved({ CrudModelRef: CrudModelRef.value }); else $props.create.onDataSaved(_); @@ -512,6 +515,7 @@ function getCheckboxIcon(value) { return 'indeterminate_check_box'; } } + function getToggleIcon(value) { if (value === null) return 'help_outline'; return value ? 'toggle_on' : 'toggle_off'; @@ -679,7 +683,8 @@ const checkbox = ref(null); }" :class="[ col.columnClass, - 'body-cell no-margin no-padding text-center', + 'body-cell no-margin no-padding', + getColAlign(col), ]" :data-row-index="rowIndex" :data-col-field="col?.name" diff --git a/src/composables/getColAlign.js b/src/composables/getColAlign.js index 57ba7cfaf..c0338a984 100644 --- a/src/composables/getColAlign.js +++ b/src/composables/getColAlign.js @@ -1,7 +1,9 @@ export function getColAlign(col) { let align; - switch (col.component) { + case 'select': + align = 'left'; + break; case 'number': align = 'right'; break; diff --git a/src/pages/Entry/Card/EntryBuys.vue b/src/pages/Entry/Card/EntryBuys.vue index 3a902907b..4bc18a4cb 100644 --- a/src/pages/Entry/Card/EntryBuys.vue +++ b/src/pages/Entry/Card/EntryBuys.vue @@ -640,6 +640,7 @@ onMounted(() => { :table-height="$props.tableHeight ?? '84vh'" auto-load footer + data-cy="entry-buys" > @@ -293,4 +287,7 @@ es: Failed to recalculate rates: No se pudieron recalcular las tarifas Failed to clone entry: No se pudo clonar la entrada Failed to delete entry: No se pudo eliminar la entrada + Recalculate rates: Recalcular tarifas + Clone: Clonar + Delete: Eliminar diff --git a/src/pages/Entry/Card/EntrySummary.vue b/src/pages/Entry/Card/EntrySummary.vue index 6b7477cfc..c40e2ba46 100644 --- a/src/pages/Entry/Card/EntrySummary.vue +++ b/src/pages/Entry/Card/EntrySummary.vue @@ -51,6 +51,7 @@ onMounted(async () => { :url="`Entries/${entityId}/getEntry`" @on-fetch="(data) => setEntryData(data)" data-key="EntrySummary" + data-cy="entry-summary" >