From 3d301abcec154f4aa5187c1cccd09f0cf7363667 Mon Sep 17 00:00:00 2001 From: Mathew May Date: Tue, 5 Mar 2024 16:26:22 +0800 Subject: [PATCH] MDL-73117 calendar: Final deprecation of threemonth_cal --- calendar/amd/build/calendar_threemonth.min.js | 13 -- .../amd/build/calendar_threemonth.min.js.map | 1 - calendar/amd/src/calendar_threemonth.js | 148 ------------------ calendar/renderer.php | 57 +------ .../templates/calendar_threemonth.mustache | 52 ------ calendar/templates/threemonth_month.mustache | 42 ----- calendar/tests/behat/behat_calendar.php | 10 -- .../tests/behat/behat_calendar_deprecated.php | 48 ++++++ calendar/upgrade.txt | 11 ++ 9 files changed, 61 insertions(+), 321 deletions(-) delete mode 100644 calendar/amd/build/calendar_threemonth.min.js delete mode 100644 calendar/amd/build/calendar_threemonth.min.js.map delete mode 100644 calendar/amd/src/calendar_threemonth.js delete mode 100644 calendar/templates/calendar_threemonth.mustache delete mode 100644 calendar/templates/threemonth_month.mustache create mode 100644 calendar/tests/behat/behat_calendar_deprecated.php diff --git a/calendar/amd/build/calendar_threemonth.min.js b/calendar/amd/build/calendar_threemonth.min.js deleted file mode 100644 index 93cae7033aaff..0000000000000 --- a/calendar/amd/build/calendar_threemonth.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * This module handles display of multiple mini calendars in a view, and - * movement through them. - * - * @deprecated since 4.0 MDL-72810. - * @todo MDL-73117 This will be deleted in Moodle 4.4. - * @module core_calendar/calendar_threemonth - * @copyright 2017 Andrew Nicols - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -define("core_calendar/calendar_threemonth",["jquery","core/notification","core_calendar/selectors","core_calendar/events","core/templates","core_calendar/view_manager"],(function($,Notification,CalendarSelectors,CalendarEvents,Templates,CalendarViewManager){return{init:function(root){!function(root){$("body").on([CalendarEvents.monthChanged,CalendarEvents.dayChanged].join(" "),(function(e,year,month,courseId,categoryId){root.queue((function(next){return processRequest(e,year,month,courseId,categoryId).then((function(){return next()})).fail(Notification.exception)}))}));var processRequest=function(e,year,month,courseId,categoryId){var newParent=root.find('[data-year="'+year+'"][data-month="'+month+'"]').closest(CalendarSelectors.calendarPeriods.month),allMonths=root.find(CalendarSelectors.calendarPeriods.month),previousMonth=$(allMonths[0]),nextMonth=$(allMonths[2]),placeHolder=$("");placeHolder.attr("data-template","core_calendar/threemonth_month"),placeHolder.attr("data-includenavigation",!1),placeHolder.attr("data-mini",!0);var requestYear,requestMonth,oldMonth,placeHolderContainer=$("
");if(placeHolderContainer.hide(),placeHolderContainer.append(placeHolder),newParent.is(previousMonth))placeHolderContainer.insertBefore(previousMonth),requestYear=previousMonth.data("previousYear"),requestMonth=previousMonth.data("previousMonth"),oldMonth=nextMonth;else{if(!newParent.is(nextMonth))return $.Deferred().resolve();placeHolderContainer.insertAfter(nextMonth),requestYear=nextMonth.data("nextYear"),requestMonth=nextMonth.data("nextMonth"),oldMonth=previousMonth}return CalendarViewManager.refreshMonthContent(placeHolder,requestYear,requestMonth,courseId,categoryId,placeHolder).then((function(){var slideUpPromise=$.Deferred(),slideDownPromise=$.Deferred();return oldMonth.slideUp("fast",(function(){$(this).remove(),slideUpPromise.resolve()})),placeHolderContainer.slideDown("fast",(function(){slideDownPromise.resolve()})),$.when(slideUpPromise,slideDownPromise)}))};root.on("click",CalendarSelectors.links.miniDayLink,(function(e){var miniDayLink=$(e.target),year=miniDayLink.data("year"),month=miniDayLink.data("month"),day=miniDayLink.text(),courseId=miniDayLink.data("courseid"),categoryId=miniDayLink.data("categoryid"),calendarRoot=$("body").find(CalendarSelectors.calendarMain);CalendarViewManager.refreshDayContent(calendarRoot,year,month,day,courseId,categoryId,calendarRoot.find('[id^="calendar-"][data-template^="core_calendar/"]'),"core_calendar/calendar_day"),e.preventDefault(),CalendarViewManager.updateUrl("?view=day")}))}(root=$(root))}}})); - -//# sourceMappingURL=calendar_threemonth.min.js.map \ No newline at end of file diff --git a/calendar/amd/build/calendar_threemonth.min.js.map b/calendar/amd/build/calendar_threemonth.min.js.map deleted file mode 100644 index fc4a2155b0721..0000000000000 --- a/calendar/amd/build/calendar_threemonth.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"calendar_threemonth.min.js","sources":["../src/calendar_threemonth.js"],"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 * This module handles display of multiple mini calendars in a view, and\n * movement through them.\n *\n * @deprecated since 4.0 MDL-72810.\n * @todo MDL-73117 This will be deleted in Moodle 4.4.\n * @module core_calendar/calendar_threemonth\n * @copyright 2017 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/notification',\n 'core_calendar/selectors',\n 'core_calendar/events',\n 'core/templates',\n 'core_calendar/view_manager',\n],\nfunction(\n $,\n Notification,\n CalendarSelectors,\n CalendarEvents,\n Templates,\n CalendarViewManager\n) {\n\n /**\n * Listen to and handle any calendar events fired by the calendar UI.\n *\n * @method registerCalendarEventListeners\n * @param {object} root The calendar root element\n */\n var registerCalendarEventListeners = function(root) {\n var body = $('body');\n body.on([CalendarEvents.monthChanged, CalendarEvents.dayChanged].join(' '), function(e, year, month, courseId, categoryId) {\n // We have to use a queue here because the calling code is decoupled from these listeners.\n // It's possible for the event to be called multiple times before one call is fully resolved.\n root.queue(function(next) {\n return processRequest(e, year, month, courseId, categoryId)\n .then(function() {\n return next();\n })\n .fail(Notification.exception)\n ;\n });\n });\n\n var processRequest = function(e, year, month, courseId, categoryId) {\n var newCurrentMonth = root.find('[data-year=\"' + year + '\"][data-month=\"' + month + '\"]');\n var newParent = newCurrentMonth.closest(CalendarSelectors.calendarPeriods.month);\n var allMonths = root.find(CalendarSelectors.calendarPeriods.month);\n\n var previousMonth = $(allMonths[0]);\n var nextMonth = $(allMonths[2]);\n\n var placeHolder = $('');\n placeHolder.attr('data-template', 'core_calendar/threemonth_month');\n placeHolder.attr('data-includenavigation', false);\n placeHolder.attr('data-mini', true);\n var placeHolderContainer = $('
');\n placeHolderContainer.hide();\n placeHolderContainer.append(placeHolder);\n\n var requestYear;\n var requestMonth;\n var oldMonth;\n\n if (newParent.is(previousMonth)) {\n // Fetch the new previous month.\n placeHolderContainer.insertBefore(previousMonth);\n\n requestYear = previousMonth.data('previousYear');\n requestMonth = previousMonth.data('previousMonth');\n oldMonth = nextMonth;\n } else if (newParent.is(nextMonth)) {\n // Fetch the new next month.\n placeHolderContainer.insertAfter(nextMonth);\n requestYear = nextMonth.data('nextYear');\n requestMonth = nextMonth.data('nextMonth');\n oldMonth = previousMonth;\n } else {\n return $.Deferred().resolve();\n }\n\n return CalendarViewManager.refreshMonthContent(\n placeHolder,\n requestYear,\n requestMonth,\n courseId,\n categoryId,\n placeHolder\n )\n .then(function() {\n var slideUpPromise = $.Deferred();\n var slideDownPromise = $.Deferred();\n oldMonth.slideUp('fast', function() {\n $(this).remove();\n slideUpPromise.resolve();\n });\n placeHolderContainer.slideDown('fast', function() {\n slideDownPromise.resolve();\n });\n\n return $.when(slideUpPromise, slideDownPromise);\n });\n };\n\n // Listen for a click on the day link in the three month block to load the day view.\n root.on('click', CalendarSelectors.links.miniDayLink, function(e) {\n\n var miniDayLink = $(e.target);\n var year = miniDayLink.data('year'),\n month = miniDayLink.data('month'),\n day = miniDayLink.text(),\n courseId = miniDayLink.data('courseid'),\n categoryId = miniDayLink.data('categoryid'),\n calendarRoot = $('body').find(CalendarSelectors.calendarMain);\n CalendarViewManager.refreshDayContent(calendarRoot, year, month, day, courseId, categoryId,\n calendarRoot.find('[id^=\"calendar-\"][data-template^=\"core_calendar/\"]'), 'core_calendar/calendar_day');\n e.preventDefault();\n CalendarViewManager.updateUrl('?view=day');\n });\n };\n\n return {\n init: function(root) {\n root = $(root);\n\n registerCalendarEventListeners(root);\n }\n };\n});\n"],"names":["define","$","Notification","CalendarSelectors","CalendarEvents","Templates","CalendarViewManager","init","root","on","monthChanged","dayChanged","join","e","year","month","courseId","categoryId","queue","next","processRequest","then","fail","exception","newParent","find","closest","calendarPeriods","allMonths","previousMonth","nextMonth","placeHolder","attr","requestYear","requestMonth","oldMonth","placeHolderContainer","hide","append","is","insertBefore","data","Deferred","resolve","insertAfter","refreshMonthContent","slideUpPromise","slideDownPromise","slideUp","this","remove","slideDown","when","links","miniDayLink","target","day","text","calendarRoot","calendarMain","refreshDayContent","preventDefault","updateUrl","registerCalendarEventListeners"],"mappings":";;;;;;;;;;AAyBAA,2CAAO,CACH,SACA,oBACA,0BACA,uBACA,iBACA,+BAEJ,SACIC,EACAC,aACAC,kBACAC,eACAC,UACAC,2BAqGO,CACHC,KAAM,SAASC,OA7FkB,SAASA,MAC/BP,EAAE,QACRQ,GAAG,CAACL,eAAeM,aAAcN,eAAeO,YAAYC,KAAK,MAAM,SAASC,EAAGC,KAAMC,MAAOC,SAAUC,YAG3GT,KAAKU,OAAM,SAASC,aACTC,eAAeP,EAAGC,KAAMC,MAAOC,SAAUC,YAC/CI,MAAK,kBACKF,UAEVG,KAAKpB,aAAaqB,qBAKvBH,eAAiB,SAASP,EAAGC,KAAMC,MAAOC,SAAUC,gBAEhDO,UADkBhB,KAAKiB,KAAK,eAAiBX,KAAO,kBAAoBC,MAAQ,MACpDW,QAAQvB,kBAAkBwB,gBAAgBZ,OACtEa,UAAYpB,KAAKiB,KAAKtB,kBAAkBwB,gBAAgBZ,OAExDc,cAAgB5B,EAAE2B,UAAU,IAC5BE,UAAY7B,EAAE2B,UAAU,IAExBG,YAAc9B,EAAE,UACpB8B,YAAYC,KAAK,gBAAiB,kCAClCD,YAAYC,KAAK,0BAA0B,GAC3CD,YAAYC,KAAK,aAAa,OAK1BC,YACAC,aACAC,SANAC,qBAAuBnC,EAAE,YAC7BmC,qBAAqBC,OACrBD,qBAAqBE,OAAOP,aAMxBP,UAAUe,GAAGV,eAEbO,qBAAqBI,aAAaX,eAElCI,YAAcJ,cAAcY,KAAK,gBACjCP,aAAeL,cAAcY,KAAK,iBAClCN,SAAWL,cACR,CAAA,IAAIN,UAAUe,GAAGT,kBAOb7B,EAAEyC,WAAWC,UALpBP,qBAAqBQ,YAAYd,WACjCG,YAAcH,UAAUW,KAAK,YAC7BP,aAAeJ,UAAUW,KAAK,aAC9BN,SAAWN,qBAKRvB,oBAAoBuC,oBACvBd,YACAE,YACAC,aACAlB,SACAC,WACAc,aAEHV,MAAK,eACEyB,eAAiB7C,EAAEyC,WACnBK,iBAAmB9C,EAAEyC,kBACzBP,SAASa,QAAQ,QAAQ,WACrB/C,EAAEgD,MAAMC,SACRJ,eAAeH,aAEnBP,qBAAqBe,UAAU,QAAQ,WACnCJ,iBAAiBJ,aAGd1C,EAAEmD,KAAKN,eAAgBC,sBAKtCvC,KAAKC,GAAG,QAASN,kBAAkBkD,MAAMC,aAAa,SAASzC,OAEnDyC,YAAcrD,EAAEY,EAAE0C,QAClBzC,KAAOwC,YAAYb,KAAK,QACxB1B,MAAQuC,YAAYb,KAAK,SACzBe,IAAMF,YAAYG,OAClBzC,SAAWsC,YAAYb,KAAK,YAC5BxB,WAAaqC,YAAYb,KAAK,cAC9BiB,aAAezD,EAAE,QAAQwB,KAAKtB,kBAAkBwD,cACpDrD,oBAAoBsD,kBAAkBF,aAAc5C,KAAMC,MAAOyC,IAAKxC,SAAUC,WAC5EyC,aAAajC,KAAK,sDAAuD,8BAC7EZ,EAAEgD,iBACFvD,oBAAoBwD,UAAU,gBAQlCC,CAFAvD,KAAOP,EAAEO"} \ No newline at end of file diff --git a/calendar/amd/src/calendar_threemonth.js b/calendar/amd/src/calendar_threemonth.js deleted file mode 100644 index 576f6c10bc58f..0000000000000 --- a/calendar/amd/src/calendar_threemonth.js +++ /dev/null @@ -1,148 +0,0 @@ -// This file is part of Moodle - http://moodle.org/ -// -// Moodle is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Moodle is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Moodle. If not, see . - -/** - * This module handles display of multiple mini calendars in a view, and - * movement through them. - * - * @deprecated since 4.0 MDL-72810. - * @todo MDL-73117 This will be deleted in Moodle 4.4. - * @module core_calendar/calendar_threemonth - * @copyright 2017 Andrew Nicols - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -define([ - 'jquery', - 'core/notification', - 'core_calendar/selectors', - 'core_calendar/events', - 'core/templates', - 'core_calendar/view_manager', -], -function( - $, - Notification, - CalendarSelectors, - CalendarEvents, - Templates, - CalendarViewManager -) { - - /** - * Listen to and handle any calendar events fired by the calendar UI. - * - * @method registerCalendarEventListeners - * @param {object} root The calendar root element - */ - var registerCalendarEventListeners = function(root) { - var body = $('body'); - body.on([CalendarEvents.monthChanged, CalendarEvents.dayChanged].join(' '), function(e, year, month, courseId, categoryId) { - // We have to use a queue here because the calling code is decoupled from these listeners. - // It's possible for the event to be called multiple times before one call is fully resolved. - root.queue(function(next) { - return processRequest(e, year, month, courseId, categoryId) - .then(function() { - return next(); - }) - .fail(Notification.exception) - ; - }); - }); - - var processRequest = function(e, year, month, courseId, categoryId) { - var newCurrentMonth = root.find('[data-year="' + year + '"][data-month="' + month + '"]'); - var newParent = newCurrentMonth.closest(CalendarSelectors.calendarPeriods.month); - var allMonths = root.find(CalendarSelectors.calendarPeriods.month); - - var previousMonth = $(allMonths[0]); - var nextMonth = $(allMonths[2]); - - var placeHolder = $(''); - placeHolder.attr('data-template', 'core_calendar/threemonth_month'); - placeHolder.attr('data-includenavigation', false); - placeHolder.attr('data-mini', true); - var placeHolderContainer = $('
'); - placeHolderContainer.hide(); - placeHolderContainer.append(placeHolder); - - var requestYear; - var requestMonth; - var oldMonth; - - if (newParent.is(previousMonth)) { - // Fetch the new previous month. - placeHolderContainer.insertBefore(previousMonth); - - requestYear = previousMonth.data('previousYear'); - requestMonth = previousMonth.data('previousMonth'); - oldMonth = nextMonth; - } else if (newParent.is(nextMonth)) { - // Fetch the new next month. - placeHolderContainer.insertAfter(nextMonth); - requestYear = nextMonth.data('nextYear'); - requestMonth = nextMonth.data('nextMonth'); - oldMonth = previousMonth; - } else { - return $.Deferred().resolve(); - } - - return CalendarViewManager.refreshMonthContent( - placeHolder, - requestYear, - requestMonth, - courseId, - categoryId, - placeHolder - ) - .then(function() { - var slideUpPromise = $.Deferred(); - var slideDownPromise = $.Deferred(); - oldMonth.slideUp('fast', function() { - $(this).remove(); - slideUpPromise.resolve(); - }); - placeHolderContainer.slideDown('fast', function() { - slideDownPromise.resolve(); - }); - - return $.when(slideUpPromise, slideDownPromise); - }); - }; - - // Listen for a click on the day link in the three month block to load the day view. - root.on('click', CalendarSelectors.links.miniDayLink, function(e) { - - var miniDayLink = $(e.target); - var year = miniDayLink.data('year'), - month = miniDayLink.data('month'), - day = miniDayLink.text(), - courseId = miniDayLink.data('courseid'), - categoryId = miniDayLink.data('categoryid'), - calendarRoot = $('body').find(CalendarSelectors.calendarMain); - CalendarViewManager.refreshDayContent(calendarRoot, year, month, day, courseId, categoryId, - calendarRoot.find('[id^="calendar-"][data-template^="core_calendar/"]'), 'core_calendar/calendar_day'); - e.preventDefault(); - CalendarViewManager.updateUrl('?view=day'); - }); - }; - - return { - init: function(root) { - root = $(root); - - registerCalendarEventListeners(root); - } - }; -}); diff --git a/calendar/renderer.php b/calendar/renderer.php index b6c8678355745..5134fa007fa5c 100644 --- a/calendar/renderer.php +++ b/calendar/renderer.php @@ -51,63 +51,10 @@ public function complete_layout() { } /** - * Produces the content for the three months block (pretend block) - * - * This includes the previous month, the current month, and the next month - * * @deprecated since 4.0 MDL-72810. - * @todo MDL-73117 This will be deleted in Moodle 4.4. - * - * @param calendar_information $calendar - * @return string */ - public function fake_block_threemonths(calendar_information $calendar) { - debugging('This method is no longer used as the three month calendar block has been removed', DEBUG_DEVELOPER); - - // Get the calendar type we are using. - $calendartype = \core_calendar\type_factory::get_calendar_instance(); - $time = $calendartype->timestamp_to_date_array($calendar->time); - - $current = $calendar->time; - $prevmonthyear = $calendartype->get_prev_month($time['year'], $time['mon']); - $prev = $calendartype->convert_to_timestamp( - $prevmonthyear[1], - $prevmonthyear[0], - 1 - ); - $nextmonthyear = $calendartype->get_next_month($time['year'], $time['mon']); - $next = $calendartype->convert_to_timestamp( - $nextmonthyear[1], - $nextmonthyear[0], - 1 - ); - - $content = ''; - - // Previous. - $calendar->set_time($prev); - list($previousmonth, ) = calendar_get_view($calendar, 'minithree', false, true); - - // Current month. - $calendar->set_time($current); - list($currentmonth, ) = calendar_get_view($calendar, 'minithree', false, true); - - // Next month. - $calendar->set_time($next); - list($nextmonth, ) = calendar_get_view($calendar, 'minithree', false, true); - - // Reset the time back. - $calendar->set_time($current); - - $data = (object) [ - 'previousmonth' => $previousmonth, - 'currentmonth' => $currentmonth, - 'nextmonth' => $nextmonth, - ]; - - $template = 'core_calendar/calendar_threemonth'; - $content .= $this->render_from_template($template, $data); - return $content; + public function fake_block_threemonths() { + throw new coding_exception(__FUNCTION__ . '() has been removed.'); } /** diff --git a/calendar/templates/calendar_threemonth.mustache b/calendar/templates/calendar_threemonth.mustache deleted file mode 100644 index 5fc66f7eb47c1..0000000000000 --- a/calendar/templates/calendar_threemonth.mustache +++ /dev/null @@ -1,52 +0,0 @@ -{{! - This file is part of Moodle - http://moodle.org/ - - Moodle is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Moodle is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Moodle. If not, see . -}} -{{! - @template core_calendar/calendar_threemonth - - @deprecated since 4.0 MDL-72810. - @todo MDL-73117 This will be deleted in Moodle 4.4. - - Calendar view to show three months as a block. - - The purpose of this template is to render a set of three months of calendar_mini in a block. - - Classes required for JS: - * none - - Data attributes required for JS: - * none - - Example context (json): - { - } -}} -
- {{#previousmonth}} - {{> core_calendar/threemonth_month}} - {{/previousmonth}} - {{#currentmonth}} - {{> core_calendar/threemonth_month}} - {{/currentmonth}} - {{#nextmonth}} - {{> core_calendar/threemonth_month}} - {{/nextmonth}} -
-{{#js}} -require(['jquery', 'core_calendar/calendar_threemonth'], function($, CalendarThreeMonth) { - CalendarThreeMonth.init($("#calendar-multi-{{uniqid}}")); -}); -{{/js}} diff --git a/calendar/templates/threemonth_month.mustache b/calendar/templates/threemonth_month.mustache deleted file mode 100644 index bac1b5b68ee86..0000000000000 --- a/calendar/templates/threemonth_month.mustache +++ /dev/null @@ -1,42 +0,0 @@ -{{! - This file is part of Moodle - http://moodle.org/ - - Moodle is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Moodle is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Moodle. If not, see . -}} -{{! - @template core_calendar/threemonth_month - - @deprecated since 4.0 MDL-72810. - @todo MDL-73117 This will be deleted in Moodle 4.4. - - Calendar view to show three months as a block. - - The purpose of this template is to render a set of three months of calendar_mini in a block. - - Classes required for JS: - * none - - Data attributes required for JS: - * none - - Example context (json): - { - } -}} -
- {{> core_calendar/calendar_mini}} -
diff --git a/calendar/tests/behat/behat_calendar.php b/calendar/tests/behat/behat_calendar.php index fc53c18233caa..3065ae8fd4684 100644 --- a/calendar/tests/behat/behat_calendar.php +++ b/calendar/tests/behat/behat_calendar.php @@ -122,16 +122,6 @@ public function i_hover_over_today_in_mini_calendar_block(): void { $this->i_hover_over_day_of_this_month_in_mini_calendar_block($todaysday); } - /** - * Hover over today in the calendar. - * - * @Given /^I hover over today in the calendar$/ - */ - public function i_hover_over_today_in_the_calendar() { - $todaysday = date('j'); - return $this->i_hover_over_day_of_this_month_in_calendar($todaysday); - } - /** * Navigate to a specific month in the calendar. * diff --git a/calendar/tests/behat/behat_calendar_deprecated.php b/calendar/tests/behat/behat_calendar_deprecated.php new file mode 100644 index 0000000000000..a563eae8a0618 --- /dev/null +++ b/calendar/tests/behat/behat_calendar_deprecated.php @@ -0,0 +1,48 @@ +. + +// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php. + +require_once(__DIR__ . '/../../../lib/behat/behat_deprecated_base.php'); + +/** + * Steps definitions that are now deprecated and will be removed in the next releases. + * + * This file only contains the steps that previously were in the behat_*.php files in the SAME DIRECTORY. + * When deprecating steps from other components or plugins, create a behat_COMPONENT_deprecated.php + * file in the same directory where the steps were defined. + * + * @package core_calendar + * @category test + * @copyright 2024 Mathew May + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class behat_calendar_deprecated extends behat_deprecated_base { + /** + * Hover over today in the calendar. + * + * @Given /^I hover over today in the calendar$/ + * + * @deprecated since 4.4 MDL-73117. + * @TODO MDL-79721: This will be deleted in Moodle 4.8. + */ + public function i_hover_over_today_in_the_calendar() { + $this->deprecated_message('behat_calendar::i_hover_over_today_in_the_calendar'); + $todaysday = date('j'); + // Note: This step was removed via MDL-71733 but this step was not deprecated alongside it. + return $this->i_hover_over_day_of_this_month_in_calendar($todaysday); + } +} diff --git a/calendar/upgrade.txt b/calendar/upgrade.txt index 3076c3fba4eec..4010d7ce1b161 100644 --- a/calendar/upgrade.txt +++ b/calendar/upgrade.txt @@ -5,6 +5,17 @@ information provided here is intended especially for developers. * The following previously deprecated methods have been removed and can no longer be used: - `calendar_process_subscription_row` - `calendar_import_icalendar_events` + - `fake_block_threemonths` + - `i_click_day_of_this_month_in_calendar` + - `i_hover_over_today_in_the_calendar` + +* The following previously deprecated files have been removed and can no longer be used: + - `calendar_threemonth.js` + - `calendar_threemonth.mustache` + - `threemonth_month.mustache` + +* The following have been deprecated: + - Behat step definition `i_hover_over_today_in_the_calendar` === 4.3 === * The `navigation` property has been removed from `\core_calendar\external\day_exporter` as it is not being used by any of the