From ee90fffce1925642b310878accdfadc6f4a4d12d Mon Sep 17 00:00:00 2001 From: sunportainer <93502624+sunportainer@users.noreply.github.com> Date: Fri, 1 Apr 2022 14:40:08 +0800 Subject: [PATCH] fix(template) add notification when delete (#6675) --- .../kube-custom-templates-view.controller.js | 2 ++ .../custom-templates-view/customTemplatesViewController.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/kubernetes/custom-templates/kube-custom-templates-view/kube-custom-templates-view.controller.js b/app/kubernetes/custom-templates/kube-custom-templates-view/kube-custom-templates-view.controller.js index 63f4c228a..669f7c0d9 100644 --- a/app/kubernetes/custom-templates/kube-custom-templates-view/kube-custom-templates-view.controller.js +++ b/app/kubernetes/custom-templates/kube-custom-templates-view/kube-custom-templates-view.controller.js @@ -61,7 +61,9 @@ export default class KubeCustomTemplatesViewController { } try { + var template = _.find(this.templates, { Id: templateId }); await this.CustomTemplateService.remove(templateId); + this.Notifications.success('Template successfully deleted', template && template.Title); _.remove(this.templates, { Id: templateId }); } catch (err) { this.Notifications.error('Failure', err, 'Failed to delete template'); diff --git a/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js b/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js index a4290e9e1..5648d25ad 100644 --- a/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js +++ b/app/portainer/views/custom-templates/custom-templates-view/customTemplatesViewController.js @@ -213,7 +213,9 @@ class CustomTemplatesViewController { } try { + var template = _.find(this.templates, { Id: templateId }); await this.CustomTemplateService.remove(templateId); + this.Notifications.success('Template successfully deleted', template && template.Title); _.remove(this.templates, { Id: templateId }); } catch (err) { this.Notifications.error('Failure', err, 'Failed to delete template');