MDL-72275 timeline: Fixed non-loading issue in dates sort
Incorrect setting/getting of the "seen" data attribute resulted in no information being fetched when switching from course view back to dates view.
This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
define ("block_timeline/view_dates",["jquery","core/str","block_timeline/event_list","core/pubsub","core/paged_content_events"],function(a,b,c,d,e){var f={EVENT_LIST_CONTAINER:"[data-region=\"event-list-container\"]"},g=[5,10,25],h=function(a){var b=parseInt(a.data("limit"),10),c=!1,d=g.map(function(a){if(b==a){c=!0}return{value:a,active:b==a}});if(!c){d[0].active=!0}return d},i=function(b,c){var f=c+e.SET_ITEMS_PER_PAGE_LIMIT;d.subscribe(f,function(c){a(b).data("limit",c)})},j=function(d){var e=d.find(f.EVENT_LIST_CONTAINER),g=a(e).attr("id")+"user_block_timeline"+Math.random();i(d,g);var j=h(d),k={persistentLimitKey:"block_timeline_user_limit_preference",eventNamespace:g};b.get_string("ariaeventlistpaginationnavdates","block_timeline").then(function(a){c.init(e,j,{},a,k);return a}).catch(function(){c.init(e,j,{},"",k)})};return{init:function init(b){b=a(b);if(b.hasClass("active")){j(b);b.data("seen",!0)}},reset:function reset(a){a.removeAttr("data-seen");if(a.hasClass("active")){j(a);a.data("seen",!0)}},shown:function shown(a){if(!a.data("seen")){j(a);a.data("seen",!0)}}}});
|
||||
define ("block_timeline/view_dates",["jquery","core/str","block_timeline/event_list","core/pubsub","core/paged_content_events"],function(a,b,c,d,e){var f={EVENT_LIST_CONTAINER:"[data-region=\"event-list-container\"]"},g=[5,10,25],h=function(a){var b=parseInt(a.data("limit"),10),c=!1,d=g.map(function(a){if(b==a){c=!0}return{value:a,active:b==a}});if(!c){d[0].active=!0}return d},i=function(b,c){var f=c+e.SET_ITEMS_PER_PAGE_LIMIT;d.subscribe(f,function(c){a(b).data("limit",c)})},j=function(d){var e=d.find(f.EVENT_LIST_CONTAINER),g=a(e).attr("id")+"user_block_timeline"+Math.random();i(d,g);var j=h(d),k={persistentLimitKey:"block_timeline_user_limit_preference",eventNamespace:g};b.get_string("ariaeventlistpaginationnavdates","block_timeline").then(function(a){c.init(e,j,{},a,k);return a}).catch(function(){c.init(e,j,{},"",k)})};return{init:function init(b){b=a(b);if(b.hasClass("active")){j(b);b.attr("data-seen",!0)}},reset:function reset(a){a.removeAttr("data-seen");if(a.hasClass("active")){j(a);a.attr("data-seen",!0)}},shown:function shown(a){if(!a.attr("data-seen")){j(a);a.attr("data-seen",!0)}}}});
|
||||
//# sourceMappingURL=view_dates.min.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -118,7 +118,7 @@ function(
|
||||
root = $(root);
|
||||
if (root.hasClass('active')) {
|
||||
load(root);
|
||||
root.data('seen', true);
|
||||
root.attr('data-seen', true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -132,7 +132,7 @@ function(
|
||||
root.removeAttr('data-seen');
|
||||
if (root.hasClass('active')) {
|
||||
load(root);
|
||||
root.data('seen', true);
|
||||
root.attr('data-seen', true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -142,9 +142,9 @@ function(
|
||||
* @param {object} root The root element for the timeline courses view.
|
||||
*/
|
||||
var shown = function(root) {
|
||||
if (!root.data('seen')) {
|
||||
if (!root.attr('data-seen')) {
|
||||
load(root);
|
||||
root.data('seen', true);
|
||||
root.attr('data-seen', true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -111,3 +111,23 @@ Feature: The timeline block allows users to see upcoming courses
|
||||
And I should not see "Course 4" in the "Timeline" "block"
|
||||
And I should not see "Test choice 2 closes" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 4 closes" in the "Timeline" "block"
|
||||
|
||||
Scenario: Current filtering always applies in courses 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 items" "button" in the "Timeline" "block"
|
||||
And I click on "Overdue" "link" in the "Timeline" "block"
|
||||
And I reload the page
|
||||
And I should see "Test assign 1 is due" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 2 closes" in the "Timeline" "block"
|
||||
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
||||
And I click on "Sort by dates" "link" in the "Timeline" "block"
|
||||
And I click on "Filter timeline items" "button" in the "Timeline" "block"
|
||||
# Confirm that when we switch back to courses view, the "All" filer continues to be applied (and not "overdue").
|
||||
When I click on "All" "link" in the "Timeline" "block"
|
||||
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 "More courses" "button" in the "Timeline" "block"
|
||||
Then I should see "Test assign 1 is due" in the "Timeline" "block"
|
||||
And I should see "Test feedback 2 closes" in the "Timeline" "block"
|
||||
|
||||
@@ -119,3 +119,23 @@ Feature: The timeline block allows users to see upcoming activities
|
||||
And I should not see "Test choice 1 closes" in the "Timeline" "block"
|
||||
And I should not see "Test choice 3 closes" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 3 closes" in the "Timeline" "block"
|
||||
|
||||
Scenario: Current filtering always applies in date view
|
||||
Given I log in as "student1"
|
||||
And I click on "Filter timeline items" "button" in the "Timeline" "block"
|
||||
And I click on "Overdue" "link" in the "Timeline" "block"
|
||||
And I reload the page
|
||||
# Expand to 25 results, to ensure we see the earliest and latest timeline items.
|
||||
And I click on "Show 5 activities per page" "button" in the "Timeline" "block"
|
||||
And I click on "25" "link"
|
||||
And I should see "Test assign 1 is due" in the "Timeline" "block"
|
||||
And I should not see "Test feedback 2 closes" in the "Timeline" "block"
|
||||
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 items" "button" in the "Timeline" "block"
|
||||
# Confirm that when we switch back to date view, the "All" filer continues to be applied (and not "overdue")
|
||||
When I click on "All" "link" in the "Timeline" "block"
|
||||
And I click on "Sort timeline items" "button" in the "Timeline" "block"
|
||||
And I click on "Sort by dates" "link" in the "Timeline" "block"
|
||||
Then I should see "Test assign 1 is due" in the "Timeline" "block"
|
||||
And I should see "Test feedback 2 closes" in the "Timeline" "block"
|
||||
|
||||
Reference in New Issue
Block a user