π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
New default value on document creation
Smaug67393ed976f9a8fc
diff --git a/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue b/frontend/components/MarkdownEditor/LazyMarkdownEditor.vueindex c2882b8d..6a080729 100644--- a/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue+++ b/frontend/components/MarkdownEditor/LazyMarkdownEditor.vue@@ -18,7 +18,7 @@ import compile from '~/helpers/markdown';import InlineToolbar from '~/components/MarkdownEditor/InlineToolbar.vue';import type { Document } from '~/stores';-const props = defineProps<{ doc?: Document }>();+const props = defineProps<{ doc?: Partial<Document> }>();const document = ref<Document | Partial<Document>>({ ...props.doc });const toolbar = ref<{ element: HTMLDivElement }>();const container = ref<HTMLDivElement>();diff --git a/frontend/pages/dashboard/docs/new.vue b/frontend/pages/dashboard/docs/new.vueindex bd677605..c591db81 100644--- a/frontend/pages/dashboard/docs/new.vue+++ b/frontend/pages/dashboard/docs/new.vue@@ -2,12 +2,14 @@<MarkdownEditor ref="editor" :doc="document" @save="data => save(data)" /></template><script lang="ts" setup>-import type { Document } from '@/stores';import MarkdownEditor from '~/components/MarkdownEditor/LazyMarkdownEditor.vue';+import type { Document } from '@/stores';const store = useDocumentsStore();const editor = ref();-const document = ref<Document | undefined>();+const document = ref<Partial<Document>>({+ accessibility: 1,+});const notifications = useNotifications();definePageMeta({ breadcrumb: 'New' });diff --git a/frontend/stores/db_strustures.d.ts b/frontend/stores/db_strustures.d.tsindex dae4fed8..bae4929c 100644--- a/frontend/stores/db_strustures.d.ts+++ b/frontend/stores/db_strustures.d.ts@@ -5,7 +5,7 @@ export interface DB_Document {tags?: string;category?: string;parent_id?: string | null;- accessibility: number; // 0: No; 1: Yes;+ accessibility: number; // 1 Visible; 2 Draft; 3 Archived;content_markdown?: string;content_html?: string;author_id: string;