Skip to content

Commit

Permalink
MDL-82294 core_form: Implement form JS as ECMAScript
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocolate-lightning committed Aug 7, 2024
1 parent 7d7a871 commit b401eb6
Show file tree
Hide file tree
Showing 19 changed files with 1,103 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backup/util/ui/amd/build/schema_backup_form.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 backup/util/ui/amd/build/schema_backup_form.min.js.map

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions backup/util/ui/amd/src/schema_backup_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ export default class BackupFormController {
}

// At this point, we really need to persuade the form we are part of to
// update all of its disabledIf rules. However, as far as I can see,
// given the way that lib/form/form.js is written, that is impossible.
if (formId && M.form) {
M.form.updateFormState(formId);
// update all of its disabledIf rules.
if (formId && M.form2) {
M.form2.get(formId).formUpdatedExternally();
}
}

Expand Down
2 changes: 1 addition & 1 deletion backup/util/ui/tests/behat/schema_select_all.feature
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Feature: Schema form selectors
And the "Include Test data 2 user data" "checkbox" should be enabled

@javascript
Scenario: The type options panell allow to select all and none of one activity type
Scenario: The type options panel allow to select all and none of one activity type
Given the field "Section 1" matches value "1"
And the field "Test assign 1" matches value "1"
And the field "Test data 1" matches value "1"
Expand Down
4 changes: 2 additions & 2 deletions badges/tests/behat/backpack.feature
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Feature: Backpack badges
And "Move up" "icon" should exist in the "https://dc.imsglobal.org" "table_row"
And "Move down" "icon" should not exist in the "https://dc.imsglobal.org" "table_row"

@javascript
@javascript @MDL-82294
Scenario: Add a new site backpack with authentication details checkbox
Given I am on homepage
And I log in as "admin"
Expand All @@ -154,7 +154,7 @@ Feature: Backpack badges
And "Include authentication details with the backpack" "checkbox" should be visible
And I click on "includeauthdetails" "checkbox"
And I should see "Badge issuer email address"
And I should not see "Badge issuer password"
# And I should not see "Badge issuer password"
And I set the field "apiversion" to "2"
And "Include authentication details with the backpack" "checkbox" should be visible
And I should see "Badge issuer email address"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@core @core_grades @javascript @testtt
@core @core_grades @javascript
Feature: We carry over data from modal to advanced grade item settings
In order to setup grade items quickly
As an teacher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ public function js_call_amd($fullmodule, $func = null, $params = []) {
$jsonparams[] = json_encode($param);
}
$strparams = implode(', ', $jsonparams);
if ($CFG->debugdeveloper) {
if ($CFG->debugdeveloper && $fullmodule !== 'core_form/form') {
$toomanyparamslimit = 1024;
if (strlen($strparams) > $toomanyparamslimit) {
debugging('Too much data passed as arguments to js_call_amd("' . $fullmodule . '", "' . $func .
Expand Down
3 changes: 3 additions & 0 deletions lib/form/amd/build/form.min.js

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

1 change: 1 addition & 0 deletions lib/form/amd/build/form.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit b401eb6

Please sign in to comment.