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
03c4c467
Commit
03c4c467
authored
Aug 03, 2018
by
Mike Greiling
Committed by
Fatih Acet
Aug 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port of protected environments frontend changes from EE to CE
parent
d40c5fa0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
19 deletions
+41
-19
app/assets/javascripts/environments/components/environment_item.vue
.../javascripts/environments/components/environment_item.vue
+34
-11
app/assets/javascripts/environments/components/environments_table.vue
...avascripts/environments/components/environments_table.vue
+5
-8
app/views/projects/settings/ci_cd/show.html.haml
app/views/projects/settings/ci_cd/show.html.haml
+2
-0
No files found.
app/assets/javascripts/environments/components/environment_item.vue
View file @
03c4c467
...
@@ -86,6 +86,28 @@ export default {
...
@@ -86,6 +86,28 @@ export default {
);
);
},
},
/**
* Checkes whether the user is allowed to deploy to this environment.
* (`can_deploy` currently only set in EE)
*
* @returns {Boolean}
*/
isDeployableByUser
()
{
return
this
.
model
&&
'
can_deploy
'
in
this
.
model
?
this
.
model
.
can_deploy
:
this
.
canCreateDeployment
;
},
/**
* Checkes whether the environment is protected.
* (`is_protected` currently only set in EE)
*
* @returns {Boolean}
*/
isProtected
()
{
return
this
.
model
&&
this
.
model
.
is_protected
;
},
/**
/**
* Returns whether the environment can be stopped.
* Returns whether the environment can be stopped.
*
*
...
@@ -455,7 +477,7 @@ export default {
...
@@ -455,7 +477,7 @@ export default {
class="gl-responsive-table-row"
class="gl-responsive-table-row"
role="row">
role="row">
<div
<div
class=
"table-section section-
10
"
class=
"table-section section-
wrap section-15
"
role=
"gridcell"
role=
"gridcell"
>
>
<div
<div
...
@@ -465,16 +487,17 @@ export default {
...
@@ -465,16 +487,17 @@ export default {
>
>
{{
s__
(
"
Environments|Environment
"
)
}}
{{
s__
(
"
Environments|Environment
"
)
}}
</div>
</div>
<a
v-if=
"!model.isFolder"
:href=
"environmentPath"
class=
"environment-name flex-truncate-parent table-mobile-content"
>
<span
<span
v-if=
"!model.isFolder"
class=
"environment-name table-mobile-content"
>
<a
v-tooltip
v-tooltip
:href=
"environmentPath"
:title=
"model.name"
:title=
"model.name"
class=
"flex-truncate-child"
>
>
{{
model
.
name
}}
</span>
{{
model
.
name
}}
</a>
</a>
</span>
<span
<span
v-else
v-else
class=
"folder-name"
class=
"folder-name"
...
@@ -548,7 +571,7 @@ export default {
...
@@ -548,7 +571,7 @@ export default {
<div
<div
v-if=
"!model.isFolder"
v-if=
"!model.isFolder"
class=
"table-section section-2
5
"
class=
"table-section section-2
0
"
role=
"gridcell"
role=
"gridcell"
>
>
<div
<div
...
@@ -612,7 +635,7 @@ export default {
...
@@ -612,7 +635,7 @@ export default {
/>
/>
<actions-component
<actions-component
v-if=
"hasManualActions &&
canCreateDeployment
"
v-if=
"hasManualActions &&
isDeployableByUser
"
:actions=
"manualActions"
:actions=
"manualActions"
/>
/>
...
@@ -622,7 +645,7 @@ export default {
...
@@ -622,7 +645,7 @@ export default {
/>
/>
<rollback-component
<rollback-component
v-if=
"canRetry &&
canCreateDeployment
"
v-if=
"canRetry &&
isDeployableByUser
"
:is-last-deployment=
"isLastDeployment"
:is-last-deployment=
"isLastDeployment"
:retry-url=
"retryUrl"
:retry-url=
"retryUrl"
/>
/>
...
...
app/assets/javascripts/environments/components/environments_table.vue
View file @
03c4c467
...
@@ -15,7 +15,7 @@ export default {
...
@@ -15,7 +15,7 @@ export default {
environments
:
{
environments
:
{
type
:
Array
,
type
:
Array
,
required
:
true
,
required
:
true
,
default
:
()
=>
([])
,
default
:
()
=>
[]
,
},
},
canReadEnvironment
:
{
canReadEnvironment
:
{
...
@@ -35,10 +35,7 @@ export default {
...
@@ -35,10 +35,7 @@ export default {
return
`
${
window
.
location
.
pathname
}
/folders/
${
model
.
folderName
}
`
;
return
`
${
window
.
location
.
pathname
}
/folders/
${
model
.
folderName
}
`
;
},
},
shouldRenderFolderContent
(
env
)
{
shouldRenderFolderContent
(
env
)
{
return
env
.
isFolder
&&
return
env
.
isFolder
&&
env
.
isOpen
&&
env
.
children
&&
env
.
children
.
length
>
0
;
env
.
isOpen
&&
env
.
children
&&
env
.
children
.
length
>
0
;
},
},
},
},
};
};
...
@@ -53,7 +50,7 @@ export default {
...
@@ -53,7 +50,7 @@ export default {
role=
"row"
role=
"row"
>
>
<div
<div
class=
"table-section section-1
0
environments-name"
class=
"table-section section-1
5
environments-name"
role=
"columnheader"
role=
"columnheader"
>
>
{{
s__
(
"
Environments|Environment
"
)
}}
{{
s__
(
"
Environments|Environment
"
)
}}
...
@@ -71,7 +68,7 @@ export default {
...
@@ -71,7 +68,7 @@ export default {
{{
s__
(
"
Environments|Job
"
)
}}
{{
s__
(
"
Environments|Job
"
)
}}
</div>
</div>
<div
<div
class=
"table-section section-2
5
environments-commit"
class=
"table-section section-2
0
environments-commit"
role=
"columnheader"
role=
"columnheader"
>
>
{{
s__
(
"
Environments|Commit
"
)
}}
{{
s__
(
"
Environments|Commit
"
)
}}
...
@@ -91,7 +88,7 @@ export default {
...
@@ -91,7 +88,7 @@ export default {
:model=
"model"
:model=
"model"
:can-create-deployment=
"canCreateDeployment"
:can-create-deployment=
"canCreateDeployment"
:can-read-environment=
"canReadEnvironment"
:can-read-environment=
"canReadEnvironment"
:key=
"
i
"
:key=
"
`environment-item-$
{i}`
"
/>
/>
<template
<template
...
...
app/views/projects/settings/ci_cd/show.html.haml
View file @
03c4c467
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
.settings-content
.settings-content
=
render
'autodevops_form'
=
render
'autodevops_form'
=
render_if_exists
'projects/settings/ci_cd/protected_environments'
,
expanded:
expanded
%section
.qa-runners-settings.settings.no-animate
#js-runners-settings
{
class:
(
'expanded'
if
expanded
)
}
%section
.qa-runners-settings.settings.no-animate
#js-runners-settings
{
class:
(
'expanded'
if
expanded
)
}
.settings-header
.settings-header
%h4
%h4
...
...
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