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
Jérome Perrin
gitlab-ce
Commits
98a0f72d
Commit
98a0f72d
authored
Oct 24, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly filter all environments
parent
9c41191a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
app/assets/javascripts/environments/environments_bundle.js.es6
...ssets/javascripts/environments/environments_bundle.js.es6
+14
-13
app/assets/javascripts/environments/stores/environmnets_store.js.es6
...javascripts/environments/stores/environmnets_store.js.es6
+1
-0
No files found.
app/assets/javascripts/environments/environments_bundle.js.es6
View file @
98a0f72d
...
@@ -15,19 +15,20 @@ $(() => {
...
@@ -15,19 +15,20 @@ $(() => {
gl.EnvironmentsListApp.$destroy(true);
gl.EnvironmentsListApp.$destroy(true);
}
}
const filters = {
const filterEnvironments = (environments = [], filter = "") => {
stopped (environments) {
return environments.filter((env) => {
return environments.filter((env) => env.state === 'stopped')
if (env.children) {
},
return env.children.filter((child) => child.state === filter).length;
available (environments) {
} else {
return environments.filter((env) => env.state === 'available')
return env.state === filter;
}
};
});
};
};
gl.EnvironmentsListApp = new Vue({
gl.EnvironmentsListApp = new Vue({
el: '#environments-list-view',
el: '#environments-list-view',
components: {
components: {
'item': gl.environmentsList.EnvironmentItem
'item': gl.environmentsList.EnvironmentItem
},
},
...
@@ -41,15 +42,15 @@ $(() => {
...
@@ -41,15 +42,15 @@ $(() => {
computed: {
computed: {
filteredEnvironments () {
filteredEnvironments () {
return filter
s[this.visibility](this.state.environments
);
return filter
Environments(this.state.environments, this.visibility
);
},
},
countStopped () {
countStopped () {
return filter
s['stopped'](this.state.environments
).length;
return filter
Environments(this.state.environments, 'stopped'
).length;
},
},
counAvailable () {
counAvailable () {
return filter
s['available'](this.state.environments
).length;
return filter
Environments(this.state.environments, 'available'
).length;
}
}
},
},
...
...
app/assets/javascripts/environments/stores/environmnets_store.js.es6
View file @
98a0f72d
...
@@ -63,6 +63,7 @@
...
@@ -63,6 +63,7 @@
return element.environment_type === environment.environment_type;
return element.environment_type === environment.environment_type;
});
});
data["vue-isChildren"] = true;
data["vue-isChildren"] = true;
if (occurs !== undefined) {
if (occurs !== undefined) {
...
...
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