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.

Improve general design of kanban system and add reset feature

Smaug6739537056268f25
diff --git a/frontend/app/components/Kanban/DeleteColumnModal.vue b/frontend/app/components/Kanban/DeleteColumn.modal.vue
similarity index 100%
rename from frontend/app/components/Kanban/DeleteColumnModal.vue
rename to frontend/app/components/Kanban/DeleteColumn.modal.vue
diff --git a/frontend/app/components/Kanban/KanbanBoard.vue b/frontend/app/components/Kanban/KanbanBoard.vue
index ff0799e4..7dff1869 100644
--- a/frontend/app/components/Kanban/KanbanBoard.vue
+++ b/frontend/app/components/Kanban/KanbanBoard.vue
@@ -66,10 +66,10 @@ const sortedColumns = computed(() => [...kanbanData.value.columns].sort((a, b) =
// Default columns
function getDefaultColumns(): KanbanColumnData[] {
return [
- { id: 'backlog', title: 'Backlog', color: 1, order: 0 },
- { id: 'todo', title: 'To Do', color: 6, order: 1 },
- { id: 'in-progress', title: 'In Progress', color: 3, order: 2 },
- { id: 'done', title: 'Done', color: 5, order: 3 },
+ { id: '0', title: 'Backlog', color: 1, order: 0 },
+ { id: '1', title: 'To Do', color: 6, order: 1 },
+ { id: '2', title: 'In Progress', color: 3, order: 2 },
+ { id: '3', title: 'Done', color: 5, order: 3 },
];
}
@@ -162,6 +162,17 @@ function updateColumn(column: KanbanColumnData) {
},
});
}
+
+function resetKanbanData() {
+ const data = {
+ kanban: {
+ columns: getDefaultColumns(),
+ cardColumns: {},
+ },
+ };
+ emit('updateMetadata', data);
+}
+defineExpose({ resetKanbanData });
</script>
<style scoped lang="scss">
diff --git a/frontend/app/components/Kanban/KanbanColumn.vue b/frontend/app/components/Kanban/KanbanColumn.vue
index 78972382..6a6039e6 100644
--- a/frontend/app/components/Kanban/KanbanColumn.vue
+++ b/frontend/app/components/Kanban/KanbanColumn.vue
@@ -63,7 +63,7 @@
<script setup lang="ts">
import KanbanCard from './KanbanCard.vue';
-import DeleteColumnModal from './DeleteColumnModal.vue';
+import DeleteColumnModal from './DeleteColumn.modal.vue';
import type { Node } from '~/stores';
export interface KanbanColumnData {
diff --git a/frontend/app/components/Kanban/ResetBoard.modal.vue b/frontend/app/components/Kanban/ResetBoard.modal.vue
new file mode 100644
index 00000000..cd29682c
--- /dev/null
+++ b/frontend/app/components/Kanban/ResetBoard.modal.vue
@@ -0,0 +1,35 @@
+<template>
+ <div class="modal">
+ <h3>Reset kanban board</h3>
+ <p>Are you sure you want to reset the kanban board?</p>
+ <p class="warn">This action cannot be undone. All columns will be deleted and cards moved to the first column.</p>
+ <div class="footer">
+ <AppButton type="secondary" @click="emit('close')">Cancel</AppButton>
+ <AppButton type="danger" @click="confirmDelete">Reset</AppButton>
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+const props = defineProps<{
+ columnTitle: string;
+ cardCount: number;
+ onConfirm: () => void;
+}>();
+
+const emit = defineEmits<{
+ close: [];
+}>();
+
+const confirmDelete = () => {
+ props.onConfirm();
+ emit('close');
+};
+</script>
+
+<style scoped lang="scss">
+.warn {
+ color: var(--red-dark);
+ opacity: 0.8;
+}
+</style>
diff --git a/frontend/app/components/MarkdownEditor/LazyMarkdownEditor.vue b/frontend/app/components/MarkdownEditor/LazyMarkdownEditor.vue
index b0fc0885..aa0d8a05 100644
--- a/frontend/app/components/MarkdownEditor/LazyMarkdownEditor.vue
+++ b/frontend/app/components/MarkdownEditor/LazyMarkdownEditor.vue
@@ -8,9 +8,7 @@
<!-- Compact Document Metadata -->
<div v-if="!minimal" class="document-meta">
<input v-model="document.name" placeholder="Document title" class="meta-title" @input="autoSaveConditional" />
- <span class="meta-separator">β€’</span>
<input v-model="document.description" placeholder="Description" class="meta-description" @input="autoSaveConditional" />
- <span class="meta-separator">β€’</span>
<AppTagInput v-model="document.tags" class="meta-tags" @update:model-value="autoSaveConditional" />
</div>
<AppTagInput v-else v-model="document.tags" style="margin: 4px 0" @update:model-value="autoSaveConditional" />
@@ -224,12 +222,6 @@ const autoSave = debounceDelayed(() => {
}
}
-.meta-separator {
- color: var(--border-color);
- font-size: 0.7rem;
- user-select: none;
-}
-
.meta-tags {
flex: 0 1 auto;
min-width: 150px;
@@ -327,10 +319,6 @@ const autoSave = debounceDelayed(() => {
padding: 8px 10px;
}
- .meta-separator {
- display: none;
- }
-
.meta-title,
.meta-description {
max-width: 100%;
diff --git a/frontend/app/components/Node/NodeList.vue b/frontend/app/components/Node/NodeList.vue
index 1c54adb5..ce7945ca 100644
--- a/frontend/app/components/Node/NodeList.vue
+++ b/frontend/app/components/Node/NodeList.vue
@@ -18,6 +18,9 @@
All workspaces
</h1>
<div class="header-actions">
+ <NuxtLink v-if="view == 'kanban'" class="btn-icon no-mobile" @click="resetKanban">
+ <Icon name="reset" display="lg" />
+ </NuxtLink>
<NodeFilter v-show="!isMobile()" :nodes="nodes" @update:nodes="filteredNodes = $event" />
<NuxtLink v-if="parent?.shared && parent.user_id != connectedId" class="btn-icon no-mobile" @click="openRemoveShareModal">
<Icon name="group_off" display="lg" />
@@ -48,6 +51,7 @@
<!-- Kanban View -->
<KanbanBoard
v-else-if="view === 'kanban' && parent"
+ ref="kanbanBoard"
:workspace="parent"
:documents="filteredNodes"
@update-metadata="updateKanbanMetadata"
@@ -72,10 +76,11 @@
import NodePermissions from '~/components/Node/NodePermissions.modal.vue';
import RemoveSharedNode from '~/components/Node/RemoveSharedNode.modal.vue';
import NodeFilter from '~/components/Node/Filter.vue';
-import KanbanBoard from '~/components/Kanban/KanbanBoard.vue';
+import KanbanBoard, { type KanbanMetadata } from '~/components/Kanban/KanbanBoard.vue';
+import NodeMetadataModal from './NodeMetadata.modal.vue';
+import ResetBoardModal from '../Kanban/ResetBoard.modal.vue';
import type { ViewMode } from '~/components/ViewSelection.vue';
import type { Node } from '~/stores';
-import NodeMetadataModal from './NodeMetadata.modal.vue';
const props = defineProps<{ parent?: Node; nodes: Node[]; parentId?: string }>();
const nodesStore = useNodesStore();
@@ -85,6 +90,19 @@ const connectedId = useUserStore().user?.id;
const view = ref<ViewMode>();
const filteredNodes = ref<Node[]>(props.nodes);
+// Kanban board reference
+const kanbanBoard = ref<InstanceType<typeof KanbanBoard> | null>(null);
+const resetKanban = () => {
+ useModal().add(
+ new Modal(shallowRef(ResetBoardModal), {
+ props: {
+ onConfirm: () => kanbanBoard.value?.resetKanbanData(),
+ },
+ size: 'small',
+ }),
+ );
+};
+
// Watch for nodes changes to update filtered nodes
watch(
() => props.nodes,
@@ -110,7 +128,7 @@ const openRemoveShareModal = () => {
const openEditModal = () => useModal().add(new Modal(shallowRef(NodeMetadataModal), { props: { doc: props.parent }, size: 'small' }));
// Kanban functionality
-async function updateKanbanMetadata(metadata: any) {
+async function updateKanbanMetadata(metadata: KanbanMetadata) {
if (!props.parent) return;
try {
diff --git a/frontend/app/components/ViewSelection.vue b/frontend/app/components/ViewSelection.vue
index 9eeed60a..d3484a43 100644
--- a/frontend/app/components/ViewSelection.vue
+++ b/frontend/app/components/ViewSelection.vue
@@ -14,7 +14,7 @@ const props = withDefaults(
showKanban?: boolean;
}>(),
{
- showKanban: true,
+ showKanban: false,
},
);
@@ -75,8 +75,4 @@ button {
fill: currentColor;
}
}
-// Separator between buttons
-button + button {
- border-left: 1px solid var(--border-color);
-}
</style>
diff --git a/frontend/public/app-icons/reset.svg b/frontend/public/app-icons/reset.svg
new file mode 100644
index 00000000..c64b304e
--- /dev/null
+++ b/frontend/public/app-icons/reset.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M480-400q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0 280q-139 0-241-91.5T122-440h82q14 104 92.5 172T480-200q117 0 198.5-81.5T760-480q0-117-81.5-198.5T480-760q-69 0-129 32t-101 88h110v80H120v-240h80v94q51-64 124.5-99T480-840q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-480q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-120Z"/></svg>
\ No newline at end of file