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.

Some bugs fixes and types check

Smaug673900a891d6e623
diff --git a/frontend/components/AppSelect.vue b/frontend/components/AppSelect.vue
index 0e449fb8..a8e22cfa 100644
--- a/frontend/components/AppSelect.vue
+++ b/frontend/components/AppSelect.vue
@@ -1,6 +1,6 @@
<template>
<div class="category-select" :style="{ width: size || '100%' }">
- <button @click="toggleDropdown">{{ selected?.title || placeholder }}</button>
+ <button @click="toggleDropdown">{{ selected?.label || placeholder }}</button>
<div v-if="open" class="dropdown">
<ul>
<AppSelectNode v-for="item in items" :key="item.id" :node="item" :level="0" @select="handleSelect" />
diff --git a/frontend/components/AppSelectNode.vue b/frontend/components/AppSelectNode.vue
index 5382d526..eeec857f 100644
--- a/frontend/components/AppSelectNode.vue
+++ b/frontend/components/AppSelectNode.vue
@@ -1,7 +1,7 @@
<template>
<li>
<button class="tree-node" :style="{ paddingLeft: `${level * 20 + 12}px`, fontWeight: node.childrens?.length ? 700 : 400 }" @click.stop="select">
- {{ node.title }}
+ {{ node.label }}
</button>
<ul v-if="node.childrens?.length">
<AppSelectNode v-for="child in node.childrens" :key="child.id" :node="child" :level="level + 1" @select="$emit('select', $event)" />
diff --git a/frontend/components/MarkdownEditor/Toolbar.vue b/frontend/components/MarkdownEditor/Toolbar.vue
index c367fa2f..9acd06bf 100644
--- a/frontend/components/MarkdownEditor/Toolbar.vue
+++ b/frontend/components/MarkdownEditor/Toolbar.vue
@@ -17,17 +17,17 @@ const emitAction = (action: string) => emit('execute-action', action, props.docu
const accessibilities: ANode[] = [
{
id: 1,
- title: 'Visible',
+ label: 'Visible',
parent_id: '',
},
{
id: 2,
- title: 'Draft',
+ label: 'Draft',
parent_id: '',
},
{
id: 3,
- title: 'Archive',
+ label: 'Archive',
parent_id: '',
},
];
diff --git a/frontend/components/Sidebar/Sidebar.vue b/frontend/components/Sidebar/Sidebar.vue
index 6db5aa15..18dbe632 100644
--- a/frontend/components/Sidebar/Sidebar.vue
+++ b/frontend/components/Sidebar/Sidebar.vue
@@ -56,7 +56,7 @@ const navigationItemsComputed = computed<Item[]>(() =>
navigationItems.map(item => ({
id: item.id,
parent_id: '',
- label: item.title,
+ label: item.label,
route: item.route,
icon: item.icon,
type: 'navigation',
diff --git a/frontend/components/Sidebar/helpers.ts b/frontend/components/Sidebar/helpers.ts
index 3bb9fa01..3104e113 100644
--- a/frontend/components/Sidebar/helpers.ts
+++ b/frontend/components/Sidebar/helpers.ts
@@ -1,7 +1,7 @@
export interface DefaultItem {
id: string;
type: 'default';
- title: string;
+ label: string;
icon?: string;
route: string;
childrens: DefaultItem[];
@@ -15,7 +15,7 @@ export const navigationItems: DefaultItem[] = [
{
id: 'manage-categories',
type: 'default',
- title: 'Manage categories',
+ label: 'Manage categories',
icon: 'categories',
route: '/dashboard/categories',
childrens: [],
@@ -23,7 +23,7 @@ export const navigationItems: DefaultItem[] = [
{
id: 'cdn',
type: 'default',
- title: 'CDN',
+ label: 'CDN',
icon: 'cdn',
route: '/dashboard/cdn',
childrens: [],
@@ -32,7 +32,7 @@ export const navigationItems: DefaultItem[] = [
{
id: 'settings',
type: 'default',
- title: 'Settings',
+ label: 'Settings',
icon: 'user_settings',
route: '/dashboard/settings',
childrens: [],
diff --git a/frontend/pages/dashboard/docs/_components/table-of-content/TableOfContents.vue b/frontend/pages/dashboard/docs/_components/table-of-content/TableOfContents.vue
index c3756456..d506dd73 100644
--- a/frontend/pages/dashboard/docs/_components/table-of-content/TableOfContents.vue
+++ b/frontend/pages/dashboard/docs/_components/table-of-content/TableOfContents.vue
@@ -48,11 +48,11 @@ function buildTree(tree: GroupedHeaders[]): TreeItem[] {
const stack: TreeItem[] = [];
for (const node of tree) {
const item: TreeItem = { title: node.title, link: node.link, level: node.level };
- while (stack.length > 0 && stack[stack.length - 1].level >= node.level) {
+ while (stack.length > 0 && stack[stack.length - 1]!.level >= node.level) {
stack.pop();
}
if (stack.length > 0) {
- if (!stack[stack.length - 1].childrens) stack[stack.length - 1].childrens = [];
+ if (!stack[stack.length - 1]!.childrens) stack[stack.length - 1]!.childrens = [];
// @ts-ignore
stack[stack.length - 1].childrens.push(item);
} else {