Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge to main for 1.9 release #95

Merged
merged 13 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
run: moodle-plugin-ci phplint

- name: PHP Copy/Paste Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpcpd

Expand Down
2 changes: 1 addition & 1 deletion amd/build/dash_instance.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/dash_instance.min.js.map

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions amd/src/dash_instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define(['jquery', 'jqueryui', 'core/log', 'core/ajax', 'core/notification', 'cor
'block_dash/preferences_modal', 'block_dash/datepicker', 'block_dash/select2', 'core/fragment', 'core/templates'],
function($, UI, Log, Ajax, Notification, ModalEvents, PreferencesModal, DatePicker, Select2, Fragment, Templates) {

var DashInstance = function(root, blockInstanceId, blockContextid, editing, istotara, pagelayout) {
var DashInstance = function(root, blockInstanceId, blockContextid, editing, istotara, pagelayout, pagecontext) {
this.root = $(root);
this.blockInstanceId = blockInstanceId;
this.blockContextid = blockContextid;
Expand All @@ -13,6 +13,7 @@ define(['jquery', 'jqueryui', 'core/log', 'core/ajax', 'core/notification', 'cor
this.sortDirections = {};
this.isTotara = istotara;
this.pageLayout = pagelayout;
this.pageContext = pagecontext;
this.init();
};

Expand All @@ -37,17 +38,17 @@ define(['jquery', 'jqueryui', 'core/log', 'core/ajax', 'core/notification', 'cor
// Select the parent datasource for the sub config.
this.getRoot().on('change', '[data-target="subsource-config"] [type=radio]', function(e) {
var subConfig;
if (subConfig = e.target.closest('[data-target="subsource-config"]')) {
if (e.target.closest('[data-target="subsource-config"]')) {
subConfig = e.target.closest('[data-target="subsource-config"]');
if (subConfig.parentNode !== null) {
var dataSource = subConfig.parentNode.querySelector('[name="config_data_source_idnumber"]');
dataSource.click(); // = true;
}
}
}.bind(this));

this.getRoot().find('.dash-configuration-form [name="config_data_source_idnumber"]').on('change', function(e) {
console.log(e);
console.log("TEST");
this.getRoot().find('.dash-configuration-form [name="config_data_source_idnumber"]').on('change', function() {

var dataSource = this.getRoot().find('.dash-configuration-form');
var formData = $(dataSource).find('form').serialize();

Expand Down Expand Up @@ -164,7 +165,7 @@ define(['jquery', 'jqueryui', 'core/log', 'core/ajax', 'core/notification', 'cor

this.getBlockContentArea().on('click', '.page-link', function(e) {
e.preventDefault();
this.currentPage = $(e.target).data('page');
this.currentPage = $(e.target).data('page');
this.refresh();
}.bind(this));

Expand Down Expand Up @@ -231,6 +232,7 @@ define(['jquery', 'jqueryui', 'core/log', 'core/ajax', 'core/notification', 'cor
"sort_field": this.sortField,
"sort_direction": sortDirection,
"pagelayout" : this.pageLayout,
"pagecontext" : this.pageContext,
}
};
return Ajax.call([request])[0];
Expand Down
Loading
Loading