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
1
Merge Requests
1
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
nexedi
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
Show 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,13 +15,14 @@ $(() => {
gl.EnvironmentsListApp.$destroy(true);
}
const filters = {
stopped (environments) {
return environments.filter((env) => env.state === 'stopped')
},
available (environments) {
return environments.filter((env) => env.state === 'available')
}
const filterEnvironments = (environments = [], filter = "") => {
return environments.filter((env) => {
if (env.children) {
return env.children.filter((child) => child.state === filter).length;
} else {
return env.state === filter;
};
});
};
gl.EnvironmentsListApp = new Vue({
...
...
@@ -41,15 +42,15 @@ $(() => {
computed: {
filteredEnvironments () {
return filter
s[this.visibility](this.state.environments
);
return filter
Environments(this.state.environments, this.visibility
);
},
countStopped () {
return filter
s['stopped'](this.state.environments
).length;
return filter
Environments(this.state.environments, 'stopped'
).length;
},
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 @@
return element.environment_type === environment.environment_type;
});
data["vue-isChildren"] = true;
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