Commit 92902735 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'master' into issue-discussions-refactor

* master:
  Fix pipeline icon in contextual nav for projects
  fixed up specs
  trying to fix tests
  fix merge conflicts
  css fixes
  try and fix some tests
  34060 Simply general project settings to use expanded panels
parents e4f8aa71 0b102591
...@@ -347,6 +347,8 @@ import GpgBadges from './gpg_badges'; ...@@ -347,6 +347,8 @@ import GpgBadges from './gpg_badges';
break; break;
case 'projects:edit': case 'projects:edit':
setupProjectEdit(); setupProjectEdit();
// Initialize expandable settings panels
initSettingsPanels();
break; break;
case 'projects:imports:show': case 'projects:imports:show':
new ProjectImport(); new ProjectImport();
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
} }
select { select {
background: transparent;
transition: background 2s ease-out; transition: background 2s ease-out;
&.highlight-changes { &.highlight-changes {
......
...@@ -54,8 +54,7 @@ ...@@ -54,8 +54,7 @@
.settings-content { .settings-content {
max-height: 1px; max-height: 1px;
overflow-y: scroll; overflow-y: scroll;
margin-right: -20px; padding-right: 110px;
padding-right: 130px;
animation: collapseMaxHeight 300ms ease-out; animation: collapseMaxHeight 300ms ease-out;
&.expanded { &.expanded {
...@@ -87,6 +86,23 @@ ...@@ -87,6 +86,23 @@
overflow: hidden; overflow: hidden;
margin-top: 20px; margin-top: 20px;
} }
.sub-section {
margin-bottom: 32px;
padding: 16px;
border: 1px solid $border-color;
background-color: $gray-light;
}
.bs-callout,
.checkbox:first-child,
.help-block {
margin-top: 0;
}
.label-light {
margin-bottom: 0;
}
} }
.settings-list-icon { .settings-list-icon {
......
...@@ -124,9 +124,9 @@ ...@@ -124,9 +124,9 @@
= nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :environments, :artifacts]) do = nav_link(controller: [:pipelines, :builds, :jobs, :pipeline_schedules, :environments, :artifacts]) do
= link_to project_pipelines_path(@project), title: 'CI / CD', class: 'shortcuts-pipelines' do = link_to project_pipelines_path(@project), title: 'CI / CD', class: 'shortcuts-pipelines' do
.nav-icon-container .nav-icon-container
= custom_icon('CI / CD') = custom_icon('pipeline')
%span.nav-item-name %span.nav-item-name
Pipelines CI / CD
%ul.sidebar-sub-level-items %ul.sidebar-sub-level-items
- if project_nav_tab? :pipelines - if project_nav_tab? :pipelines
......
- form = local_assigns.fetch(:form) - form = local_assigns.fetch(:form)
%fieldset.features.merge-requests-feature.append-bottom-default = render 'projects/merge_request_merge_settings', form: form
%hr
%h5.prepend-top-0
Merge Requests
= render 'projects/merge_request_merge_settings', form: form
- page_title "General"
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- expanded = Rails.env.test?
= render "projects/settings/head" = render "projects/settings/head"
.project-edit-container .project-edit-container
.row.prepend-top-default %section.settings.general-settings
.col-lg-4.profile-settings-sidebar .settings-header
%h4.prepend-top-0 %h4
Project settings General project settings
.col-lg-8 %button.btn.js-settings-toggle
= expanded ? 'Collapse' : 'Expand'
%p
Update your project name, description, avatar, and other general settings.
.settings-content.no-animate{ class: ('expanded' if expanded) }
.project-edit-errors .project-edit-errors
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f| = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit-project" }, authenticity_token: true do |f|
%fieldset %fieldset
...@@ -35,89 +42,7 @@ ...@@ -35,89 +42,7 @@
= f.label :tag_list, "Tags", class: 'label-light' = f.label :tag_list, "Tags", class: 'label-light'
= f.text_field :tag_list, value: @project.tag_list.sort.join(', '), maxlength: 2000, class: "form-control" = f.text_field :tag_list, value: @project.tag_list.sort.join(', '), maxlength: 2000, class: "form-control"
%p.help-block Separate tags with commas. %p.help-block Separate tags with commas.
%hr %fieldset.features
%fieldset
%h5.prepend-top-0
Sharing & Permissions
.form_group.prepend-top-20.sharing-and-permissions
.row.js-visibility-select
.col-md-8
.label-light
= label_tag :project_visibility, 'Project Visibility', class: 'label-light', for: :project_visibility_level
= link_to icon('question-circle'), help_page_path("public_access/public_access")
%span.help-block
.col-md-4.visibility-select-container
= render('projects/visibility_select', model_method: :visibility_level, form: f, selected_level: @project.visibility_level)
= f.fields_for :project_feature do |feature_fields|
%fieldset.features
.row
.col-md-8.project-feature
= feature_fields.label :repository_access_level, "Repository", class: 'label-light'
%span.help-block View and edit files in this project
.col-md-4.js-repo-access-level
= project_feature_access_select(:repository_access_level)
.row
.col-md-8.project-feature.nested
= feature_fields.label :merge_requests_access_level, "Merge requests", class: 'label-light'
%span.help-block Submit changes to be merged upstream
.col-md-4
= project_feature_access_select(:merge_requests_access_level)
.row
.col-md-8.project-feature.nested
= feature_fields.label :builds_access_level, "Pipelines", class: 'label-light'
%span.help-block Build, test, and deploy your changes
.col-md-4
= project_feature_access_select(:builds_access_level)
.row
.col-md-8.project-feature
= feature_fields.label :snippets_access_level, "Snippets", class: 'label-light'
%span.help-block Share code pastes with others out of Git repository
.col-md-4
= project_feature_access_select(:snippets_access_level)
.row
.col-md-8.project-feature
= feature_fields.label :issues_access_level, "Issues", class: 'label-light'
%span.help-block Lightweight issue tracking system for this project
.col-md-4
= project_feature_access_select(:issues_access_level)
.row
.col-md-8.project-feature
= feature_fields.label :wiki_access_level, "Wiki", class: 'label-light'
%span.help-block Pages for project documentation
.col-md-4
= project_feature_access_select(:wiki_access_level)
.form-group
= render 'shared/allow_request_access', form: f
- if Gitlab.config.lfs.enabled && current_user.admin?
.row.js-lfs-enabled
.col-md-8
= f.label :lfs_enabled, 'LFS', class: 'label-light'
%span.help-block
Git Large File Storage
= link_to icon('question-circle'), help_page_path('workflow/lfs/manage_large_binaries_with_git_lfs')
.col-md-4
.select-wrapper
= f.select :lfs_enabled, [%w(Enabled true), %w(Disabled false)], {}, selected: @project.lfs_enabled?, class: 'pull-right form-control project-repo-select select-control', data: { field: 'lfs_enabled' }
= icon('chevron-down')
- if Gitlab.config.registry.enabled
.form-group.js-container-registry{ style: ("display: none;" if @project.project_feature.send(:repository_access_level) == 0) }
.checkbox
= f.label :container_registry_enabled do
= f.check_box :container_registry_enabled
%strong Container Registry
%br
%span.descr Enable Container Registry for this project
= link_to icon('question-circle'), help_page_path('user/project/container_registry'), target: '_blank'
= render 'merge_request_settings', form: f
%hr
%fieldset.features.append-bottom-default
%h5.prepend-top-0 %h5.prepend-top-0
Project avatar Project avatar
.form-group .form-group
...@@ -137,41 +62,114 @@ ...@@ -137,41 +62,114 @@
= link_to 'Remove avatar', project_avatar_path(@project), data: { confirm: "Project avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar" = link_to 'Remove avatar', project_avatar_path(@project), data: { confirm: "Project avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
= f.submit 'Save changes', class: "btn btn-save" = f.submit 'Save changes', class: "btn btn-save"
.row.prepend-top-default %section.settings.sharing-permissions
%hr .settings-header
.row.prepend-top-default %h4
.col-lg-4 Sharing and permissions
%h4.prepend-top-0 %button.btn.js-settings-toggle
Housekeeping = expanded ? 'Collapse' : 'Expand'
%p.append-bottom-0 %p
%p Enable or disable certain project features and choose access levels.
Runs a number of housekeeping tasks within the current repository, .settings-content.no-animate{ class: ('expanded' if expanded) }
such as compressing file revisions and removing unreachable objects. = form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "sharing-permissions-form" }, authenticity_token: true do |f|
.col-lg-8 .form_group.sharing-and-permissions
= link_to 'Housekeeping', housekeeping_project_path(@project), .row.js-visibility-select
method: :post, class: "btn btn-default" .col-md-8
%hr .label-light
.row.prepend-top-default = label_tag :project_visibility, 'Project Visibility', class: 'label-light', for: :project_visibility_level
.col-lg-4 = link_to icon('question-circle'), help_page_path("public_access/public_access")
%h4.prepend-top-0 %span.help-block
Export project .col-md-4.visibility-select-container
%p.append-bottom-0 = render('projects/visibility_select', model_method: :visibility_level, form: f, selected_level: @project.visibility_level)
%p = f.fields_for :project_feature do |feature_fields|
Export this project with all its related data in order to move your project to a new GitLab instance. Once the export is finished, you can import the file from the "New Project" page. %fieldset.features
%p .row
Once the exported file is ready, you will receive a notification email with a download link. .col-md-8.project-feature
= feature_fields.label :repository_access_level, "Repository", class: 'label-light'
%span.help-block View and edit files in this project
.col-md-4.js-repo-access-level
= project_feature_access_select(:repository_access_level)
.col-lg-8 .row
.col-md-8.project-feature.nested
= feature_fields.label :merge_requests_access_level, "Merge requests", class: 'label-light'
%span.help-block Submit changes to be merged upstream
.col-md-4
= project_feature_access_select(:merge_requests_access_level)
- if @project.export_project_path .row
= link_to 'Download export', download_export_project_path(@project), .col-md-8.project-feature.nested
rel: 'nofollow', download: '', method: :get, class: "btn btn-default" = feature_fields.label :builds_access_level, "Pipelines", class: 'label-light'
= link_to 'Generate new export', generate_new_export_project_path(@project), %span.help-block Build, test, and deploy your changes
method: :post, class: "btn btn-default" .col-md-4
- else = project_feature_access_select(:builds_access_level)
= link_to 'Export project', export_project_path(@project),
method: :post, class: "btn btn-default" .row
.col-md-8.project-feature
= feature_fields.label :snippets_access_level, "Snippets", class: 'label-light'
%span.help-block Share code pastes with others out of Git repository
.col-md-4
= project_feature_access_select(:snippets_access_level)
.row
.col-md-8.project-feature
= feature_fields.label :issues_access_level, "Issues", class: 'label-light'
%span.help-block Lightweight issue tracking system for this project
.col-md-4
= project_feature_access_select(:issues_access_level)
.row
.col-md-8.project-feature
= feature_fields.label :wiki_access_level, "Wiki", class: 'label-light'
%span.help-block Pages for project documentation
.col-md-4
= project_feature_access_select(:wiki_access_level)
.form-group
= render 'shared/allow_request_access', form: f
- if Gitlab.config.lfs.enabled && current_user.admin?
.row.js-lfs-enabled.form-group.sharing-and-permissions
.col-md-8
= f.label :lfs_enabled, 'Git Large File Storage', class: 'label-light'
= link_to icon('question-circle'), help_page_path('workflow/lfs/manage_large_binaries_with_git_lfs')
%span.help-block Manages large files such as audio, video and graphics files.
.col-md-4
.select-wrapper
= f.select :lfs_enabled, [%w(Enabled true), %w(Disabled false)], {}, selected: @project.lfs_enabled?, class: 'pull-right form-control project-repo-select select-control', data: { field: 'lfs_enabled' }
= icon('chevron-down')
- if Gitlab.config.registry.enabled
.form-group.js-container-registry{ style: ("display: none;" if @project.project_feature.send(:repository_access_level) == 0) }
.checkbox
= f.label :container_registry_enabled do
= f.check_box :container_registry_enabled
%strong Container Registry
%br
%span.descr Enable Container Registry for this project
= link_to icon('question-circle'), help_page_path('user/project/container_registry'), target: '_blank'
= f.submit 'Save changes', class: "btn btn-save"
%section.settings.merge-requests-feature{ style: ("display: none;" if @project.project_feature.send(:merge_requests_access_level) == 0) }
.settings-header
%h4
Merge request settings
%button.btn.js-settings-toggle
= expanded ? 'Collapse' : 'Expand'
%p
Customize your merge request restrictions.
.settings-content.no-animate{ class: ('expanded' if expanded) }
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "merge-request-settings-form" }, authenticity_token: true do |f|
= render 'merge_request_settings', form: f
= f.submit 'Save changes', class: "btn btn-save"
%section.settings
.settings-header
%h4
Export project
%button.btn.js-settings-toggle
= expanded ? 'Collapse' : 'Expand'
%p
Export this project with all its related data in order to move your project to a new GitLab instance. Once the export is finished, you can import the file from the "New Project" page.
.settings-content.no-animate{ class: ('expanded' if expanded) }
.bs-callout.bs-callout-info .bs-callout.bs-callout-info
%p.append-bottom-0 %p.append-bottom-0
%p %p
...@@ -189,110 +187,117 @@ ...@@ -189,110 +187,117 @@
%li Container registry images %li Container registry images
%li CI variables %li CI variables
%li Any encrypted tokens %li Any encrypted tokens
- if can? current_user, :archive_project, @project %p
%hr Once the exported file is ready, you will receive a notification email with a download link.
.row.prepend-top-default - if @project.export_project_path
.col-lg-4 = link_to 'Download export', download_export_project_path(@project),
%h4.warning-title.prepend-top-0 rel: 'nofollow', download: '', method: :get, class: "btn btn-default"
- if @project.archived? = link_to 'Generate new export', generate_new_export_project_path(@project),
Unarchive project method: :post, class: "btn btn-default"
- else - else
Archive project = link_to 'Export project', export_project_path(@project),
%p.append-bottom-0 method: :post, class: "btn btn-default"
%section.settings.advanced-settings
.settings-header
%h4
Advanced settings
%button.btn.js-settings-toggle
= expanded ? 'Collapse' : 'Expand'
%p
Perform advanced options such as housekeeping, exporting, archiveing, renameing, transfering, or removeing your project.
.settings-content.no-animate{ class: ('expanded' if expanded) }
.sub-section
%h4 Housekeeping
%p
Runs a number of housekeeping tasks within the current repository, such as compressing file revisions and removing unreachable objects.
= link_to 'Run housekeeping', housekeeping_project_path(@project),
method: :post, class: "btn btn-default"
- if can? current_user, :archive_project, @project
.sub-section
%h4.warning-title
- if @project.archived?
Unarchive project
- else
Archive project
- if @project.archived? - if @project.archived?
Unarchiving the project will mark its repository as active. The project can be committed to. %p
Unarchiving the project will mark its repository as active. The project can be committed to.
%strong Once active this project shows up in the search and on the dashboard.
= link_to 'Unarchive project', unarchive_project_path(@project),
data: { confirm: "Are you sure that you want to unarchive this project?\nWhen this project is unarchived it is active and can be committed to again." },
method: :post, class: "btn btn-success"
- else - else
Archiving the project will mark its repository as read-only. It is hidden from the dashboard and doesn't show up in searches. %p
.col-lg-8 Archiving the project will mark its repository as read-only. It is hidden from the dashboard and doesn't show up in searches.
- if @project.archived? %strong Archived projects cannot be committed to!
%p = link_to 'Archive project', archive_project_path(@project),
%strong Once active this project shows up in the search and on the dashboard. data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." },
= link_to 'Unarchive project', unarchive_project_path(@project), method: :post, class: "btn btn-warning"
data: { confirm: "Are you sure that you want to unarchive this project?\nWhen this project is unarchived it is active and can be committed to again." }, .sub-section.rename-respository
method: :post, class: "btn btn-success" %h4.warning-title
- else Rename repository
%p %p
%strong Archived projects cannot be committed to! Export this project with all its related data in order to move your project to a new GitLab instance. Once the export is finished, you can import the file from the "New Project" page.
= link_to 'Archive project', archive_project_path(@project), = render 'projects/errors'
data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." }, = form_for([@project.namespace.becomes(Namespace), @project]) do |f|
method: :post, class: "btn btn-warning" .form-group.project_name_holder
%hr = f.label :name, class: 'label-light' do
.row.prepend-top-default Project name
.col-lg-4 .form-group
%h4.prepend-top-0.warning-title = f.text_field :name, class: "form-control"
Rename repository
.col-lg-8
= render 'projects/errors'
= form_for([@project.namespace.becomes(Namespace), @project]) do |f|
.form-group.project_name_holder
= f.label :name, class: 'label-light' do
Project name
.form-group
= f.text_field :name, class: "form-control"
.form-group
= f.label :path, class: 'label-light' do
%span Path
.form-group
.input-group
.input-group-addon
#{URI.join(root_url, @project.namespace.full_path)}/
= f.text_field :path, class: 'form-control'
%ul
%li Be careful. Renaming a project's repository can have unintended side effects.
%li You will need to update your local repositories to point to the new location.
- if @project.deployment_services.any?
%li Your deployment services will be broken, you will need to manually fix the services after renaming.
= f.submit 'Rename project', class: "btn btn-warning"
- if can?(current_user, :change_namespace, @project)
%hr
.row.prepend-top-default
.col-lg-4
%h4.prepend-top-0.danger-title
Transfer project to new group
%p.append-bottom-0
Please select the group you want to transfer this project to in the dropdown to the right.
.col-lg-8
= form_for([@project.namespace.becomes(Namespace), @project], url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'js-project-transfer-form' } ) do |f|
.form-group .form-group
= label_tag :new_namespace_id, nil, class: 'label-light' do = f.label :path, class: 'label-light' do
%span Select a new namespace %span Path
.form-group .form-group
= select_tag :new_namespace_id, namespaces_options(nil), include_blank: true, class: 'select2' .input-group
.input-group-addon
#{URI.join(root_url, @project.namespace.full_path)}/
= f.text_field :path, class: 'form-control'
%ul %ul
%li Be careful. Changing the project's namespace can have unintended side effects. %li Be careful. Renaming a project's repository can have unintended side effects.
%li You can only transfer the project to namespaces you manage.
%li You will need to update your local repositories to point to the new location. %li You will need to update your local repositories to point to the new location.
%li Project visibility level will be changed to match namespace rules when transfering to a group. - if @project.deployment_services.any?
= f.submit 'Transfer project', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => transfer_project_message(@project) } %li Your deployment services will be broken, you will need to manually fix the services after renaming.
- if @project.forked? && can?(current_user, :remove_fork_project, @project) = f.submit 'Rename project', class: "btn btn-warning"
%hr - if can?(current_user, :change_namespace, @project)
.row.prepend-top-default.append-bottom-default .sub-section
.col-lg-4 %h4.danger-title
%h4.prepend-top-0.danger-title Transfer project
Remove fork relationship = form_for([@project.namespace.becomes(Namespace), @project], url: transfer_project_path(@project), method: :put, remote: true, html: { class: 'js-project-transfer-form' } ) do |f|
%p.append-bottom-0 .form-group
= label_tag :new_namespace_id, nil, class: 'label-light' do
%span Select a new namespace
.form-group
= select_tag :new_namespace_id, namespaces_options(nil), include_blank: true, class: 'select2'
%ul
%li Be careful. Changing the project's namespace can have unintended side effects.
%li You can only transfer the project to namespaces you manage.
%li You will need to update your local repositories to point to the new location.
%li Project visibility level will be changed to match namespace rules when transfering to a group.
= f.submit 'Transfer project', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => transfer_project_message(@project) }
- if @project.forked? && can?(current_user, :remove_fork_project, @project)
.sub-section
%h4.danger-title
Remove fork relationship
%p %p
This will remove the fork relationship to source project This will remove the fork relationship to source project
= succeed "." do = succeed "." do
= link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project) = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
.col-lg-8 = form_for([@project.namespace.becomes(Namespace), @project], url: remove_fork_project_path(@project), method: :delete, remote: true, html: { class: 'transfer-project' }) do |f|
= form_for([@project.namespace.becomes(Namespace), @project], url: remove_fork_project_path(@project), method: :delete, remote: true, html: { class: 'transfer-project' }) do |f| %p
%p %strong Once removed, the fork relationship cannot be restored and you will no longer be able to send merge requests to the source.
%strong Once removed, the fork relationship cannot be restored and you will no longer be able to send merge requests to the source. = button_to 'Remove fork relationship', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_message(@project) }
= button_to 'Remove fork relationship', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_message(@project) } - if can?(current_user, :remove_project, @project)
- if can?(current_user, :remove_project, @project) .sub-section
%hr %h4.danger-title
.row.prepend-top-default.append-bottom-default Remove project
.col-lg-4
%h4.prepend-top-0.danger-title
Remove project
%p.append-bottom-0
Removing the project will delete its repository and all related resources including issues, merge requests etc.
.col-lg-8
= form_tag(project_path(@project), method: :delete) do
%p %p
%strong Removed projects cannot be restored! Removing the project will delete its repository and all related resources including issues, merge requests etc.
= button_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) } = form_tag(project_path(@project), method: :delete) do
%p
%strong Removed projects cannot be restored!
= button_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) }
.save-project-loader.hide .save-project-loader.hide
.center .center
......
...@@ -10,7 +10,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -10,7 +10,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end end
step 'I save project' do step 'I save project' do
click_button 'Save changes' page.within '.general-settings' do
click_button 'Save changes'
end
end end
step 'I should see project with new settings' do step 'I should see project with new settings' do
...@@ -31,7 +33,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -31,7 +33,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar, :project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
) )
click_button 'Save changes' page.within '.general-settings' do
click_button 'Save changes'
end
@project.reload @project.reload
end end
...@@ -50,7 +54,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -50,7 +54,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar, :project_avatar,
File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')
) )
click_button 'Save changes' page.within '.general-settings' do
click_button 'Save changes'
end
@project.reload @project.reload
end end
...@@ -69,7 +75,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -69,7 +75,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step 'change project default branch' do step 'change project default branch' do
select 'fix', from: 'project_default_branch' select 'fix', from: 'project_default_branch'
click_button 'Save changes' page.within '.general-settings' do
click_button 'Save changes'
end
end end
step 'I should see project default branch changed' do step 'I should see project default branch changed' do
......
...@@ -103,7 +103,7 @@ module SharedProject ...@@ -103,7 +103,7 @@ module SharedProject
step 'I should see project settings' do step 'I should see project settings' do
expect(current_path).to eq edit_project_path(@project) expect(current_path).to eq edit_project_path(@project)
expect(page).to have_content("Project name") expect(page).to have_content("Project name")
expect(page).to have_content("Sharing & Permissions") expect(page).to have_content("Sharing and permissions")
end end
def current_project def current_project
......
...@@ -20,21 +20,25 @@ describe 'Edit Project Settings' do ...@@ -20,21 +20,25 @@ describe 'Edit Project Settings' do
visit edit_project_path(project) visit edit_project_path(project)
select 'Disabled', from: "project_project_feature_attributes_#{tool_name}_access_level" select 'Disabled', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes' page.within('.sharing-permissions') do
click_button 'Save changes'
end
wait_for_requests wait_for_requests
expect(page).not_to have_selector(".shortcuts-#{shortcut_name}") expect(page).not_to have_selector(".shortcuts-#{shortcut_name}")
select 'Everyone with access', from: "project_project_feature_attributes_#{tool_name}_access_level" select 'Everyone with access', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes' page.within('.sharing-permissions') do
click_button 'Save changes'
end
wait_for_requests wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}") expect(page).to have_selector(".shortcuts-#{shortcut_name}")
select 'Only team members', from: "project_project_feature_attributes_#{tool_name}_access_level" select 'Only team members', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes' page.within('.sharing-permissions') do
click_button 'Save changes'
end
wait_for_requests wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}") expect(page).to have_selector(".shortcuts-#{shortcut_name}")
sleep 0.1
end end
end end
end end
...@@ -174,7 +178,11 @@ describe 'Edit Project Settings' do ...@@ -174,7 +178,11 @@ describe 'Edit Project Settings' do
it "disables repository related features" do it "disables repository related features" do
select "Disabled", from: "project_project_feature_attributes_repository_access_level" select "Disabled", from: "project_project_feature_attributes_repository_access_level"
expect(find(".edit-project")).to have_selector("select.disabled", count: 2) page.within('.sharing-permissions') do
click_button "Save changes"
end
expect(find(".sharing-permissions")).to have_selector("select.disabled", count: 2)
end end
it "shows empty features project homepage" do it "shows empty features project homepage" do
...@@ -182,7 +190,9 @@ describe 'Edit Project Settings' do ...@@ -182,7 +190,9 @@ describe 'Edit Project Settings' do
select "Disabled", from: "project_project_feature_attributes_issues_access_level" select "Disabled", from: "project_project_feature_attributes_issues_access_level"
select "Disabled", from: "project_project_feature_attributes_wiki_access_level" select "Disabled", from: "project_project_feature_attributes_wiki_access_level"
click_button "Save changes" page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests wait_for_requests
visit project_path(project) visit project_path(project)
...@@ -195,7 +205,9 @@ describe 'Edit Project Settings' do ...@@ -195,7 +205,9 @@ describe 'Edit Project Settings' do
select "Disabled", from: "project_project_feature_attributes_issues_access_level" select "Disabled", from: "project_project_feature_attributes_issues_access_level"
select "Disabled", from: "project_project_feature_attributes_wiki_access_level" select "Disabled", from: "project_project_feature_attributes_wiki_access_level"
click_button "Save changes" page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests wait_for_requests
visit activity_project_path(project) visit activity_project_path(project)
...@@ -236,7 +248,9 @@ describe 'Edit Project Settings' do ...@@ -236,7 +248,9 @@ describe 'Edit Project Settings' do
end end
def save_changes_and_check_activity_tab def save_changes_and_check_activity_tab
click_button "Save changes" page.within('.sharing-permissions') do
click_button "Save changes"
end
wait_for_requests wait_for_requests
visit activity_project_path(project) visit activity_project_path(project)
......
...@@ -14,7 +14,9 @@ describe 'Edit Project Settings' do ...@@ -14,7 +14,9 @@ describe 'Edit Project Settings' do
it 'shows errors for invalid project name' do it 'shows errors for invalid project name' do
visit edit_project_path(project) visit edit_project_path(project)
fill_in 'project_name_edit', with: 'foo&bar' fill_in 'project_name_edit', with: 'foo&bar'
click_button 'Save changes' page.within('.general-settings') do
click_button 'Save changes'
end
expect(page).to have_field 'project_name_edit', with: 'foo&bar' expect(page).to have_field 'project_name_edit', with: 'foo&bar'
expect(page).to have_content "Name can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'." expect(page).to have_content "Name can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'."
expect(page).to have_button 'Save changes' expect(page).to have_button 'Save changes'
...@@ -23,7 +25,9 @@ describe 'Edit Project Settings' do ...@@ -23,7 +25,9 @@ describe 'Edit Project Settings' do
it 'shows a successful notice when the project is updated' do it 'shows a successful notice when the project is updated' do
visit edit_project_path(project) visit edit_project_path(project)
fill_in 'project_name_edit', with: 'hello world' fill_in 'project_name_edit', with: 'hello world'
click_button 'Save changes' page.within('.general-settings') do
click_button 'Save changes'
end
expect(page).to have_content "Project 'hello world' was successfully updated." expect(page).to have_content "Project 'hello world' was successfully updated."
end end
end end
......
...@@ -20,6 +20,9 @@ feature 'Project settings > Merge Requests', :js do ...@@ -20,6 +20,9 @@ feature 'Project settings > Merge Requests', :js do
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved') expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
select 'Disabled', from: "project_project_feature_attributes_merge_requests_access_level" select 'Disabled', from: "project_project_feature_attributes_merge_requests_access_level"
within('.sharing-permissions-form') do
click_on('Save changes')
end
expect(page).not_to have_content('Only allow merge requests to be merged if the pipeline succeeds') expect(page).not_to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved') expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved')
...@@ -37,6 +40,9 @@ feature 'Project settings > Merge Requests', :js do ...@@ -37,6 +40,9 @@ feature 'Project settings > Merge Requests', :js do
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved') expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
select 'Everyone with access', from: "project_project_feature_attributes_builds_access_level" select 'Everyone with access', from: "project_project_feature_attributes_builds_access_level"
within('.sharing-permissions-form') do
click_on('Save changes')
end
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds') expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved') expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
...@@ -55,6 +61,9 @@ feature 'Project settings > Merge Requests', :js do ...@@ -55,6 +61,9 @@ feature 'Project settings > Merge Requests', :js do
expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved') expect(page).not_to have_content('Only allow merge requests to be merged if all discussions are resolved')
select 'Everyone with access', from: "project_project_feature_attributes_merge_requests_access_level" select 'Everyone with access', from: "project_project_feature_attributes_merge_requests_access_level"
within('.sharing-permissions-form') do
click_on('Save changes')
end
expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds') expect(page).to have_content('Only allow merge requests to be merged if the pipeline succeeds')
expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved') expect(page).to have_content('Only allow merge requests to be merged if all discussions are resolved')
...@@ -73,7 +82,9 @@ feature 'Project settings > Merge Requests', :js do ...@@ -73,7 +82,9 @@ feature 'Project settings > Merge Requests', :js do
scenario 'when unchecked sets :printing_merge_request_link_enabled to false' do scenario 'when unchecked sets :printing_merge_request_link_enabled to false' do
uncheck('project_printing_merge_request_link_enabled') uncheck('project_printing_merge_request_link_enabled')
click_on('Save') within('.merge-request-settings-form') do
click_on('Save changes')
end
# Wait for save to complete and page to reload # Wait for save to complete and page to reload
checkbox = find_field('project_printing_merge_request_link_enabled') checkbox = find_field('project_printing_merge_request_link_enabled')
......
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