BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3ea611e7
Commit
3ea611e7
authored
Oct 24, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds counter for number of children in each folder
parent
070165f0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+13
-2
environments.scss
app/assets/stylesheets/pages/environments.scss
+8
-1
_environment.html.haml
...s/projects/environments/components/_environment.html.haml
+3
-0
No files found.
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
3ea611e7
...
...
@@ -37,10 +37,10 @@
* Folder items have different behaviours - it is possible to toggle
* them and show their children.
*
* @returns {
Number} The length of the children array
* @returns {
Boolean}
*/
isFolder () {
return this.model.children && this.model.children.length
return this.model.children && this.model.children.length
? true : false;
},
/**
...
...
@@ -51,6 +51,17 @@
*/
isChildren () {
return this.model['vue-isChildren'];
},
/**
* Counts the number of environments in each folder.
* Used to show a badge with the counter.
*
* @returns {Boolean} The number of environments for the current folder
*/
childrenCounter () {
return this.model.children && this.model.children.length;
}
},
...
...
app/assets/stylesheets/pages/environments.scss
View file @
3ea611e7
...
...
@@ -64,7 +64,7 @@
}
}
.children-row
.environment-name
{
.children-row
.environment-name
{
margin-left
:
17px
;
margin-right
:
-17px
;
}
...
...
@@ -75,6 +75,13 @@
.folder-name
{
cursor
:
pointer
;
.badge
{
font-weight
:
normal
;
background-color
:
$gray-darker
;
color
:
$gl-placeholder-color
;
vertical-align
:
baseline
;
}
}
}
...
...
app/views/projects/environments/components/_environment.html.haml
View file @
3ea611e7
...
...
@@ -14,6 +14,9 @@
=
icon
(
"caret-right"
)
{{model.name}}
%span
.badge
{{childrenCounter}}
%td
.deployment-column
%span
{
"v-if"
=>
"!isFolder && model.last_deployment && model.last_deployment.iid"
}
...
...
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