π 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
Move constants in helpers (no state required)
Smaug6739e87e2ff2efab
diff --git a/frontend/app/components/AppColorPicker.vue b/frontend/app/components/AppColorPicker.vueindex fd9a2339..d408dbdd 100644--- a/frontend/app/components/AppColorPicker.vue+++ b/frontend/app/components/AppColorPicker.vue@@ -44,6 +44,8 @@</template><script setup lang="ts">+import { appColors } from '~/helpers/constants';+const props = defineProps<{ modelValue?: number; nullable?: boolean }>();const emit = defineEmits<{ (e: 'update:modelValue', color: number): void }>();diff --git a/frontend/app/components/MarkdownEditor/EditorPreferences.vue b/frontend/app/components/MarkdownEditor/EditorPreferences.vueindex e5ded122..5f510405 100644--- a/frontend/app/components/MarkdownEditor/EditorPreferences.vue+++ b/frontend/app/components/MarkdownEditor/EditorPreferences.vue@@ -24,6 +24,8 @@</template><script setup lang="ts">+import { EDITOR_FONTS } from '~/helpers/constants';+const store = usePreferences();</script>diff --git a/frontend/app/components/Node/NodeMetadata.modal.vue b/frontend/app/components/Node/NodeMetadata.modal.vueindex 6e2d7a58..43121acb 100644--- a/frontend/app/components/Node/NodeMetadata.modal.vue+++ b/frontend/app/components/Node/NodeMetadata.modal.vue@@ -42,6 +42,7 @@</template><script setup lang="ts">+import { DOCUMENT_THEMES, CATEGORY_ROLES } from '~/helpers/constants';import type { Node } from '~/stores';const nodeStore = useNodesStore();diff --git a/frontend/app/components/Node/NodePermissions.modal.vue b/frontend/app/components/Node/NodePermissions.modal.vueindex 5103624d..ac09f1d0 100644--- a/frontend/app/components/Node/NodePermissions.modal.vue+++ b/frontend/app/components/Node/NodePermissions.modal.vue@@ -67,6 +67,7 @@</template><script setup lang="ts">+import { DOCUMENT_ACCESSIBILITIES, DOCUMENT_GENERAL_ACCESS, NODE_PERMISSIONS } from '~/helpers/constants';import type { Node, Permission, PublicUser } from '~/stores';const props = defineProps<{ node: Node }>();diff --git a/frontend/app/composables/colors.ts b/frontend/app/composables/colors.tsindex 3516cbdf..32de39df 100644--- a/frontend/app/composables/colors.ts+++ b/frontend/app/composables/colors.ts@@ -1,3 +1,5 @@+import { appColors } from '~/helpers/constants';+/** Get theme color name by index (-2 = primary, -1 = none, 0+ = color index) */export function getAppColor(index: number = 0, defaultPrimary?: boolean): string {if ((defaultPrimary && index < 0) || index == -2) return 'primary';diff --git a/frontend/app/composables/date.ts b/frontend/app/composables/formatters.tssimilarity index 100%rename from frontend/app/composables/date.tsrename to frontend/app/composables/formatters.tsdiff --git a/frontend/app/composables/constants.ts b/frontend/app/helpers/constants.tssimilarity index 100%rename from frontend/app/composables/constants.tsrename to frontend/app/helpers/constants.tsdiff --git a/frontend/app/pages/dashboard/admin/index.vue b/frontend/app/pages/dashboard/admin/index.vueindex 94c6cb2b..14f1aef1 100644--- a/frontend/app/pages/dashboard/admin/index.vue+++ b/frontend/app/pages/dashboard/admin/index.vue@@ -2,6 +2,10 @@<div class="card-component"><h1>Admin dashboard</h1><p>From this dashboard, you can manage users and site settings.</p>- <AppButton type="primary" @click="useRouter().push('/dashboard/admin/users')">Manage users</AppButton>+ <AppButton type="primary" @click="router.push('/dashboard/admin/users')">Manage users</AppButton></div></template>++<script setup lang="ts">+const router = useRouter();+</script>diff --git a/frontend/app/pages/dashboard/admin/users/[id]/index.vue b/frontend/app/pages/dashboard/admin/users/[id]/index.vueindex 9a273c53..189a5e82 100644--- a/frontend/app/pages/dashboard/admin/users/[id]/index.vue+++ b/frontend/app/pages/dashboard/admin/users/[id]/index.vue@@ -41,7 +41,7 @@</div><AppButton type="success" @click="saveChanges">Save Changes</AppButton>- <AppButton type="primary" @click="useRouter().push(`/dashboard/admin/users/${user.id}/documents`)">View nodes</AppButton>+ <AppButton type="primary" @click="router.push(`/dashboard/admin/users/${user.id}/documents`)">View nodes</AppButton></div><div v-else>No user found.</div></div>@@ -53,6 +53,8 @@ import type { User } from '~/stores';definePageMeta({ breadcrumb: 'User Details' });const route = useRoute();+const router = useRouter();+const user = ref<User | undefined>(undefined);const store = useAdminStore();watchEffect(async () => {diff --git a/frontend/app/pages/dashboard/categories/[id]/edit.vue b/frontend/app/pages/dashboard/categories/[id]/edit.vueindex 10b4899a..bad5fea7 100644--- a/frontend/app/pages/dashboard/categories/[id]/edit.vue+++ b/frontend/app/pages/dashboard/categories/[id]/edit.vue@@ -43,6 +43,7 @@</template><script lang="ts" setup>+import { CATEGORY_ROLES } from '~/helpers/constants';import DeleteModal from '../_modals/DeleteCategoryModal.vue';const nodesStore = useNodesStore();diff --git a/frontend/app/pages/dashboard/settings/_views/preferences.vue b/frontend/app/pages/dashboard/settings/_views/preferences.vueindex 56d7ad48..640524ef 100644--- a/frontend/app/pages/dashboard/settings/_views/preferences.vue+++ b/frontend/app/pages/dashboard/settings/_views/preferences.vue@@ -63,6 +63,7 @@</template><script setup lang="ts">+import { DOCUMENT_SIZES, DOCUMENT_THEMES, EDITOR_FONTS } from '~/helpers/constants';const preferencesStore = usePreferences();// @ts-expect-error unknown typeconst p = preferencesStore.get as <K extends PreferenceKey>(key: K) => ReturnType<unknown>;