Merge branch 'MDL-72594-master-2' of git://github.com/mickhawkins/moodle
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
define ("block_timeline/event_list",["jquery","core/notification","core/templates","core/paged_content_factory","core/str","core/user_date","block_timeline/calendar_events_repository"],function(a,b,c,d,e,f,g){var h=!1,i={EMPTY_MESSAGE:"[data-region=\"empty-message\"]",ROOT:"[data-region=\"event-list-container\"]",EVENT_LIST_CONTENT:"[data-region=\"event-list-content\"]",EVENT_LIST_LOADING_PLACEHOLDER:"[data-region=\"event-list-loading-placeholder\"]",TIMELINE_BLOCK:"[data-region=\"timeline\"]",TIMELINE_SEARCH:"[data-region=\"search-input\"]"},j={EVENT_LIST_CONTENT:"block_timeline/event-list-content"},k={ignoreControlWhileLoading:!0,controlPlacementBottom:!0,ariaLabels:{itemsperpagecomponents:"ariaeventlistpagelimit, block_timeline"}},l=function(a){a.find(i.EVENT_LIST_CONTENT).addClass("hidden");a.find(i.EMPTY_MESSAGE).removeClass("hidden")},m=function(a){a.find(i.EVENT_LIST_CONTENT).removeClass("hidden");a.find(i.EMPTY_MESSAGE).addClass("hidden")},n=function(a){a.find(i.EVENT_LIST_CONTENT).empty()},o=function(a,b){var c={},d={courseview:h,eventsbyday:[]};a.forEach(function(a){var b=a.timeusermidnight;if(c[b]){c[b].push(a)}else{c[b]=[a]}});Object.keys(c).forEach(function(a){var e=c[a];d.eventsbyday.push({past:a<b,dayTimestamp:a,events:e})});return d},p=function(a,b){var d=o(a,b),e=j.EVENT_LIST_CONTENT;return c.render(e,d)},q=function(a,b,c,d,e,f,h){var i=d!=void 0?a+d*86400:!1,j={starttime:a+c*86400,limit:b};if(e){j.aftereventid=e}if(i){j.endtime=i}if(h){j.searchvalue=h}if(f){j.courseid=f;return g.queryByCourse(j)}else{return g.queryByTime(j)}},r=function(a,b,c,d,e,g,h,i,j){var k=a.pageNumber,l=a.limit,m=k;while(!d.hasOwnProperty(m)){m--}var n=d[m],o=null;if(e&&e.hasOwnProperty(k)){o=e[k]}else{o=q(c,l+1,h,i,n,g,j)}return o.then(function(a){if(!a.events.length){b.allItemsLoaded(k);return[]}var d=a.events.filter(function(a){if("open"==a.eventtype||"opensubmission"==a.eventtype){var b=f.getUserMidnightForTimestamp(a.timesort,c);return b>c}return!0}),e=d.length<=l;if(e){b.allItemsLoaded(k)}else{d.pop()}return d})},s=function(c,f,g,h,i,j,l,m,n,o){var q={1:0},s=!1,t=a.extend({},k,n);return e.get_string("ariaeventlistpagelimit","block_timeline",a.isArray(c)?c[0].value:c).then(function(a){t.ariaLabels.itemsperpage=a;t.ariaLabels.paginationnav=m;return a}).then(function(){return d.createWithLimit(c,function(c,d){var e=[];c.forEach(function(a){var c=a.pageNumber,h=r(a,d,g,q,f,i,j,l,o).then(function(a){if(a.length){s=!0;var b=a[a.length-1].id;q[c+1]=b;return p(a,g)}else{return a}}).catch(b.exception);e.push(h)});a.when.apply(a,e).then(function(){h.resolve(s)}).catch(function(){h.resolve(s)});return e},t)})};return{init:function init(d,e,f,g){var j=4<arguments.length&&arguments[4]!==void 0?arguments[4]:{};d=a(d);h=!!j.courseview;var k=a.Deferred(),o=d.find(i.EVENT_LIST_CONTENT),p=d.find(i.EVENT_LIST_LOADING_PLACEHOLDER),q=d.attr("data-course-id"),r=parseInt(d.attr("data-days-offset"),10),t=d.attr("data-days-limit"),u=parseInt(d.attr("data-midnight"),10),v=d.closest(i.TIMELINE_BLOCK).find(i.TIMELINE_SEARCH).val();n(d);m(d);p.removeClass("hidden");if(t!=void 0){t=parseInt(t,10)}return s(e,f,u,k,q,r,t,g,j,v).then(function(b,e){b=a(b);b.addClass("hidden");c.replaceNodeContents(o,b,e);k.then(function(a){b.removeClass("hidden");p.addClass("hidden");if(!a){l(d)}return a}).catch(function(){return!1});return b}).catch(b.exception)},rootSelector:i.ROOT}});
|
||||
define ("block_timeline/event_list",["jquery","core/notification","core/templates","core/paged_content_factory","core/str","core/user_date","block_timeline/calendar_events_repository"],function(a,b,c,d,e,f,g){var h=!1,i={EMPTY_MESSAGE:"[data-region=\"empty-message\"]",ROOT:"[data-region=\"event-list-container\"]",EVENT_LIST_CONTENT:"[data-region=\"event-list-content\"]",EVENT_LIST_LOADING_PLACEHOLDER:"[data-region=\"event-list-loading-placeholder\"]",TIMELINE_BLOCK:"[data-region=\"timeline\"]",TIMELINE_SEARCH:"[data-region=\"search-input\"]"},j={EVENT_LIST_CONTENT:"block_timeline/event-list-content"},k={ignoreControlWhileLoading:!0,controlPlacementBottom:!0,ariaLabels:{itemsperpagecomponents:"ariaeventlistpagelimit, block_timeline"}},l=function(a){a.find(i.EVENT_LIST_CONTENT).addClass("hidden");a.find(i.EMPTY_MESSAGE).removeClass("hidden")},m=function(a){a.find(i.EVENT_LIST_CONTENT).removeClass("hidden");a.find(i.EMPTY_MESSAGE).addClass("hidden")},n=function(a){a.find(i.EVENT_LIST_CONTENT).empty()},o=function(a){var b={},c={courseview:h,eventsbyday:[]};a.forEach(function(a){var c=a.timeusermidnight;if(b[c]){b[c].push(a)}else{b[c]=[a]}});Object.keys(b).forEach(function(a){var d=b[a];c.eventsbyday.push({dayTimestamp:a,events:d})});return c},p=function(a){var b=o(a),d=j.EVENT_LIST_CONTENT;return c.render(d,b)},q=function(a,b,c,d,e,f,h){var i=d!=void 0?a+d*86400:!1,j={starttime:a+c*86400,limit:b};if(e){j.aftereventid=e}if(i){j.endtime=i}if(h){j.searchvalue=h}if(f){j.courseid=f;return g.queryByCourse(j)}else{return g.queryByTime(j)}},r=function(a,b,c,d,e,g,h,i,j){var k=a.pageNumber,l=a.limit,m=k;while(!d.hasOwnProperty(m)){m--}var n=d[m],o=null;if(e&&e.hasOwnProperty(k)){o=e[k]}else{o=q(c,l+1,h,i,n,g,j)}return o.then(function(a){if(!a.events.length){b.allItemsLoaded(k);return[]}var d=document.querySelector("[data-filtername='overdue']"),e=d&&d.getAttribute("aria-current"),g=a.events.filter(function(a){if("open"==a.eventtype||"opensubmission"==a.eventtype){var b=f.getUserMidnightForTimestamp(a.timesort,c);return b>c}return!e||a.overdue}),h=g.length<=l;if(h){b.allItemsLoaded(k)}else{g.pop()}return g})},s=function(c,f,g,h,i,j,l,m,n,o){var q={1:0},s=!1,t=a.extend({},k,n);return e.get_string("ariaeventlistpagelimit","block_timeline",a.isArray(c)?c[0].value:c).then(function(a){t.ariaLabels.itemsperpage=a;t.ariaLabels.paginationnav=m;return a}).then(function(){return d.createWithLimit(c,function(c,d){var e=[];c.forEach(function(a){var c=a.pageNumber,h=r(a,d,g,q,f,i,j,l,o).then(function(a){if(a.length){s=!0;var b=a[a.length-1].id;q[c+1]=b;return p(a)}else{return a}}).catch(b.exception);e.push(h)});a.when.apply(a,e).then(function(){h.resolve(s)}).catch(function(){h.resolve(s)});return e},t)})};return{init:function init(d,e,f,g){var j=4<arguments.length&&arguments[4]!==void 0?arguments[4]:{};d=a(d);h=!!j.courseview;var k=a.Deferred(),o=d.find(i.EVENT_LIST_CONTENT),p=d.find(i.EVENT_LIST_LOADING_PLACEHOLDER),q=d.attr("data-course-id"),r=parseInt(d.attr("data-days-offset"),10),t=d.attr("data-days-limit"),u=parseInt(d.attr("data-midnight"),10),v=d.closest(i.TIMELINE_BLOCK).find(i.TIMELINE_SEARCH).val();n(d);m(d);p.removeClass("hidden");if(t!=void 0){t=parseInt(t,10)}return s(e,f,u,k,q,r,t,g,j,v).then(function(b,e){b=a(b);b.addClass("hidden");c.replaceNodeContents(o,b,e);k.then(function(a){b.removeClass("hidden");p.addClass("hidden");if(!a){l(d)}return a}).catch(function(){return!1});return b}).catch(b.exception)},rootSelector:i.ROOT}});
|
||||
//# sourceMappingURL=event_list.min.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -124,10 +124,9 @@ function(
|
||||
* Each day timestamp is the day's midnight in the user's timezone.
|
||||
*
|
||||
* @param {array} calendarEvents List of calendar events
|
||||
* @param {Number} midnight A timestamp representing midnight in the user's timezone
|
||||
* @return {object}
|
||||
*/
|
||||
var buildTemplateContext = function(calendarEvents, midnight) {
|
||||
var buildTemplateContext = function(calendarEvents) {
|
||||
var eventsByDay = {};
|
||||
var templateContext = {
|
||||
courseview,
|
||||
@@ -146,7 +145,6 @@ function(
|
||||
Object.keys(eventsByDay).forEach(function(dayTimestamp) {
|
||||
var events = eventsByDay[dayTimestamp];
|
||||
templateContext.eventsbyday.push({
|
||||
past: dayTimestamp < midnight,
|
||||
dayTimestamp: dayTimestamp,
|
||||
events: events
|
||||
});
|
||||
@@ -159,11 +157,10 @@ function(
|
||||
* Render the HTML for the given calendar events.
|
||||
*
|
||||
* @param {array} calendarEvents A list of calendar events
|
||||
* @param {Number} midnight A timestamp representing midnight for the user
|
||||
* @return {promise} Resolved with HTML and JS strings.
|
||||
*/
|
||||
var render = function(calendarEvents, midnight) {
|
||||
var templateContext = buildTemplateContext(calendarEvents, midnight);
|
||||
var render = function(calendarEvents) {
|
||||
var templateContext = buildTemplateContext(calendarEvents);
|
||||
var templateName = TEMPLATES.EVENT_LIST_CONTENT;
|
||||
|
||||
return Templates.render(templateName, templateContext);
|
||||
@@ -275,12 +272,19 @@ function(
|
||||
return [];
|
||||
}
|
||||
|
||||
// Determine if the overdue filter is applied.
|
||||
const overdueFilter = document.querySelector("[data-filtername='overdue']");
|
||||
const filterByOverdue = (overdueFilter && overdueFilter.getAttribute('aria-current'));
|
||||
|
||||
var calendarEvents = result.events.filter(function(event) {
|
||||
if (event.eventtype == "open" || event.eventtype == "opensubmission") {
|
||||
var dayTimestamp = UserDate.getUserMidnightForTimestamp(event.timesort, midnight);
|
||||
return dayTimestamp > midnight;
|
||||
}
|
||||
return true;
|
||||
|
||||
// When filtering by overdue, we fetch all events due today, in case any have elapsed already and are overdue.
|
||||
// This means if filtering by overdue, some events fetched might not be required (eg if due later today).
|
||||
return (!filterByOverdue || event.overdue);
|
||||
});
|
||||
// We expect to receive limit + 1 events back from the server.
|
||||
// Any less means there are no more events to load.
|
||||
@@ -378,7 +382,7 @@ function(
|
||||
// Record the id that the next page will need to start from.
|
||||
lastIds[pageNumber + 1] = lastEventId;
|
||||
// Get the HTML and JS for these calendar events.
|
||||
return render(calendarEvents, midnight);
|
||||
return render(calendarEvents);
|
||||
} else {
|
||||
return calendarEvents;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class main implements renderable, templatable {
|
||||
if (in_array($this->filter, [BLOCK_TIMELINE_FILTER_BY_NONE, BLOCK_TIMELINE_FILTER_BY_OVERDUE])) {
|
||||
$offset = -14;
|
||||
if ($this->filter == BLOCK_TIMELINE_FILTER_BY_OVERDUE) {
|
||||
$limit = 0;
|
||||
$limit = 1;
|
||||
}
|
||||
} else {
|
||||
$offset = 0;
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
{{#eventsbyday}}
|
||||
<div class="mt-3">
|
||||
<h5 class="h6 d-inline {{^courseview}}font-weight-bold{{/courseview}}">{{#userdate}} {{dayTimestamp}}, {{#str}} strftimedaydate, core_langconfig {{/str}} {{/userdate}}</h5>
|
||||
{{#past}}<span class="badge badge-pill badge-danger">{{#str}} overdue, block_timeline {{/str}}</span>{{/past}}
|
||||
</div>
|
||||
{{> block_timeline/event-list-items }}
|
||||
{{/eventsbyday}}
|
||||
|
||||
@@ -41,7 +41,8 @@
|
||||
"key": "icon",
|
||||
"component": "mod_assign",
|
||||
"alttext": "Assignment icon"
|
||||
}
|
||||
},
|
||||
"overdue": false
|
||||
}
|
||||
}}
|
||||
<div class="list-group-item timeline-event-list-item flex-column py-2 pl-0 pr-0 border-bottom"
|
||||
@@ -54,11 +55,13 @@
|
||||
{{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
|
||||
</div>
|
||||
<div class="event-name-container flex-grow-1 text-truncate line-height-3">
|
||||
<a href="{{url}}"
|
||||
title={{#quote}}{{{name}}}{{/quote}}
|
||||
aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": {{#quote}}{{{activityname}}}{{/quote}}, "course": {{#quote}}{{{course.fullnamedisplay}}}{{/quote}}, "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'>
|
||||
<h6 class="event-name text-truncate mb-0">{{{activityname}}}</h6>
|
||||
</a>
|
||||
<h6 class="event-name text-truncate mb-0">
|
||||
<a href="{{url}}"
|
||||
title={{#quote}}{{{name}}}{{/quote}}
|
||||
aria-label='{{#str}} ariaeventlistitem, block_timeline, { "name": {{#quote}}{{{activityname}}}{{/quote}}, "course": {{#quote}}{{{course.fullnamedisplay}}}{{/quote}}, "date": "{{#userdate}} {{timesort}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}" } {{/str}}'>
|
||||
{{{activityname}}}</a>
|
||||
{{#overdue}}<span class="badge badge-pill badge-danger ml-1">{{#str}} overdue, block_timeline {{/str}}</span>{{/overdue}}
|
||||
</h6>
|
||||
<small class="text-truncate mb-0">
|
||||
{{#courseview}}
|
||||
{{activitystr}}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
class="dropdown-item"
|
||||
href="#"
|
||||
data-from="-14"
|
||||
data-to="0"
|
||||
data-to="1"
|
||||
data-filtername="overdue"
|
||||
{{#overdue}}aria-current="true"{{/overdue}}
|
||||
aria-label="{{#str}} ariadayfilteroption, block_timeline, {{#str}} overdue, block_timeline {{/str}}{{/str}}"
|
||||
|
||||
@@ -24,9 +24,11 @@ Feature: The timeline block allows users to see upcoming courses
|
||||
| feedback | C1 | feedback2 | Test feedback 2 | Test feedback description | ##first day of +10 months## | ##last day of +10 months## |
|
||||
| feedback | C3 | feedback3 | Test feedback 3 | Test feedback description | ##first day of +5 months## | ##last day of +5 months## |
|
||||
| feedback | C4 | feedback4 | Test feedback 4 | Test feedback description | ##yesterday## | ##tomorrow## |
|
||||
| feedback | C1 | feedback5 | Test feedback 5 | Test feedback description | ##yesterday## | ##now +1 minute## |
|
||||
And the following "activities" exist:
|
||||
| activity | course | idnumber | name | intro | timeopen | duedate |
|
||||
| assign | C1 | assign1 | Test assign 1 | Test assign description | ##1 month ago## | ##yesterday## |
|
||||
| activity | course | idnumber | name | intro | timeopen | duedate |
|
||||
| assign | C1 | assign1 | Test assign 1 | Test assign description | ##1 month ago## | ##yesterday## |
|
||||
| assign | C2 | assign2 | Test assign 2 | Test assign description | ##yesterday## | ##now -1 minute## |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| student1 | C1 | student |
|
||||
@@ -36,6 +38,8 @@ Feature: The timeline block allows users to see upcoming courses
|
||||
|
||||
Scenario: Next 30 days in course view
|
||||
Given I log in as "student1"
|
||||
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
||||
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"
|
||||
@@ -45,13 +49,14 @@ Feature: The timeline block allows users to see upcoming courses
|
||||
And I should see "Choice closes" in the "Timeline" "block"
|
||||
And "Test feedback 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Feedback closes" in the "Timeline" "block"
|
||||
And "Test feedback 5" "link" should exist in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And I should not see "Course 3" in the "Timeline" "block"
|
||||
And "Test choice 2" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 2" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
|
||||
And "Test assign 1" "link" should not exist in the "Timeline" "block"
|
||||
And I should not see "Assignment is due" in the "Timeline" "block"
|
||||
|
||||
Scenario: All in course view
|
||||
Given I log in as "student1"
|
||||
@@ -68,7 +73,9 @@ Feature: The timeline block allows users to see upcoming courses
|
||||
And "Test feedback 1" "link" should exist in the "Timeline" "block"
|
||||
And "Test feedback 2" "link" should exist in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should exist in the "Timeline" "block"
|
||||
And "Test feedback 5" "link" should exist in the "Timeline" "block"
|
||||
And "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Assignment is due" in the "Timeline" "block"
|
||||
And I should see "Choice closes" in the "Timeline" "block"
|
||||
And I should not see "More courses" in the "Timeline" "block"
|
||||
@@ -88,6 +95,8 @@ Feature: The timeline block allows users to see upcoming courses
|
||||
And I should see "More courses" in the "Timeline" "block"
|
||||
And "Test choice 1" "link" should exist in the "Timeline" "block"
|
||||
And "Test feedback 1" "link" should exist in the "Timeline" "block"
|
||||
And "Test feedback 5" "link" should exist in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And I should not see "Course 3" in the "Timeline" "block"
|
||||
And "Test choice 2" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should not exist in the "Timeline" "block"
|
||||
@@ -136,3 +145,38 @@ Feature: The timeline block allows users to see upcoming courses
|
||||
And I click on "More courses" "button" in the "Timeline" "block"
|
||||
Then "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
And "Test feedback 2" "link" should exist in the "Timeline" "block"
|
||||
|
||||
Scenario: Overdue in course view
|
||||
Given I log in as "student1"
|
||||
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
||||
And I click on "Sort by courses" "link" in the "Timeline" "block"
|
||||
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
||||
When I click on "Overdue" "link" in the "Timeline" "block"
|
||||
Then "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And I should not see "Test feedback 1" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 2" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 3" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 4" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 5" in the "Timeline" "block"
|
||||
And I should not see "Test choice 1" in the "Timeline" "block"
|
||||
And I should not see "Test choice 2" in the "Timeline" "block"
|
||||
And I should not see "Test choice 3" in the "Timeline" "block"
|
||||
|
||||
Scenario: Persistent Overdue in course view
|
||||
Given I log in as "student1"
|
||||
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
||||
And I click on "Sort by courses" "link" in the "Timeline" "block"
|
||||
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
||||
When I click on "Overdue" "link" in the "Timeline" "block"
|
||||
And I reload the page
|
||||
Then "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And "Test feedback 1" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 2" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 4" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 5" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 1" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 2" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should not exist in the "Timeline" "block"
|
||||
|
||||
@@ -22,9 +22,11 @@ Feature: The timeline block allows users to see upcoming activities
|
||||
| feedback | C2 | feedback1 | Test feedback 1 | Test feedback description | ##yesterday## | ##tomorrow## |
|
||||
| feedback | C1 | feedback2 | Test feedback 2 | Test feedback description | ##first day of +10 months## | ##last day of +10 months## |
|
||||
| feedback | C3 | feedback3 | Test feedback 3 | Test feedback description | ##first day of +5 months## | ##last day of +5 months## |
|
||||
| feedback | C2 | feedback4 | Test feedback 4 | Test feedback description | ##yesterday## | ##now +1 minute## |
|
||||
And the following "activities" exist:
|
||||
| activity | course | idnumber | name | intro | timeopen | duedate |
|
||||
| assign | C1 | assign1 | Test assign 1 | Test assign description | ##1 month ago## | ##yesterday## |
|
||||
| activity | course | idnumber | name | intro | timeopen | duedate |
|
||||
| assign | C1 | assign1 | Test assign 1 | Test assign description | ##1 month ago## | ##yesterday## |
|
||||
| assign | C2 | assign2 | Test assign 2 | Test assign description | ##yesterday## | ##now -1 minute## |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| student1 | C1 | student |
|
||||
@@ -40,6 +42,8 @@ Feature: The timeline block allows users to see upcoming activities
|
||||
And I should see "Course 2 · Choice closes" in the "Timeline" "block"
|
||||
And "Test feedback 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Feedback closes" in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And "Test feedback 4" "link" should exist in the "Timeline" "block"
|
||||
And "Test choice 2" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
|
||||
@@ -50,13 +54,15 @@ Feature: The timeline block allows users to see upcoming activities
|
||||
Given I log in as "student1"
|
||||
And I click on "Filter timeline by date" "button" in the "Timeline" "block"
|
||||
When I click on "Overdue" "link" in the "Timeline" "block"
|
||||
And "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
Then I should see "Course 1 · Assignment is due" in the "Timeline" "block"
|
||||
Then "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 1 · Assignment is due" in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And "Test choice 2" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 1" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 1" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 4" "link" should not exist in the "Timeline" "block"
|
||||
|
||||
Scenario: All in date view
|
||||
Given I log in as "student1"
|
||||
@@ -64,24 +70,26 @@ Feature: The timeline block allows users to see upcoming activities
|
||||
When I click on "All" "link" in the "Timeline" "block"
|
||||
Then "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 1 · Assignment is due" in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Assignment is due" in the "Timeline" "block"
|
||||
And "Test feedback 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Feedback closes" in the "Timeline" "block"
|
||||
And "Test choice 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Choice closes" in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 3 · Choice closes" in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 3 · Feedback closes" in the "Timeline" "block"
|
||||
And "Test feedback 4" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Feedback closes" in the "Timeline" "block"
|
||||
And "Test choice 2" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 2" "link" should not exist in the "Timeline" "block"
|
||||
And I click on "[data-region='paging-bar'] [data-control='next'] [data-region='page-link']" "css_element" in the "Timeline" "block"
|
||||
And "Test feedback 2" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 1 · Feedback closes" in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 3 · Choice closes" in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 3 · Feedback closes" in the "Timeline" "block"
|
||||
And I should not see "Test assign 1" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 1" in the "Timeline" "block"
|
||||
And I should not see "Test choice 1" in the "Timeline" "block"
|
||||
And I should not see "Test choice 3" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 3" in the "Timeline" "block"
|
||||
And I should not see "Test choice 2" in the "Timeline" "block"
|
||||
|
||||
Scenario: All in date view no next
|
||||
@@ -92,7 +100,10 @@ Feature: The timeline block allows users to see upcoming activities
|
||||
When I click on "25" "link" in the "Timeline" "block"
|
||||
Then "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 1 · Assignment is due" in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Assignment is due" in the "Timeline" "block"
|
||||
And "Test feedback 1" "link" should exist in the "Timeline" "block"
|
||||
And "Test feedback 4" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Feedback closes" in the "Timeline" "block"
|
||||
And "Test choice 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Choice closes" in the "Timeline" "block"
|
||||
@@ -111,25 +122,27 @@ Feature: The timeline block allows users to see upcoming activities
|
||||
And I reload the page
|
||||
Then "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 1 · Assignment is due" in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Assignment is due" in the "Timeline" "block"
|
||||
And "Test feedback 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Feedback closes" in the "Timeline" "block"
|
||||
And "Test choice 1" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Choice closes" in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 3 · Choice closes" in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 3 · Feedback closes" in the "Timeline" "block"
|
||||
And "Test feedback 4" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Feedback closes" in the "Timeline" "block"
|
||||
And I should not see "Test choice 2" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 2" in the "Timeline" "block"
|
||||
And I click on "[data-region='paging-bar'] [data-control='next']" "css_element" in the "Timeline" "block"
|
||||
And "Test feedback 2" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 1 · Feedback closes" in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 3 · Choice closes" in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 3 · Feedback closes" in the "Timeline" "block"
|
||||
And I should not see "Test assign 1" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 1" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 3" in the "Timeline" "block"
|
||||
And I should not see "Test choice 1" in the "Timeline" "block"
|
||||
And I should not see "Test choice 2" in the "Timeline" "block"
|
||||
And I should not see "Test choice 3" in the "Timeline" "block"
|
||||
|
||||
Scenario: Persistent Overdue in date view
|
||||
Given I log in as "student1"
|
||||
@@ -137,11 +150,15 @@ Feature: The timeline block allows users to see upcoming activities
|
||||
When I click on "Overdue" "link" in the "Timeline" "block"
|
||||
And I reload the page
|
||||
Then "Test assign 1" "link" should exist in the "Timeline" "block"
|
||||
And "Test choice 2" "link" should not exist in the "Timeline" "block"
|
||||
And I should see "Course 1 · Assignment is due" in the "Timeline" "block"
|
||||
And "Test assign 2" "link" should exist in the "Timeline" "block"
|
||||
And I should see "Course 2 · Assignment is due" in the "Timeline" "block"
|
||||
And "Test feedback 1" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 1" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 3" "link" should not exist in the "Timeline" "block"
|
||||
And "Test feedback 4" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 1" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 2" "link" should not exist in the "Timeline" "block"
|
||||
And "Test choice 3" "link" should not exist in the "Timeline" "block"
|
||||
|
||||
Scenario: Current filtering always applies in date view
|
||||
Given I log in as "student1"
|
||||
|
||||
@@ -91,6 +91,7 @@ class event_exporter_base extends exporter {
|
||||
$data->visible = $event->is_visible() ? 1 : 0;
|
||||
$data->timemodified = $event->get_times()->get_modified_time()->getTimestamp();
|
||||
$data->component = $event->get_component();
|
||||
$data->overdue = $data->timesort < time();
|
||||
|
||||
if ($repeats = $event->get_repeats()) {
|
||||
$data->repeatid = $repeats->get_id();
|
||||
@@ -212,6 +213,12 @@ class event_exporter_base extends exporter {
|
||||
'timeusermidnight' => ['type' => PARAM_INT],
|
||||
'visible' => ['type' => PARAM_INT],
|
||||
'timemodified' => ['type' => PARAM_INT],
|
||||
'overdue' => [
|
||||
'type' => PARAM_BOOL,
|
||||
'optional' => true,
|
||||
'default' => false,
|
||||
'null' => NULL_ALLOWED
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user