chore(react/collections/table): bring back renaming columns

This commit is contained in:
Elian Doran
2025-09-11 21:34:10 +03:00
parent d367cf9972
commit 60ef816f0c
5 changed files with 82 additions and 40 deletions

View File

@@ -57,6 +57,27 @@ export default class BoardApi {
this.saveConfig(this.viewConfig);
}
async renameColumn(oldValue: string, newValue: string) {
const noteIds = this.byColumn?.get(oldValue)?.map(item => item.note.noteId) || [];
// Change the value in the notes.
await executeBulkActions(noteIds, [
{
name: "updateLabelValue",
labelName: this.statusAttribute,
labelValue: newValue
}
]);
// Rename the column in the persisted data.
for (const column of this.viewConfig.columns || []) {
if (column.value === oldValue) {
column.value = newValue;
}
}
this.saveConfig(this.viewConfig);
}
async insertRowAtPosition(
column: string,
relativeToBranchId: string,