diff options
4 files changed, 18 insertions, 29 deletions
diff --git a/app/views/shared/_personal_access_tokens_table.html.haml b/app/views/shared/_personal_access_tokens_table.html.haml index ab7a2db002e..c5e4d6e2871 100644 --- a/app/views/shared/_personal_access_tokens_table.html.haml +++ b/app/views/shared/_personal_access_tokens_table.html.haml @@ -39,22 +39,3 @@ - else .settings-message.text-center This user has no active #{type} Tokens. - -%hr - -%h5 Inactive #{type} Tokens (#{inactive_tokens.length}) -- if inactive_tokens.present? - .table-responsive - %table.table.inactive-tokens - %thead - %tr - %th Name - %th Created - %tbody - - inactive_tokens.each do |token| - %tr - %td= token.name - %td= token.created_at.to_date.to_s(:medium) -- else - .settings-message.text-center - This user has no inactive #{type} Tokens. diff --git a/changelogs/unreleased/19629-remove-inactive-tokens-list.yml b/changelogs/unreleased/19629-remove-inactive-tokens-list.yml new file mode 100644 index 00000000000..414e3d49e29 --- /dev/null +++ b/changelogs/unreleased/19629-remove-inactive-tokens-list.yml @@ -0,0 +1,4 @@ +--- +title: Remove Inactive Personal Access Tokens list from Access Tokens page +merge_request: 12866 +author: diff --git a/spec/features/admin/admin_users_impersonation_tokens_spec.rb b/spec/features/admin/admin_users_impersonation_tokens_spec.rb index cd7040891e9..d01722805c4 100644 --- a/spec/features/admin/admin_users_impersonation_tokens_spec.rb +++ b/spec/features/admin/admin_users_impersonation_tokens_spec.rb @@ -8,8 +8,8 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do find(".table.active-tokens") end - def inactive_impersonation_tokens - find(".table.inactive-tokens") + def no_personal_access_tokens_message + find(".settings-message") end before do @@ -60,15 +60,17 @@ describe 'Admin > Users > Impersonation Tokens', feature: true, js: true do click_on "Revoke" - expect(inactive_impersonation_tokens).to have_text(impersonation_token.name) + expect(page).to have_selector(".settings-message") + expect(no_personal_access_tokens_message).to have_text("This user has no active Impersonation Tokens.") end - it "moves expired tokens to the 'inactive' section" do + it "removes expired tokens from 'active' section" do impersonation_token.update(expires_at: 5.days.ago) visit admin_user_impersonation_tokens_path(user_id: user.username) - expect(inactive_impersonation_tokens).to have_text(impersonation_token.name) + expect(page).to have_selector(".settings-message") + expect(no_personal_access_tokens_message).to have_text("This user has no active Impersonation Tokens.") end end end diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb index 44b7ee101c9..3c08b6bc091 100644 --- a/spec/features/profiles/personal_access_tokens_spec.rb +++ b/spec/features/profiles/personal_access_tokens_spec.rb @@ -7,8 +7,8 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do find(".table.active-tokens") end - def inactive_personal_access_tokens - find(".table.inactive-tokens") + def no_personal_access_tokens_message + find(".settings-message") end def created_personal_access_token @@ -80,14 +80,16 @@ describe 'Profile > Personal Access Tokens', feature: true, js: true do visit profile_personal_access_tokens_path click_on "Revoke" - expect(inactive_personal_access_tokens).to have_text(personal_access_token.name) + expect(page).to have_selector(".settings-message") + expect(no_personal_access_tokens_message).to have_text("This user has no active Personal Access Tokens.") end - it "moves expired tokens to the 'inactive' section" do + it "removes expired tokens from 'active' section" do personal_access_token.update(expires_at: 5.days.ago) visit profile_personal_access_tokens_path - expect(inactive_personal_access_tokens).to have_text(personal_access_token.name) + expect(page).to have_selector(".settings-message") + expect(no_personal_access_tokens_message).to have_text("This user has no active Personal Access Tokens.") end context "when revocation fails" do |