diff --git a/blocks/myoverview/amd/build/view.min.js.map b/blocks/myoverview/amd/build/view.min.js.map
index a8de3262a83..8f78cb5060f 100644
--- a/blocks/myoverview/amd/build/view.min.js.map
+++ b/blocks/myoverview/amd/build/view.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/view.js"],"names":["TEMPLATES","COURSES_CARDS","COURSES_LIST","COURSES_SUMMARY","NOCOURSES","GROUPINGS","GROUPING_ALLINCLUDINGHIDDEN","GROUPING_ALL","GROUPING_INPROGRESS","GROUPING_FUTURE","GROUPING_PAST","GROUPING_FAVOURITES","GROUPING_HIDDEN","NUMCOURSES_PERPAGE","loadedPages","courseOffset","lastPage","lastLimit","namespace","getFilterValues","root","courseRegion","find","SELECTORS","courseView","region","display","attr","grouping","sort","displaycategories","customfieldname","customfieldvalue","DEFAULT_PAGED_CONTENT_CONFIG","ignoreControlWhileLoading","controlPlacementBottom","persistentLimitKey","getMyCourses","filters","limit","Repository","getEnrolledCoursesByTimeline","offset","classification","getSearchMyCourses","searchValue","searchvalue","getFavouriteIconContainer","courseId","FAVOURITE_ICON","getPagedContentContainer","index","getCourseId","hideFavouriteIcon","iconContainer","isFavouriteIcon","ICON_IS_FAVOURITE","addClass","Aria","hide","notFavourteIcon","ICON_NOT_FAVOURITE","removeClass","unhide","showFavouriteIcon","getAddFavouriteMenuItem","getRemoveFavouriteMenuItem","addToFavourites","removeAction","addAction","setCourseFavouriteState","then","success","PubSub","publish","CourseEvents","favorited","Notification","alert","catch","exception","removeFromFavourites","unfavorited","getHideCourseMenuItem","getShowCourseMenuItem","hideCourse","hideAction","showAction","setCourseHiddenState","hideElement","showCourse","status","updateUserPreferences","preferences","type","value","id","pagingBar","jumpto","parseInt","courseList","reducedCourse","courses","reduce","accumulator","current","push","newElement","slice","forEach","popElement","length","pagedContentContainer","PagedContentFactory","resetLastPageNumber","pagedContentPage","renderCourses","html","js","Templates","replaceNodeContents","page","remove","setFavouriteCourses","result","warnings","course","isfavourite","noCoursesRender","nocoursesimg","render","coursesData","currentTemplate","Array","isArray","Object","values","map","showcoursecategory","setLimit","registerPagedEventHandlers","event","PagedContentEvents","SET_ITEMS_PER_PAGE_LIMIT","subscribe","itemsPerPageFunc","pagingLimit","itemsPerPage","active","totalCourseCount","filter","pagingOption","pageBuilder","currentPage","pageData","actions","activeSearch","nextPageStart","pageCourses","currentPageLength","remainingCourses","allItemsLoaded","nextoffset","resetGlobals","standardFunctionalityCurry","promises","pagePromise","searchFunctionalityCurry","inputValue","searchingPromise","initializePagedContent","promiseFunction","config","eventNamespace","pagedContentPromise","createWithLimit","pagesData","pageNumber","registerEventListeners","CustomEvents","define","events","activate","on","ACTION_ADD_FAVOURITE","e","data","favourite","target","closest","originalEvent","preventDefault","ACTION_REMOVE_FAVOURITE","ACTION_HIDE_COURSE","ACTION_SHOW_COURSE","input","querySelector","searchInput","clearIcon","searchIcon","addEventListener","clearSearch","trim","classList","parentElement","add","init","document","selectBlock","Math","random","reset"],"mappings":"otBAsBA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,O,whEAGMA,CAAAA,CAAS,CAAG,CACdC,aAAa,CAAE,6BADD,CAEdC,YAAY,CAAE,4BAFA,CAGdC,eAAe,CAAE,+BAHH,CAIdC,SAAS,CAAE,wBAJG,C,CAOZC,CAAS,CAAG,CACdC,2BAA2B,CAAE,oBADf,CAEdC,YAAY,CAAE,KAFA,CAGdC,mBAAmB,CAAE,YAHP,CAIdC,eAAe,CAAE,QAJH,CAKdC,aAAa,CAAE,MALD,CAMdC,mBAAmB,CAAE,YANP,CAOdC,eAAe,CAAE,QAPH,C,CAUZC,CAAkB,CAAG,CAAC,EAAD,CAAK,EAAL,CAAS,EAAT,CAAa,EAAb,CAAiB,CAAjB,C,CAEvBC,CAAW,CAAG,E,CAEdC,CAAY,CAAG,C,CAEfC,CAAQ,CAAG,C,CAEXC,CAAS,CAAG,C,CAEZC,CAAS,CAAG,I,CAQVC,CAAe,CAAG,SAAAC,CAAI,CAAI,C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,CAA8CsL,IAAI,CAACC,MAAL,EAA1D,CACA9L,CAAI,CAACO,IAAL,CAAU,WAAV,IACH,CAED+I,EAAsB,CAACtJ,CAAD,CAAOgJ,EAA0B,EAAjC,CACzB,C,WAWM,GAAM+C,CAAAA,EAAK,CAAG,SAAA/L,CAAI,CAAI,CACzB,GAAyB,CAArB,CAAAN,CAAW,CAACiG,MAAhB,CAA4B,CACxBjG,CAAW,CAAC+F,OAAZ,CAAoB,SAACT,CAAD,CAAajD,CAAb,CAAuB,CACvC,GAAIgE,CAAAA,CAAgB,CAAGjE,CAAwB,CAAC9B,CAAD,CAAO+B,CAAP,CAA/C,CACAiE,EAAa,CAAChG,CAAD,CAAOgF,CAAP,CAAb,CAAgC7B,IAAhC,CAAqC,SAAC8C,CAAD,CAAOC,CAAP,CAAc,CAC/C,MAAOC,CAAAA,CAAS,CAACC,mBAAV,CAA8BL,CAA9B,CAAgDE,CAAhD,CAAsDC,CAAtD,CACV,CAFD,EAEGvC,KAFH,CAESF,CAAY,CAACG,SAFtB,CAGH,CALD,CAMH,CAPD,IAOO,CACH8H,EAAI,CAAC1L,CAAD,CACP,CACJ,CAXM,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manage the courses view for the overview block.\n *\n * @copyright 2018 Bas Brands \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport $ from 'jquery';\nimport * as Repository from 'block_myoverview/repository';\nimport * as PagedContentFactory from 'core/paged_content_factory';\nimport * as PubSub from 'core/pubsub';\nimport * as CustomEvents from 'core/custom_interaction_events';\nimport * as Notification from 'core/notification';\nimport * as Templates from 'core/templates';\nimport * as CourseEvents from 'core_course/events';\nimport SELECTORS from 'block_myoverview/selectors';\nimport * as PagedContentEvents from 'core/paged_content_events';\nimport * as Aria from 'core/aria';\nimport {debounce} from 'core/utils';\n\nconst TEMPLATES = {\n COURSES_CARDS: 'block_myoverview/view-cards',\n COURSES_LIST: 'block_myoverview/view-list',\n COURSES_SUMMARY: 'block_myoverview/view-summary',\n NOCOURSES: 'core_course/no-courses'\n};\n\nconst GROUPINGS = {\n GROUPING_ALLINCLUDINGHIDDEN: 'allincludinghidden',\n GROUPING_ALL: 'all',\n GROUPING_INPROGRESS: 'inprogress',\n GROUPING_FUTURE: 'future',\n GROUPING_PAST: 'past',\n GROUPING_FAVOURITES: 'favourites',\n GROUPING_HIDDEN: 'hidden'\n};\n\nconst NUMCOURSES_PERPAGE = [12, 24, 48, 96, 0];\n\nlet loadedPages = [];\n\nlet courseOffset = 0;\n\nlet lastPage = 0;\n\nlet lastLimit = 0;\n\nlet namespace = null;\n\n/**\n * Get filter values from DOM.\n *\n * @param {object} root The root element for the courses view.\n * @return {filters} Set filters.\n */\nconst getFilterValues = root => {\n const courseRegion = root.find(SELECTORS.courseView.region);\n return {\n display: courseRegion.attr('data-display'),\n grouping: courseRegion.attr('data-grouping'),\n sort: courseRegion.attr('data-sort'),\n displaycategories: courseRegion.attr('data-displaycategories'),\n customfieldname: courseRegion.attr('data-customfieldname'),\n customfieldvalue: courseRegion.attr('data-customfieldvalue'),\n };\n};\n\n// We want the paged content controls below the paged content area.\n// and the controls should be ignored while data is loading.\nconst DEFAULT_PAGED_CONTENT_CONFIG = {\n ignoreControlWhileLoading: true,\n controlPlacementBottom: true,\n persistentLimitKey: 'block_myoverview_user_paging_preference'\n};\n\n/**\n * Get enrolled courses from backend.\n *\n * @param {object} filters The filters for this view.\n * @param {int} limit The number of courses to show.\n * @return {promise} Resolved with an array of courses.\n */\nconst getMyCourses = (filters, limit) => {\n return Repository.getEnrolledCoursesByTimeline({\n offset: courseOffset,\n limit: limit,\n classification: filters.grouping,\n sort: filters.sort,\n customfieldname: filters.customfieldname,\n customfieldvalue: filters.customfieldvalue\n });\n};\n\n/**\n * Search for enrolled courses from backend.\n *\n * @param {object} filters The filters for this view.\n * @param {int} limit The number of courses to show.\n * @param {string} searchValue What does the user want to search within their courses.\n * @return {promise} Resolved with an array of courses.\n */\nconst getSearchMyCourses = (filters, limit, searchValue) => {\n return Repository.getEnrolledCoursesByTimeline({\n offset: courseOffset,\n limit: limit,\n classification: 'search',\n sort: filters.sort,\n customfieldname: filters.customfieldname,\n customfieldvalue: filters.customfieldvalue,\n searchvalue: searchValue\n });\n};\n\n/**\n * Get the container element for the favourite icon.\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n * @return {Object} The favourite icon container\n */\nconst getFavouriteIconContainer = (root, courseId) => {\n return root.find(SELECTORS.FAVOURITE_ICON + '[data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Get the paged content container element.\n *\n * @param {Object} root The course overview container\n * @param {Number} index Rendered page index.\n * @return {Object} The rendered paged container.\n */\nconst getPagedContentContainer = (root, index) => {\n return root.find('[data-region=\"paged-content-page\"][data-page=\"' + index + '\"]');\n};\n\n/**\n * Get the course id from a favourite element.\n *\n * @param {Object} root The favourite icon container element.\n * @return {Number} Course id.\n */\nconst getCourseId = root => {\n return root.attr('data-course-id');\n};\n\n/**\n * Hide the favourite icon.\n *\n * @param {Object} root The favourite icon container element.\n * @param {Number} courseId Course id number.\n */\nconst hideFavouriteIcon = (root, courseId) => {\n const iconContainer = getFavouriteIconContainer(root, courseId);\n\n const isFavouriteIcon = iconContainer.find(SELECTORS.ICON_IS_FAVOURITE);\n isFavouriteIcon.addClass('hidden');\n Aria.hide(isFavouriteIcon);\n\n const notFavourteIcon = iconContainer.find(SELECTORS.ICON_NOT_FAVOURITE);\n notFavourteIcon.removeClass('hidden');\n Aria.unhide(notFavourteIcon);\n};\n\n/**\n * Show the favourite icon.\n *\n * @param {Object} root The course overview container.\n * @param {Number} courseId Course id number.\n */\nconst showFavouriteIcon = (root, courseId) => {\n const iconContainer = getFavouriteIconContainer(root, courseId);\n\n const isFavouriteIcon = iconContainer.find(SELECTORS.ICON_IS_FAVOURITE);\n isFavouriteIcon.removeClass('hidden');\n Aria.unhide(isFavouriteIcon);\n\n const notFavourteIcon = iconContainer.find(SELECTORS.ICON_NOT_FAVOURITE);\n notFavourteIcon.addClass('hidden');\n Aria.hide(notFavourteIcon);\n};\n\n/**\n * Get the action menu item\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id.\n * @return {Object} The add to favourite menu item.\n */\nconst getAddFavouriteMenuItem = (root, courseId) => {\n return root.find('[data-action=\"add-favourite\"][data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Get the action menu item\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id.\n * @return {Object} The remove from favourites menu item.\n */\nconst getRemoveFavouriteMenuItem = (root, courseId) => {\n return root.find('[data-action=\"remove-favourite\"][data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Add course to favourites\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n */\nconst addToFavourites = (root, courseId) => {\n const removeAction = getRemoveFavouriteMenuItem(root, courseId);\n const addAction = getAddFavouriteMenuItem(root, courseId);\n\n setCourseFavouriteState(courseId, true).then(success => {\n if (success) {\n PubSub.publish(CourseEvents.favorited, courseId);\n removeAction.removeClass('hidden');\n addAction.addClass('hidden');\n showFavouriteIcon(root, courseId);\n } else {\n Notification.alert('Starring course failed', 'Could not change favourite state');\n }\n return;\n }).catch(Notification.exception);\n};\n\n/**\n * Remove course from favourites\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n */\nconst removeFromFavourites = (root, courseId) => {\n const removeAction = getRemoveFavouriteMenuItem(root, courseId);\n const addAction = getAddFavouriteMenuItem(root, courseId);\n\n setCourseFavouriteState(courseId, false).then(success => {\n if (success) {\n PubSub.publish(CourseEvents.unfavorited, courseId);\n removeAction.addClass('hidden');\n addAction.removeClass('hidden');\n hideFavouriteIcon(root, courseId);\n } else {\n Notification.alert('Starring course failed', 'Could not change favourite state');\n }\n return;\n }).catch(Notification.exception);\n};\n\n/**\n * Get the action menu item\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id.\n * @return {Object} The hide course menu item.\n */\nconst getHideCourseMenuItem = (root, courseId) => {\n return root.find('[data-action=\"hide-course\"][data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Get the action menu item\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id.\n * @return {Object} The show course menu item.\n */\nconst getShowCourseMenuItem = (root, courseId) => {\n return root.find('[data-action=\"show-course\"][data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Hide course\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n */\nconst hideCourse = (root, courseId) => {\n const hideAction = getHideCourseMenuItem(root, courseId);\n const showAction = getShowCourseMenuItem(root, courseId);\n const filters = getFilterValues(root);\n\n setCourseHiddenState(courseId, true);\n\n // Remove the course from this view as it is now hidden and thus not covered by this view anymore.\n // Do only if we are not in \"All\" view mode where really all courses are shown.\n if (filters.grouping !== GROUPINGS.GROUPING_ALLINCLUDINGHIDDEN) {\n hideElement(root, courseId);\n }\n\n hideAction.addClass('hidden');\n showAction.removeClass('hidden');\n};\n\n/**\n * Show course\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n */\nconst showCourse = (root, courseId) => {\n const hideAction = getHideCourseMenuItem(root, courseId);\n const showAction = getShowCourseMenuItem(root, courseId);\n const filters = getFilterValues(root);\n\n setCourseHiddenState(courseId, null);\n\n // Remove the course from this view as it is now shown again and thus not covered by this view anymore.\n // Do only if we are not in \"All\" view mode where really all courses are shown.\n if (filters.grouping !== GROUPINGS.GROUPING_ALLINCLUDINGHIDDEN) {\n hideElement(root, courseId);\n }\n\n hideAction.removeClass('hidden');\n showAction.addClass('hidden');\n};\n\n/**\n * Set the courses hidden status and push to repository\n *\n * @param {Number} courseId Course id to favourite.\n * @param {Boolean} status new hidden status.\n * @return {Promise} Repository promise.\n */\nconst setCourseHiddenState = (courseId, status) => {\n\n // If the given status is not hidden, the preference has to be deleted with a null value.\n if (status === false) {\n status = null;\n }\n return Repository.updateUserPreferences({\n preferences: [\n {\n type: 'block_myoverview_hidden_course_' + courseId,\n value: status\n }\n ]\n });\n};\n\n/**\n * Reset the loadedPages dataset to take into account the hidden element\n *\n * @param {Object} root The course overview container\n * @param {Number} id The course id number\n */\nconst hideElement = (root, id) => {\n const pagingBar = root.find('[data-region=\"paging-bar\"]');\n const jumpto = parseInt(pagingBar.attr('data-active-page-number'));\n\n // Get a reduced dataset for the current page.\n const courseList = loadedPages[jumpto];\n let reducedCourse = courseList.courses.reduce((accumulator, current) => {\n if (+id !== +current.id) {\n accumulator.push(current);\n }\n return accumulator;\n }, []);\n\n // Get the next page's data if loaded and pop the first element from it.\n if (typeof (loadedPages[jumpto + 1]) !== 'undefined') {\n const newElement = loadedPages[jumpto + 1].courses.slice(0, 1);\n\n // Adjust the dataset for the reset of the pages that are loaded.\n loadedPages.forEach((courseList, index) => {\n if (index > jumpto) {\n let popElement = [];\n if (typeof (loadedPages[index + 1]) !== 'undefined') {\n popElement = loadedPages[index + 1].courses.slice(0, 1);\n }\n loadedPages[index].courses = [...loadedPages[index].courses.slice(1), ...popElement];\n }\n });\n\n reducedCourse = [...reducedCourse, ...newElement];\n }\n\n // Check if the next page is the last page and if it still has data associated to it.\n if (lastPage === jumpto + 1 && loadedPages[jumpto + 1].courses.length === 0) {\n const pagedContentContainer = root.find('[data-region=\"paged-content-container\"]');\n PagedContentFactory.resetLastPageNumber($(pagedContentContainer).attr('id'), jumpto);\n }\n\n loadedPages[jumpto].courses = reducedCourse;\n\n // Reduce the course offset.\n courseOffset--;\n\n // Render the paged content for the current.\n const pagedContentPage = getPagedContentContainer(root, jumpto);\n renderCourses(root, loadedPages[jumpto]).then((html, js) => {\n return Templates.replaceNodeContents(pagedContentPage, html, js);\n }).catch(Notification.exception);\n\n // Delete subsequent pages in order to trigger the callback.\n loadedPages.forEach((courseList, index) => {\n if (index > jumpto) {\n const page = getPagedContentContainer(root, index);\n page.remove();\n }\n });\n};\n\n/**\n * Set the courses favourite status and push to repository\n *\n * @param {Number} courseId Course id to favourite.\n * @param {boolean} status new favourite status.\n * @return {Promise} Repository promise.\n */\nconst setCourseFavouriteState = (courseId, status) => {\n\n return Repository.setFavouriteCourses({\n courses: [\n {\n 'id': courseId,\n 'favourite': status\n }\n ]\n }).then(result => {\n if (result.warnings.length === 0) {\n loadedPages.forEach(courseList => {\n courseList.courses.forEach((course, index) => {\n if (course.id === courseId) {\n courseList.courses[index].isfavourite = status;\n }\n });\n });\n return true;\n } else {\n return false;\n }\n }).catch(Notification.exception);\n};\n\n/**\n * Given there are no courses to render provide the rendered template.\n *\n * @param {object} root The root element for the courses view.\n * @return {promise} jQuery promise resolved after rendering is complete.\n */\nconst noCoursesRender = root => {\n const nocoursesimg = root.find(SELECTORS.courseView.region).attr('data-nocoursesimg');\n return Templates.render(TEMPLATES.NOCOURSES, {\n nocoursesimg: nocoursesimg\n });\n};\n\n/**\n * Render the dashboard courses.\n *\n * @param {object} root The root element for the courses view.\n * @param {array} coursesData containing array of returned courses.\n * @return {promise} jQuery promise resolved after rendering is complete.\n */\nconst renderCourses = (root, coursesData) => {\n\n const filters = getFilterValues(root);\n\n let currentTemplate = '';\n if (filters.display === 'card') {\n currentTemplate = TEMPLATES.COURSES_CARDS;\n } else if (filters.display === 'list') {\n currentTemplate = TEMPLATES.COURSES_LIST;\n } else {\n currentTemplate = TEMPLATES.COURSES_SUMMARY;\n }\n\n if (!coursesData) {\n return noCoursesRender(root);\n } else {\n // Sometimes we get weird objects coming after a failed search, cast to ensure typing functions.\n if (Array.isArray(coursesData.courses) === false) {\n coursesData.courses = Object.values(coursesData.courses);\n }\n // Whether the course category should be displayed in the course item.\n coursesData.courses = coursesData.courses.map(course => {\n course.showcoursecategory = filters.displaycategories === 'on';\n return course;\n });\n if (coursesData.courses.length) {\n return Templates.render(currentTemplate, {\n courses: coursesData.courses,\n });\n } else {\n return noCoursesRender(root);\n }\n }\n};\n\n/**\n * Return the callback to be passed to the subscribe event\n *\n * @param {object} root The root element for the courses view\n * @return {function} Partially applied function that'll execute when passed a limit\n */\nconst setLimit = root => {\n // @param {Number} limit The paged limit that is passed through the event.\n return limit => root.find(SELECTORS.courseView.region).attr('data-paging', limit);\n};\n\n/**\n * Intialise the paged list and cards views on page load.\n * Returns an array of paged contents that we would like to handle here\n *\n * @param {object} root The root element for the courses view\n * @param {string} namespace The namespace for all the events attached\n */\nconst registerPagedEventHandlers = (root, namespace) => {\n const event = namespace + PagedContentEvents.SET_ITEMS_PER_PAGE_LIMIT;\n PubSub.subscribe(event, setLimit(root));\n};\n\n/**\n * Figure out how many items are going to be allowed to be rendered in the block.\n *\n * @param {Number} pagingLimit How many courses to display\n * @param {Object} root The course overview container\n * @return {Number[]} How many courses will be rendered\n */\nconst itemsPerPageFunc = (pagingLimit, root) => {\n let itemsPerPage = NUMCOURSES_PERPAGE.map(value => {\n let active = false;\n if (value === pagingLimit) {\n active = true;\n }\n\n return {\n value: value,\n active: active\n };\n });\n\n // Filter out all pagination options which are too large for the amount of courses user is enrolled in.\n const totalCourseCount = parseInt(root.find(SELECTORS.courseView.region).attr('data-totalcoursecount'), 10);\n return itemsPerPage.filter(pagingOption => {\n return pagingOption.value < totalCourseCount || pagingOption.value === 0;\n });\n};\n\n/**\n * Mutates and controls the loadedPages array and handles the bootstrapping.\n *\n * @param {Array|Object} coursesData Array of all of the courses to start building the page from\n * @param {Number} currentPage What page are we currently on?\n * @param {Object} pageData Any current page information\n * @param {Object} actions Paged content helper\n * @param {null|boolean} activeSearch Are we currently actively searching and building up search results?\n */\nconst pageBuilder = (coursesData, currentPage, pageData, actions, activeSearch = null) => {\n // If the courseData comes in an object then get the value otherwise it is a pure array.\n let courses = coursesData.courses ? coursesData.courses : coursesData;\n let nextPageStart = 0;\n let pageCourses = [];\n\n // If current page's data is loaded make sure we max it to page limit.\n if (typeof (loadedPages[currentPage]) !== 'undefined') {\n pageCourses = loadedPages[currentPage].courses;\n const currentPageLength = pageCourses.length;\n if (currentPageLength < pageData.limit) {\n nextPageStart = pageData.limit - currentPageLength;\n pageCourses = {...loadedPages[currentPage].courses, ...courses.slice(0, nextPageStart)};\n }\n } else {\n // When the page limit is zero, there is only one page of courses, no start for next page.\n nextPageStart = pageData.limit || false;\n pageCourses = (pageData.limit > 0) ? courses.slice(0, pageData.limit) : courses;\n }\n\n // Finished setting up the current page.\n loadedPages[currentPage] = {\n courses: pageCourses\n };\n\n // Set up the next page (if there is more than one page).\n const remainingCourses = nextPageStart !== false ? courses.slice(nextPageStart, courses.length) : [];\n if (remainingCourses.length) {\n loadedPages[currentPage + 1] = {\n courses: remainingCourses\n };\n }\n\n // Set the last page to either the current or next page.\n if (loadedPages[currentPage].courses.length < pageData.limit || !remainingCourses.length) {\n lastPage = currentPage;\n if (activeSearch === null) {\n actions.allItemsLoaded(currentPage);\n }\n } else if (typeof (loadedPages[currentPage + 1]) !== 'undefined'\n && loadedPages[currentPage + 1].courses.length < pageData.limit) {\n lastPage = currentPage + 1;\n }\n\n courseOffset = coursesData.nextoffset;\n};\n\n/**\n * In cases when switching between regular rendering and search rendering we need to reset some variables.\n */\nconst resetGlobals = () => {\n courseOffset = 0;\n loadedPages = [];\n lastPage = 0;\n lastLimit = 0;\n};\n\n/**\n * The default functionality of fetching paginated courses without special handling.\n *\n * @return {function(Object, Object, Object, Object, Object, Promise, Number): void}\n */\nconst standardFunctionalityCurry = () => {\n resetGlobals();\n return (filters, currentPage, pageData, actions, root, promises, limit) => {\n const pagePromise = getMyCourses(\n filters,\n limit\n ).then(coursesData => {\n pageBuilder(coursesData, currentPage, pageData, actions);\n return renderCourses(root, loadedPages[currentPage]);\n }).catch(Notification.exception);\n\n promises.push(pagePromise);\n };\n};\n\n/**\n * Initialize the searching functionality so we can call it when required.\n *\n * @return {function(Object, Number, Object, Object, Object, Promise, Number, String): void}\n */\nconst searchFunctionalityCurry = () => {\n resetGlobals();\n return (filters, currentPage, pageData, actions, root, promises, limit, inputValue) => {\n const searchingPromise = getSearchMyCourses(\n filters,\n limit,\n inputValue\n ).then(coursesData => {\n pageBuilder(coursesData, currentPage, pageData, actions);\n return renderCourses(root, loadedPages[currentPage]);\n }).catch(Notification.exception);\n\n promises.push(searchingPromise);\n };\n};\n\n/**\n * Initialise the courses list and cards views on page load.\n *\n * @param {object} root The root element for the courses view.\n * @param {function} promiseFunction How do we fetch the courses and what do we do with them?\n * @param {null | string} inputValue What to search for\n */\nconst initializePagedContent = (root, promiseFunction, inputValue = null) => {\n const pagingLimit = parseInt(root.find(SELECTORS.courseView.region).attr('data-paging'), 10);\n let itemsPerPage = itemsPerPageFunc(pagingLimit, root);\n\n const filters = getFilterValues(root);\n const config = {...{}, ...DEFAULT_PAGED_CONTENT_CONFIG};\n config.eventNamespace = namespace;\n\n const pagedContentPromise = PagedContentFactory.createWithLimit(\n itemsPerPage,\n (pagesData, actions) => {\n let promises = [];\n pagesData.forEach(pageData => {\n const currentPage = pageData.pageNumber;\n let limit = (pageData.limit > 0) ? pageData.limit : 0;\n\n // Reset local variables if limits have changed.\n if (+lastLimit !== +limit) {\n loadedPages = [];\n courseOffset = 0;\n lastPage = 0;\n }\n\n if (lastPage === currentPage) {\n // If we are on the last page and have it's data then load it from cache.\n actions.allItemsLoaded(lastPage);\n promises.push(renderCourses(root, loadedPages[currentPage]));\n return;\n }\n\n lastLimit = limit;\n\n // Get 2 pages worth of data as we will need it for the hidden functionality.\n if (typeof (loadedPages[currentPage + 1]) === 'undefined') {\n if (typeof (loadedPages[currentPage]) === 'undefined') {\n limit *= 2;\n }\n }\n\n // Call the curried function that'll handle the course promise and any manipulation of it.\n promiseFunction(filters, currentPage, pageData, actions, root, promises, limit, inputValue);\n });\n return promises;\n },\n config\n );\n\n pagedContentPromise.then((html, js) => {\n registerPagedEventHandlers(root, namespace);\n return Templates.replaceNodeContents(root.find(SELECTORS.courseView.region), html, js);\n }).catch(Notification.exception);\n};\n\n/**\n * Listen to, and handle events for the myoverview block.\n *\n * @param {Object} root The myoverview block container element.\n * @param {HTMLElement} page The whole HTMLElement for our block.\n */\nconst registerEventListeners = (root, page) => {\n\n CustomEvents.define(root, [\n CustomEvents.events.activate\n ]);\n\n root.on(CustomEvents.events.activate, SELECTORS.ACTION_ADD_FAVOURITE, (e, data) => {\n const favourite = $(e.target).closest(SELECTORS.ACTION_ADD_FAVOURITE);\n const courseId = getCourseId(favourite);\n addToFavourites(root, courseId);\n data.originalEvent.preventDefault();\n });\n\n root.on(CustomEvents.events.activate, SELECTORS.ACTION_REMOVE_FAVOURITE, (e, data) => {\n const favourite = $(e.target).closest(SELECTORS.ACTION_REMOVE_FAVOURITE);\n const courseId = getCourseId(favourite);\n removeFromFavourites(root, courseId);\n data.originalEvent.preventDefault();\n });\n\n root.on(CustomEvents.events.activate, SELECTORS.FAVOURITE_ICON, (e, data) => {\n data.originalEvent.preventDefault();\n });\n\n root.on(CustomEvents.events.activate, SELECTORS.ACTION_HIDE_COURSE, (e, data) => {\n const target = $(e.target).closest(SELECTORS.ACTION_HIDE_COURSE);\n const courseId = getCourseId(target);\n hideCourse(root, courseId);\n data.originalEvent.preventDefault();\n });\n\n root.on(CustomEvents.events.activate, SELECTORS.ACTION_SHOW_COURSE, (e, data) => {\n const target = $(e.target).closest(SELECTORS.ACTION_SHOW_COURSE);\n const courseId = getCourseId(target);\n showCourse(root, courseId);\n data.originalEvent.preventDefault();\n });\n\n // Searching functionality event handlers.\n const input = page.querySelector(SELECTORS.region.searchInput);\n const clearIcon = page.querySelector(SELECTORS.region.clearIcon);\n const searchIcon = page.querySelector(SELECTORS.region.searchIcon);\n\n clearIcon.addEventListener('click', () => {\n input.value = '';\n clearSearch(searchIcon, clearIcon, root);\n });\n\n input.addEventListener('input', debounce(() => {\n if (input.value === '') {\n clearSearch(searchIcon, clearIcon, root);\n } else {\n activeSearch(searchIcon, clearIcon);\n initializePagedContent(root, searchFunctionalityCurry(), input.value.trim());\n }\n }, 300));\n};\n\n/**\n * Reset the search icon and trigger the init for the block.\n *\n * @param {HTMLElement} searchIcon Our search icon to manipulate.\n * @param {HTMLElement} clearIcon Our closing icon to manipulate.\n * @param {Object} root The myoverview block container element.\n */\nexport const clearSearch = (searchIcon, clearIcon, root) => {\n searchIcon.classList.remove('d-none');\n clearIcon.parentElement.classList.add('d-none');\n init(root);\n};\n\n/**\n * Change the searching icon to its' active state.\n *\n * @param {HTMLElement} searchIcon Our search icon to manipulate.\n * @param {HTMLElement} clearIcon Our closing icon to manipulate.\n */\nconst activeSearch = (searchIcon, clearIcon) => {\n searchIcon.classList.add('d-none');\n clearIcon.parentElement.classList.remove('d-none');\n};\n\n/**\n * Intialise the courses list and cards views on page load.\n *\n * @param {object} root The root element for the courses view.\n */\nexport const init = root => {\n root = $(root);\n loadedPages = [];\n lastPage = 0;\n courseOffset = 0;\n\n if (!root.attr('data-init')) {\n const page = document.querySelector(SELECTORS.region.selectBlock);\n registerEventListeners(root, page);\n namespace = \"block_myoverview_\" + root.attr('id') + \"_\" + Math.random();\n root.attr('data-init', true);\n }\n\n initializePagedContent(root, standardFunctionalityCurry());\n};\n\n/**\n * Reset the courses views to their original\n * state on first page load.courseOffset\n *\n * This is called when configuration has changed for the event lists\n * to cause them to reload their data.\n *\n * @param {Object} root The root element for the timeline view.\n */\nexport const reset = root => {\n if (loadedPages.length > 0) {\n loadedPages.forEach((courseList, index) => {\n let pagedContentPage = getPagedContentContainer(root, index);\n renderCourses(root, courseList).then((html, js) => {\n return Templates.replaceNodeContents(pagedContentPage, html, js);\n }).catch(Notification.exception);\n });\n } else {\n init(root);\n }\n};\n"],"file":"view.min.js"}
\ No newline at end of file
+{"version":3,"sources":["../src/view.js"],"names":["TEMPLATES","COURSES_CARDS","COURSES_LIST","COURSES_SUMMARY","NOCOURSES","GROUPINGS","GROUPING_ALLINCLUDINGHIDDEN","GROUPING_ALL","GROUPING_INPROGRESS","GROUPING_FUTURE","GROUPING_PAST","GROUPING_FAVOURITES","GROUPING_HIDDEN","NUMCOURSES_PERPAGE","loadedPages","courseOffset","lastPage","lastLimit","namespace","getFilterValues","root","courseRegion","find","SELECTORS","courseView","region","display","attr","grouping","sort","displaycategories","customfieldname","customfieldvalue","DEFAULT_PAGED_CONTENT_CONFIG","ignoreControlWhileLoading","controlPlacementBottom","persistentLimitKey","getMyCourses","filters","limit","Repository","getEnrolledCoursesByTimeline","offset","classification","getSearchMyCourses","searchValue","searchvalue","getFavouriteIconContainer","courseId","FAVOURITE_ICON","getPagedContentContainer","index","getCourseId","hideFavouriteIcon","iconContainer","isFavouriteIcon","ICON_IS_FAVOURITE","addClass","Aria","hide","notFavourteIcon","ICON_NOT_FAVOURITE","removeClass","unhide","showFavouriteIcon","getAddFavouriteMenuItem","getRemoveFavouriteMenuItem","addToFavourites","removeAction","addAction","setCourseFavouriteState","then","success","PubSub","publish","CourseEvents","favorited","Notification","alert","catch","exception","removeFromFavourites","unfavorited","getHideCourseMenuItem","getShowCourseMenuItem","hideCourse","hideAction","showAction","setCourseHiddenState","hideElement","showCourse","status","updateUserPreferences","preferences","type","value","id","pagingBar","jumpto","parseInt","courseList","reducedCourse","courses","reduce","accumulator","current","push","newElement","slice","forEach","popElement","length","pagedContentContainer","PagedContentFactory","resetLastPageNumber","pagedContentPage","renderCourses","html","js","Templates","replaceNodeContents","page","remove","setFavouriteCourses","result","warnings","course","isfavourite","noCoursesRender","nocoursesimg","render","coursesData","currentTemplate","Array","isArray","Object","values","map","showcoursecategory","setLimit","registerPagedEventHandlers","event","PagedContentEvents","SET_ITEMS_PER_PAGE_LIMIT","subscribe","itemsPerPageFunc","pagingLimit","itemsPerPage","active","totalCourseCount","filter","pagingOption","pageBuilder","currentPage","pageData","actions","activeSearch","nextPageStart","pageCourses","currentPageLength","remainingCourses","allItemsLoaded","nextoffset","resetGlobals","standardFunctionalityCurry","promises","pagePromise","searchFunctionalityCurry","inputValue","searchingPromise","initializePagedContent","promiseFunction","config","eventNamespace","pagedContentPromise","createWithLimit","pagesData","pageNumber","registerEventListeners","CustomEvents","define","events","activate","on","ACTION_ADD_FAVOURITE","e","data","favourite","target","closest","originalEvent","preventDefault","ACTION_REMOVE_FAVOURITE","ACTION_HIDE_COURSE","ACTION_SHOW_COURSE","input","querySelector","searchInput","clearIcon","searchIcon","addEventListener","clearSearch","trim","classList","parentElement","add","init","document","selectBlock","Math","random","reset"],"mappings":"otBAsBA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,O,whEAGMA,CAAAA,CAAS,CAAG,CACdC,aAAa,CAAE,6BADD,CAEdC,YAAY,CAAE,4BAFA,CAGdC,eAAe,CAAE,+BAHH,CAIdC,SAAS,CAAE,wBAJG,C,CAOZC,CAAS,CAAG,CACdC,2BAA2B,CAAE,oBADf,CAEdC,YAAY,CAAE,KAFA,CAGdC,mBAAmB,CAAE,YAHP,CAIdC,eAAe,CAAE,QAJH,CAKdC,aAAa,CAAE,MALD,CAMdC,mBAAmB,CAAE,YANP,CAOdC,eAAe,CAAE,QAPH,C,CAUZC,CAAkB,CAAG,CAAC,EAAD,CAAK,EAAL,CAAS,EAAT,CAAa,EAAb,CAAiB,CAAjB,C,CAEvBC,CAAW,CAAG,E,CAEdC,CAAY,CAAG,C,CAEfC,CAAQ,CAAG,C,CAEXC,CAAS,CAAG,C,CAEZC,CAAS,CAAG,I,CAQVC,CAAe,CAAG,SAAAC,CAAI,CAAI,CAC5B,GAAMC,CAAAA,CAAY,CAAGD,CAAI,CAACE,IAAL,CAAUC,UAAUC,UAAV,CAAqBC,MAA/B,CAArB,CACA,MAAO,CACHC,OAAO,CAAEL,CAAY,CAACM,IAAb,CAAkB,cAAlB,CADN,CAEHC,QAAQ,CAAEP,CAAY,CAACM,IAAb,CAAkB,eAAlB,CAFP,CAGHE,IAAI,CAAER,CAAY,CAACM,IAA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CAAW,CAAC+F,OAAZ,CAAoB,SAACT,CAAD,CAAajD,CAAb,CAAuB,CACvC,GAAIgE,CAAAA,CAAgB,CAAGjE,CAAwB,CAAC9B,CAAD,CAAO+B,CAAP,CAA/C,CACAiE,EAAa,CAAChG,CAAD,CAAOgF,CAAP,CAAb,CAAgC7B,IAAhC,CAAqC,SAAC8C,CAAD,CAAOC,CAAP,CAAc,CAC/C,MAAOC,CAAAA,CAAS,CAACC,mBAAV,CAA8BL,CAA9B,CAAgDE,CAAhD,CAAsDC,CAAtD,CACV,CAFD,EAEGvC,KAFH,CAESF,CAAY,CAACG,SAFtB,CAGH,CALD,CAMH,CAPD,IAOO,CACH8H,EAAI,CAAC1L,CAAD,CACP,CACJ,CAXM,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manage the courses view for the overview block.\n *\n * @copyright 2018 Bas Brands \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport $ from 'jquery';\nimport * as Repository from 'block_myoverview/repository';\nimport * as PagedContentFactory from 'core/paged_content_factory';\nimport * as PubSub from 'core/pubsub';\nimport * as CustomEvents from 'core/custom_interaction_events';\nimport * as Notification from 'core/notification';\nimport * as Templates from 'core/templates';\nimport * as CourseEvents from 'core_course/events';\nimport SELECTORS from 'block_myoverview/selectors';\nimport * as PagedContentEvents from 'core/paged_content_events';\nimport * as Aria from 'core/aria';\nimport {debounce} from 'core/utils';\n\nconst TEMPLATES = {\n COURSES_CARDS: 'block_myoverview/view-cards',\n COURSES_LIST: 'block_myoverview/view-list',\n COURSES_SUMMARY: 'block_myoverview/view-summary',\n NOCOURSES: 'core_course/no-courses'\n};\n\nconst GROUPINGS = {\n GROUPING_ALLINCLUDINGHIDDEN: 'allincludinghidden',\n GROUPING_ALL: 'all',\n GROUPING_INPROGRESS: 'inprogress',\n GROUPING_FUTURE: 'future',\n GROUPING_PAST: 'past',\n GROUPING_FAVOURITES: 'favourites',\n GROUPING_HIDDEN: 'hidden'\n};\n\nconst NUMCOURSES_PERPAGE = [12, 24, 48, 96, 0];\n\nlet loadedPages = [];\n\nlet courseOffset = 0;\n\nlet lastPage = 0;\n\nlet lastLimit = 0;\n\nlet namespace = null;\n\n/**\n * Get filter values from DOM.\n *\n * @param {object} root The root element for the courses view.\n * @return {filters} Set filters.\n */\nconst getFilterValues = root => {\n const courseRegion = root.find(SELECTORS.courseView.region);\n return {\n display: courseRegion.attr('data-display'),\n grouping: courseRegion.attr('data-grouping'),\n sort: courseRegion.attr('data-sort'),\n displaycategories: courseRegion.attr('data-displaycategories'),\n customfieldname: courseRegion.attr('data-customfieldname'),\n customfieldvalue: courseRegion.attr('data-customfieldvalue'),\n };\n};\n\n// We want the paged content controls below the paged content area.\n// and the controls should be ignored while data is loading.\nconst DEFAULT_PAGED_CONTENT_CONFIG = {\n ignoreControlWhileLoading: true,\n controlPlacementBottom: true,\n persistentLimitKey: 'block_myoverview_user_paging_preference'\n};\n\n/**\n * Get enrolled courses from backend.\n *\n * @param {object} filters The filters for this view.\n * @param {int} limit The number of courses to show.\n * @return {promise} Resolved with an array of courses.\n */\nconst getMyCourses = (filters, limit) => {\n return Repository.getEnrolledCoursesByTimeline({\n offset: courseOffset,\n limit: limit,\n classification: filters.grouping,\n sort: filters.sort,\n customfieldname: filters.customfieldname,\n customfieldvalue: filters.customfieldvalue\n });\n};\n\n/**\n * Search for enrolled courses from backend.\n *\n * @param {object} filters The filters for this view.\n * @param {int} limit The number of courses to show.\n * @param {string} searchValue What does the user want to search within their courses.\n * @return {promise} Resolved with an array of courses.\n */\nconst getSearchMyCourses = (filters, limit, searchValue) => {\n return Repository.getEnrolledCoursesByTimeline({\n offset: courseOffset,\n limit: limit,\n classification: 'search',\n sort: filters.sort,\n customfieldname: filters.customfieldname,\n customfieldvalue: filters.customfieldvalue,\n searchvalue: searchValue\n });\n};\n\n/**\n * Get the container element for the favourite icon.\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n * @return {Object} The favourite icon container\n */\nconst getFavouriteIconContainer = (root, courseId) => {\n return root.find(SELECTORS.FAVOURITE_ICON + '[data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Get the paged content container element.\n *\n * @param {Object} root The course overview container\n * @param {Number} index Rendered page index.\n * @return {Object} The rendered paged container.\n */\nconst getPagedContentContainer = (root, index) => {\n return root.find('[data-region=\"paged-content-page\"][data-page=\"' + index + '\"]');\n};\n\n/**\n * Get the course id from a favourite element.\n *\n * @param {Object} root The favourite icon container element.\n * @return {Number} Course id.\n */\nconst getCourseId = root => {\n return root.attr('data-course-id');\n};\n\n/**\n * Hide the favourite icon.\n *\n * @param {Object} root The favourite icon container element.\n * @param {Number} courseId Course id number.\n */\nconst hideFavouriteIcon = (root, courseId) => {\n const iconContainer = getFavouriteIconContainer(root, courseId);\n\n const isFavouriteIcon = iconContainer.find(SELECTORS.ICON_IS_FAVOURITE);\n isFavouriteIcon.addClass('hidden');\n Aria.hide(isFavouriteIcon);\n\n const notFavourteIcon = iconContainer.find(SELECTORS.ICON_NOT_FAVOURITE);\n notFavourteIcon.removeClass('hidden');\n Aria.unhide(notFavourteIcon);\n};\n\n/**\n * Show the favourite icon.\n *\n * @param {Object} root The course overview container.\n * @param {Number} courseId Course id number.\n */\nconst showFavouriteIcon = (root, courseId) => {\n const iconContainer = getFavouriteIconContainer(root, courseId);\n\n const isFavouriteIcon = iconContainer.find(SELECTORS.ICON_IS_FAVOURITE);\n isFavouriteIcon.removeClass('hidden');\n Aria.unhide(isFavouriteIcon);\n\n const notFavourteIcon = iconContainer.find(SELECTORS.ICON_NOT_FAVOURITE);\n notFavourteIcon.addClass('hidden');\n Aria.hide(notFavourteIcon);\n};\n\n/**\n * Get the action menu item\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id.\n * @return {Object} The add to favourite menu item.\n */\nconst getAddFavouriteMenuItem = (root, courseId) => {\n return root.find('[data-action=\"add-favourite\"][data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Get the action menu item\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id.\n * @return {Object} The remove from favourites menu item.\n */\nconst getRemoveFavouriteMenuItem = (root, courseId) => {\n return root.find('[data-action=\"remove-favourite\"][data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Add course to favourites\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n */\nconst addToFavourites = (root, courseId) => {\n const removeAction = getRemoveFavouriteMenuItem(root, courseId);\n const addAction = getAddFavouriteMenuItem(root, courseId);\n\n setCourseFavouriteState(courseId, true).then(success => {\n if (success) {\n PubSub.publish(CourseEvents.favorited, courseId);\n removeAction.removeClass('hidden');\n addAction.addClass('hidden');\n showFavouriteIcon(root, courseId);\n } else {\n Notification.alert('Starring course failed', 'Could not change favourite state');\n }\n return;\n }).catch(Notification.exception);\n};\n\n/**\n * Remove course from favourites\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n */\nconst removeFromFavourites = (root, courseId) => {\n const removeAction = getRemoveFavouriteMenuItem(root, courseId);\n const addAction = getAddFavouriteMenuItem(root, courseId);\n\n setCourseFavouriteState(courseId, false).then(success => {\n if (success) {\n PubSub.publish(CourseEvents.unfavorited, courseId);\n removeAction.addClass('hidden');\n addAction.removeClass('hidden');\n hideFavouriteIcon(root, courseId);\n } else {\n Notification.alert('Starring course failed', 'Could not change favourite state');\n }\n return;\n }).catch(Notification.exception);\n};\n\n/**\n * Get the action menu item\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id.\n * @return {Object} The hide course menu item.\n */\nconst getHideCourseMenuItem = (root, courseId) => {\n return root.find('[data-action=\"hide-course\"][data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Get the action menu item\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id.\n * @return {Object} The show course menu item.\n */\nconst getShowCourseMenuItem = (root, courseId) => {\n return root.find('[data-action=\"show-course\"][data-course-id=\"' + courseId + '\"]');\n};\n\n/**\n * Hide course\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n */\nconst hideCourse = (root, courseId) => {\n const hideAction = getHideCourseMenuItem(root, courseId);\n const showAction = getShowCourseMenuItem(root, courseId);\n const filters = getFilterValues(root);\n\n setCourseHiddenState(courseId, true);\n\n // Remove the course from this view as it is now hidden and thus not covered by this view anymore.\n // Do only if we are not in \"All (including archived)\" view mode where really all courses are shown.\n if (filters.grouping !== GROUPINGS.GROUPING_ALLINCLUDINGHIDDEN) {\n hideElement(root, courseId);\n }\n\n hideAction.addClass('hidden');\n showAction.removeClass('hidden');\n};\n\n/**\n * Show course\n *\n * @param {Object} root The course overview container\n * @param {Number} courseId Course id number\n */\nconst showCourse = (root, courseId) => {\n const hideAction = getHideCourseMenuItem(root, courseId);\n const showAction = getShowCourseMenuItem(root, courseId);\n const filters = getFilterValues(root);\n\n setCourseHiddenState(courseId, null);\n\n // Remove the course from this view as it is now shown again and thus not covered by this view anymore.\n // Do only if we are not in \"All (including archived)\" view mode where really all courses are shown.\n if (filters.grouping !== GROUPINGS.GROUPING_ALLINCLUDINGHIDDEN) {\n hideElement(root, courseId);\n }\n\n hideAction.removeClass('hidden');\n showAction.addClass('hidden');\n};\n\n/**\n * Set the courses hidden status and push to repository\n *\n * @param {Number} courseId Course id to favourite.\n * @param {Boolean} status new hidden status.\n * @return {Promise} Repository promise.\n */\nconst setCourseHiddenState = (courseId, status) => {\n\n // If the given status is not hidden, the preference has to be deleted with a null value.\n if (status === false) {\n status = null;\n }\n return Repository.updateUserPreferences({\n preferences: [\n {\n type: 'block_myoverview_hidden_course_' + courseId,\n value: status\n }\n ]\n });\n};\n\n/**\n * Reset the loadedPages dataset to take into account the hidden element\n *\n * @param {Object} root The course overview container\n * @param {Number} id The course id number\n */\nconst hideElement = (root, id) => {\n const pagingBar = root.find('[data-region=\"paging-bar\"]');\n const jumpto = parseInt(pagingBar.attr('data-active-page-number'));\n\n // Get a reduced dataset for the current page.\n const courseList = loadedPages[jumpto];\n let reducedCourse = courseList.courses.reduce((accumulator, current) => {\n if (+id !== +current.id) {\n accumulator.push(current);\n }\n return accumulator;\n }, []);\n\n // Get the next page's data if loaded and pop the first element from it.\n if (typeof (loadedPages[jumpto + 1]) !== 'undefined') {\n const newElement = loadedPages[jumpto + 1].courses.slice(0, 1);\n\n // Adjust the dataset for the reset of the pages that are loaded.\n loadedPages.forEach((courseList, index) => {\n if (index > jumpto) {\n let popElement = [];\n if (typeof (loadedPages[index + 1]) !== 'undefined') {\n popElement = loadedPages[index + 1].courses.slice(0, 1);\n }\n loadedPages[index].courses = [...loadedPages[index].courses.slice(1), ...popElement];\n }\n });\n\n reducedCourse = [...reducedCourse, ...newElement];\n }\n\n // Check if the next page is the last page and if it still has data associated to it.\n if (lastPage === jumpto + 1 && loadedPages[jumpto + 1].courses.length === 0) {\n const pagedContentContainer = root.find('[data-region=\"paged-content-container\"]');\n PagedContentFactory.resetLastPageNumber($(pagedContentContainer).attr('id'), jumpto);\n }\n\n loadedPages[jumpto].courses = reducedCourse;\n\n // Reduce the course offset.\n courseOffset--;\n\n // Render the paged content for the current.\n const pagedContentPage = getPagedContentContainer(root, jumpto);\n renderCourses(root, loadedPages[jumpto]).then((html, js) => {\n return Templates.replaceNodeContents(pagedContentPage, html, js);\n }).catch(Notification.exception);\n\n // Delete subsequent pages in order to trigger the callback.\n loadedPages.forEach((courseList, index) => {\n if (index > jumpto) {\n const page = getPagedContentContainer(root, index);\n page.remove();\n }\n });\n};\n\n/**\n * Set the courses favourite status and push to repository\n *\n * @param {Number} courseId Course id to favourite.\n * @param {boolean} status new favourite status.\n * @return {Promise} Repository promise.\n */\nconst setCourseFavouriteState = (courseId, status) => {\n\n return Repository.setFavouriteCourses({\n courses: [\n {\n 'id': courseId,\n 'favourite': status\n }\n ]\n }).then(result => {\n if (result.warnings.length === 0) {\n loadedPages.forEach(courseList => {\n courseList.courses.forEach((course, index) => {\n if (course.id === courseId) {\n courseList.courses[index].isfavourite = status;\n }\n });\n });\n return true;\n } else {\n return false;\n }\n }).catch(Notification.exception);\n};\n\n/**\n * Given there are no courses to render provide the rendered template.\n *\n * @param {object} root The root element for the courses view.\n * @return {promise} jQuery promise resolved after rendering is complete.\n */\nconst noCoursesRender = root => {\n const nocoursesimg = root.find(SELECTORS.courseView.region).attr('data-nocoursesimg');\n return Templates.render(TEMPLATES.NOCOURSES, {\n nocoursesimg: nocoursesimg\n });\n};\n\n/**\n * Render the dashboard courses.\n *\n * @param {object} root The root element for the courses view.\n * @param {array} coursesData containing array of returned courses.\n * @return {promise} jQuery promise resolved after rendering is complete.\n */\nconst renderCourses = (root, coursesData) => {\n\n const filters = getFilterValues(root);\n\n let currentTemplate = '';\n if (filters.display === 'card') {\n currentTemplate = TEMPLATES.COURSES_CARDS;\n } else if (filters.display === 'list') {\n currentTemplate = TEMPLATES.COURSES_LIST;\n } else {\n currentTemplate = TEMPLATES.COURSES_SUMMARY;\n }\n\n if (!coursesData) {\n return noCoursesRender(root);\n } else {\n // Sometimes we get weird objects coming after a failed search, cast to ensure typing functions.\n if (Array.isArray(coursesData.courses) === false) {\n coursesData.courses = Object.values(coursesData.courses);\n }\n // Whether the course category should be displayed in the course item.\n coursesData.courses = coursesData.courses.map(course => {\n course.showcoursecategory = filters.displaycategories === 'on';\n return course;\n });\n if (coursesData.courses.length) {\n return Templates.render(currentTemplate, {\n courses: coursesData.courses,\n });\n } else {\n return noCoursesRender(root);\n }\n }\n};\n\n/**\n * Return the callback to be passed to the subscribe event\n *\n * @param {object} root The root element for the courses view\n * @return {function} Partially applied function that'll execute when passed a limit\n */\nconst setLimit = root => {\n // @param {Number} limit The paged limit that is passed through the event.\n return limit => root.find(SELECTORS.courseView.region).attr('data-paging', limit);\n};\n\n/**\n * Intialise the paged list and cards views on page load.\n * Returns an array of paged contents that we would like to handle here\n *\n * @param {object} root The root element for the courses view\n * @param {string} namespace The namespace for all the events attached\n */\nconst registerPagedEventHandlers = (root, namespace) => {\n const event = namespace + PagedContentEvents.SET_ITEMS_PER_PAGE_LIMIT;\n PubSub.subscribe(event, setLimit(root));\n};\n\n/**\n * Figure out how many items are going to be allowed to be rendered in the block.\n *\n * @param {Number} pagingLimit How many courses to display\n * @param {Object} root The course overview container\n * @return {Number[]} How many courses will be rendered\n */\nconst itemsPerPageFunc = (pagingLimit, root) => {\n let itemsPerPage = NUMCOURSES_PERPAGE.map(value => {\n let active = false;\n if (value === pagingLimit) {\n active = true;\n }\n\n return {\n value: value,\n active: active\n };\n });\n\n // Filter out all pagination options which are too large for the amount of courses user is enrolled in.\n const totalCourseCount = parseInt(root.find(SELECTORS.courseView.region).attr('data-totalcoursecount'), 10);\n return itemsPerPage.filter(pagingOption => {\n return pagingOption.value < totalCourseCount || pagingOption.value === 0;\n });\n};\n\n/**\n * Mutates and controls the loadedPages array and handles the bootstrapping.\n *\n * @param {Array|Object} coursesData Array of all of the courses to start building the page from\n * @param {Number} currentPage What page are we currently on?\n * @param {Object} pageData Any current page information\n * @param {Object} actions Paged content helper\n * @param {null|boolean} activeSearch Are we currently actively searching and building up search results?\n */\nconst pageBuilder = (coursesData, currentPage, pageData, actions, activeSearch = null) => {\n // If the courseData comes in an object then get the value otherwise it is a pure array.\n let courses = coursesData.courses ? coursesData.courses : coursesData;\n let nextPageStart = 0;\n let pageCourses = [];\n\n // If current page's data is loaded make sure we max it to page limit.\n if (typeof (loadedPages[currentPage]) !== 'undefined') {\n pageCourses = loadedPages[currentPage].courses;\n const currentPageLength = pageCourses.length;\n if (currentPageLength < pageData.limit) {\n nextPageStart = pageData.limit - currentPageLength;\n pageCourses = {...loadedPages[currentPage].courses, ...courses.slice(0, nextPageStart)};\n }\n } else {\n // When the page limit is zero, there is only one page of courses, no start for next page.\n nextPageStart = pageData.limit || false;\n pageCourses = (pageData.limit > 0) ? courses.slice(0, pageData.limit) : courses;\n }\n\n // Finished setting up the current page.\n loadedPages[currentPage] = {\n courses: pageCourses\n };\n\n // Set up the next page (if there is more than one page).\n const remainingCourses = nextPageStart !== false ? courses.slice(nextPageStart, courses.length) : [];\n if (remainingCourses.length) {\n loadedPages[currentPage + 1] = {\n courses: remainingCourses\n };\n }\n\n // Set the last page to either the current or next page.\n if (loadedPages[currentPage].courses.length < pageData.limit || !remainingCourses.length) {\n lastPage = currentPage;\n if (activeSearch === null) {\n actions.allItemsLoaded(currentPage);\n }\n } else if (typeof (loadedPages[currentPage + 1]) !== 'undefined'\n && loadedPages[currentPage + 1].courses.length < pageData.limit) {\n lastPage = currentPage + 1;\n }\n\n courseOffset = coursesData.nextoffset;\n};\n\n/**\n * In cases when switching between regular rendering and search rendering we need to reset some variables.\n */\nconst resetGlobals = () => {\n courseOffset = 0;\n loadedPages = [];\n lastPage = 0;\n lastLimit = 0;\n};\n\n/**\n * The default functionality of fetching paginated courses without special handling.\n *\n * @return {function(Object, Object, Object, Object, Object, Promise, Number): void}\n */\nconst standardFunctionalityCurry = () => {\n resetGlobals();\n return (filters, currentPage, pageData, actions, root, promises, limit) => {\n const pagePromise = getMyCourses(\n filters,\n limit\n ).then(coursesData => {\n pageBuilder(coursesData, currentPage, pageData, actions);\n return renderCourses(root, loadedPages[currentPage]);\n }).catch(Notification.exception);\n\n promises.push(pagePromise);\n };\n};\n\n/**\n * Initialize the searching functionality so we can call it when required.\n *\n * @return {function(Object, Number, Object, Object, Object, Promise, Number, String): void}\n */\nconst searchFunctionalityCurry = () => {\n resetGlobals();\n return (filters, currentPage, pageData, actions, root, promises, limit, inputValue) => {\n const searchingPromise = getSearchMyCourses(\n filters,\n limit,\n inputValue\n ).then(coursesData => {\n pageBuilder(coursesData, currentPage, pageData, actions);\n return renderCourses(root, loadedPages[currentPage]);\n }).catch(Notification.exception);\n\n promises.push(searchingPromise);\n };\n};\n\n/**\n * Initialise the courses list and cards views on page load.\n *\n * @param {object} root The root element for the courses view.\n * @param {function} promiseFunction How do we fetch the courses and what do we do with them?\n * @param {null | string} inputValue What to search for\n */\nconst initializePagedContent = (root, promiseFunction, inputValue = null) => {\n const pagingLimit = parseInt(root.find(SELECTORS.courseView.region).attr('data-paging'), 10);\n let itemsPerPage = itemsPerPageFunc(pagingLimit, root);\n\n const filters = getFilterValues(root);\n const config = {...{}, ...DEFAULT_PAGED_CONTENT_CONFIG};\n config.eventNamespace = namespace;\n\n const pagedContentPromise = PagedContentFactory.createWithLimit(\n itemsPerPage,\n (pagesData, actions) => {\n let promises = [];\n pagesData.forEach(pageData => {\n const currentPage = pageData.pageNumber;\n let limit = (pageData.limit > 0) ? pageData.limit : 0;\n\n // Reset local variables if limits have changed.\n if (+lastLimit !== +limit) {\n loadedPages = [];\n courseOffset = 0;\n lastPage = 0;\n }\n\n if (lastPage === currentPage) {\n // If we are on the last page and have it's data then load it from cache.\n actions.allItemsLoaded(lastPage);\n promises.push(renderCourses(root, loadedPages[currentPage]));\n return;\n }\n\n lastLimit = limit;\n\n // Get 2 pages worth of data as we will need it for the hidden functionality.\n if (typeof (loadedPages[currentPage + 1]) === 'undefined') {\n if (typeof (loadedPages[currentPage]) === 'undefined') {\n limit *= 2;\n }\n }\n\n // Call the curried function that'll handle the course promise and any manipulation of it.\n promiseFunction(filters, currentPage, pageData, actions, root, promises, limit, inputValue);\n });\n return promises;\n },\n config\n );\n\n pagedContentPromise.then((html, js) => {\n registerPagedEventHandlers(root, namespace);\n return Templates.replaceNodeContents(root.find(SELECTORS.courseView.region), html, js);\n }).catch(Notification.exception);\n};\n\n/**\n * Listen to, and handle events for the myoverview block.\n *\n * @param {Object} root The myoverview block container element.\n * @param {HTMLElement} page The whole HTMLElement for our block.\n */\nconst registerEventListeners = (root, page) => {\n\n CustomEvents.define(root, [\n CustomEvents.events.activate\n ]);\n\n root.on(CustomEvents.events.activate, SELECTORS.ACTION_ADD_FAVOURITE, (e, data) => {\n const favourite = $(e.target).closest(SELECTORS.ACTION_ADD_FAVOURITE);\n const courseId = getCourseId(favourite);\n addToFavourites(root, courseId);\n data.originalEvent.preventDefault();\n });\n\n root.on(CustomEvents.events.activate, SELECTORS.ACTION_REMOVE_FAVOURITE, (e, data) => {\n const favourite = $(e.target).closest(SELECTORS.ACTION_REMOVE_FAVOURITE);\n const courseId = getCourseId(favourite);\n removeFromFavourites(root, courseId);\n data.originalEvent.preventDefault();\n });\n\n root.on(CustomEvents.events.activate, SELECTORS.FAVOURITE_ICON, (e, data) => {\n data.originalEvent.preventDefault();\n });\n\n root.on(CustomEvents.events.activate, SELECTORS.ACTION_HIDE_COURSE, (e, data) => {\n const target = $(e.target).closest(SELECTORS.ACTION_HIDE_COURSE);\n const courseId = getCourseId(target);\n hideCourse(root, courseId);\n data.originalEvent.preventDefault();\n });\n\n root.on(CustomEvents.events.activate, SELECTORS.ACTION_SHOW_COURSE, (e, data) => {\n const target = $(e.target).closest(SELECTORS.ACTION_SHOW_COURSE);\n const courseId = getCourseId(target);\n showCourse(root, courseId);\n data.originalEvent.preventDefault();\n });\n\n // Searching functionality event handlers.\n const input = page.querySelector(SELECTORS.region.searchInput);\n const clearIcon = page.querySelector(SELECTORS.region.clearIcon);\n const searchIcon = page.querySelector(SELECTORS.region.searchIcon);\n\n clearIcon.addEventListener('click', () => {\n input.value = '';\n clearSearch(searchIcon, clearIcon, root);\n });\n\n input.addEventListener('input', debounce(() => {\n if (input.value === '') {\n clearSearch(searchIcon, clearIcon, root);\n } else {\n activeSearch(searchIcon, clearIcon);\n initializePagedContent(root, searchFunctionalityCurry(), input.value.trim());\n }\n }, 300));\n};\n\n/**\n * Reset the search icon and trigger the init for the block.\n *\n * @param {HTMLElement} searchIcon Our search icon to manipulate.\n * @param {HTMLElement} clearIcon Our closing icon to manipulate.\n * @param {Object} root The myoverview block container element.\n */\nexport const clearSearch = (searchIcon, clearIcon, root) => {\n searchIcon.classList.remove('d-none');\n clearIcon.parentElement.classList.add('d-none');\n init(root);\n};\n\n/**\n * Change the searching icon to its' active state.\n *\n * @param {HTMLElement} searchIcon Our search icon to manipulate.\n * @param {HTMLElement} clearIcon Our closing icon to manipulate.\n */\nconst activeSearch = (searchIcon, clearIcon) => {\n searchIcon.classList.add('d-none');\n clearIcon.parentElement.classList.remove('d-none');\n};\n\n/**\n * Intialise the courses list and cards views on page load.\n *\n * @param {object} root The root element for the courses view.\n */\nexport const init = root => {\n root = $(root);\n loadedPages = [];\n lastPage = 0;\n courseOffset = 0;\n\n if (!root.attr('data-init')) {\n const page = document.querySelector(SELECTORS.region.selectBlock);\n registerEventListeners(root, page);\n namespace = \"block_myoverview_\" + root.attr('id') + \"_\" + Math.random();\n root.attr('data-init', true);\n }\n\n initializePagedContent(root, standardFunctionalityCurry());\n};\n\n/**\n * Reset the courses views to their original\n * state on first page load.courseOffset\n *\n * This is called when configuration has changed for the event lists\n * to cause them to reload their data.\n *\n * @param {Object} root The root element for the timeline view.\n */\nexport const reset = root => {\n if (loadedPages.length > 0) {\n loadedPages.forEach((courseList, index) => {\n let pagedContentPage = getPagedContentContainer(root, index);\n renderCourses(root, courseList).then((html, js) => {\n return Templates.replaceNodeContents(pagedContentPage, html, js);\n }).catch(Notification.exception);\n });\n } else {\n init(root);\n }\n};\n"],"file":"view.min.js"}
\ No newline at end of file
diff --git a/blocks/myoverview/amd/src/view.js b/blocks/myoverview/amd/src/view.js
index a58a11ebf43..c552916ef5d 100644
--- a/blocks/myoverview/amd/src/view.js
+++ b/blocks/myoverview/amd/src/view.js
@@ -298,7 +298,7 @@ const hideCourse = (root, courseId) => {
setCourseHiddenState(courseId, true);
// Remove the course from this view as it is now hidden and thus not covered by this view anymore.
- // Do only if we are not in "All" view mode where really all courses are shown.
+ // Do only if we are not in "All (including archived)" view mode where really all courses are shown.
if (filters.grouping !== GROUPINGS.GROUPING_ALLINCLUDINGHIDDEN) {
hideElement(root, courseId);
}
@@ -321,7 +321,7 @@ const showCourse = (root, courseId) => {
setCourseHiddenState(courseId, null);
// Remove the course from this view as it is now shown again and thus not covered by this view anymore.
- // Do only if we are not in "All" view mode where really all courses are shown.
+ // Do only if we are not in "All (including archived)" view mode where really all courses are shown.
if (filters.grouping !== GROUPINGS.GROUPING_ALLINCLUDINGHIDDEN) {
hideElement(root, courseId);
}
diff --git a/blocks/myoverview/lang/en/block_myoverview.php b/blocks/myoverview/lang/en/block_myoverview.php
index e3239186d72..a09f6f63f45 100644
--- a/blocks/myoverview/lang/en/block_myoverview.php
+++ b/blocks/myoverview/lang/en/block_myoverview.php
@@ -22,12 +22,12 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['allincludinghidden'] = 'All';
-$string['all'] = 'All (except removed from view)';
+$string['allincludinghidden'] = 'All (including archived)';
+$string['all'] = 'All';
$string['addtofavourites'] = 'Star this course';
$string['aria:addtofavourites'] = 'Star for';
$string['aria:allcoursesincludinghidden'] = 'Show all courses';
-$string['aria:allcourses'] = 'Show all courses except courses removed from view';
+$string['aria:allcourses'] = 'Show all courses except archived courses';
$string['aria:card'] = 'Switch to card view';
$string['aria:controls'] = 'Course overview controls';
$string['aria:courseactions'] = 'Actions for current course';
@@ -81,11 +81,11 @@ $string['summary'] = 'Summary';
$string['title'] = 'Course name';
$string['aria:hidecourse'] = 'Remove {$a} from view';
$string['aria:showcourse'] = 'Restore {$a} to view';
-$string['aria:hiddencourses'] = 'Show courses removed from view';
-$string['hidden'] = 'Courses removed from view';
-$string['hidecourse'] = 'Remove from view';
-$string['hiddencourses'] = 'Removed from view';
-$string['show'] = 'Restore to view';
+$string['aria:hiddencourses'] = 'Show archived courses';
+$string['hidden'] = 'Archived courses';
+$string['hidecourse'] = 'Archive';
+$string['hiddencourses'] = 'Archived';
+$string['show'] = 'Unarchive';
$string['privacy:request:preference:set'] = 'The value of the setting \'{$a->name}\' was \'{$a->value}\'';
// Deprecated since Moodle 3.7.
diff --git a/blocks/myoverview/tests/behat/block_myoverview_adminsettings.feature b/blocks/myoverview/tests/behat/block_myoverview_adminsettings.feature
index 92a51af321b..25a1c148346 100644
--- a/blocks/myoverview/tests/behat/block_myoverview_adminsettings.feature
+++ b/blocks/myoverview/tests/behat/block_myoverview_adminsettings.feature
@@ -26,48 +26,47 @@ Feature: The my overview block allows admins to easily configure the students' c
| student1 | C4 | student |
| student1 | C5 | student |
- Scenario: Enable 'All' course filter option
+ Scenario: Enable 'All (including archived)' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
- And I set the field "All" to "1"
+ And I set the field "All (including archived)" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- # We have to check for the data attribute instead of the list element text as we would get false positives from the "All (except removed from view)" element otherwise
- Then "[data-value='allincludinghidden']" "css_element" should exist in the ".block_myoverview .dropdown-menu" "css_element"
+ And I click on "All" "button" in the "Course overview" "block"
+ # We have to check for the data attribute instead of the list element text as we would get false positives from the "All" element otherwise
+ Then "All (including archived)" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
+
+ Scenario: Disable 'All (including archived)' course filter option
+ Given I log in as "admin"
+ And I navigate to "Plugins > Blocks > Course overview" in site administration
+ And I set the field "All (including archived)" to "0"
+ And I press "Save"
+ And I log out
+ Then I am on the "My courses" page logged in as "student1"
+ And I click on "All" "button" in the "Course overview" "block"
+ Then "All (including archived)" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
+
+ Scenario: Enable 'All' course filter option
+ Given I log in as "admin"
+ And I navigate to "Plugins > Blocks > Course overview" in site administration
+ And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "1"
+ And I press "Save"
+ And I log out
+ Then I am on the "My courses" page logged in as "student1"
+ And I click on "All" "button" in the "Course overview" "block"
+ Then "[data-value='all']" "css_element" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'All' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
- And I set the field "All" to "0"
+ And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- # We have to check for the data attribute instead of the list element text as we would get false negatives "All (except removed from view)" element otherwise
- Then "[data-value='allincludinghidden']" "css_element" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
-
- Scenario: Enable 'All (except removed from view)' course filter option
- Given I log in as "admin"
- And I navigate to "Plugins > Blocks > Course overview" in site administration
- And I set the field "All (except removed from view)" to "1"
- And I press "Save"
- And I log out
- Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- Then "All (except removed from view)" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
-
- Scenario: Disable 'All (except removed from view)' course filter option
- Given I log in as "admin"
- And I navigate to "Plugins > Blocks > Course overview" in site administration
- And I set the field "All (except removed from view)" to "0"
- And I press "Save"
- And I log out
- Then I am on the "My courses" page logged in as "student1"
- # 'All (except removed from view)' option has been disabled, so the button is falling back to the 'In progress' option which is the next enabled option.
+ # 'All' option has been disabled, so the button is falling back to the 'In progress' option which is the next enabled option.
And I click on "In progress" "button" in the "Course overview" "block"
- Then "All (except removed from view)" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
+ Then "[data-value='all']" "css_element" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'In progress' course filter option
Given I log in as "admin"
@@ -76,7 +75,8 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ # We have to check for the data attribute instead of the list element text as we would get false negatives "All (including archived)" element otherwise
Then "In progress" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'In progress' course filter option
@@ -86,7 +86,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
Then "In progress" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'Future' course filter option
@@ -96,7 +96,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
Then "Future" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'Future' course filter option
@@ -106,7 +106,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
Then "Future" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'Past' course filter option
@@ -116,7 +116,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
Then "Past" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'Past' course filter option
@@ -126,7 +126,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
Then "Past" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'Starred' course filter option
@@ -136,7 +136,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
Then "Starred" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'Starred' course filter option
@@ -146,39 +146,39 @@ Feature: The my overview block allows admins to easily configure the students' c
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
Then "Starred" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Enable 'Removed courses' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
- And I set the field "Removed from view" to "1"
+ And I set the field "Archived" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- Then "Removed from view" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
+ And I click on "All" "button" in the "Course overview" "block"
+ Then "Archived" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable 'Removed courses' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
- And I set the field "Removed from view" to "0"
+ And I set the field "Archived" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- Then "Removed from view" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
+ And I click on "All" "button" in the "Course overview" "block"
+ Then "Archived" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Scenario: Disable all course filter options
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
- And I set the field "All" to "0"
- And I set the field "All (except removed from view)" to "0"
+ And I set the field "All (including archived)" to "0"
+ And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I set the field "In progress" to "0"
And I set the field "Future" to "0"
And I set the field "Past" to "0"
And I set the field "Starred" to "0"
- And I set the field "Removed from view" to "0"
+ And I set the field "Archived" to "0"
And I press "Save"
And I log out
And I am on the "My courses" page logged in as "student1"
@@ -192,13 +192,13 @@ Feature: The my overview block allows admins to easily configure the students' c
Scenario: Disable all but one course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
- And I set the field "All" to "0"
- And I set the field "All (except removed from view)" to "0"
+ And I set the field "All (including archived)" to "0"
+ And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I set the field "In progress" to "1"
And I set the field "Future" to "0"
And I set the field "Past" to "0"
And I set the field "Starred" to "0"
- And I set the field "Removed from view" to "0"
+ And I set the field "Archived" to "0"
And I press "Save"
And I log out
And I am on the "My courses" page logged in as "student1"
diff --git a/blocks/myoverview/tests/behat/block_myoverview_customfield.feature b/blocks/myoverview/tests/behat/block_myoverview_customfield.feature
index 096b136895e..96f401ecb22 100644
--- a/blocks/myoverview/tests/behat/block_myoverview_customfield.feature
+++ b/blocks/myoverview/tests/behat/block_myoverview_customfield.feature
@@ -36,7 +36,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | checkboxfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Checkbox field: Yes" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@@ -49,7 +49,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | checkboxfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Checkbox field: No" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
@@ -62,7 +62,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | datefield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "1 February 2001" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@@ -75,7 +75,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | datefield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "6 August 1980" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@@ -88,7 +88,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | datefield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "No Date field" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@@ -101,7 +101,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | selectfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
And I should not see "Option 4" in the "Course overview" "block"
When I click on "Option 1" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
@@ -115,7 +115,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | selectfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Option 2" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@@ -128,7 +128,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | selectfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "No Select field" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
@@ -141,7 +141,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | textfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "fish" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@@ -154,7 +154,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | textfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "dog" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@@ -167,7 +167,7 @@ Feature: The my overview block allows users to group courses by custom fields
| displaygroupingcustomfield | 1 | block_myoverview |
| customfiltergrouping | textfield | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "No Text field" "link" in the "Course overview" "block"
Then I should not see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
@@ -192,6 +192,6 @@ Feature: The my overview block allows users to group courses by custom fields
And I press "Save changes"
And I log out
When I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
Then I should not see "penguin" in the "Course overview" "block"
Then I should not see "No text field" in the "Course overview" "block"
diff --git a/blocks/myoverview/tests/behat/block_myoverview_dashboard.feature b/blocks/myoverview/tests/behat/block_myoverview_dashboard.feature
index ce381bcb1c1..75142568a0d 100644
--- a/blocks/myoverview/tests/behat/block_myoverview_dashboard.feature
+++ b/blocks/myoverview/tests/behat/block_myoverview_dashboard.feature
@@ -28,7 +28,7 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View past courses
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Past" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@@ -38,7 +38,7 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View future courses
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Future" "link" in the "Course overview" "block"
Then I should see "Course 5" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
@@ -48,7 +48,7 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View inprogress courses
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "In progress" "link" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Then I should see "Course 3" in the "Course overview" "block"
@@ -58,21 +58,21 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View all (except removed) courses
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
Then I should see "Course 5" in the "Course overview" "block"
- Scenario: View all (including removed) courses
+ Scenario: View all (including archived) courses
Given the following config values are set as admin:
| config | value | plugin |
| displaygroupingallincludinghidden | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- # We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (except removed from view)" element instead
+ And I click on "All" "button" in the "Course overview" "block"
+ # We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including archived)" element instead
When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
@@ -82,7 +82,7 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View inprogress courses - test persistence
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
And I click on "In progress" "link" in the "Course overview" "block"
And I reload the page
Then I should see "In progress" in the "Course overview" "block"
@@ -94,10 +94,10 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View all (except removed) courses - w/ persistence
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
And I reload the page
- Then I should see "All (except removed from view)" in the "Course overview" "block"
+ Then I should see "All" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Then I should see "Course 3" in the "Course overview" "block"
@@ -106,7 +106,7 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View past courses - w/ persistence
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Past" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Past" in the "Course overview" "block"
@@ -118,7 +118,7 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View future courses - w/ persistence
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Future" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Future" in the "Course overview" "block"
@@ -132,7 +132,7 @@ Feature: The my overview block allows users to easily access their courses
Given I am on the "My courses" page logged in as "student1"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Starred" "link" in the "Course overview" "block"
And I reload the page
Then I should see "Starred" in the "Course overview" "block"
@@ -198,10 +198,10 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View inprogress courses with hide persistent functionality
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "In progress" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
@@ -211,10 +211,10 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View past courses with hide persistent functionality
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Past" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
And I reload the page
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
@@ -224,10 +224,10 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View future courses with hide persistent functionality
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
When I click on "Future" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should not see "Course 5" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
@@ -237,10 +237,10 @@ Feature: The my overview block allows users to easily access their courses
Scenario: View all (except hidden) courses with hide persistent functionality
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should not see "Course 5" in the "Course overview" "block"
And I should see "Course 1" in the "Course overview" "block"
@@ -248,16 +248,16 @@ Feature: The my overview block allows users to easily access their courses
And I should see "Course 3" in the "Course overview" "block"
And I should see "Course 4" in the "Course overview" "block"
- Scenario: View all (including removed) courses with hide persistent functionality
+ Scenario: View all (including archived) courses with hide persistent functionality
Given the following config values are set as admin:
| config | value | plugin |
| displaygroupingallincludinghidden | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- # We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (except removed from view)" element instead
+ And I click on "All" "button" in the "Course overview" "block"
+ # We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including archived)" element instead
When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should see "Course 5" in the "Course overview" "block"
And I should see "Course 1" in the "Course overview" "block"
diff --git a/blocks/myoverview/tests/behat/block_myoverview_hidden.feature b/blocks/myoverview/tests/behat/block_myoverview_hidden.feature
index e82f34bdf0d..45b29931b65 100644
--- a/blocks/myoverview/tests/behat/block_myoverview_hidden.feature
+++ b/blocks/myoverview/tests/behat/block_myoverview_hidden.feature
@@ -25,91 +25,91 @@ Feature: The my overview block allows users to hide their courses
Scenario: Test hide toggle functionality
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
Then I should not see "Course 2" in the "Course overview" "block"
Scenario: Test hide toggle functionality w/ favorites
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
When I reload the page
Then I should not see "Course 2" in the "Course overview" "block"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
And I click on "Starred" "link" in the "Course overview" "block"
Then I should not see "Course 2" in the "Course overview" "block"
And I click on "Starred" "button" in the "Course overview" "block"
- And I click on "Removed from view" "link" in the "Course overview" "block"
+ And I click on "Archived" "link" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Scenario: Test show toggle functionality
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- When I click on "All (except removed from view)" "button" in the "Course overview" "block"
- And I click on "Removed from view" "link" in the "Course overview" "block"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ When I click on "All" "button" in the "Course overview" "block"
+ And I click on "Archived" "link" in the "Course overview" "block"
When I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Restore to view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I click on "Unarchive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
- And I click on "Removed from view" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "Archived" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Scenario: Test show toggle functionality w/ favorites
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Star this course" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- And I click on "Removed from view" "link" in the "Course overview" "block"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I click on "All" "button" in the "Course overview" "block"
+ And I click on "Archived" "link" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Restore to view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I click on "Unarchive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
When I reload the page
Then I should not see "Course 2" in the "Course overview" "block"
- And I click on "Removed from view" "button" in the "Course overview" "block"
- And I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "Archived" "button" in the "Course overview" "block"
+ And I click on "All" "link" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
And I click on "Starred" "link" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
- Scenario: Test a course is hidden directly with "All (except removed from view)" courses
+ Scenario: Test a course is hidden directly with "All" courses
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
Then I should not see "Course 2" in the "Course overview" "block"
- Scenario: Test a course is never hidden with "All (including removed)" courses
+ Scenario: Test a course is never hidden with "All (including archived)" courses
Given the following config values are set as admin:
| config | value | plugin |
| displaygroupingallincludinghidden | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
# We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (except hidden)" element instead
When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
Then I should see "Course 2" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I should not see "Remove from view" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I should see "Restore to view" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I click on "Restore to view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I should not see "Archive" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I should see "Unarchive" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I click on "Unarchive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
Then I should see "Course 2" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I should see "Remove from view" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
- And I should not see "Restore to view" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I should see "Archive" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
+ And I should not see "Unarchive" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
diff --git a/blocks/myoverview/tests/behat/block_myoverview_pagelimit_persistence.feature b/blocks/myoverview/tests/behat/block_myoverview_pagelimit_persistence.feature
index 1822a2d7ab9..8766c50eef5 100644
--- a/blocks/myoverview/tests/behat/block_myoverview_pagelimit_persistence.feature
+++ b/blocks/myoverview/tests/behat/block_myoverview_pagelimit_persistence.feature
@@ -49,7 +49,7 @@ Feature: The my overview block allows users to persistence of their page limits
Given I am on the "My courses" page logged in as "student1"
When I click on "[data-action='limit-toggle']" "css_element" in the "Course overview" "block"
And I click on "All" "link" in the ".dropdown-menu.show" "css_element"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
And I click on "In progress" "link" in the "Course overview" "block"
Then I should see "Course 13"
And I should see "All" in the "[data-action='limit-toggle']" "css_element"
diff --git a/blocks/myoverview/tests/behat/block_myoverview_progress.feature b/blocks/myoverview/tests/behat/block_myoverview_progress.feature
index 3d503a2ba07..1292e1890ca 100644
--- a/blocks/myoverview/tests/behat/block_myoverview_progress.feature
+++ b/blocks/myoverview/tests/behat/block_myoverview_progress.feature
@@ -22,8 +22,8 @@ Feature: Course overview block show users their progress on courses
Scenario: Course progress percentage should not be displayed if completion is not enabled
Given I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
- When I click on "All (except removed from view)" "link" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
+ When I click on "All" "link" in the "Course overview" "block"
Then I should not see "0%" in the "Course overview" "block"
Scenario: User complete activity and verify his progress
@@ -35,10 +35,10 @@ Feature: Course overview block show users their progress on courses
And I press "Save and return to course"
And I log out
When I am on the "My courses" page logged in as "student1"
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should see "0%" in the "Course overview" "block"
And I am on the "Test choice 1" "choice activity" page
And I am on the "My courses" page
- And I click on "All (except removed from view)" "button" in the "Course overview" "block"
+ And I click on "All" "button" in the "Course overview" "block"
And I should see "100%" in the "Course overview" "block"