Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Open new modal settings

Smaug67391f9213d5f71f
diff --git a/frontend/app/components/Sidebar/SidebarItem.vue b/frontend/app/components/Sidebar/SidebarItem.vue
index f4daacc0..8b587c4b 100644
--- a/frontend/app/components/Sidebar/SidebarItem.vue
+++ b/frontend/app/components/Sidebar/SidebarItem.vue
@@ -11,7 +11,8 @@
>
<Icon :name="icon" :class="customClass" />&nbsp;
- <NuxtLink :to="item.route" style="flex: 1" class="close">{{ item.label }}</NuxtLink>
+ <NuxtLink v-if="item.onClick" style="flex: 1" class="close" @click="item.onClick">{{ item.label }}</NuxtLink>
+ <NuxtLink v-else :to="item.route" style="flex: 1" class="close">{{ item.label }}</NuxtLink>
<Icon v-if="item.data.shared && !item.parent_id" name="users" fill="var(--font-color)" />
@@ -27,11 +28,14 @@
</template>
<script setup lang="ts">
-import type { Node } from '~/stores';
import { navigationItems, type DefaultItem } from './helpers';
+import type { Node } from '~/stores';
+
const nodesStore = useNodesStore();
const { isOpened } = useSidebar();
const props = defineProps<{ item: Item | DefaultItem }>();
+const isDragOver = ref<boolean>(false);
+
const customClass = computed(() => {
if ('color' in props.item.data && props.item.data.color != null && props.item.data.color != -1)
return `item-icon ${getAppColor(props.item.data.color as number)}`;
@@ -42,12 +46,10 @@ const icon = computed(() => {
return props.item.icon || '';
});
-const isDragOver = ref<boolean>(false);
-
const onClick = (m: MouseEvent) => {
// if element does not have the "close" class, don't close the sidebar
if (!(m.target as HTMLElement).closest('.close')) return;
- if (isMobile() && props.item.route) isOpened.value = false;
+ if (isMobile() && (props.item.route || props.item.onClick)) isOpened.value = false;
};
const dragStart = (event: DragEvent) => {
diff --git a/frontend/app/components/Sidebar/helpers.ts b/frontend/app/components/Sidebar/helpers.ts
index 672ab4e6..6a88d326 100644
--- a/frontend/app/components/Sidebar/helpers.ts
+++ b/frontend/app/components/Sidebar/helpers.ts
@@ -1,6 +1,7 @@
-import type { Node } from '~/stores';
+import SettingsModal from '@/pages/dashboard/settings/modal.vue';
+import type { Node } from '@/stores';
-export type DefaultItem = Item<Omit<Node, 'user_id' | 'data' | 'show' | 'created_timestamp' | 'updated_timestamp'>>;
+export type DefaultItem = Item<Omit<Node, 'user_id' | 'data' | 'show' | 'access' | 'created_timestamp' | 'updated_timestamp'>>;
export interface Workspace {
text: string;
value?: string;
@@ -60,8 +61,12 @@ export const navigationItems: DefaultItem[] = [
id: 'settings',
parent_id: '',
label: 'Settings',
- route: '/dashboard/settings',
+ route: '',
icon: 'user_settings',
+ onClick: () => {
+ if (isMobile()) useRouter().push('/dashboard/settings');
+ else useModal().add(new Modal(shallowRef(SettingsModal), { props: {}, size: 'large', noPadding: true }));
+ },
data: {
id: 'settings',
role: -1,