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
ea91d9cc
Commit
ea91d9cc
authored
Oct 21, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds attribute in store
parent
9c1e5649
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
app/assets/javascripts/environments/stores/environmnets_store.js.es6
...javascripts/environments/stores/environmnets_store.js.es6
+12
-4
No files found.
app/assets/javascripts/environments/stores/environmnets_store.js.es6
View file @
ea91d9cc
...
...
@@ -13,6 +13,11 @@
* In order to display a tree view we need to modify the received
* data in to a tree structure based on `environment_type`
* sorted alphabetically.
* In each children a `vue-` property will be added. This property will be
* used to know if an item is a children mostly for css purposes. This is
* needed because the children row is a fragment instance and therfore does
* not accept non-prop attributes.
*
*
* @example
* it will transform this:
...
...
@@ -25,8 +30,8 @@
* [
* { name: "review", children:
* [
* { name: "environment", environment_type: "review"},
* { name: "environment_2", environment_type: "review"}
* { name: "environment", environment_type: "review"
, vue-isChildren: true
},
* { name: "environment_2", environment_type: "review"
, vue-isChildren: true
}
* ]
* },
* {name: "environment_1", environment_type: null}
...
...
@@ -44,12 +49,15 @@
});
if (occurs !== undefined) {
acc[acc.indexOf(occurs)].children.push(environment);
acc[acc.indexOf(occurs)].children.push(
Object.assign({}, environment, {"vue-isChildren": true}));
acc[acc.indexOf(occurs)].children.sort();
} else {
acc.push({
name: environment.environment_type,
children: [environment]
children: [
Object.assign({}, environment, {"vue-isChildren": true})
]
});
}
} else {
...
...
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