refactor(collections/board): use same title editor for new columns

This commit is contained in:
Elian Doran
2025-09-12 17:05:17 +03:00
parent ede4b99bcd
commit 0d275b3259
2 changed files with 39 additions and 51 deletions

View File

@@ -43,6 +43,27 @@ export default class BoardApi {
await attributes.setLabel(noteId, this.statusAttribute, newColumn);
}
async addNewColumn(columnName: string) {
if (!columnName.trim()) {
return;
}
if (!this.viewConfig) {
this.viewConfig = {};
}
if (!this.viewConfig.columns) {
this.viewConfig.columns = [];
}
// Add the new column to persisted data if it doesn't exist
const existingColumn = this.viewConfig.columns.find(col => col.value === columnName);
if (!existingColumn) {
this.viewConfig.columns.push({ value: columnName });
this.saveConfig(this.viewConfig);
}
}
async removeColumn(column: string) {
// Remove the value from the notes.
const noteIds = this.byColumn?.get(column)?.map(item => item.note.noteId) || [];