Skip to content

Commit

Permalink
Merge branch 'MDL-72893-master' of https://github.com/HuongNV13/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Nov 29, 2021
2 parents d29c093 + f1c0c29 commit d1667b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion blocks/timeline/amd/build/event_list.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blocks/timeline/amd/build/event_list.min.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions blocks/timeline/amd/src/event_list.js
Expand Up @@ -28,15 +28,17 @@ define(
'core/templates',
'core/str',
'core/user_date',
'block_timeline/calendar_events_repository'
'block_timeline/calendar_events_repository',
'core/pending'
],
function(
$,
Notification,
Templates,
Str,
UserDate,
CalendarEventsRepository
CalendarEventsRepository,
Pending
) {

var SECONDS_IN_DAY = 60 * 60 * 24;
Expand Down Expand Up @@ -215,6 +217,7 @@ function(
* @param {object} additionalConfig Additional config options to pass to pagedContentFactory.
*/
var init = function(root, additionalConfig = {}) {
const pendingPromise = new Pending('block/timeline:event-init');
root = $(root);

courseview = !!additionalConfig.courseview;
Expand Down Expand Up @@ -286,6 +289,8 @@ function(
});

return html;
}).then(() => {
return pendingPromise.resolve();
})
.catch(Notification.exception);
};
Expand Down
4 changes: 2 additions & 2 deletions blocks/timeline/tests/behat/block_timeline_courses.feature
Expand Up @@ -42,8 +42,8 @@ Feature: The timeline block allows users to see upcoming courses
And I click on "Next 30 days" "link" in the "Timeline" "block"
And I click on "Sort timeline items" "button" in the "Timeline" "block"
When I click on "Sort by courses" "link" in the "Timeline" "block"
Then I should see "Course 1" in the "Timeline" "block"
And I should see "Course 2" in the "Timeline" "block"
Then I should see "Course 1" in the ".block_timeline [data-region='view-courses']" "css_element"
And I should see "Course 2" in the ".block_timeline [data-region='view-courses']" "css_element"
And I should see "Show more courses" in the "Timeline" "block"
And "Test choice 1" "link" should exist in the "Timeline" "block"
And I should see "Choice closes" in the "Timeline" "block"
Expand Down

0 comments on commit d1667b6

Please sign in to comment.