Skip to content

Commit

Permalink
Remove 'Add Attribute' action from sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Dany Marcoux committed Nov 25, 2020
1 parent 874d1ed commit 25ec22f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
14 changes: 7 additions & 7 deletions src/api/app/views/webui/attribute/index.html.haml
@@ -1,7 +1,6 @@
- @pagetitle = "Attributes of #{@package ? "#{@package} (Project #{@project})" : "Project #{@project}"}"
- can_update_container = policy(@container).update?
- if can_update_container && feature_enabled?(:responsive_ux)
= render partial: 'webui/attribute/responsive_ux/index_actions', locals: { project: @project, package: @package }

.card
= render(partial: "webui/#{@container.model_name.singular}/tabs", locals: { project: @project, package: @package })

Expand Down Expand Up @@ -39,9 +38,10 @@
%p
%em No attributes set

- if can_update_container && !feature_enabled?(:responsive_ux)
%p
= link_to(new_attribs_path(project: @project.name, package: @package), title: 'Add Attribute') do
%i.fas.fa-plus-circle.text-primary
Add Attribute
- if can_update_container
%ul.list-inline
%li.list-inline-item
= link_to(new_attribs_path(project: @project.name, package: @package), title: 'Add Attribute', class: 'nav-link') do
%i.fas.fa-plus-circle.text-primary
Add Attribute
= render(partial: 'delete_dialog')

This file was deleted.

2 changes: 1 addition & 1 deletion src/api/spec/features/beta/webui/attributes_spec.rb
Expand Up @@ -40,7 +40,7 @@
login user

visit index_attribs_path(project: user.home_project_name)
desktop? ? click_link('Add Attribute') : click_menu_link('Actions', 'Add Attribute')
click_link('Add Attribute')
find('select#attrib_attrib_type_id').select('OBS:VeryImportantProject')
click_button('Add')
expect(page).to have_content('Sorry, you are not authorized to create this Attrib.')
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/features/beta/webui/projects_spec.rb
Expand Up @@ -130,7 +130,7 @@
visit project_show_path(project)

click_link('Attributes')
desktop? ? click_link('Add Attribute') : click_menu_link('Actions', 'Add Attribute')
click_link('Add Attribute')
select('OBS:MaintenanceProject')
click_button('Add')

Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/support/features/features_attribute.rb
@@ -1,7 +1,7 @@
module FeaturesAttribute
def add_attribute_with_values(package = nil)
visit index_attribs_path(project: user.home_project_name, package: package.try(:name))
desktop? ? click_link('Add Attribute') : click_menu_link('Actions', 'Add Attribute')
click_link('Add Attribute')
expect(page).to have_text('Add Attribute')
find('select#attrib_attrib_type_id').select("#{attribute_type.attrib_namespace}:#{attribute_type.name}", match: :first)
click_button('Add')
Expand Down

0 comments on commit 25ec22f

Please sign in to comment.