Commit 05323a78 authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'project-settings' into 'master'

Project settings UI update

![Screen_Shot_2016-05-16_at_16.42.55](/uploads/2e308cbf26a002fc411c3e84b663a5d1/Screen_Shot_2016-05-16_at_16.42.55.png)![Screen_Shot_2016-05-16_at_16.43.01](/uploads/8d983c43307c65852efe002f6e9482d9/Screen_Shot_2016-05-16_at_16.43.01.png)![Screen_Shot_2016-05-16_at_16.43.16](/uploads/6124e0600cc0e5b309a60b065409d537/Screen_Shot_2016-05-16_at_16.43.16.png)![Screen_Shot_2016-05-16_at_16.43.13](/uploads/177976c2c08034e096e7ebdcad1f369f/Screen_Shot_2016-05-16_at_16.43.13.png)

See merge request !4162
parents c00ba9a6 10e3de7a
...@@ -134,14 +134,6 @@ ...@@ -134,14 +134,6 @@
} }
} }
.change-username-title {
color: $gl-warning;
}
.remove-account-title {
color: $gl-danger;
}
.provider-btn-group { .provider-btn-group {
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
margin-bottom: 0; margin-bottom: 0;
} }
.new_project, .new_project,
.edit_project { .edit-project {
fieldset.features { fieldset.features {
.control-label { .control-label {
font-weight: normal; font-weight: normal;
......
...@@ -12,3 +12,11 @@ ...@@ -12,3 +12,11 @@
border: 1px solid $warning-message-border; border: 1px solid $warning-message-border;
border-radius: $border-radius-base; border-radius: $border-radius-base;
} }
.warning-title {
color: $gl-warning;
}
.danger-title {
color: $gl-danger;
}
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
- if current_user.can_change_username? - if current_user.can_change_username?
.row.prepend-top-default .row.prepend-top-default
.col-lg-3.profile-settings-sidebar .col-lg-3.profile-settings-sidebar
%h4.prepend-top-0.change-username-title %h4.prepend-top-0.warning-title
Change username Change username
%p %p
Changing your username will change path to all personal projects! Changing your username will change path to all personal projects!
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
- if signup_enabled? - if signup_enabled?
.row.prepend-top-default .row.prepend-top-default
.col-lg-3.profile-settings-sidebar .col-lg-3.profile-settings-sidebar
%h4.prepend-top-0.remove-account-title %h4.prepend-top-0.danger-title
Remove account Remove account
.col-lg-9 .col-lg-9
- if @user.can_be_removed? - if @user.can_be_removed?
......
%fieldset.builds-feature %fieldset.builds-feature
%legend %h5.prepend-top-0
Builds: Builds
- unless @repository.gitlab_ci_yml - unless @repository.gitlab_ci_yml
.form-group .form-group
.col-sm-offset-2.col-sm-10 %p Builds need to be configured before you can begin using Continuous Integration.
%p Builds need to be configured before you can begin using Continuous Integration. = link_to 'Get started with Builds', help_page_path('ci/quick_start', 'README'), class: 'btn btn-info'
= link_to 'Get started with Builds', help_page_path('ci/quick_start', 'README'), class: 'btn btn-info'
%hr
.form-group .form-group
.col-sm-offset-2.col-sm-10 %p Get recent application code using the following command:
%p Get recent application code using the following command: .radio
.radio = f.label :build_allow_git_fetch_false do
= f.label :build_allow_git_fetch_false do = f.radio_button :build_allow_git_fetch, 'false'
= f.radio_button :build_allow_git_fetch, 'false' %strong git clone
%strong git clone %br
%br %span.descr Slower but makes sure you have a clean dir before every build
%span.descr Slower but makes sure you have a clean dir before every build .radio
.radio = f.label :build_allow_git_fetch_true do
= f.label :build_allow_git_fetch_true do = f.radio_button :build_allow_git_fetch, 'true'
= f.radio_button :build_allow_git_fetch, 'true' %strong git fetch
%strong git fetch %br
%br %span.descr Faster
%span.descr Faster
.form-group .form-group
= f.label :build_timeout_in_minutes, 'Timeout', class: 'control-label' = f.label :build_timeout_in_minutes, 'Timeout', class: 'label-light'
.col-sm-10 = f.number_field :build_timeout_in_minutes, class: 'form-control', min: '0'
= f.number_field :build_timeout_in_minutes, class: 'form-control', min: '0' %p.help-block per build in minutes
%p.help-block per build in minutes
.form-group .form-group
= f.label :build_coverage_regex, "Test coverage parsing", class: 'control-label' = f.label :build_coverage_regex, "Test coverage parsing", class: 'label-light'
.col-sm-10 .input-group
.input-group %span.input-group-addon /
%span.input-group-addon / = f.text_field :build_coverage_regex, class: 'form-control', placeholder: '\(\d+.\d+\%\) covered'
= f.text_field :build_coverage_regex, class: 'form-control', placeholder: '\(\d+.\d+\%\) covered' %span.input-group-addon /
%span.input-group-addon / %p.help-block
%p.help-block We will use this regular expression to find test coverage output in build trace.
We will use this regular expression to find test coverage output in build trace. Leave blank if you want to disable this feature
Leave blank if you want to disable this feature .bs-callout.bs-callout-info
.bs-callout.bs-callout-info %p Below are examples of regex for existing tools:
%p Below are examples of regex for existing tools: %ul
%ul %li
%li Simplecov (Ruby) -
Simplecov (Ruby) - %code \(\d+.\d+\%\) covered
%code \(\d+.\d+\%\) covered %li
%li pytest-cov (Python) -
pytest-cov (Python) - %code \d+\%\s*$
%code \d+\%\s*$ %li
%li phpunit --coverage-text --colors=never (PHP) -
phpunit --coverage-text --colors=never (PHP) - %code ^\s*Lines:\s*\d+.\d+\%
%code ^\s*Lines:\s*\d+.\d+\% %li
%li gcovr (C/C++) -
gcovr (C/C++) - %code ^TOTAL.*\s+(\d+\%)$
%code ^TOTAL.*\s+(\d+\%)$ %li
%li tap --coverage-report=text-summary (Node.js) -
tap --coverage-report=text-summary (Node.js) - %code ^Statements\s*:\s*([^%]+)
%code ^Statements\s*:\s*([^%]+)
.form-group .form-group
.col-sm-offset-2.col-sm-10 .checkbox
.checkbox = f.label :public_builds do
= f.label :public_builds do = f.check_box :public_builds
= f.check_box :public_builds %strong Public builds
%strong Public builds .help-block Allow everyone to access builds for Public and Internal projects
.help-block Allow everyone to access builds for Public and Internal projects
.form-group .form-group.append-bottom-0
= f.label :runners_token, "Runners token", class: 'control-label' = f.label :runners_token, "Runners token", class: 'label-light'
.col-sm-10 = f.text_field :runners_token, class: "form-control", placeholder: 'xEeFCaDAB89'
= f.text_field :runners_token, class: "form-control", placeholder: 'xEeFCaDAB89' %p.help-block The secure token used to checkout project.
%p.help-block The secure token used to checkout project.
.project-edit-container.prepend-top-default .project-edit-container
.project-edit-errors .row.prepend-top-default
.project-edit-content .col-lg-3.profile-settings-sidebar
.panel.panel-default %h4.prepend-top-0
.panel-heading
Project settings Project settings
.panel-body .col-lg-9
= form_for [@project.namespace.becomes(Namespace), @project], remote: true, html: { multipart: true, class: "edit_project form-horizontal fieldset-form" }, 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.append-bottom-0
%fieldset
.form-group.project_name_holder
= f.label :name, class: 'control-label' do
Project name
.col-sm-10
= f.text_field :name, class: "form-control", id: "project_name_edit"
.form-group
= f.label :description, class: 'control-label' do
Project description
%span.light (optional)
.col-sm-10
= f.text_area :description, class: "form-control", rows: 3, maxlength: 250
- unless @project.empty_repo?
.form-group
= f.label :default_branch, "Default Branch", class: 'control-label'
.col-sm-10= f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'})
= render 'shared/visibility_level', f: f, visibility_level: @project.visibility_level, can_change_visibility_level: can_change_visibility_level?(@project, current_user), form_model: @project
.form-group .form-group
= f.label :tag_list, "Tags", class: 'control-label' = f.label :name, class: 'label-light' do
.col-sm-10 Project name
= f.text_field :tag_list, value: @project.tag_list.to_s, maxlength: 2000, class: "form-control" = f.text_field :name, class: "form-control", id: "project_name_edit"
%p.help-block Separate tags with commas. .form-group
= f.label :description, class: 'label-light' do
%fieldset.features Project description
%legend %span.light (optional)
Features: = f.text_area :description, class: "form-control", rows: 3, maxlength: 250
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :issues_enabled do
= f.check_box :issues_enabled
%strong Issues
%br
%span.descr Lightweight issue tracking system for this project
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :merge_requests_enabled do
= f.check_box :merge_requests_enabled
%strong Merge Requests
%br
%span.descr Submit changes to be merged upstream
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :builds_enabled do
= f.check_box :builds_enabled
%strong Builds
%br
%span.descr Test and deploy your changes before merge
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :wiki_enabled do
= f.check_box :wiki_enabled
%strong Wiki
%br
%span.descr Pages for project documentation
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :snippets_enabled do
= f.check_box :snippets_enabled
%strong Snippets
%br
%span.descr Share code pastes with others out of git repository
- if Gitlab.config.registry.enabled
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :container_registry_enabled do
= f.check_box :container_registry_enabled
%strong Container Registry
%br
%span.descr Enable Container Registry for this repository
= render 'builds_settings', f: f
%fieldset.features - unless @project.empty_repo?
%legend
Project avatar:
.form-group .form-group
.col-sm-offset-2.col-sm-10 = f.label :default_branch, "Default Branch", class: 'label-light'
- if @project.avatar? = f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'})
= project_icon("#{@project.namespace.to_param}/#{@project.to_param}", alt: '', class: 'avatar project-avatar s160') .form-group.project-visibility-level-holder
%p.light = f.label :visibility_level, class: 'label-light' do
- if @project.avatar_in_git Visibility Level
Project avatar in repository: #{ @project.avatar_in_git } = link_to "(?)", help_page_path("public_access", "public_access")
%p.light - if can_change_visibility_level?(@project, current_user)
- if @project.avatar? = render('shared/visibility_radios', model_method: :visibility_level, form: f, selected_level: @project.visibility_level, form_model: @project)
You can change your project avatar here - else
- else .info
You can upload a project avatar here = visibility_level_icon(@project.visibility_level)
%a.choose-btn.btn.btn-sm.js-choose-project-avatar-button %strong
%i.icon-paper-clip = visibility_level_label(@project.visibility_level)
%span Choose File ... .light= visibility_level_description(@project.visibility_level, @project)
  .form-group
%span.file_name.js-avatar-filename File name... = f.label :tag_list, "Tags", class: 'label-light'
= f.file_field :avatar, class: "js-project-avatar-input hidden" = f.text_field :tag_list, value: @project.tag_list.to_s, maxlength: 2000, class: "form-control"
.light The maximum file size allowed is 200KB. %p.help-block Separate tags with commas.
- if @project.avatar? %hr
%hr %fieldset.features.append-bottom-0
= link_to 'Remove avatar', namespace_project_avatar_path(@project.namespace, @project), data: { confirm: "Project avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar" %h5.prepend-top-0
Features
.form-group
.form-actions .checkbox
= f.submit 'Save changes', class: "btn btn-save" = f.label :issues_enabled do
= f.check_box :issues_enabled
%strong Issues
.danger-settings
.panel.panel-default
.panel-heading Housekeeping
.errors-holder
.panel-body
%p
Runs a number of housekeeping tasks within the current repository,
such as compressing file revisions and removing unreachable objects.
%br
.form-actions
= link_to 'Housekeeping', housekeeping_namespace_project_path(@project.namespace, @project),
method: :post, class: "btn btn-default"
- if can? current_user, :archive_project, @project
- if @project.archived?
.panel.panel-success
.panel-heading
Unarchive project
.panel-body
%p
Unarchiving the project will mark its repository as active.
%br %br
The project can be committed to. %span.descr Lightweight issue tracking system for this project
.form-group
.checkbox
= f.label :merge_requests_enabled do
= f.check_box :merge_requests_enabled
%strong Merge Requests
%br %br
%strong Once active this project shows up in the search and on the dashboard. %span.descr Submit changes to be merged upstream
.form-group
.form-actions .checkbox
= link_to 'Unarchive project', unarchive_namespace_project_path(@project.namespace, @project), = f.label :builds_enabled do
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." }, = f.check_box :builds_enabled
method: :post, class: "btn btn-success" %strong Builds
- else %br
.panel.panel-warning %span.descr Test and deploy your changes before merge
.panel-heading .form-group
Archive project .checkbox
.panel-body = f.label :wiki_enabled do
%p = f.check_box :wiki_enabled
Archiving the project will mark its repository as read-only. %strong Wiki
%br %br
It is hidden from the dashboard and doesn't show up in searches. %span.descr Pages for project documentation
.form-group
.checkbox
= f.label :snippets_enabled do
= f.check_box :snippets_enabled
%strong Snippets
%br %br
%strong Archived projects cannot be committed to! %span.descr Share code pastes with others out of git repository
- if Gitlab.config.registry.enabled
.form-actions
= link_to 'Archive project', archive_namespace_project_path(@project.namespace, @project),
data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." },
method: :post, class: "btn btn-warning"
- else
.nothing-here-block Only the project owner can archive a project
.panel.panel-default.panel.panel-warning
.panel-heading Rename repository
.errors-holder
.panel-body
= form_for([@project.namespace.becomes(Namespace), @project], html: { class: 'form-horizontal' }) do |f|
.form-group.project_name_holder
= f.label :name, class: 'control-label' do
Project name
.col-sm-9
.form-group
= f.text_field :name, class: "form-control"
.form-group .form-group
= f.label :path, class: 'control-label' do .checkbox
%span Path = f.label :container_registry_enabled do
.col-sm-9 = f.check_box :container_registry_enabled
.form-group %strong Container Registry
.input-group
.input-group-addon
#{URI.join(root_url, @project.namespace.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.
.form-actions
= f.submit 'Rename project', class: "btn btn-warning"
- if can?(current_user, :change_namespace, @project)
.panel.panel-default.panel.panel-danger
.panel-heading Transfer project
.errors-holder
.panel-body
= form_for([@project.namespace.becomes(Namespace), @project], url: transfer_namespace_project_path(@project.namespace, @project), method: :put, remote: true, html: { class: 'transfer-project form-horizontal' }) do |f|
.form-group
= label_tag :new_namespace_id, nil, class: 'control-label' do
%span Namespace
.col-sm-9
.form-group
= select_tag :new_namespace_id, namespaces_options(@project.namespace_id), { prompt: 'Choose a project namespace', 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.
.form-actions
= f.submit 'Transfer project', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => transfer_project_message(@project) }
- else
.nothing-here-block Only the project owner can transfer a project
- if @project.forked?
- if can?(current_user, :remove_fork_project, @project)
= form_for([@project.namespace.becomes(Namespace), @project], url: remove_fork_namespace_project_path(@project.namespace, @project), method: :delete, remote: true, html: { class: 'transfer-project form-horizontal' }) do |f|
.panel.panel-default.panel.panel-danger
.panel-heading Remove fork relationship
.panel-body
%p
This will remove the fork relationship to source project
#{link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)}.
%br %br
%strong Once removed, the fork relationship cannot be restored and you will no longer be able to send merge requests to the source. %span.descr Enable Container Registry for this repository
.form-actions %hr
= button_to 'Remove fork relationship', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_fork_project_message(@project) } = render 'builds_settings', f: f
%hr
%fieldset.features.append-bottom-default
%h5.prepend-top-0
Project avatar
.form-group
- if @project.avatar?
= project_icon("#{@project.namespace.to_param}/#{@project.to_param}", alt: '', class: 'avatar project-avatar s160')
%p.light
- if @project.avatar_in_git
Project avatar in repository: #{ @project.avatar_in_git }
%a.choose-btn.btn.js-choose-project-avatar-button
Browse file...
%span.file_name.prepend-left-default.js-avatar-filename No file chosen
= f.file_field :avatar, class: "js-project-avatar-input hidden"
.help-block The maximum file size allowed is 200KB.
- if @project.avatar?
%hr
= link_to 'Remove avatar', namespace_project_avatar_path(@project.namespace, @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"
.row.prepend-top-default
%hr
.row.prepend-top-default
.col-lg-3
%h4.prepend-top-0
Housekeeping
%p.append-bottom-0
%p
Runs a number of housekeeping tasks within the current repository,
such as compressing file revisions and removing unreachable objects.
.col-lg-9
= link_to 'Housekeeping', housekeeping_namespace_project_path(@project.namespace, @project),
method: :post, class: "btn btn-save"
%hr
- if can? current_user, :archive_project, @project
.row.prepend-top-default
.col-lg-3
%h4.warning-title.prepend-top-0
- if @project.archived?
Unarchive project
- else
Archive project
%p.append-bottom-0
- if @project.archived?
Unarchiving the project will mark its repository as active. The project can be committed to.
- else
Archiving the project will mark its repository as read-only. It is hidden from the dashboard and doesn't show up in searches.
.col-lg-9
- if @project.archived?
%p
%strong Once active this project shows up in the search and on the dashboard.
= link_to 'Unarchive project', unarchive_namespace_project_path(@project.namespace, @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
.nothing-here-block Only the project owner can remove the fork relationship. %p
%strong Archived projects cannot be committed to!
- if can?(current_user, :remove_project, @project) = link_to 'Archive project', archive_namespace_project_path(@project.namespace, @project),
.panel.panel-default.panel.panel-danger data: { confirm: "Are you sure that you want to archive this project?\nAn archived project cannot be committed to." },
.panel-heading Remove project method: :post, class: "btn btn-warning"
.panel-body %hr
= form_tag(namespace_project_path(@project.namespace, @project), method: :delete, class: 'form-horizontal') do .row.prepend-top-default
%p .col-lg-3
Removing the project will delete its repository and all related resources including issues, merge requests etc. %h4.prepend-top-0.warning-title
%br Rename repository
%strong Removed projects cannot be restored! .col-lg-9
.form-actions = form_for([@project.namespace.becomes(Namespace), @project]) do |f|
= button_to 'Remove project', '#', class: "btn btn-remove js-confirm-danger", data: { "confirm-danger-message" => remove_project_message(@project) } .form-group.project_name_holder
- else = f.label :name, class: 'label-light' do
.nothing-here-block Only the project owner can remove a project. 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.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.
= f.submit 'Rename project', class: "btn btn-warning"
- if can?(current_user, :change_namespace, @project)
%hr
.row.prepend-top-default
.col-lg-3
%h4.prepend-top-0.danger-title
Transfer project
.col-lg-9
= form_for([@project.namespace.becomes(Namespace), @project], url: transfer_namespace_project_path(@project.namespace, @project), method: :put, remote: true) do |f|
.form-group
= label_tag :new_namespace_id, nil, class: 'label-light' do
%span Namespace
.form-group
= select_tag :new_namespace_id, namespaces_options(@project.namespace_id), { prompt: 'Choose a project namespace', 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)
%hr
.row.prepend-top-default.append-bottom-default
.col-lg-3
%h4.prepend-top-0.danger-title
Remove fork relationship
%p.append-bottom-0
%p
This will remove the fork relationship to source project
= succeed "." do
= link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
.col-lg-9
= form_for([@project.namespace.becomes(Namespace), @project], url: remove_fork_namespace_project_path(@project.namespace, @project), method: :delete, remote: true, html: { class: 'transfer-project' }) do |f|
%p
%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) }
- if can?(current_user, :remove_project, @project)
%hr
.row.prepend-top-default.append-bottom-default
.col-lg-3
%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-9
= form_tag(namespace_project_path(@project.namespace, @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
...@@ -264,5 +224,4 @@ ...@@ -264,5 +224,4 @@
Saving project. Saving project.
%p Please wait a moment, this page will automatically refresh when ready. %p Please wait a moment, this page will automatically refresh when ready.
= render 'shared/confirm_modal', phrase: @project.path = render 'shared/confirm_modal', phrase: @project.path
...@@ -95,7 +95,7 @@ module SharedProject ...@@ -95,7 +95,7 @@ module SharedProject
step 'I should see project settings' do step 'I should see project settings' do
expect(current_path).to eq edit_namespace_project_path(@project.namespace, @project) expect(current_path).to eq edit_namespace_project_path(@project.namespace, @project)
expect(page).to have_content("Project name") expect(page).to have_content("Project name")
expect(page).to have_content("Features:") expect(page).to have_content("Features")
end end
def current_project def current_project
......
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