From 4c9241075dc1b2f1cda5648cf9ad1f553db3d03b Mon Sep 17 00:00:00 2001 From: Douglas Barbosa Alexandre Date: Tue, 18 Oct 2016 01:32:00 -0200 Subject: Warn user deleting a group label affect all projects within the group --- app/helpers/labels_helper.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/helpers') diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb index a1d7713b45f..d7cfd24c918 100644 --- a/app/helpers/labels_helper.rb +++ b/app/helpers/labels_helper.rb @@ -155,6 +155,13 @@ module LabelsHelper label.subscribed?(current_user) ? 'Unsubscribe' : 'Subscribe' end + def label_deletion_confirm_text(label) + case label + when GroupLabel then 'Remove this label? This will affect all projects within the group. Are you sure?' + when ProjectLabel then 'Remove this label? Are you sure?' + end + end + # Required for Banzai::Filter::LabelReferenceFilter module_function :render_colored_label, :render_colored_cross_project_label, :text_color_for_bg, :escape_once -- cgit v1.2.3