1243 Commits

Author SHA1 Message Date
Andrew Nicols
613f933442
Merge branch 'MDL-80820' of https://github.com/marinaglancy/moodle 2024-04-15 10:42:22 +08:00
Pedro Jordao
942868a1a6 MDL-80195 forms: Keep dropdown menu open when tabbing into datepicker
When accessing a datepicker that is within a dropdown menu using the tab
key, the navigation sequence was changed since the datepicker code is
not rendered within the dropdown menu element, thus the dropdown was
closed as it was understood that we were not more inside it.
Furthermore, when exiting the datepicker by pressing tab, as the
dropdown was closed, the navigation jumped to the first element on the
page, which is the link to Skip to main content.

To resolve this, a validation was added that keeps the dropdown menu
open if the datepicker is open and accessed via the tab key.
2024-04-08 12:57:18 -03:00
Marina Glancy
42c76b711a MDL-80820 lib/pear: phpdoc corrections 2024-04-08 10:13:39 +01:00
Marina Glancy
ef1759da74 MDL-80820 various: fix incorrect phpdocs 2024-04-08 10:13:10 +01:00
Daniel Ziegenberg
08027e408c
MDL-81281 phpunit: assertObjectHasAttribute is deprecated
To be integrated as part of MDL-81266

When running PHPUnit 9.6 we get the following deprecation warnings:
"assertObjectHasAttribute() is deprecated and will be removed in PHPUnit
10. Refactor your test to use assertObjectHasProperty() instead."

So we replace all instances of assertObjectHasAttribute with
assertObjectHasProperty.

PHPUnit justifies the change with:
> PHPUnit currently refers to "fields" (see above) as "attributes". This
> is (or will become) confusing considering the introduction of
> attributes in PHP 8 and their support in PHPUnit.  PHPUnit will be
> changed to use the term "property" instead of "attribute" where "field"
> is meant.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2024-03-25 16:21:45 +01:00
Mikel Martín
9733ccc381 MDL-81188 form: Fix password element layout
MDL-75670 generated a regression in forms password element layout that was not
being displayed in a single line as before.

- Modify the password element template to display the input and the password
unmask icon in a single line.
- Change the password unmask button styles to be consistent with other
focus states.
- Modify passwordunmask behat form field to work with the new password element
layout changes.
2024-03-18 09:19:35 +01:00
Ilya Tregubov
6c9e011d32 Merge branch 'MDL-80991' of https://github.com/paulholden/moodle 2024-03-12 11:28:21 +08:00
Huong Nguyen
88dc0f5010 Merge branch 'MDL-79769-master' of https://github.com/davewoloszyn/moodle 2024-03-12 09:18:10 +07:00
Marina Glancy
36c91ff907 MDL-80431 forms: do not use fieldset tag without a legend 2024-03-08 15:02:15 +00:00
David Woloszyn
cd935eb3e2 MDL-79769 login: Fix focus loss of loginpageautofocus setting
Added new form event to fix login fields focus loss when DOM is
manipulated by togglesensitive.
2024-03-08 15:54:37 +11:00
Jun Pataleta
3278ce7aba
Merge branch 'MDL-65292' of https://github.com/stronk7/moodle 2024-03-08 08:00:41 +08:00
Paul Holden
3ecb9b8ec0
MDL-80991 files: consistent display of filepicker accepted types. 2024-03-05 11:51:47 +00:00
Sara Arjona
e1034deb8b
Merge branch 'MDL-75670-main' of https://github.com/roland04/moodle 2024-03-04 16:05:18 +01:00
Mikel Martín
d0d62fd06c MDL-75670 theme: Refactor form-inline helper class dropped in BS5
- Replace .form-inline Bootstrap helper class with .d-flex.flex-wrap.align-items-center
- Refactor .form-inline occurrences in SCSS files or remove when unneeded
2024-02-29 13:56:46 +01:00
Mikel Martín
4ce883ae21 MDL-75670 theme: Refactor form-group helper class dropped in BS5
- Replace .form-group Boostrap helper class with .mb-3. The .form-group class was only
adding margin bottom styles, so it is an straightforward change.
- Replace .form-group references in SCSS files with .fitem now .form-group has been removed.
- There were some other .form-group occurrences in the code that were using it not for styling
but incorrectly for managing some logic. These have been also replaced with .fitem or removed.
2024-02-29 13:55:37 +01:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
Sara Arjona
a42d1335f5
Merge branch 'MDL-80197' of https://github.com/pedrojordao/moodle 2024-02-28 16:09:30 +01:00
Paul Holden
bb6652699e
Merge branch 'MDL-75794-main' of https://github.com/aanabit/moodle into main 2024-02-23 12:54:00 +00:00
Jun Pataleta
f6a22d3e61
Merge branch 'MDL-80805-main' of https://github.com/sammarshallou/moodle 2024-02-23 17:32:05 +08:00
Amaia Anabitarte
0c081f004a MDL-75794 mod_data: deprecate behat steps to generate entries and fields 2024-02-22 17:37:54 +01:00
Pedro Jordao
9239366aa7 MDL-80197 forms: Added attributes to the calendar link
The datepicker is not keyboard accessible when in a modal.

As we are using yui datepicker and the change is not simple, I added aria-hidden and tabindex properties to avoid screenreaders.
2024-02-19 20:57:52 -03:00
sam marshall
14b1e93e85 MDL-80805 core_form: Accessibility - add aria-required to form fields
Most types of form field will now include aria-required="true" if the
field is marked as required. This causes assistive technology to inform
users that the field is required.

Before this change, in some cases (e.g. screen reader users tabbing
through fields) users were not informed that a field is required.
2024-02-15 14:30:33 +00:00
sam marshall
4bb42cc362 MDL-80608 core_form: Fire modal form event for errors in definition
The ERROR event is defined as being fired if an exception occurs while
contacting the server. This change ensures it is fired for exceptions
in the form definition AJAX request, not just form submission.

Additionally, if such an error occurs in submission, the form buttons
were left in disabled state. This change makes them enabled again.
2024-02-14 13:49:39 +00:00
meirzamoodle
9ba1423359 MDL-74641 repository: Handles increase bytes while extracting zip files
We should not rely solely on the provided size information.
Therefore the system needs to recalculate the size of each file in the zip file,
whether small or big.

The changes also cover the filemanager.js file if an error appears.
2024-02-07 02:34:19 +01:00
Ilya Tregubov
59cac76dc1 Merge branch 'MDL-79927' of https://github.com/paulholden/moodle 2024-01-25 09:53:21 +08:00
Sara Arjona
8b36abdb9d
Merge branch 'MDL-80259-main' of https://github.com/roland04/moodle 2024-01-24 09:16:12 +01:00
Mikel Martín
a198884333 MDL-80259 theme_boost: Refactor badge helper classes for Bootstrap 5 2024-01-23 08:27:23 +01:00
Ferran Recio
f4adbc8a11 MDL-79029 behat: replace deprecated behat steps 2024-01-22 11:12:28 +01:00
Jun Pataleta
82c9578e36
Merge branch 'MDL-72308' of https://github.com/paulholden/moodle 2024-01-18 11:31:09 +08:00
Paul Holden
e2cb2fa5dc
MDL-72308 forms: final removal of legacy formchangechecker YUI. 2024-01-15 14:24:51 +00:00
Paul Holden
9357a1c583
MDL-80192 forms: implement method to set group element hidden label.
This is consistent with the API used for other form element types,
in order to provide screen-readable text in the fieldset legend while
not necessarily wanting to display said label.

The new class property is automatically exported to the template via
the `templatable_form_element` trait.
2024-01-12 08:33:37 +00:00
Paul Holden
24f59a7d32
MDL-79927 files: scope toggleall checkboxes per filemanager instance.
Ensures that when multiple exist on the same page, each operates
independently of the others.
2024-01-04 13:22:33 +00:00
Ilya Tregubov
1e83b9eba7 Merge branch 'MDL-79985-master' of https://github.com/ferranrecio/moodle 2023-12-20 09:06:08 +08:00
Ferran Recio
3344354641 MDL-79985 forms: add choicedropdown form element
The new quick form field uses a choice list to display a dropdown
component inside a form. Apart from que quick form code, the patch also
include a small improvement to the choicelist class to disable empty
values. This small patch is needed because the quickform field won't
allow empty values.
2023-12-19 09:43:35 +01:00
Jun Pataleta
030def7a46
Merge branch 'MDL-80079-master' of https://github.com/andrewnicols/moodle 2023-12-06 21:59:47 +08:00
Paul Holden
b7205c5c84
MDL-71336 forms: ensure grouped date elements have unique IDs.
Previously they were each taking the ID of their parent group element.
2023-11-23 12:01:24 +00:00
Huong Nguyen
4cf3f384c3 Merge branch 'MDL-80066' of https://github.com/elza3ym/moodle 2023-11-16 10:52:48 +07:00
Andrew Nicols
dab4a2b66f
MDL-80079 core: Correct incorrect arg to format_string::$options 2023-11-14 22:28:55 +08:00
Sara Arjona
ff518d3e71
Merge branch 'MDL-77581-master' of https://github.com/dpalou/moodle 2023-11-13 17:19:02 +01:00
Mohamed Shehata
52b9a59d79 MDL-80066 form: fix date picker on small screens 2023-11-09 17:39:10 +02:00
Dani Palou
273251d765 MDL-77581 behat: Apply new lesson generators to existing tests 2023-11-09 10:18:43 +01:00
Paul Holden
58d9babe56
MDL-79629 javascript: native promises enhancing autocomplete module.
Preserve existing `enhance` method return of jQuery style promises to
allow calling code to continue relying on that (e.g. when calling old
style `.done` and `.fail`).

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-11-08 20:05:35 +00:00
Mikel Martín
e9afd7f072
MDL-79629 forms: Improvements to autocomplete form element
- Preserve autocomplete input options classes to the autocomplete suggestions
- Add new styles for suggestions headings
- Add a new class selector form-autocomplete-input so input can be easily selected
  for styling.

Various improvements to make the module more re-usable elsewhere:
change event bubbling, promise argument support when enhancing.

Co-authored-by: Paul Holden <paulh@moodle.com>
2023-11-02 14:50:10 +00:00
viettruongq
2375b00a08 MDL-70760 admin: Limited length config setting validate client-side 2023-11-01 22:02:58 +07:00
Ruslan Kabalin
afe7f76e14 MDL-79762 core: Add possibility to define modal type for modalform
If `moduleName` param is passed in config object for modalform, it will be
used to instantiate modal class, otherwise 'core/modal_save_cancel' is
used.

Co-authored-by: Marina Glancy <marina@moodle.com>
2023-10-25 15:56:33 +01:00
Sara Arjona
cc9430929d
MDL-77708 docs: Update references from docs.moodle.org/dev 2023-09-26 10:30:19 +02:00
Huong Nguyen
632e603304
Merge branch 'MDL-78728' of https://github.com/paulholden/moodle 2023-09-15 16:19:27 +08:00
Jun Pataleta
4370887449
Merge branch 'MDL-78916-master' of https://github.com/junpataleta/moodle 2023-09-15 16:19:06 +08:00
Jake Dallimore
893ce4f7b2
MDL-78916 core_form: allow class overrides on button form element
This works the same as the customclassoverride on the submit element,
in that only the 'btn' class is hard coded in the template. Passing
$options['customclassoverride'] to the constructor allows calling code
to specify other classes to be added beside 'btn'. E.g. 'btn-primary'.
If no options array is passed, 'btn-secondary' is used (the existing
class used for button elements).
2023-09-13 17:37:06 +08:00
Jun Pataleta
6c6a655b0b
Merge branch 'MDL-78527-master' of https://github.com/aanabit/moodle 2023-09-13 11:17:20 +08:00