Fix: Tag Interface Delete Button #104256

Manually merged
Sybren A. Stüvel merged 39 commits from Evelinealy/flamenco:tag-interface into main 2023-11-02 16:13:14 +01:00
Showing only changes of commit 956ec43e99 - Show all commits

View File

@ -164,7 +164,6 @@ export default {
sorter: "string", sorter: "string",
editor: "input", editor: "input",
vertAlign: "center", vertAlign: "center",
width: 400,
formatter(cell) { formatter(cell) {
const cellValue = cell.getData().description; const cellValue = cell.getData().description;
@ -245,16 +244,15 @@ export default {
}, },
deleteTag(tag) { deleteTag(tag) {
if (!tag) {
return;
}
const api = new WorkerMgtApi(getAPIClient()); const api = new WorkerMgtApi(getAPIClient());
api api
.deleteWorkerTag(tag.id) .deleteWorkerTag(tag.id)
.then(() => { .then(() => {
this.tags = this.tags.filter((t) => t.id !== tag.id); this.tabulator.getRows().forEach((row) => {
this.tabulator.setData(this.tags); if (row.getData().id === tag.id) {
row.delete();
}
});
}) })
.catch((error) => { .catch((error) => {
const errorMsg = JSON.stringify(error); const errorMsg = JSON.stringify(error);