Commit feaf24e7 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Remove useless delete button in group settings

The delete button does not do anything when the project is already
marked for deletion. This also adds a badge to indicate that the project
is marked for deletion.

Changelog: fixed
EE: true
parent e20771af
= link_to _('Delete'), project, data: { confirm: remove_project_message(project) }, method: :delete, class: "btn gl-button btn-danger"
- if project.archived
%span.badge.badge-warning.badge-pill.gl-badge.md= _('archived')
......@@ -15,13 +15,12 @@
.controls
= link_to _('Members'), project_project_members_path(project), id: "edit_#{dom_id(project)}", class: "btn gl-button"
= link_to _('Edit'), edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn gl-button"
= link_to _('Delete'), project, data: { confirm: remove_project_message(project)}, method: :delete, class: "btn gl-button btn-danger"
= render 'delete_project_button', project: project
.stats
%span.badge.badge-pill
= storage_counter(project.statistics&.storage_size)
- if project.archived
%span.badge.badge-warning archived
= render 'project_badges', project: project
.title
= link_to(project_path(project)) do
......
- unless project.marked_for_deletion?
= link_to _('Delete'), project, data: { confirm: remove_project_message(project) }, method: :delete, class: "btn gl-button btn-danger"
- if project.marked_for_deletion?
%span.badge.badge-warning.badge-pill.gl-badge.md= _('pending deletion')
- elsif project.archived
%span.badge.badge-warning.badge-pill.gl-badge.md= _('archived')
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Group projects page' do
let(:user) { create :user }
let(:group) { create :group }
before do
group.add_owner(user)
sign_in(user)
end
context 'when group has project pending deletion' do
before do
stub_licensed_features(adjourned_deletion_for_projects_and_groups: true)
end
let!(:project) { create(:project, :archived, namespace: group, marked_for_deletion_at: Date.current) }
it 'renders projects list' do
visit projects_group_path(group)
expect(page).to have_link project.name
expect(page).not_to have_css('span.badge.badge-warning', text: 'archived')
expect(page).to have_css('span.badge.badge-warning', text: 'pending deletion')
end
end
end
......@@ -23,7 +23,7 @@ RSpec.describe 'User browse group projects page' do
visit projects_group_path(group)
expect(page).to have_link project.name
expect(page).to have_xpath("//span[@class='badge badge-warning']", text: 'archived')
expect(page).to have_css('span.badge.badge-warning', text: 'archived')
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment