Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
01090760
Commit
01090760
authored
Jul 28, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EE port of 34060-simplified-general-project-settings
parent
c7837b50
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
328 additions
and
263 deletions
+328
-263
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+3
-0
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+0
-1
app/assets/stylesheets/pages/settings.scss
app/assets/stylesheets/pages/settings.scss
+18
-2
app/views/projects/_merge_request_settings.html.haml
app/views/projects/_merge_request_settings.html.haml
+2
-7
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+232
-225
ee/app/views/projects/ee/_issues_settings.html.haml
ee/app/views/projects/ee/_issues_settings.html.haml
+19
-11
features/steps/project/project.rb
features/steps/project/project.rb
+12
-4
features/steps/shared/project.rb
features/steps/shared/project.rb
+1
-1
spec/features/projects/features_visibility_spec.rb
spec/features/projects/features_visibility_spec.rb
+23
-9
spec/features/projects/project_settings_spec.rb
spec/features/projects/project_settings_spec.rb
+6
-2
spec/features/projects/settings/merge_requests_settings_spec.rb
...eatures/projects/settings/merge_requests_settings_spec.rb
+12
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
01090760
...
...
@@ -378,6 +378,9 @@ import initGroupAnalytics from './init_group_analytics';
new
UsersSelect
();
new
GroupsSelect
();
setupProjectEdit
();
// Initialize expandable settings panels
initSettingsPanels
();
new
UsersSelect
();
break
;
case
'
projects:pipelines:new
'
:
new
NewBranchForm
(
$
(
'
.js-new-pipeline-form
'
));
...
...
app/assets/stylesheets/pages/projects.scss
View file @
01090760
...
...
@@ -36,7 +36,6 @@
}
select
{
background
:
transparent
;
transition
:
background
2s
ease-out
;
&
.highlight-changes
{
...
...
app/assets/stylesheets/pages/settings.scss
View file @
01090760
...
...
@@ -54,8 +54,7 @@
.settings-content
{
max-height
:
1px
;
overflow-y
:
scroll
;
margin-right
:
-20px
;
padding-right
:
130px
;
padding-right
:
110px
;
animation
:
collapseMaxHeight
300ms
ease-out
;
&
.expanded
{
...
...
@@ -87,6 +86,23 @@
overflow
:
hidden
;
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
{
...
...
app/views/projects/_merge_request_settings.html.haml
View file @
01090760
-
form
=
local_assigns
.
fetch
(
:form
)
%fieldset
.features.merge-requests-feature.append-bottom-default
%hr
%h5
.prepend-top-0
Merge Requests
=
render
'projects/ee/merge_request_settings'
,
form:
form
,
project:
@project
=
render
'projects/ee/merge_request_settings'
,
form:
form
,
project:
@project
=
render
'projects/merge_request_merge_settings'
,
form:
form
=
render
'projects/merge_request_merge_settings'
,
form:
form
app/views/projects/edit.html.haml
View file @
01090760
This diff is collapsed.
Click to expand it.
ee/app/views/projects/ee/_issues_settings.html.haml
View file @
01090760
-
if
@project
.
feature_available?
(
:issuable_default_templates
)
%fieldset
.features.append-bottom-0.issues-feature
%hr
%h5
.prepend-top-0
Issues
.form-group
=
form
.
label
:issues_template
,
class:
'label-light'
do
Default description template for issues
=
link_to
icon
(
'question-circle'
),
help_page_path
(
'user/project/description_templates'
,
anchor:
'setting-a-default-template-for-issues-and-merge-requests'
),
target:
'_blank'
=
form
.
text_area
:issues_template
,
class:
"form-control"
,
rows:
3
.hint
Description parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
'user/markdown'
),
target:
'_blank'
}
.
-
expanded
=
Rails
.
env
.
test?
%section
.settings.issues-features
{
style:
(
"display:none;"
if
@project
.
project_feature
.
send
(
:issues_access_level
)
==
0
)}
.settings-header
%h4
Issue settings
%button
.btn.js-settings-toggle
=
expanded
?
'Collapse'
:
'Expand'
%p
Customize your issue restrictions.
.settings-content.no-animate
{
class:
(
'expanded'
if
expanded
)
}
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
],
remote:
true
,
html:
{
multipart:
true
,
class:
"issue-settings-form"
},
authenticity_token:
true
do
|
f
|
.form-group
=
f
.
label
:issues_template
,
class:
'label-light'
do
Default description template for issues
=
link_to
icon
(
'question-circle'
),
help_page_path
(
'user/project/description_templates'
,
anchor:
'setting-a-default-template-for-issues-and-merge-requests'
),
target:
'_blank'
=
f
.
text_area
:issues_template
,
class:
"form-control"
,
rows:
3
.hint
Description parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_page_path
(
'user/markdown'
),
target:
'_blank'
}
.
=
f
.
submit
'Save changes'
,
class:
"btn btn-save"
features/steps/project/project.rb
View file @
01090760
...
...
@@ -11,7 +11,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
step
'I save project'
do
click_button
'Save changes'
page
.
within
'.general-settings'
do
click_button
'Save changes'
end
end
step
'I should see project with new settings'
do
...
...
@@ -32,7 +34,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar
,
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
end
...
...
@@ -51,7 +55,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
:project_avatar
,
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
end
...
...
@@ -92,7 +98,9 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step
'change project default branch'
do
select
'fix'
,
from:
'project_default_branch'
click_button
'Save changes'
page
.
within
'.general-settings'
do
click_button
'Save changes'
end
end
step
'I should see project default branch changed'
do
...
...
features/steps/shared/project.rb
View file @
01090760
...
...
@@ -103,7 +103,7 @@ module SharedProject
step
'I should see project settings'
do
expect
(
current_path
).
to
eq
edit_project_path
(
@project
)
expect
(
page
).
to
have_content
(
"Project name"
)
expect
(
page
).
to
have_content
(
"Sharing
& P
ermissions"
)
expect
(
page
).
to
have_content
(
"Sharing
and p
ermissions"
)
end
def
current_project
...
...
spec/features/projects/features_visibility_spec.rb
View file @
01090760
...
...
@@ -20,21 +20,25 @@ describe 'Edit Project Settings' do
visit
edit_project_path
(
project
)
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
expect
(
page
).
not_to
have_selector
(
".shortcuts-
#{
shortcut_name
}
"
)
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
expect
(
page
).
to
have_selector
(
".shortcuts-
#{
shortcut_name
}
"
)
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
expect
(
page
).
to
have_selector
(
".shortcuts-
#{
shortcut_name
}
"
)
sleep
0.1
end
end
end
...
...
@@ -174,7 +178,11 @@ describe 'Edit Project Settings' do
it
"disables repository related features"
do
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
it
"shows empty features project homepage"
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_wiki_access_level"
click_button
"Save changes"
page
.
within
(
'.sharing-permissions'
)
do
click_button
"Save changes"
end
wait_for_requests
visit
project_path
(
project
)
...
...
@@ -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_wiki_access_level"
click_button
"Save changes"
page
.
within
(
'.sharing-permissions'
)
do
click_button
"Save changes"
end
wait_for_requests
visit
activity_project_path
(
project
)
...
...
@@ -236,7 +248,9 @@ describe 'Edit Project Settings' do
end
def
save_changes_and_check_activity_tab
click_button
"Save changes"
page
.
within
(
'.sharing-permissions'
)
do
click_button
"Save changes"
end
wait_for_requests
visit
activity_project_path
(
project
)
...
...
spec/features/projects/project_settings_spec.rb
View file @
01090760
...
...
@@ -14,7 +14,9 @@ describe 'Edit Project Settings' do
it
'shows errors for invalid project name'
do
visit
edit_project_path
(
project
)
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_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'
...
...
@@ -23,7 +25,9 @@ describe 'Edit Project Settings' do
it
'shows a successful notice when the project is updated'
do
visit
edit_project_path
(
project
)
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."
end
end
...
...
spec/features/projects/settings/merge_requests_settings_spec.rb
View file @
01090760
...
...
@@ -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'
)
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 all discussions are resolved'
)
...
...
@@ -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'
)
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 all discussions are resolved'
)
...
...
@@ -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'
)
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 all discussions are resolved'
)
...
...
@@ -73,7 +82,9 @@ feature 'Project settings > Merge Requests', :js do
scenario
'when unchecked sets :printing_merge_request_link_enabled to false'
do
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
checkbox
=
find_field
(
'project_printing_merge_request_link_enabled'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment