From c1070b838e0dcf1c5c1ed2dda0c16a874708cb6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 7 Feb 2023 15:23:13 +0100 Subject: [PATCH] Web app: better notifications for job deletion --- web/app/src/stores/notifications.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/app/src/stores/notifications.js b/web/app/src/stores/notifications.js index 765c81ed..b24204f2 100644 --- a/web/app/src/stores/notifications.js +++ b/web/app/src/stores/notifications.js @@ -42,10 +42,18 @@ export const useNotifs = defineStore('notifications', { * @param {API.SocketIOJobUpdate} jobUpdate Job update received via SocketIO. */ addJobUpdate(jobUpdate) { - let msg = `Job ${jobUpdate.name}`; - if (jobUpdate.previous_status && jobUpdate.previous_status != jobUpdate.status) { + let msg = "Job"; + if (jobUpdate.name) msg += ` ${jobUpdate.name}`; + if (jobUpdate.was_deleted) { + msg += " was deleted"; + } + else if (jobUpdate.previous_status && jobUpdate.previous_status != jobUpdate.status) { msg += ` changed status ${jobUpdate.previous_status} ➜ ${jobUpdate.status}`; } + else { + // Don't bother logging just "Job" + its name, as it conveys no info. + return; + } this.add(msg) },