π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix(nc-gui): show ws settings in mobile mode
Ramesh Mane3371ed074db8
diff --git a/packages/nc-gui/assets/style.scss b/packages/nc-gui/assets/style.scssindex 99bc15dbab..090ffbeb24 100644--- a/packages/nc-gui/assets/style.scss+++ b/packages/nc-gui/assets/style.scss@@ -1406,7 +1406,7 @@ svg.nc-virtual-cell-icon {}.nc-settings-item-card-wrapper {- @apply max-w-[600px] min-w-100 w-full flex flex-col gap-4;+ @apply max-w-[600px] md:(min-w-100) w-full flex flex-col gap-4;.nc-settings-item-heading {@apply text-bodyLgBold font-700;diff --git a/packages/nc-gui/components/dashboard/MiniSidebar.vue b/packages/nc-gui/components/dashboard/MiniSidebar.vueindex 9983f89d15..04fed87926 100644--- a/packages/nc-gui/components/dashboard/MiniSidebar.vue+++ b/packages/nc-gui/components/dashboard/MiniSidebar.vue@@ -189,12 +189,12 @@ useEventListener(document, 'keydown', async (e: KeyboardEvent) => {</div></NcTooltip></DashboardMiniSidebarItemWrapper>- <div v-if="isUIAllowed('workspaceSettings') || isUIAllowed('workspaceCollaborators')" class="px-2 my-2 w-full">+ <div v-if="(!isMobileMode || isEeUI) && (isUIAllowed('workspaceSettings') || isUIAllowed('workspaceCollaborators'))" class="px-2 my-2 w-full"><NcDivider class="!my-0 !border-nc-border-gray-dark" /></div><DashboardMiniSidebarItemWrapperv-if="isUIAllowed('workspaceSettings') || isUIAllowed('workspaceCollaborators')"- show-in-mobile+ :show-in-mobile="isEeUI"><NcTooltip:title="isEeUI ? `${$t('objects.workspace')} ${$t('labels.settings')}` : $t('title.teamAndSettings')"diff --git a/packages/nc-gui/components/general/HideLeftSidebarBtn.vue b/packages/nc-gui/components/general/HideLeftSidebarBtn.vuenew file mode 100644index 0000000000..cc0f9f563a--- /dev/null+++ b/packages/nc-gui/components/general/HideLeftSidebarBtn.vue@@ -0,0 +1,49 @@+<script lang="ts" setup>+const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())++const { isMobileMode } = useGlobal()++const route = useRoute()++const onClick = () => {+ if (!isLeftSidebarOpen.value) return++ isLeftSidebarOpen.value = !isLeftSidebarOpen.value+}+</script>++<template>+ <div v-if="isMobileMode || isLeftSidebarOpen" v-e="['c:leftSidebar:hideToggle']">+ <NcTooltip+ placement="topLeft"+ hide-on-click+ class="transition-all duration-150"+ :class="{+ 'opacity-0 w-0 pointer-events-none': !isMobileMode && !isLeftSidebarOpen,+ 'opacity-100 max-w-10': isMobileMode || isLeftSidebarOpen,+ }"+ >+ <template #title>+ {{ isLeftSidebarOpen ? `${$t('title.hideSidebar')}` : `${$t('title.showSidebar')}` }}+ </template>+ <NcButton+ :type="isMobileMode ? 'secondary' : 'text'"+ :size="isMobileMode ? 'medium' : 'small'"+ class="nc-sidebar-left-toggle-icon !text-nc-content-gray-subtle2 !hover:text-nc-content-gray w-8"+ @click="onClick"+ >+ <div class="flex items-center text-inherit">+ <GeneralIcon v-if="isMobileMode" icon="close" />+ <GeneralIcon+ v-else+ icon="doubleLeftArrow"+ class="duration-150 transition-all !text-lg -mt-0.5 !text-nc-content-gray-muted bg-opacity-50"+ :class="{+ 'transform rotate-180': !isLeftSidebarOpen,+ }"+ />+ </div>+ </NcButton>+ </NcTooltip>+ </div>+</template>diff --git a/packages/nc-gui/components/workspace/CollaboratorsList.vue b/packages/nc-gui/components/workspace/CollaboratorsList.vueindex 923e855548..0a33ab10de 100644--- a/packages/nc-gui/components/workspace/CollaboratorsList.vue+++ b/packages/nc-gui/components/workspace/CollaboratorsList.vue@@ -264,8 +264,8 @@ const removeCollaborator = (userId: string, workspaceId: string) => {<divclass="nc-collaborator-table-container overflow-auto nc-scrollbar-thin relative":class="{- 'h-[calc(100vh-144px)]': !height && isAdminPanel,- 'h-[calc(100vh-92px)]': !height && !isAdminPanel,+ 'nc-is-admin-panel': !height && isAdminPanel,+ 'nc-is-ws-members-list': !height && !isAdminPanel,}":style="`${height ? `height: ${height}` : ''}`"@scroll.passive="handleScroll"@@ -274,7 +274,7 @@ const removeCollaborator = (userId: string, workspaceId: string) => {<PaymentBanner /></div>- <div class="nc-collaborator-table-wrapper h-full max-w-[1200px] mx-auto py-6 px-6 flex flex-col gap-6 sticky top-0">+ <div class="nc-collaborator-table-wrapper h-full max-w-[1200px] mx-auto py-6 px-4 md:px-6 flex flex-col gap-6 sticky top-0"><div class="w-full flex items-center justify-between gap-3"><a-inputv-model:value="userSearchText"@@ -517,4 +517,22 @@ const removeCollaborator = (userId: string, workspaceId: string) => {.badge-text {@apply text-[14px] pt-1 text-center;}++.nc-collaborator-table-container {+ &.nc-is-admin-panel {+ @apply h-[calc(100vh-144px)];++ @supports (height: 100dvh) {+ @apply h-[calc(100dvh-144px)];+ }+ }++ &.nc-is-ws-members-list {+ @apply h-[calc(100vh-var(--topbar-height)-44px)];++ @supports (height: 100dvh) {+ @apply h-[calc(100dvh-var(--topbar-height)-44px)];+ }+ }+}</style>diff --git a/packages/nc-gui/components/workspace/View.vue b/packages/nc-gui/components/workspace/View.vueindex 532644a17a..61c030f813 100644--- a/packages/nc-gui/components/workspace/View.vue+++ b/packages/nc-gui/components/workspace/View.vue@@ -11,16 +11,16 @@ const route = router.currentRouteconst { t } = useI18n()-const { hideSidebar } = storeToRefs(useSidebarStore())+const { hideSidebar, isLeftSidebarOpen } = storeToRefs(useSidebarStore())-const { isUIAllowed, isBaseRolesLoaded } = useRoles()+const { isUIAllowed, isBaseRolesLoaded, loadRoles } = useRoles()++const { appInfo, isMobileMode } = useGlobal()const workspaceStore = useWorkspace()-const { loadRoles } = useRoles()const { activeWorkspace: _activeWorkspace, workspaces, deletingWorkspace } = storeToRefs(workspaceStore)const { loadCollaborators, loadWorkspace } = workspaceStore-const { appInfo } = useGlobal()const orgStore = useOrg()const { orgId, org } = storeToRefs(orgStore)@@ -128,16 +128,24 @@ onBeforeUnmount(() => {v-if="!props.workspaceId"class="min-w-0 p-2 h-[var(--topbar-height)] border-b-1 border-nc-border-gray-medium flex items-center gap-2">- <div class="flex-1 nc-breadcrumb nc-no-negative-margin pl-1 nc-workspace-title">- <div class="nc-breadcrumb-item capitalize">+ <GeneralOpenLeftSidebarBtn v-if="isMobileMode && !isLeftSidebarOpen" />+ <div+ class="flex-1 nc-breadcrumb nc-no-negative-margin pl-1 nc-workspace-title"+ :class="{+ 'max-w-[calc(100%_-_52px)]': isMobileMode,+ }"+ >+ <div class="nc-breadcrumb-item capitalize truncate">{{ currentWorkspace?.title }}</div><GeneralIcon icon="ncSlash1" class="nc-breadcrumb-divider" />- <h1 class="nc-breadcrumb-item active">+ <h1 class="nc-breadcrumb-item active truncate">{{ $t('title.teamAndSettings') }}</h1></div>++ <GeneralHideLeftSidebarBtn v-if="isMobileMode && isLeftSidebarOpen" /></div><template v-else><div class="nc-breadcrumb px-2">diff --git a/packages/nc-gui/store/sidebar.ts b/packages/nc-gui/store/sidebar.tsindex e4d907519c..567d59d1ad 100644--- a/packages/nc-gui/store/sidebar.ts+++ b/packages/nc-gui/store/sidebar.ts@@ -2,10 +2,14 @@ import { acceptHMRUpdate, defineStore } from 'pinia'import { INITIAL_LEFT_SIDEBAR_WIDTH, MAX_WIDTH_FOR_MOBILE_MODE } from '~/lib/constants'export const useSidebarStore = defineStore('sidebarStore', () => {+ const route = useRoute()+const { width } = useWindowSize()+const isViewPortMobile = () => {return width.value < MAX_WIDTH_FOR_MOBILE_MODE}+const { isMobileMode, leftSidebarSize: _leftSidebarSize, isLeftSidebarOpen: _isLeftSidebarOpen } = useGlobal()const miniSidebarWidth = computed(() => {@@ -17,6 +21,10 @@ export const useSidebarStore = defineStore('sidebarStore', () => {const tablesStore = useTablesStore()const isLeftSidebarOpen = computed({get() {+ if (isMobileMode.value && route.name === 'index-typeOrId-settings') {+ return _isLeftSidebarOpen.value+ }+return (isMobileMode.value && !tablesStore.activeTableId) || _isLeftSidebarOpen.value},set(value) {