From ac30a798f0e301af721a8d991ed3df728bff365a Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Wed, 31 Jul 2024 11:53:38 -0400 Subject: [PATCH] FIX: system badges can be disabled (#28169) (#28171) A previous commit mistakenly assumed system badges couldn't be disabled. Co-authored-by: Joffrey JAFFEUX --- .../addon/templates/admin-badges/show.hbs | 29 +++++++------------ config/locales/client.en.yml | 1 - spec/system/admin_badges_spec.rb | 2 +- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/app/assets/javascripts/admin/addon/templates/admin-badges/show.hbs b/app/assets/javascripts/admin/addon/templates/admin-badges/show.hbs index 9995d141365..9fa3017bd79 100644 --- a/app/assets/javascripts/admin/addon/templates/admin-badges/show.hbs +++ b/app/assets/javascripts/admin/addon/templates/admin-badges/show.hbs @@ -11,24 +11,17 @@ {{data.name}} - {{#if this.readOnly}} - - {{i18n "admin.badges.disable_system"}} - - {{else}} - - - - {{/if}} + + + {{#if this.readOnly}} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index b42466d260f..b39a39d9df4 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -6931,7 +6931,6 @@ en: confirm: "Yes, update password policy" badges: - disable_system: This badge is a system badge and cannot be disabled and/or deleted. status: Status title: Badges new_badge: New Badge diff --git a/spec/system/admin_badges_spec.rb b/spec/system/admin_badges_spec.rb index 58b60f4c380..91039998715 100644 --- a/spec/system/admin_badges_spec.rb +++ b/spec/system/admin_badges_spec.rb @@ -16,7 +16,7 @@ describe "Admin Badges Page", type: :system do badge = Badge.find(Badge::Autobiographer) - expect(form).to have_an_alert(I18n.t("admin_js.admin.badges.disable_system")) + expect(form.field("enabled")).to be_enabled expect(form.field("badge_type_id")).to be_disabled expect(form.field("badge_type_id")).to have_value(BadgeType::Bronze.to_s) expect(form.field("badge_grouping_id")).to be_disabled