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
9a074366
Commit
9a074366
authored
Feb 08, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backport fixes for pipelines_store frontend specs
parent
11d33873
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
app/assets/javascripts/commit/pipelines/pipelines_store.js.es6
...ssets/javascripts/commit/pipelines/pipelines_store.js.es6
+1
-1
app/assets/javascripts/vue_realtime_listener/index.js.es6
app/assets/javascripts/vue_realtime_listener/index.js.es6
+11
-0
spec/javascripts/commit/pipelines/pipelines_store_spec.js.es6
.../javascripts/commit/pipelines/pipelines_store_spec.js.es6
+3
-0
No files found.
app/assets/javascripts/commit/pipelines/pipelines_store.js.es6
View file @
9a074366
...
...
@@ -26,7 +26,7 @@ class PipelinesStore {
*/
startTimeAgoLoops() {
const startTimeLoops = () => {
this.timeLoopInterval = setInterval(
function timeloopInterval()
{
this.timeLoopInterval = setInterval(
() =>
{
this.$children[0].$children.reduce((acc, component) => {
const timeAgoComponent = component.$children.filter(el => el.$options._componentTag === 'time-ago')[0];
acc.push(timeAgoComponent);
...
...
app/assets/javascripts/vue_realtime_listener/index.js.es6
View file @
9a074366
...
...
@@ -14,5 +14,16 @@
window.addEventListener('focus', startIntervals);
window.addEventListener('blur', removeIntervals);
document.addEventListener('beforeunload', removeAll);
// add removeAll methods to stack
const stack = gl.VueRealtimeListener.reset;
gl.VueRealtimeListener.reset = () => {
gl.VueRealtimeListener.reset = stack;
removeAll();
stack();
};
};
// remove all event listeners and intervals
gl.VueRealtimeListener.reset = () => undefined; // noop
})(window.gl || (window.gl = {}));
spec/javascripts/commit/pipelines/pipelines_store_spec.js.es6
View file @
9a074366
...
...
@@ -7,6 +7,9 @@ describe('Store', () => {
store = new gl.commits.pipelines.PipelinesStore();
});
// unregister intervals and event handlers
afterEach(() => gl.VueRealtimeListener.reset());
it('should start with a blank state', () => {
expect(store.state.pipelines.length).toBe(0);
});
...
...
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