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
4381eab6
Commit
4381eab6
authored
Dec 19, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify approvals store initialization.
parent
d89d0dcf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
app/assets/javascripts/merge_request_widget/approvals/approvals_store.js.es6
...pts/merge_request_widget/approvals/approvals_store.js.es6
+4
-4
app/assets/javascripts/merge_request_widget/widget_store.js.es6
...sets/javascripts/merge_request_widget/widget_store.js.es6
+1
-1
spec/javascripts/approvals/approvals_store_spec.js.es6
spec/javascripts/approvals/approvals_store_spec.js.es6
+1
-4
No files found.
app/assets/javascripts/merge_request_widget/approvals/approvals_store.js.es6
View file @
4381eab6
...
...
@@ -4,10 +4,10 @@
(() => {
let singleton;
class ApprovalsStore {
class
MergeRequest
ApprovalsStore {
constructor(rootStore) {
if (!singleton) {
singleton =
gl.ApprovalsStore =
this;
singleton = this;
this.init(rootStore);
}
return singleton;
...
...
@@ -63,6 +63,6 @@
return this.rootStore.assignToData(key, data);
}
}
gl.
ApprovalsStore =
ApprovalsStore;
})();
gl.
MergeRequestApprovalsStore = MergeRequest
ApprovalsStore;
})(
window.gl || (window.gl = {})
);
app/assets/javascripts/merge_request_widget/widget_store.js.es6
View file @
4381eab6
...
...
@@ -28,7 +28,7 @@
}
initApprovals() {
gl.ApprovalsStore = new gl.ApprovalsStore(this);
gl.ApprovalsStore = new gl.
MergeRequest
ApprovalsStore(this);
this.assignToData('approvals', {});
}
...
...
spec/javascripts/approvals/approvals_store_spec.js.es6
View file @
4381eab6
...
...
@@ -8,9 +8,6 @@ $.rails = {
};
(() => {
// store constructor reference, to overwrite ApprovalStore singleton
gl.ApprovalsConstructor = gl.ApprovalsStore;
// stand in for promise returned by api calls
const mockThenable = {
then() {
...
...
@@ -34,7 +31,7 @@ $.rails = {
describe('Approvals Store', function () {
beforeEach(function () {
this.rootStore = mockRootStore;
this.approvalsStore = new gl.
ApprovalsConstructor
(this.rootStore);
this.approvalsStore = new gl.
MergeRequestApprovalsStore
(this.rootStore);
});
it('should define all needed approval api calls', function () {
...
...
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