Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#12874 closed Bug (fixed)

Information about aggregated tasks should be somehow accessible in aggregator#finished

Reported by: Piotrek Koszuliński Owned by: Marek Lewandowski
Priority: Normal Milestone: CKEditor 4.5.0 Beta
Component: General Version: 4.5.0 Beta
Keywords: Cc:

Description

This should be somehow possible:

notification.on( 'finished', function() {
	editor.showNotification( 'Uploaded ' + this.getDoneTasksCount() + ' files.', 'success', 2000 );
} );

The information may also be passed as evt.data's properties, but I think that this is much simpler, because we just need to move _reset() call after firing the #finished event. Note - aggregator must be reset even if the event is cancelled.

Besides that, it would be good to add this code snippet to API docs. This is so common scenario that it should be mentioned in the aggregator's class description and #finished event docs.

Change History (5)

comment:1 Changed 5 years ago by Marek Lewandowski

Pushed to t/12874.

comment:2 Changed 5 years ago by Marek Lewandowski

Owner: set to Marek Lewandowski
Status: newreview

comment:3 Changed 5 years ago by Piotr Jasiun

I have moved tests descriptions before tests declarations, because it was misleading and suggest that this was a comment to the first line of the test code. I also added one assertion to be sure that getDoneTasksCount() returns now proper value. Closed with git:a191bee.

comment:4 Changed 5 years ago by Piotr Jasiun

Resolution: fixed
Status: reviewclosed

comment:5 Changed 5 years ago by Marek Lewandowski

Method getDoneTasksCount is not related with _finish so it should not be included in its test.

But you've pointed out that in fact getDoneTasksCount does not have any tests.

As a result TC was added in git:ec874ca and revert in git:2f235aa840.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy