chore: hide owned by me for super

This commit is contained in:
mertmit
2026-03-01 05:34:57 +00:00
parent 5afdead5d2
commit e59d8bb94b

View File

@@ -1,4 +1,6 @@
<script lang="ts" setup>
import { OrgUserRoles } from 'nocodb-sdk'
type FilterType = 'all' | 'starred' | 'private' | 'owned' | 'managed'
const props = defineProps<{
@@ -22,9 +24,13 @@ const { t } = useI18n()
const { isMobileMode } = useGlobal()
const { orgRoles } = useRoles()
const isFilterDropdownOpen = ref(false)
const isSearchFocused = ref(false)
const isSuperAdmin = computed(() => !!orgRoles.value?.[OrgUserRoles.SUPER_ADMIN])
// Filter options in priority order: Starred → Private → Managed → Owned
const filterOptions = computed<NcListItemType[]>(() => [
{ value: 'all', label: t('activity.allBases'), icon: 'ncList' },
@@ -35,7 +41,7 @@ const filterOptions = computed<NcListItemType[]>(() => [
{ value: 'managed', label: t('labels.managed'), icon: 'ncBox' },
]
: []),
{ value: 'owned', label: t('activity.ownedByMe'), icon: 'ncUser' },
...(!isSuperAdmin.value ? [{ value: 'owned', label: t('activity.ownedByMe'), icon: 'ncUser' }] : []),
])
const selectedFilter = computed(() => {