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
4df7c9ed
Commit
4df7c9ed
authored
Oct 14, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Starts Vue view for environmnets List
parent
b33791d8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
0 deletions
+89
-0
app/assets/javascripts/environments/components/environments_tree_view.js.es6
...pts/environments/components/environments_tree_view.js.es6
+0
-0
app/assets/javascripts/environments/environments_bundle.js.es6
...ssets/javascripts/environments/environments_bundle.js.es6
+49
-0
app/assets/javascripts/environments/services/environments_service.js.es6
...scripts/environments/services/environments_service.js.es6
+19
-0
app/assets/javascripts/environments/stores/environmnets_store.js.es6
...javascripts/environments/stores/environmnets_store.js.es6
+21
-0
No files found.
app/assets/javascripts/environments/components/environments_tree_view.js.es6
0 → 100644
View file @
4df7c9ed
app/assets/javascripts/environments/environments_bundle.js.es6
0 → 100644
View file @
4df7c9ed
//= require vue
//= require vue-resource
//= require_tree ./stores
//= require_tree ./services
$(() => {
const $environmentsListApp = document.getElementById('environments-list-view');
const Store = gl.environmentsList.EnvironmentsStore;
window.gl = window.gl || {};
if (gl.EnvironmentsListApp) {
gl.EnvironmentsListApp.$destroy(true);
}
gl.EnvironmentsListApp = new Vue({
el: $environmentsListApp,
components: {
'tree-view': gl.environmentsList.TreeView
},
data: {
endpoint: $environmentsListApp.dataset.endpoint,
loading: true
},
init: Store.create.bind(Store),
created() {
gl.environmentsService = new EnvironmentsService(this.endpoint);
},
/**
* Fetches all the environmnets and stores them.
* Toggles loading property.
*/
ready() {
gl.environmentsService.all().then((resp) => {
Store.addEnvironments(resp.json());
this.loading = false;
});
}
});
});
\ No newline at end of file
app/assets/javascripts/environments/services/environments_service.js.es6
0 → 100644
View file @
4df7c9ed
class EnvironmentsService {
constructor (root) {
Vue.http.options.root = root;
debugger;
this.environments = Vue.resource(root);
Vue.http.interceptors.push((request, next) => {
request.headers['X-CSRF-Token'] = $.rails.csrfToken();
next();
});
}
all () {
return this.environments.get();
}
};
\ No newline at end of file
app/assets/javascripts/environments/stores/environmnets_store.js.es6
0 → 100644
View file @
4df7c9ed
(() => {
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
gl.environmentsList.EnvironmentsStore = {
create () {
},
/**
* Stores the received environmnets.
*
* @param {Array} environments List of environments
* @return {type}
*/
addEnvironments(environments) {
console.log(environments);
}
}
})();
\ No newline at end of file
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