feat(views/board): add new column

This commit is contained in:
Elian Doran
2025-07-20 20:06:54 +03:00
parent b22e08b1eb
commit 1f792ca418
2 changed files with 133 additions and 0 deletions

View File

@@ -87,6 +87,21 @@ export default class BoardApi {
this.viewStorage.store(this.persistedData);
}
async createColumn(columnValue: string) {
// Add the new column to persisted data if it doesn't exist
if (!this.persistedData.columns) {
this.persistedData.columns = [];
}
const existingColumn = this.persistedData.columns.find(col => col.value === columnValue);
if (!existingColumn) {
this.persistedData.columns.push({ value: columnValue });
await this.viewStorage.store(this.persistedData);
}
return columnValue;
}
static async build(parentNote: FNote, viewStorage: ViewModeStorage<BoardData>) {
let persistedData = await viewStorage.restore() ?? {};
const { byColumn, newPersistedData } = await getBoardData(parentNote, "status", persistedData);