From 24efc38c7aa8bcf68944b321ef64d829f3c2f815 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Tue, 10 Oct 2023 13:29:49 +0000 Subject: [PATCH 1/8] fix(nc-gui): Fixed table pagination timing coming up on group by --- packages/nc-gui/components/smartsheet/grid/GroupBy.vue | 2 ++ packages/nc-gui/components/smartsheet/grid/Table.vue | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/smartsheet/grid/GroupBy.vue b/packages/nc-gui/components/smartsheet/grid/GroupBy.vue index ad003337c2..67919f0934 100644 --- a/packages/nc-gui/components/smartsheet/grid/GroupBy.vue +++ b/packages/nc-gui/components/smartsheet/grid/GroupBy.vue @@ -297,6 +297,7 @@ const onScroll = (e: Event) => { v-model:pagination-data="vGroup.paginationData" align-count-on-right custom-label="groups" + show-api-timing :change-page="(p: number) => groupWrapperChangePage(p, vGroup)" :style="`${props.depth && props.depth > 0 ? 'border-radius: 0 0 12px 12px !important;' : ''}`" > @@ -305,6 +306,7 @@ const onScroll = (e: Event) => { v-model:pagination-data="vGroup.paginationData" align-count-on-right custom-label="groups" + show-api-timing :change-page="(p: number) => groupWrapperChangePage(p, vGroup)" :hide-sidebars="true" :style="`${props.depth && props.depth > 0 ? 'border-radius: 0 0 12px 12px !important;' : ''}margin-left: ${scrollBump}px;`" diff --git a/packages/nc-gui/components/smartsheet/grid/Table.vue b/packages/nc-gui/components/smartsheet/grid/Table.vue index bdcfeb039e..0c010a3629 100644 --- a/packages/nc-gui/components/smartsheet/grid/Table.vue +++ b/packages/nc-gui/components/smartsheet/grid/Table.vue @@ -1682,7 +1682,7 @@ const loaderText = computed(() => { v-if="headerOnly !== true" :key="isMobileMode" v-model:pagination-data="paginationDataRef" - show-api-timing + :show-api-timing="!isGroupBy" align-count-on-right :change-page="changePage" :hide-sidebars="paginationStyleRef?.hideSidebars === true" From 48ee51614bf1400e6bd833e7278c1c0ddbfd488c Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Tue, 10 Oct 2023 13:29:49 +0000 Subject: [PATCH 2/8] fix(nc-gui): Fixed details open for editor role --- packages/nc-gui/components/smartsheet/Details.vue | 2 +- .../components/smartsheet/topbar/SelectMode.vue | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Details.vue b/packages/nc-gui/components/smartsheet/Details.vue index 5c5915a452..32484a243f 100644 --- a/packages/nc-gui/components/smartsheet/Details.vue +++ b/packages/nc-gui/components/smartsheet/Details.vue @@ -33,7 +33,7 @@ const openedSubTab = computed({ watch(openedSubTab, () => { // TODO: Find a good way to know when the roles are populated and check // Re-enable this check for first render - if (openedSubTab.value === 'field' && !isUIAllowed('hookList')) { + if (openedSubTab.value === 'field' && !isUIAllowed('fieldAdd')) { onViewsTabChange('relation') } if (openedSubTab.value === 'webhook' && !isUIAllowed('hookList')) { diff --git a/packages/nc-gui/components/smartsheet/topbar/SelectMode.vue b/packages/nc-gui/components/smartsheet/topbar/SelectMode.vue index cf224665e7..600629f433 100644 --- a/packages/nc-gui/components/smartsheet/topbar/SelectMode.vue +++ b/packages/nc-gui/components/smartsheet/topbar/SelectMode.vue @@ -3,7 +3,17 @@ import { storeToRefs, useViewsStore } from '#imports' const { openedViewsTab, activeView } = storeToRefs(useViewsStore()) +const { isUIAllowed } = useRoles() + const { onViewsTabChange } = useViewsStore() + +const onClickDetails = () => { + if (isUIAllowed('fieldAdd')) { + onViewsTabChange('field') + } else { + onViewsTabChange('relation') + } +}