Fix: Tag Interface Delete Button #104256
@ -164,7 +164,6 @@ export default {
|
|||||||
sorter: "string",
|
sorter: "string",
|
||||||
editor: "input",
|
editor: "input",
|
||||||
vertAlign: "center",
|
vertAlign: "center",
|
||||||
width: 400,
|
|
||||||
|
|
||||||
dr.sybren marked this conversation as resolved
Outdated
|
|||||||
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
|
||||||
dr.sybren marked this conversation as resolved
Outdated
Sybren A. Stüvel
commented
This shouldn't happen anyway, so you can just remove the entire conditional return here. Better to raise an error that you can see & debug (because of the This shouldn't happen anyway, so you can just remove the entire conditional return here. Better to raise an error that you can see & debug (because of the `tag.id` access failing) than to silently ignore mistakes.
|
|||||||
.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();
|
||||||
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
dr.sybren marked this conversation as resolved
Outdated
Sybren A. Stüvel
commented
This can be removed. The SocketIO handling will already remove the tag, no matter who did the deletion. This can be removed. The SocketIO handling will already remove the tag, no matter who did the deletion.
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
const errorMsg = JSON.stringify(error);
|
const errorMsg = JSON.stringify(error);
|
||||||
|
Loading…
Reference in New Issue
Block a user
Not sure if a fixed width is going to work well here, especially when the window gets resized.