Skip to content

Commit

Permalink
WR422914 Bug fixes and performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonThornett committed Nov 7, 2024
1 parent 8d6ea9d commit 5adb32f
Show file tree
Hide file tree
Showing 33 changed files with 306 additions and 194 deletions.
2 changes: 1 addition & 1 deletion amd/build/course_selector.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/course_selector.min.js.map

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/dashboard.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/dashboard.min.js.map

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

2 changes: 0 additions & 2 deletions amd/src/course_selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ define(['core/ajax', 'core/notification'], function (Ajax, Notification) {
let courseArray = JSON.parse(response);
// eslint-disable-next-line promise/no-callback-in-promise
callback(courseArray);
}).fail(() => {
Notification.exception(new Error('Failed to get events'));
});
};

Expand Down
23 changes: 22 additions & 1 deletion amd/src/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,28 @@

export const init = () => {

// Load the tab cuntionality.
// Create the course search filter.
require(['core/form-autocomplete', 'core/str'], function(Autocomplete, Str) {
Str.get_string('courseselect', 'local_assessfreq').then((loading) => {
Autocomplete.enhance(
'#local-assessfreq-course-filter',
false,
'local_assessfreq/course_selector',
loading,
false,
true,
);
const course_filter = document.getElementById("local-assessfreq-course-filter");
course_filter.addEventListener('change', event => {
let courseid = event.target.value;
let url = new URL(window.location);
url.searchParams.set('courseid', courseid);
window.location = url;
});
});
});

// Load the tab functionality.
tabs();

};
Expand Down
Loading

0 comments on commit 5adb32f

Please sign in to comment.