Commit 254dd734 authored by sfang97's avatar sfang97

Add project visibility modal back

parent 52a21137
...@@ -216,10 +216,7 @@ export default { ...@@ -216,10 +216,7 @@ export default {
</p> </p>
</div> </div>
<div <div v-if="isEditing" class="row-content-block gl-display-flex gl-justify-content-end">
v-if="isEditing"
class="row-content-block gl-display-flex gl-justify-content-space-between"
>
<button class="btn btn-cancel" type="button" @click="onCancel">{{ __('Cancel') }}</button> <button class="btn btn-cancel" type="button" @click="onCancel">{{ __('Cancel') }}</button>
<loading-button <loading-button
:loading="isSaving" :loading="isSaving"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
= ("To confirm, type %{phrase_code}").html_safe % { phrase_code: '<code class="js-confirm-danger-match">%{phrase_name}</code>'.html_safe % { phrase_name: @project.full_path } } = ("To confirm, type %{phrase_code}").html_safe % { phrase_code: '<code class="js-confirm-danger-match">%{phrase_name}</code>'.html_safe % { phrase_name: @project.full_path } }
.form-group .form-group
= text_field_tag 'confirm_path_input', '', class: 'form-control js-confirm-danger-input qa-confirm-input' = text_field_tag 'confirm_path_input', '', class: 'form-control js-confirm-danger-input qa-confirm-input'
.form-actions.clearfix .form-actions.gl-display-flex.gl-justify-content-end.clearfix
%button.btn.btn-default.gl-display-flex.gl-justify-content-end{ type: "button", "data-dismiss": "modal" } %button.btn.btn-default{ type: "button", "data-dismiss": "modal" }
= _('Cancel') = _('Cancel')
= submit_tag _('Reduce project visibility'), class: "btn btn-danger js-confirm-danger-submit qa-confirm-button", disabled: true = submit_tag _('Reduce project visibility'), class: "btn btn-danger js-confirm-danger-submit qa-confirm-button", disabled: true
...@@ -21,10 +21,9 @@ ...@@ -21,10 +21,9 @@
%input{ name: 'update_section', type: 'hidden', value: 'js-shared-permissions' } %input{ name: 'update_section', type: 'hidden', value: 'js-shared-permissions' }
%template.js-project-permissions-form-data{ type: "application/json" }= project_permissions_panel_data_json(@project) %template.js-project-permissions-form-data{ type: "application/json" }= project_permissions_panel_data_json(@project)
.js-project-permissions-form .js-project-permissions-form
- if !show_visibility_confirm_modal?(@project) - if show_visibility_confirm_modal?(@project)
= render "visibility_modal" = render "visibility_modal"
.gl-display-flex.gl-justify-content-end = f.submit _('Save changes'), class: "btn btn-success #{('js-confirm-danger' if show_visibility_confirm_modal?(@project))}", data: { qa_selector: 'visibility_features_permissions_save_button', check_field_name: ("project[visibility_level]" if show_visibility_confirm_modal?(@project)), check_compare_value: @project.visibility_level }
= f.submit _('Save changes'), class: "btn btn-success #{('js-confirm-danger' if show_visibility_confirm_modal?(@project))}", data: { qa_selector: 'visibility_features_permissions_save_button', check_field_name: ("project[visibility_level]" if show_visibility_confirm_modal?(@project)), check_compare_value: @project.visibility_level }
%section.qa-merge-request-settings.rspec-merge-request-settings.settings.merge-requests-feature.no-animate#js-merge-request-settings{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:merge_requests_access_level) == 0)] } %section.qa-merge-request-settings.rspec-merge-request-settings.settings.merge-requests-feature.no-animate#js-merge-request-settings{ class: [('expanded' if expanded), ('hidden' if @project.project_feature.send(:merge_requests_access_level) == 0)] }
.settings-header .settings-header
...@@ -39,7 +38,7 @@ ...@@ -39,7 +38,7 @@
%input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-settings' } %input{ name: 'update_section', type: 'hidden', value: 'js-merge-request-settings' }
= render 'projects/merge_request_settings', form: f = render 'projects/merge_request_settings', form: f
.gl-display-flex.gl-justify-content-end .gl-display-flex.gl-justify-content-end
= f.submit _('Save changes'), class: "btn btn-succes gl-display-flex gl-justify-content-end qa-save-merge-request-changes rspec-save-merge-request-changes" = f.submit _('Save changes'), class: "btn btn-succes qa-save-merge-request-changes rspec-save-merge-request-changes"
= render_if_exists 'projects/merge_request_approvals_settings', expanded: expanded = render_if_exists 'projects/merge_request_approvals_settings', expanded: expanded
......
...@@ -22,10 +22,10 @@ RSpec.describe 'User changes public project visibility', :js do ...@@ -22,10 +22,10 @@ RSpec.describe 'User changes public project visibility', :js do
click_button 'Save changes' click_button 'Save changes'
end end
find('.js-confirm-danger-input').send_keys(project.name) find('.js-confirm-danger-input').send_keys(project.path_with_namespace)
page.within '.modal' do page.within '.modal' do
click_button 'Confirm' click_button 'Reduce project visibility'
end end
expect(page).to have_text("Project '#{project.name}' was successfully updated") expect(page).to have_text("Project '#{project.name}' was successfully updated")
......
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