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
Tatuya Kamada
gitlab-ce
Commits
8f3678f1
Commit
8f3678f1
authored
Feb 09, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CJS in environments service
parent
26a951b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
19 deletions
+7
-19
app/assets/javascripts/environments/components/environment.js.es6
...ts/javascripts/environments/components/environment.js.es6
+3
-3
app/assets/javascripts/environments/services/environments_service.js.es6
...scripts/environments/services/environments_service.js.es6
+4
-16
No files found.
app/assets/javascripts/environments/components/environment.js.es6
View file @
8f3678f1
...
...
@@ -5,7 +5,7 @@
window.Vue = require('vue');
window.Vue.use(require('vue-resource'));
require('../services/environments_service');
const EnvironmentsService =
require('../services/environments_service');
require('./environment_item');
const Store = require('../stores/environments_store');
...
...
@@ -68,11 +68,11 @@ const Store = require('../stores/environments_store');
const scope = this.$options.getQueryParameter('scope') || this.visibility;
const endpoint = `${this.endpoint}?scope=${scope}`;
gl.environmentsS
ervice = new EnvironmentsService(endpoint);
const s
ervice = new EnvironmentsService(endpoint);
this.isLoading = true;
return
gl.environmentsS
ervice.all()
return
s
ervice.all()
.then(resp => resp.json())
.then((json) => {
this.store.storeAvailableCount(json.available_count);
...
...
app/assets/javascripts/environments/services/environments_service.js.es6
View file @
8f3678f1
/* globals Vue */
/* eslint-disable no-unused-vars, no-param-reassign */
const Vue = window.Vue = require('vue');
class EnvironmentsService {
constructor(root) {
Vue.http.options.root = root;
this.environments = Vue.resource(root);
Vue.http.interceptors.push((request, next) => {
// needed in order to not break the tests.
if ($.rails) {
request.headers['X-CSRF-Token'] = $.rails.csrfToken();
}
next();
});
constructor(endpoint) {
this.environments = Vue.resource(endpoint);
}
all() {
...
...
@@ -22,4 +10,4 @@ class EnvironmentsService {
}
}
window.EnvironmentsService
= EnvironmentsService;
module.exports
= EnvironmentsService;
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