Remove save button for managed repositories

This commit removes the settings `save` button for managed repositories.

Important: When adjustable settings for any vendor should be added,
this button must be shown depending on some individual vendor logic.
pull/3196/head
Oliver Günther 9 years ago
parent 325ddf6fb3
commit 6763fe875d
  1. 8
      app/views/repositories/_settings.html.erb
  2. 2
      spec/features/repositories/create_repository_spec.rb

@ -54,7 +54,11 @@ See doc/COPYRIGHT.rdoc for more details.
<% unless @repository.nil? %> <% unless @repository.nil? %>
<%= render partial: "/repositories/settings/vendor_form", <%= render partial: "/repositories/settings/vendor_form",
locals: { form: f, repository: @repository, vendor: vendor_name(@repository) } %> locals: { form: f, repository: @repository, vendor: vendor_name(@repository) } %>
<%= render partial: "/repositories/settings/submit",
locals: { form: f, is_creation_form: is_creation_form, project: @project } %> <%# Hide the save button for existing managed repositories %>
<% if is_creation_form || !@repository.managed? %>
<%= render partial: "/repositories/settings/submit",
locals: { form: f, is_creation_form: is_creation_form, project: @project } %>
<% end %>
<% end %> <% end %>
<% end %> <% end %>

@ -140,7 +140,7 @@ describe 'Create repository', type: :feature, js: true do
find('input[type="radio"][value="managed"]').set(true) find('input[type="radio"][value="managed"]').set(true)
find('button[type="submit"]', text: I18n.t(:button_create)).click find('button[type="submit"]', text: I18n.t(:button_create)).click
expect(page).to have_selector('button', text: I18n.t(:button_save)) expect(page).not_to have_selector('button', text: I18n.t(:button_save))
expect(page).to have_selector('a.icon-delete', text: I18n.t(:button_delete)) expect(page).to have_selector('a.icon-delete', text: I18n.t(:button_delete))
end end
end end

Loading…
Cancel
Save