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
Léo-Paul Géneau
gitlab-ce
Commits
adb22344
Commit
adb22344
authored
Oct 21, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Beautifies sent data into human readable formats
parent
d418d499
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
app/assets/javascripts/environments/stores/environmnets_store.js.es6
...javascripts/environments/stores/environmnets_store.js.es6
+20
-4
No files found.
app/assets/javascripts/environments/stores/environmnets_store.js.es6
View file @
adb22344
...
...
@@ -43,25 +43,41 @@
*/
storeEnvironments(environments) {
const environmentsTree = environments.reduce((acc, environment) => {
const data = Object.assign({}, environment);
if (data.last_deployment) {
//humanizes actions names if there are any actions
if (data.last_deployment.manual_actions) {
data.last_deployment.manual_actions = data.last_deployment.manual_actions.map((action) => Object.assign({}, action, {name: gl.text.humanize(action.name)}));
}
//transforms created date for deployment in a human readable format
if (data.last_deployment.created_at) {
// TODO - how to do this without jquery
}
}
if (environment.environment_type !== null) {
const occurs = acc.find((element, index, array) => {
return element.name === environment.environment_type;
});
data["vue-isChildren"] = true;
if (occurs !== undefined) {
acc[acc.indexOf(occurs)].children.push(
Object.assign({}, environment, {"vue-isChildren": true}));
acc[acc.indexOf(occurs)].children.push(data);
acc[acc.indexOf(occurs)].children.sort();
} else {
acc.push({
name: environment.environment_type,
children: [
Object.assign(
{}, environment, {"vue-isChildren": true}
)
Object.assign(
data
)
]
});
}
} else {
acc.push(
environment
);
acc.push(
data
);
}
return acc;
...
...
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