Skip to content

Commit

Permalink
CI: Make CI happy
Browse files Browse the repository at this point in the history
  • Loading branch information
sharpchi committed Jun 27, 2024
1 parent bc7d520 commit 32a604f
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 28 deletions.
13 changes: 12 additions & 1 deletion amd/build/backup.min.js

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

2 changes: 1 addition & 1 deletion amd/build/backup.min.js.map

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

29 changes: 28 additions & 1 deletion amd/src/backup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
// 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 <http://www.gnu.org/licenses/>.

/**
* Competency picker.
*
* To handle 'save' events use: picker.on('save')
* This will receive a object with either a single 'competencyId', or an array in 'competencyIds'
* depending on the value of multiSelect.
*
* @module local_solent/backup
* @copyright 2024 Solent University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
import Ajax from 'core/ajax';
import Pending from 'core/pending';
import Notification from 'core/notification';

/**
* Get import restrictions to exclude templated items.
Expand All @@ -14,7 +41,7 @@ export const getImportRestrictions = () => {
const pendingPromise = new Pending('local/solent:getImportRestrictions');
Ajax.call([request])[0]
.then(restrictactivitybackup)
.catch();
.catch(Notification.exception);
return pendingPromise.resolve();
};

Expand Down
6 changes: 3 additions & 3 deletions db/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
defined('MOODLE_INTERNAL') || die();

$functions = [
'local_solent_get_import_restrictions' => array(
'local_solent_get_import_restrictions' => [
'classname' => 'local_solent_external',
'methodname' => 'get_import_restrictions',
'classpath' => 'local/solent/externallib.php',
'description' => 'Load course import restrictions to prevent duplicate activities ',
'type' => 'read',
'ajax' => true
)
'ajax' => true,
],
];
4 changes: 2 additions & 2 deletions externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function get_import_restrictions() {
// Either part can be null, but not both.
$item = [
'activity' => null,
'title' => null
'title' => null,
];
$error = false;
foreach ($selectors as $selector) {
Expand Down Expand Up @@ -91,7 +91,7 @@ public static function get_import_restrictions_returns(): external_multiple_stru
return new external_multiple_structure(
new external_single_structure([
'activity' => new external_value(PARAM_ALPHAEXT, 'Component name of activity', VALUE_REQUIRED, null),
'title' => new external_value(PARAM_TEXT, 'Text to search for', VALUE_REQUIRED, null)
'title' => new external_value(PARAM_TEXT, 'Text to search for', VALUE_REQUIRED, null),
])
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function local_solent_page_init(moodle_page $page) {
}

$page->requires->strings_for_js([
'noroleerror'
'noroleerror',
], 'local_solent');
}

Expand Down
2 changes: 1 addition & 1 deletion tests/behat/hide_activities.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Feature: Testing hide_activities in local_solent
Then I should see "Add an activity or resource" in the ".modal-title" "css_element"
And I should see "Page" in the ".modal-body" "css_element"
And I should not see "Lesson" in the ".modal-body" "css_element"
And I should not see "Feedback" in the ".modal-body" "css_element"
And I should not see "Feedback" in the ".modal-body" "css_element"
2 changes: 1 addition & 1 deletion tests/externallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function test_get_import_restrictions() {
$this->assertSame(['activity' => null, 'title' => 'Escape \{this\}'], $restrictions[6]);
$this->assertSame([
'activity' => 'label',
'title' => 'Collaborative learningCollaborative learning\.\.\.'
'title' => 'Collaborative learningCollaborative learning\.\.\.',
], $restrictions[7]);
}
}
Loading

0 comments on commit 32a604f

Please sign in to comment.