π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
feat: rls indicator
mertmitee91cb0f2d6c
diff --git a/packages/nc-gui/components/dashboard/TreeView/Table/Node.vue b/packages/nc-gui/components/dashboard/TreeView/Table/Node.vueindex 53f6a66bce..0499f850be 100644--- a/packages/nc-gui/components/dashboard/TreeView/Table/Node.vue+++ b/packages/nc-gui/components/dashboard/TreeView/Table/Node.vue@@ -496,11 +496,6 @@ const enabledOptions = computed(() => {</span></NcTooltip><div v-if="!isEditing" class="flex items-center">- <NcTooltip v-if="table.meta?.is_rls_enabled" placement="bottom">- <template #title> Row-level security is enabled. Some rows may be hidden based on your access permissions. </template>- <GeneralIcon icon="ncShield" class="!w-3.5 !h-3.5 flex-none text-nc-content-gray-subtle2" />- </NcTooltip>-<NcTooltip v-if="table.description?.length" placement="bottom"><template #title><div class="whitespace-pre-wrap break-words">{{ table.description }}</div>diff --git a/packages/nc-gui/components/smartsheet/grid/PaginationV2.vue b/packages/nc-gui/components/smartsheet/grid/PaginationV2.vueindex 89ed987b21..70b8d357a4 100644--- a/packages/nc-gui/components/smartsheet/grid/PaginationV2.vue+++ b/packages/nc-gui/components/smartsheet/grid/PaginationV2.vue@@ -36,6 +36,8 @@ const { isMysql, isPg } = baseStoreconst { meta, isViewOperationsAllowed } = useSmartsheetStoreOrThrow()+const isRlsEnabled = computed(() => parseProp(meta.value?.meta)?.is_rls_enabled === true)+const { updateAggregate, getAggregations, visibleFieldsComputed, displayFieldComputed } = useViewAggregateOrThrow()const scrollLeft = toRef(props, 'scrollLeft')@@ -165,13 +167,21 @@ const getCountWithLabel = (defaultCount: number) => {</div><NcTooltip v-else class="flex sticky items-center h-full"><template #title> {{ getCountWithLabel(count).count }} {{ getCountWithLabel(count).label }} </template>- <span- data-testid="grid-pagination"- class="text-nc-content-gray-muted text-ellipsis overflow-hidden pl-1 truncate nc-grid-row-count caption text-xs text-nowrap"- >- {{ Intl.NumberFormat('en', { notation: 'compact' }).format(getCountWithLabel(count).count) }}- {{ getCountWithLabel(count).label }}- </span>+ <div class="flex items-center gap-1">+ <span+ data-testid="grid-pagination"+ class="text-nc-content-gray-muted text-ellipsis overflow-hidden pl-1 truncate nc-grid-row-count caption text-xs text-nowrap"+ >+ {{ Intl.NumberFormat('en', { notation: 'compact' }).format(getCountWithLabel(count).count) }}+ {{ getCountWithLabel(count).label }}+ </span>+ <NcTooltip v-if="isRlsEnabled">+ <template #title>+ Row-level security is enabled. Some rows may be hidden based on your access permissions.+ </template>+ <GeneralIcon icon="ncShield" class="!w-3.5 !h-3.5 text-nc-content-gray-muted" />+ </NcTooltip>+ </div></NcTooltip></template>@@ -180,13 +190,21 @@ const getCountWithLabel = (defaultCount: number) => {<template #title>{{ getCountWithLabel(totalRows ?? 0).count }} {{ getCountWithLabel(totalRows ?? 0).label }}</template>- <span- data-testid="grid-pagination"- class="text-nc-content-gray-muted text-ellipsis overflow-hidden pl-1 truncate nc-grid-row-count caption text-xs text-nowrap"- >- {{ Intl.NumberFormat('en', { notation: 'compact' }).format(getCountWithLabel(totalRows ?? 0).count) }}- {{ getCountWithLabel(totalRows ?? 0).label }}- </span>+ <div class="flex items-center gap-1">+ <span+ data-testid="grid-pagination"+ class="text-nc-content-gray-muted text-ellipsis overflow-hidden pl-1 truncate nc-grid-row-count caption text-xs text-nowrap"+ >+ {{ Intl.NumberFormat('en', { notation: 'compact' }).format(getCountWithLabel(totalRows ?? 0).count) }}+ {{ getCountWithLabel(totalRows ?? 0).label }}+ </span>+ <NcTooltip v-if="isRlsEnabled">+ <template #title>+ Row-level security is enabled. Some rows may be hidden based on your access permissions.+ </template>+ <GeneralIcon icon="ncShield" class="!w-3.5 !h-3.5 text-nc-content-gray-muted" />+ </NcTooltip>+ </div></NcTooltip></template>diff --git a/packages/nc-gui/components/smartsheet/grid/canvas/composables/useCanvasRender.ts b/packages/nc-gui/components/smartsheet/grid/canvas/composables/useCanvasRender.tsindex 0760e1469d..6dccf746d6 100644--- a/packages/nc-gui/components/smartsheet/grid/canvas/composables/useCanvasRender.ts+++ b/packages/nc-gui/components/smartsheet/grid/canvas/composables/useCanvasRender.ts@@ -2278,7 +2278,7 @@ export function useCanvasRender({? t('objects.records'): t('objects.record')- renderSingleLineText(ctx, {+ const recordCountResult = renderSingleLineText(ctx, {text: `${Intl.NumberFormat('en', { notation: 'compact' }).format(count)} ${label}`,x: xOffset + 8,y: height.value - AGGREGATION_HEIGHT + 2,@@ -2288,6 +2288,22 @@ export function useCanvasRender({maxWidth: availWidth - 16,fontFamily: '500 12px Inter',})++ const isRlsEnabled = parseProp(meta.value?.meta)?.is_rls_enabled === true++ if (isRlsEnabled) {+ const shieldX = xOffset + 8 + recordCountResult.width + 6+ const shieldY = height.value - AGGREGATION_HEIGHT + (AGGREGATION_HEIGHT - 14) / 2++ spriteLoader.renderIcon(ctx, {+ icon: 'ncShield' as IconMapKey,+ size: 14,+ color: getColor(themeV4Colors.gray['400']),+ x: shieldX,+ y: shieldY,+ })+ }+// Not exactly sure, but height.value becomes zero, randomly when scrollif (height.value) {tryShowTooltip({@@ -2296,10 +2312,23 @@ export function useCanvasRender({rect: {x: xOffset,y: height.value - AGGREGATION_HEIGHT,- width: availWidth - 16,+ width: recordCountResult.width + 16,height: AGGREGATION_HEIGHT,},})++ if (isRlsEnabled) {+ tryShowTooltip({+ mousePosition,+ text: 'Row-level security is enabled. Some rows may be hidden based on your access permissions.',+ rect: {+ x: xOffset + 8 + recordCountResult.width + 6,+ y: height.value - AGGREGATION_HEIGHT,+ width: 20,+ height: AGGREGATION_HEIGHT,+ },+ })+ }}ctx.strokeStyle = getColor(themeV4Colors.gray['200'])