From 113ecaed4a56d18ad2bd1123ae8694a49e2f52bc Mon Sep 17 00:00:00 2001 From: Efe Agare <39013780+EfeAgare@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:19:22 +0100 Subject: [PATCH] Remove error from display in UI (#4786) * - remove error from display in UI * add comment * remove from ui * remove status error from spec * Commit changes on schema * revert schema changes --- app/models/partner.rb | 3 ++- app/views/partners/_statuses.html.erb | 3 +-- spec/models/partner_spec.rb | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/partner.rb b/app/models/partner.rb index 858d01a67e..15979d9d02 100644 --- a/app/models/partner.rb +++ b/app/models/partner.rb @@ -27,7 +27,8 @@ class Partner < ApplicationRecord "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ].freeze - enum :status, { uninvited: 0, invited: 1, awaiting_review: 2, approved: 3, error: 4, recertification_required: 5, deactivated: 6 } + # Status `4` (error) was removed for being obsolete but is intentionally skipped to preserve existing enum values. + enum status: { uninvited: 0, invited: 1, awaiting_review: 2, approved: 3, recertification_required: 5, deactivated: 6 } belongs_to :organization belongs_to :partner_group, optional: true diff --git a/app/views/partners/_statuses.html.erb b/app/views/partners/_statuses.html.erb index fcedc452c6..1f5f0432c0 100644 --- a/app/views/partners/_statuses.html.erb +++ b/app/views/partners/_statuses.html.erb @@ -2,8 +2,7 @@ "uninvited": 'ban', "invited": 'envelope', "awaiting_review": 'question-circle', - "approved": 'check-circle', - "error": 'exclamation-circle' + "approved": 'check-circle' }.with_indifferent_access current_filtered_status = params.dig(:filters, :by_status) %> diff --git a/spec/models/partner_spec.rb b/spec/models/partner_spec.rb index a3e0a06060..fe2856794d 100644 --- a/spec/models/partner_spec.rb +++ b/spec/models/partner_spec.rb @@ -131,7 +131,6 @@ expect(build(:partner, status: :invited)).not_to be_deletable expect(build(:partner, status: :awaiting_review)).not_to be_deletable expect(build(:partner, status: :approved)).not_to be_deletable - expect(build(:partner, status: :error)).not_to be_deletable expect(build(:partner, status: :recertification_required)).not_to be_deletable expect(build(:partner, status: :deactivated)).not_to be_deletable end @@ -191,7 +190,6 @@ it 'should return false', :aggregate_failures do expect(build(:partner, status: :uninvited)).not_to be_approvable expect(build(:partner, status: :approved)).not_to be_approvable - expect(build(:partner, status: :error)).not_to be_approvable expect(build(:partner, status: :recertification_required)).not_to be_approvable expect(build(:partner, status: :deactivated)).not_to be_approvable end