745 Commits

Author SHA1 Message Date
Rajesh Taneja
86ebbed6ca
MDL-56210 behat: Test for disabled button later
With phantomjs, dom is not updated by the time
next step is executed, so suffle it to ensure
this scenario pass
2016-10-05 15:45:22 +08:00
David Monllao
2e5a8fd7aa Merge branch 'wip-mdl-56210' of https://github.com/rajeshtaneja/moodle 2016-10-03 13:53:29 +08:00
Rajesh Taneja
eed52d64bb
MDL-56210 behat: Ensure behat waits for dependancy manager 2016-09-30 10:19:09 +08:00
Eloy Lafuente (stronk7)
83edfba240 MDL-56127 forms: multiple select dependencies fixed
This is a fix for a regressions introduced by MDL-54778. It
seems that escaped all our tests because there isn't any case
of such a dependency in core, but Daniele Cordella was facing
it within his surveypro module.
2016-09-29 16:53:08 +02:00
Eloy Lafuente (stronk7)
d0deb28c24 Merge branch 'MDL-55804_master' of git://github.com/dmonllao/moodle 2016-09-29 01:14:33 +02:00
David Monllao
80180e0f92 MDL-55804 forms: Return exported data through _prepareValue 2016-09-27 08:11:56 +08:00
Dan Poltawski
62398cd807 Merge branch 'wip-MDL-55519-master' of git://github.com/abgreeve/moodle 2016-09-26 15:23:32 +01:00
Damyon Wiese
e584e6ae46 MDL-55071 theme/output: PHPCS fixes for new theme branch
Part of MDL-55071
2016-09-23 10:57:36 +01:00
Damyon Wiese
e8272e748c MDL-55071 theme_boost: Fix relevant JS warnings
Part of MDL-55071
2016-09-23 10:57:36 +01:00
Damyon Wiese
63e4df60f6 MDL-55839 behat: Behat fixes for theme_noname
This is a squash of many small fixes.
The list of changes are:

Initial set of behat selectors overrides required for new theme.

set core behat selectors if not overridden by theme

Remove pause

Fix for checkboxes not saving properly

Custom override for click in the user menu

Fix for behat guessing the field type.

Behat fix for guessing the correct field type.

Fix for missing closeElementBefore mforms mess.

Fix for textareas not displaying their contents.

Fix availability form element

Fix action menu selectors for activities in a course page

Fix textareas not retaining their values

Fix selector for blocks

I had to change the single select template to use an input instead of a button because of a
behat bug we have not tracked down yet.

Fix for frozen attribute in form elements

Use input instead of button while behat is still broken

Fix for navigation selector override

Behat selector fixes and multi-select fixes for templated select

Fix for configure blocks selector + booleans for autocomplete

Fixes for course_summary behat tests

Allow optgroups in single_select

Behat fixes for block_navigation

Fixes for url form element and activity chooser selectors

blocks_social - fix specific selector for behat

Fix export_for_template for selectgroups element.

Dont set empty id on the form

Fix direct call to behat_navigation in backup context

Checkbox empty value fix

Fix for assign grading panel popouts

file picker overrides to find a file manager in the page

Fix chat tests to use element name

Make selectors in mod_data behat less specific

MDL-55839: recent activity behat test relies on time()

SQUASH Honour mform element "class" attribute on the container

SQUASH Fixes for behat in mod_forum

SQUASH search form template showing value as text next to the button

SQUASH undo double selectgroup fix

SQUASH - The slightly different structure to action menus breaks course drag and drop

SQUASH Wrap loading icon in a span so the selector still works.

SQUASH Fix fragile javascript in report_loglive

SQUASH Fix tabtree, and selectgroups for mod_feedback

Also - do-not enhance the action menu - we are dropping support for this.

SQUASH Fix filemanager selector and pix_icon template for mod_forum tests.

SQUASH Fixes to breadcrumb and add formid to single select (fixes mod_glossary tests)

SQUASH lesson behat fixes. 95% of lesson styles were rubbish so they were disgarded.

SQUASH Fix lti behat tests - they were cheating and using a context step from quiz

SQUASH Behat fixes for quiz with new theme

SQUASH behat fixes for mod_wiki

SQUASH Workshop behat fixes

SQUASH Frozen form elements cannot use a readonly form element because it screws with the form JS "disabledIf" stuff.

SQUASH Fixes for grades behat tests

SQUASH behat fixes for groups

SQUASH blacklist action menu tests

SQUASH Fix for tag form element missing "manage standard tags" link

SQUASH Incomplete fixes for course behat tests

SQUASH behat fixes for badges

SQUASH Tags fixes for behat

SQUASH filepicker fixes for behat

SQUASH Abort guessing field type when we hit 'html'

SQUASH Fix for admin/tool/behat tests

SQUASH fix for admin tool behat tests

SQUASH fix for availabilty conditions hiding "aria-hidden" elements

SQUASH give the blocks more room. We get behat files because nav tree nodes are not in view

SQUASH Blocks fixed

Fix behaviour of unchecked checkboxes

SQUASH Remove incorrect step in user test

SQUASH behat fixes for course tests

Part of MDL-55071
2016-09-23 10:55:16 +01:00
Frederic Massart
0f24d9cb25 MDL-55830 form: Selectgroups option values where not passed to template
Part of MDL-55071
2016-09-23 10:55:16 +01:00
Andrew Nicols
2c3a6e2479 MDL-55657 theme_noname: Use a separate template for passwordunmask
Part of MDL-55071
2016-09-23 10:55:14 +01:00
Frederic Massart
fc7f69e7e8 MDL-51948 formslib: Support forcing LTR on form elements
Part of MDL-55071
2016-09-23 10:54:49 +01:00
Damyon Wiese
d6f2ce1486 MDL-55656 theme_noname: Include advanced and required field markup
The new form elements were not including the markup for advanced
and required fields. I used an <abbr> tag in the label to give
and accessible indication of the advanced and required fields.

Part of MDL-55071
2016-09-23 10:53:56 +01:00
Damyon Wiese
ce18fb1e86 MDL-55417 forms: Change iscancel property to issecondary for submit buttons
This is more future proof for the template.

Part of MDL-55071
2016-09-23 10:53:31 +01:00
Damyon Wiese
7e2cd5b84e MDL-55417 forms: Improve some of the new templates for form elements
Also - un-deprecate selectwithlink (Fred convinced me).

Part of MDL-55071
2016-09-23 10:53:30 +01:00
Damyon Wiese
97a00c9b8e MDL-55417 forms: Keep the JS for autocomplete in the template
Part of MDL-55071
2016-09-23 10:53:30 +01:00
Damyon Wiese
344321e1ef MDL-55417 forms: Clean up form element template patch
Use a trait and a base mustache template for all form elements to reduce code
duplication and increase standardisation.

Part of MDL-55071
2016-09-23 10:53:30 +01:00
Damyon Wiese
91bda4cd45 MDL-55417 forms: Render form elements with a template
This change allows form elements to be overridden with a mustache template.
The template can even listen for form validation errors and supply the JS to
change the look of the form element when there is/isn't a validation error.

Initial support is for all core form elements including:

text, select, selectyesno and checkboxes, groups, dateselector, datetimeselector,
autocomplete, modvisible, advcheckbox, button, duration, filemanager, filepicker, editor, static, grading,
warning, textarea, password, url, submit, questioncategory, recaptcha.

Part of MDL-55071
2016-09-23 10:53:30 +01:00
Damyon Wiese
88af020839 MDL-55411 theme_noname: Style the filepicker for bootstrap 4
Uses templates.

Part of MDL-55071
2016-09-23 10:49:49 +01:00
Adrian Greeve
6965ffe041 MDL-55519 activities: mform element shows correct maxgrade.
In certain circumstances the max grade value would revert
back to the default max grade value.
2016-09-20 08:56:24 +08:00
Marina Glancy
721e2def56 MDL-55123 forms: do not call non-static methods statically
this breaks in PHP7.1
2016-09-12 12:06:18 +08:00
Marina Glancy
64c45a2928 MDL-55123 forms: correctly create elements in unittests 2016-09-12 11:56:04 +08:00
Damyon Wiese
bb0b39b839 MDL-55520 forms: Properly format the grademax for the database 2016-08-16 11:19:51 +08:00
Damyon Wiese
c3d4d3f7c1 MDL-55520 forms: Mod grade is changing values back to default
When a field is disabled in the page - no value is sent and modgrade is reverting
to the default. This change prevents the max grade from changing accidentally.
2016-08-11 14:43:05 +08:00
Dan Poltawski
3a0bc0fdc4 MDL-55244 js: build changes
There should be no changes to minified code
2016-07-25 07:58:05 +01:00
Dan Poltawski
bc8b6dc652 MDL-55244 js: fix various lint warnings in yui
* Incorrect brace style
* Empty functions
* Multiple var statemnts
2016-07-25 07:53:05 +01:00
Dan Poltawski
5bb4f444de MDL-55244 js: fix problems with eslint --fix
eslint --fix '**/yui/src/**/*.js'
2016-07-25 07:53:05 +01:00
Dan Poltawski
ad3f8cd18c MDL-54944 eslint: make the .eslintrc default stricter
Instead of using the more rollup-tolerant config for all files, make the
configuration stricter by default but lower in grunt for yui modules.

This means that manual runs (prechecker) or editor integrations will
flag up the errors as well as grunt.

Also add ignore lines to the core files so that eslint isn't noisy when
not running with grunt.
2016-07-11 12:44:34 +01:00
Eloy Lafuente (stronk7)
e40dd1cdcd MDL-54778 form: Make it all js style (eslint) compliant
The changes in this commit should not be problematic, just:

- different whitespace.
- some docs.
- 1 variable to camelCase.

And then, less trivial, but safe enough IMO:

- a change to camelCase some identifiers and their calculation.
2016-06-22 01:29:51 +02:00
Andrew Nicols
badbaa64e3 MDL-54778 form: Fix lots of issues with form dependencies
The original issue here was that each loop of the named values did not
check for prototypal properties. As a result, if there were input fields
with names such as 'sort', 'valueOf', 'constructor', etc. these would
return their prototypal functions instead of a falsy value, and be treated
as though they are array - hence the 'Cannot push to Function' type error.

Following on from this I discovered that the data stores were being created
as arrays, but used as objects. This can also cause issues with some form
input names -- e.g. if they are numeric.

These two issues were resolved together by correctly storing them in
objects, and checking that those objects had real properties
(hasOwnProperty). This itself has to use the prototypal function to cater
for the potential of a field name called 'hasOwnProperty'.

I also found that the instance value stores were being initialised in the
prototype (and therefore shared), which meant that there were numerous
issues if two forms were present on the same page, or one form replaced an
existing one (e.g. forms initialised in JS).

In addition, it also became apparant that several values were being used
outside of scope, or in the wrong scope. This caused further issues when
creating multiple forms on a page.
2016-06-21 07:58:13 +08:00
Marina Glancy
6ee5e596b8 MDL-54837 tags: fixed bug when collection is locked
also fixed fatal error for upgraded plugins that did not pass tag
component to the tag form element
2016-06-07 08:38:39 +08:00
Marina Glancy
4ca17b63a1 MDL-54666 modedit: use default values when modgrade element is frozen 2016-05-21 12:37:46 +08:00
Eloy Lafuente (stronk7)
973641fe13 MDL-54666 tests: Verify that any activity keeps the settings
This was affecting both to rateable (forum...) and not rateable
(assignment...) activities. So tests have been completed to verify
that now saving is performed and the correct scale values stored.
2016-05-20 23:48:25 +02:00
Frederic Massart
440b4c54ca MDL-53957 form: Support frontpage for selection in course element 2016-05-06 09:27:31 +08:00
Skylar Kelty
e594a6a8e9 MDL-53889 forms: Fix course field values after multiple value updates 2016-05-06 09:27:30 +08:00
Adrian Greeve
1a9068ae01 MDL-53888 mod_url: Choose a link option now works.
Fixed a regression from MDL-50484.
2016-05-06 09:27:28 +08:00
Damyon Wiese
821ab1bf9b MDL-52954 assign: Behat fixes because the assign grading ui has changed 2016-04-15 15:57:56 +08:00
Eric Merrill
427e3cbcd6 MDL-53167 search: Add ability to limit courses searched 2016-04-07 14:41:59 -04:00
Andrew Nicols
82eb2cf1be MDL-53577 JS: get_string requires component 2016-04-07 12:10:26 +08:00
Ben Tindell
a2fb838e82 MDL-53577 repository: Added maxbytes error message
Changing the error message that is displayed to users when they
upload a file that is greater than the maximum upload size. Does not
include all upload cases; focuses on those most used by students.
2016-04-04 15:33:40 -05:00
Rajesh Taneja
b73e5047af MDL-46891 core_grade: Steps are not valid as element is disabled 2016-03-11 10:51:16 +08:00
Damyon Wiese
235ef57a3d MDL-51324 forms: Add a new course selector
This is a squashed commit containing a number of changes:

This is an ajax driven course selector that has searching etc. It can select single, or multiple courses.
Make course selector accept a list of courses to exclude
courseselector - lookup coursename on setValue
Use the get_course_display_name_in_list function to generate the course names
Add a throttle to auto-complete to reduce spamming the server
Do a single query to fetch all the courses in the mform element when validation fails
Fix core course search function to return results when there are less than 2 chars in the query.
Handle setData with an empty array in new course selector
2016-03-09 13:30:18 +08:00
David Monllao
406151d8e2 Merge branch 'wip-mdl-53300' of https://github.com/rajeshtaneja/moodle 2016-03-08 16:13:42 +08:00
Rajesh Taneja
bdd4bed8b5 MDL-53300 core_grade: use currentgradetype if modgrade_type is not set
If mod has grades, then while upgrading
modgrade_type is disabled. This will not post
it with form and hence validation fails.
To avoid above problem, use ->currentgradetype
if modgrade_type is not set
2016-03-01 16:38:59 +08:00
Andrew Nicols
cf633c555e MDL-30811 form: Remove continue from test. 2016-03-01 12:11:10 +08:00
Rajesh Taneja
1ebda3eb8c MDL-50484 lib_formslib: Persistant input should have different id
Persistant input is appended for frozen elements
and should have different id then the actual element
2016-02-19 14:00:04 +08:00
Dan Poltawski
220f8115d9 Merge branch 'MDL-44626-master' of git://github.com/andrewnicols/moodle 2016-02-15 10:36:20 +00:00
Andrew Nicols
658a922fa6 MDL-44626 repository: Correct error message when uploading large files 2016-02-11 08:08:57 +08:00
Mark Nelson
1b8bd51c06 MDL-48634 core_form: added behat test for 'modgrade' validation 2016-02-09 17:46:42 +08:00