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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
11a606fe
Commit
11a606fe
authored
Nov 08, 2018
by
Simon Knox
Committed by
Sean McGivern
Nov 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backport changes from gitlab-ee!7903
parent
df8f6636
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
5 deletions
+26
-5
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+9
-0
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+5
-2
spec/lib/gitlab/import_export/attribute_configuration_spec.rb
.../lib/gitlab/import_export/attribute_configuration_spec.rb
+12
-3
No files found.
app/helpers/projects_helper.rb
View file @
11a606fe
...
@@ -540,4 +540,13 @@ module ProjectsHelper
...
@@ -540,4 +540,13 @@ module ProjectsHelper
network
network
]
]
end
end
def
sidebar_operations_paths
%w[
environments
clusters
user
gcp
]
end
end
end
app/views/layouts/nav/sidebar/_project.html.haml
View file @
11a606fe
...
@@ -195,7 +195,7 @@
...
@@ -195,7 +195,7 @@
=
_
(
'Charts'
)
=
_
(
'Charts'
)
-
if
project_nav_tab?
:operations
-
if
project_nav_tab?
:operations
=
nav_link
(
controller:
[
:environments
,
:clusters
,
:user
,
:gcp
]
)
do
=
nav_link
(
controller:
sidebar_operations_paths
)
do
=
link_to
metrics_project_environments_path
(
@project
),
class:
'shortcuts-operations'
do
=
link_to
metrics_project_environments_path
(
@project
),
class:
'shortcuts-operations'
do
.nav-icon-container
.nav-icon-container
=
sprite_icon
(
'cloud-gear'
)
=
sprite_icon
(
'cloud-gear'
)
...
@@ -203,7 +203,7 @@
...
@@ -203,7 +203,7 @@
=
_
(
'Operations'
)
=
_
(
'Operations'
)
%ul
.sidebar-sub-level-items
%ul
.sidebar-sub-level-items
=
nav_link
(
controller:
[
:environments
,
:clusters
,
:user
,
:gcp
]
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
nav_link
(
controller:
sidebar_operations_paths
,
html_options:
{
class:
"fly-out-top-item"
}
)
do
=
link_to
metrics_project_environments_path
(
@project
)
do
=
link_to
metrics_project_environments_path
(
@project
)
do
%strong
.fly-out-top-item-name
%strong
.fly-out-top-item-name
=
_
(
'Operations'
)
=
_
(
'Operations'
)
...
@@ -215,6 +215,8 @@
...
@@ -215,6 +215,8 @@
%span
%span
=
_
(
'Metrics'
)
=
_
(
'Metrics'
)
=
render_if_exists
"layouts/nav/sidebar/tracing_link"
=
nav_link
(
controller: :environments
,
action:
[
:index
,
:folder
,
:show
,
:new
,
:edit
,
:create
,
:update
,
:stop
,
:terminal
])
do
=
nav_link
(
controller: :environments
,
action:
[
:index
,
:folder
,
:show
,
:new
,
:edit
,
:create
,
:update
,
:stop
,
:terminal
])
do
=
link_to
project_environments_path
(
@project
),
title:
_
(
'Environments'
),
class:
'shortcuts-environments qa-operations-environments-link'
do
=
link_to
project_environments_path
(
@project
),
title:
_
(
'Environments'
),
class:
'shortcuts-environments qa-operations-environments-link'
do
%span
%span
...
@@ -326,6 +328,7 @@
...
@@ -326,6 +328,7 @@
=
link_to
project_settings_ci_cd_path
(
@project
),
title:
_
(
'CI / CD'
)
do
=
link_to
project_settings_ci_cd_path
(
@project
),
title:
_
(
'CI / CD'
)
do
%span
%span
=
_
(
'CI / CD'
)
=
_
(
'CI / CD'
)
=
render_if_exists
'projects/sidebar/settings_operations'
-
if
@project
.
pages_available?
-
if
@project
.
pages_available?
=
nav_link
(
controller: :pages
)
do
=
nav_link
(
controller: :pages
)
do
=
link_to
project_pages_path
(
@project
),
title:
_
(
'Pages'
)
do
=
link_to
project_pages_path
(
@project
),
title:
_
(
'Pages'
)
do
...
...
spec/lib/gitlab/import_export/attribute_configuration_spec.rb
View file @
11a606fe
...
@@ -23,15 +23,23 @@ describe 'Import/Export attribute configuration' do
...
@@ -23,15 +23,23 @@ describe 'Import/Export attribute configuration' do
let
(
:safe_attributes_file
)
{
'spec/lib/gitlab/import_export/safe_model_attributes.yml'
}
let
(
:safe_attributes_file
)
{
'spec/lib/gitlab/import_export/safe_model_attributes.yml'
}
let
(
:safe_model_attributes
)
{
YAML
.
load_file
(
safe_attributes_file
)
}
let
(
:safe_model_attributes
)
{
YAML
.
load_file
(
safe_attributes_file
)
}
let
(
:ee_safe_attributes_file
)
{
'ee/spec/lib/gitlab/import_export/safe_model_attributes.yml'
}
let
(
:ee_safe_model_attributes
)
{
File
.
exist?
(
ee_safe_attributes_file
)
?
YAML
.
load_file
(
ee_safe_attributes_file
)
:
{}
}
it
'has no new columns'
do
it
'has no new columns'
do
relation_names
.
each
do
|
relation_name
|
relation_names
.
each
do
|
relation_name
|
relation_class
=
relation_class_for_name
(
relation_name
)
relation_class
=
relation_class_for_name
(
relation_name
)
relation_attributes
=
relation_class
.
new
.
attributes
.
keys
relation_attributes
=
relation_class
.
new
.
attributes
.
keys
expect
(
safe_model_attributes
[
relation_class
.
to_s
]).
not_to
be_nil
,
"Expected exported class
#{
relation_class
}
to exist in safe_model_attributes"
current_attributes
=
parsed_attributes
(
relation_name
,
relation_attributes
)
current_attributes
=
parsed_attributes
(
relation_name
,
relation_attributes
)
safe_attributes
=
safe_model_attributes
[
relation_class
.
to_s
]
safe_attributes
=
safe_model_attributes
[
relation_class
.
to_s
].
dup
||
[]
ee_safe_model_attributes
[
relation_class
.
to_s
].
to_a
.
each
do
|
attribute
|
safe_attributes
<<
attribute
end
expect
(
safe_attributes
).
not_to
be_nil
,
"Expected exported class
#{
relation_class
}
to exist in safe_model_attributes"
new_attributes
=
current_attributes
-
safe_attributes
new_attributes
=
current_attributes
-
safe_attributes
expect
(
new_attributes
).
to
be_empty
,
failure_message
(
relation_class
.
to_s
,
new_attributes
)
expect
(
new_attributes
).
to
be_empty
,
failure_message
(
relation_class
.
to_s
,
new_attributes
)
...
@@ -43,6 +51,7 @@ describe 'Import/Export attribute configuration' do
...
@@ -43,6 +51,7 @@ describe 'Import/Export attribute configuration' do
It looks like
#{
relation_class
}
, which is exported using the project Import/Export, has new attributes:
#{
new_attributes
.
join
(
','
)
}
It looks like
#{
relation_class
}
, which is exported using the project Import/Export, has new attributes:
#{
new_attributes
.
join
(
','
)
}
Please add the attribute(s) to SAFE_MODEL_ATTRIBUTES if you consider this can be exported.
Please add the attribute(s) to SAFE_MODEL_ATTRIBUTES if you consider this can be exported.
#{
"If the model/associations are EE-specific, use `
#{
File
.
expand_path
(
ee_safe_attributes_file
)
}
`.
\n
"
if
ee_safe_model_attributes
.
any?
}
Otherwise, please blacklist the attribute(s) in IMPORT_EXPORT_CONFIG by adding it to its correspondent
Otherwise, please blacklist the attribute(s) in IMPORT_EXPORT_CONFIG by adding it to its correspondent
model in the +excluded_attributes+ section.
model in the +excluded_attributes+ section.
...
...
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