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
8068d977
Commit
8068d977
authored
Nov 09, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds permissions to actions component
parent
51e79186
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
6 deletions
+33
-6
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+27
-4
app/views/projects/environments/index.html.haml
app/views/projects/environments/index.html.haml
+6
-2
No files found.
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
8068d977
...
...
@@ -24,9 +24,7 @@
'actions-component': window.gl.environmentsList.ActionsComponent,
},
props: {
model: Object,
},
props: ['model', 'can-create-deployment', 'can-create-deployment', 'can-read-environment'],
data() {
return {
...
...
@@ -247,6 +245,14 @@
return undefined;
},
canReadEnvironmentParsed() {
return convertToBoolean(this.canReadEnvironment);
},
canCreateDeploymentParsed() {
return convertToBoolean(this.canCreateDeployment);
},
},
/**
...
...
@@ -261,6 +267,19 @@
return {}.hasOwnProperty.call(obj, key);
},
/**
* Converts permission provided as strings to booleans.
* @param {String} string
* @returns {Boolean}
*/
convertPermissionToBoolean(string) {
if (string === 'true') {
return true;
}
return false;
},
methods: {
/**
* Toggles the visibility of a folders' children.
...
...
@@ -272,6 +291,10 @@
},
},
ready() {
debugger;
},
template: `
<tr>
<td v-bind:class="rowClass">
...
...
@@ -340,7 +363,7 @@
<td class="hidden-xs">
<div v-if="!isFolder">
<div v-if="hasManualActions">
<div v-if="hasManualActions
&& canCreateDeploymentParsed
">
<actions-component :actions="manualActions"></actions-component>
</div>
</div>
...
...
app/views/projects/environments/index.html.haml
View file @
8068d977
...
...
@@ -5,7 +5,7 @@
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_tag
(
"environments/environments_bundle.js"
)
#environments-list-view
{
data:
{
environments_data:
environments_list_data
,
"can-create-deployment"
=>
can?
(
current_user
,
:create_deployment
,
@environment
),
"can
_read_
environment"
=>
can?
(
current_user
,
:read_environment
,
@project
)},
class:
container_class
}
#environments-list-view
{
data:
{
environments_data:
environments_list_data
,
"can-create-deployment"
=>
can?
(
current_user
,
:create_deployment
,
@environment
),
"can
-read-
environment"
=>
can?
(
current_user
,
:read_environment
,
@project
)},
class:
container_class
}
.top-area
%ul
.nav-links
{
"v-if"
=>
"!loading"
}
%li
{
class:
(
'active'
if
@scope
.
nil?
)}
...
...
@@ -56,5 +56,9 @@
%th
%th
.hidden-xs
%tbody
%tr
{
"is"
=>
"environment-item"
,
"v-for"
=>
"model in filteredEnvironments"
,
":model"
=>
"model"
}
%tr
{
"is"
=>
"environment-item"
,
"v-for"
=>
"model in filteredEnvironments"
,
":model"
=>
"model"
,
"can-create-deployment"
=>
can?
(
current_user
,
:create_deployment
,
@environment
),
"can-read-environment"
=>
can?
(
current_user
,
:read_environment
,
@project
)}
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