MDL-78095 course: Respect is_bulk_editable()

This commit is contained in:
james-cnz 2024-02-02 10:49:07 +13:00
parent f30110b5eb
commit 02037c5f2c
3 changed files with 12 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -125,12 +125,12 @@ class BulkSelector {
}
return this._getContentCheckboxes(bulk.selectedType).every(bulkSelect => {
if (bulkSelect.disabled) {
return false;
return true;
}
// Section zero is never selectale for bulk actions.
// Some sections may not be selectale for bulk actions.
if (bulk.selectedType == 'section') {
const section = this.courseEditor.get('section', bulkSelect.dataset.id);
if (section.number == 0) {
if (!section.bulkeditable) {
return true;
}
}
@ -227,6 +227,12 @@ class BulkSelector {
if (bulkSelect.disabled) {
return true;
}
if (elementType == 'section') {
const section = this.courseEditor.get('section', bulkSelect.dataset.id);
if (value && !section?.bulkeditable) {
return true;
}
}
if (bulkSelect.dataset.id == id || bulkSelect.dataset.id == lastSelectedId) {
found++;
}
@ -277,7 +283,7 @@ class BulkSelector {
}
if (elementType == 'section') {
const section = this.courseEditor.get('section', bulkSelect.dataset.id);
if (section?.number == 0) {
if (value && !section?.bulkeditable) {
return;
}
}