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.

fix: typescript errors for deep properties & AppDrop types

Smaug6739918b897e6e94
diff --git a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
index dc97639e..2dc70e63 100644
--- a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
+++ b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
@@ -2,7 +2,7 @@
<div class="container">
<EditorAppHeader icon="image" :title="t('markdown.image.title')" :subtitle="t('markdown.image.subtitle')" />
<div class="content">
- <AppDrop ref="dropComponent" @select="submitFile as (file: File) => void" />
+ <AppDrop ref="dropComponent" @select="submitFile" />
<Loader v-if="isLoading" style="margin: 12px auto" />
<p v-if="uploadError" class="error">{{ uploadError }}</p>
<div class="search-bar">
@@ -50,12 +50,12 @@ const filteredImages = computed(() => {
return nodesStore.resources.filter(img => isImageFile(img.metadata?.filetype as string) && img.name.toLowerCase().includes(searchQuery.value.toLowerCase()));
});
-const submitFile = (selectedFile: File) => {
+const submitFile = (selectedFile: File | File[] | null) => {
if (!selectedFile) return;
isLoading.value = true;
const body = new FormData();
body.append('parent_id', props.nodeId || '');
- body.append('file', selectedFile);
+ body.append('file', Array.isArray(selectedFile) ? selectedFile[0]! : selectedFile);
dropComponent.value.reset(); // Reset drop component
resourcesStore
.post(body)
diff --git a/frontend/app/pages/(public)/_components/SelfHostSteps.vue b/frontend/app/pages/(public)/_components/SelfHostSteps.vue
index 23da4a28..38240d59 100644
--- a/frontend/app/pages/(public)/_components/SelfHostSteps.vue
+++ b/frontend/app/pages/(public)/_components/SelfHostSteps.vue
@@ -43,16 +43,16 @@
<span class="command">docker compose up -d</span>
</div>
<div class="terminal-line output">
- <span>{{ tm('landing.selfHost.terminal.lines.0') }}</span>
+ <span>{{ terminalLines[0] }}</span>
</div>
<div class="terminal-line output success">
- <span>{{ tm('landing.selfHost.terminal.lines.1') }}</span>
+ <span>{{ terminalLines[1] }}</span>
</div>
<div class="terminal-line output success">
- <span>{{ tm('landing.selfHost.terminal.lines.2') }}</span>
+ <span>{{ terminalLines[2] }}</span>
</div>
<div class="terminal-line output success">
- <span>{{ tm('landing.selfHost.terminal.lines.3') }}</span>
+ <span>{{ terminalLines[3] }}</span>
</div>
<div class="terminal-line">
<span class="prompt">$</span>
@@ -66,19 +66,19 @@
<div class="notes">
<span class="pill">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 16.2l-3.5-3.5-1.4 1.4L9 19 20 8l-1.4-1.4z" /></svg>
- {{ tm('landing.selfHost.notes.0') }}
+ {{ notes[0] }}
</span>
<span class="pill">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 16.2l-3.5-3.5-1.4 1.4L9 19 20 8l-1.4-1.4z" /></svg>
- {{ tm('landing.selfHost.notes.1') }}
+ {{ notes[1] }}
</span>
<span class="pill">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 16.2l-3.5-3.5-1.4 1.4L9 19 20 8l-1.4-1.4z" /></svg>
- {{ tm('landing.selfHost.notes.2') }}
+ {{ notes[2] }}
</span>
<span class="pill">
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 16.2l-3.5-3.5-1.4 1.4L9 19 20 8l-1.4-1.4z" /></svg>
- {{ tm('landing.selfHost.notes.3') }}
+ {{ notes[3] }}
</span>
</div>
</section>
@@ -93,6 +93,16 @@ const steps = computed(() => {
return tm('landing.selfHost.steps') as Array<{ title: string; description: string; code?: string }>;
});
+const terminalLines = computed(() => {
+ void locale.value;
+ return tm('landing.selfHost.terminal.lines') as string[];
+});
+
+const notes = computed(() => {
+ void locale.value;
+ return tm('landing.selfHost.notes') as string[];
+});
+
const copiedIndex = ref<number | null>(null);
function copyCode(code: string, index: number) {
diff --git a/frontend/app/pages/(public)/login/request-reset.vue b/frontend/app/pages/(public)/login/request-reset.vue
index e196f2ba..4c223e0a 100644
--- a/frontend/app/pages/(public)/login/request-reset.vue
+++ b/frontend/app/pages/(public)/login/request-reset.vue
@@ -39,7 +39,7 @@ async function reset() {
else errors.value.username = '';
userStore
.requestReset(username.value)
- .then(() => router.push(localeRoute('/login/done')))
+ .then(() => router.push(localeRoute('/login/done')!))
.catch(err => (errors.value.general = err || 'An error occurred while requesting reset'));
}
</script>
diff --git a/frontend/app/pages/dashboard/import/backup.vue b/frontend/app/pages/dashboard/import/backup.vue
index 31044489..f7ec07b6 100644
--- a/frontend/app/pages/dashboard/import/backup.vue
+++ b/frontend/app/pages/dashboard/import/backup.vue
@@ -8,7 +8,7 @@
<NuxtLink to="/dashboard/settings?p=backup" style="color: var(--primary)">{{ t('import.meta.settingsLink') }}</NuxtLink
>.
</p>
- <AppDrop ref="dropComponent" @select="handleFileSelect as (file: File) => void" />
+ <AppDrop ref="dropComponent" @select="handleFileSelect" />
<div class="submit">
<AppButton type="primary" :disabled="!selectedFile || isAnalyzing" @click="analyzeFile">
{{ isAnalyzing ? t('import.steps.select.analyzing') : t('import.steps.select.startImport') }}
@@ -91,8 +91,9 @@ const unchangedCount = computed(() => {
});
// Methods
-const handleFileSelect = (file?: File) => {
- selectedFile.value = file;
+const handleFileSelect = (file?: File | File[] | null) => {
+ if (!file) return;
+ selectedFile.value = Array.isArray(file) ? file[0] : file;
analyzeError.value = '';
};