Commit 8516e113 authored by Mike Greiling's avatar Mike Greiling

fix MR widget approvals bundle

parent 40e3494d
/* global Vue */
/* global Flash */
window.Vue = require('vue');
window.Vue.use(require('vue-resource'));
const Vue = window.Vue;
require('./approvals_store');
(() => {
class ApprovalsApi {
class ApprovalsApi {
constructor(endpoint) {
gl.ApprovalsApi = this;
this.init(endpoint);
......@@ -32,7 +34,7 @@ require('./approvals_store');
return Vue.http.delete(this.baseEndpoint).catch(() => new Flash(flashErrorMessage));
}
}
}
gl.ApprovalsApi = ApprovalsApi;
})();
window.gl = window.gl || {};
window.gl.ApprovalsApi = ApprovalsApi;
function requireAll(context) { return context.keys().map(context); }
require('./approvals_store');
require('./approvals_api');
requireAll(require.context('./components', true, /^\.\/.*\.(js|es6)$/));
require('./components/approvals_body');
require('./components/approvals_footer');
/* global Vue */
require('./approvals_api');
(() => {
let singleton;
let singleton;
class MergeRequestApprovalsStore {
class MergeRequestApprovalsStore {
constructor(rootStore) {
if (!singleton) {
singleton = this;
......@@ -60,6 +57,7 @@ require('./approvals_api');
assignToRootStore(key, data) {
return this.rootStore.assignToData(key, data);
}
}
gl.MergeRequestApprovalsStore = MergeRequestApprovalsStore;
})(window.gl || (window.gl = {}));
}
window.gl = window.gl || {};
window.gl.MergeRequestApprovalsStore = MergeRequestApprovalsStore;
/* global Vue */
const Vue = require('vue');
require('../approvals_store');
require('../approvals_api');
(() => {
Vue.component('approvals-body', {
Vue.component('approvals-body', {
name: 'approvals-body',
props: {
approvedBy: {
......@@ -91,5 +91,4 @@ require('../approvals_api');
</div>
</div>
`,
});
})();
});
/* global Vue */
const Vue = require('vue');
require('../approvals_store');
require('../../../vue_common_component/link_to_member_avatar');
(() => {
Vue.component('approvals-footer', {
Vue.component('approvals-footer', {
name: 'approvals-footer',
props: {
approvedBy: {
......@@ -89,5 +89,4 @@ require('../../../vue_common_component/link_to_member_avatar');
</span>
</div>
`,
});
})();
});
/* global Vue */
const Vue = require('vue');
require('./widget_store');
require('./approvals/approvals_bundle');
(() => {
$(() => {
window.gl = window.gl || {};
$(() => {
const rootEl = document.getElementById('merge-request-widget-app');
const widgetSharedStore = new gl.MergeRequestWidgetStore(rootEl);
......@@ -12,5 +12,4 @@ require('./approvals/approvals_bundle');
el: rootEl,
data: widgetSharedStore.data,
});
});
})(window.gl || (window.gl = {}));
});
require('./approvals/approvals_store');
(() => {
let singleton;
let singleton;
class MergeRequestWidgetStore {
class MergeRequestWidgetStore {
constructor(rootEl) {
if (!singleton) {
singleton = gl.MergeRequestWidget.Store = this;
......@@ -35,6 +34,7 @@ require('./approvals/approvals_store');
this.data[key] = val;
return val;
}
}
gl.MergeRequestWidgetStore = MergeRequestWidgetStore;
})(window.gl || (window.gl = {}));
}
window.gl = window.gl || {};
window.gl.MergeRequestWidgetStore = MergeRequestWidgetStore;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment