Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57280

Make it easier to create adhoc modal types

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3
    • Component/s: JavaScript
    • Labels:
    • Testing Instructions:
      Hide

      Test 1

      I've included a testing commit on top of the changes to create a page that launches a few different types of modals. If you cherry-pick that commit then you should be able to go to <your_moodle_instance>/testmodal.php to do the testing.

      The testing commit can be found here:
      git@github.com:ryanwyllie/moodle.git MDL-57280-master-test
      a9f0c99ed20a2f15abe9216239da7d7a3677bba7

      Click each of the links to launch the corresponding modals. They should all launch a different modal.

      The last link should launch a modal that was registered at run time and isn't a default type that is pre-loaded in the factory.

      Test 2 - Existing modal

      1. Create a site with two users
      2. Log in as user 1 and send a message to user 2
      3. Log in as user 2 and view the message you received in the messaging page
      4. Click the "edit" button to toggle on the deletion mode of messaging
      5. Click the "Delete all" link
      6. Confirm that the yes/no modal opens up
      Show
      Test 1 I've included a testing commit on top of the changes to create a page that launches a few different types of modals. If you cherry-pick that commit then you should be able to go to <your_moodle_instance>/testmodal.php to do the testing. The testing commit can be found here: git@github.com:ryanwyllie/moodle.git MDL-57280 -master-test a9f0c99ed20a2f15abe9216239da7d7a3677bba7 Click each of the links to launch the corresponding modals. They should all launch a different modal. The last link should launch a modal that was registered at run time and isn't a default type that is pre-loaded in the factory. Test 2 - Existing modal Create a site with two users Log in as user 1 and send a message to user 2 Log in as user 2 and view the message you received in the messaging page Click the "edit" button to toggle on the deletion mode of messaging Click the "Delete all" link Confirm that the yes/no modal opens up
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-57280-master

      Description

      When writing the docs for the AMD modal I realised there was too much heavy lifting required if someone wanted to create an adhoc modal type just for use within their plugin or what ever.

      They would need to handle all of the creation and focus management and stuff themselves because the factory only worked for hardcoded core modal types.

      Instead the factory should use a modal types registry, rather than a hardcoded list, that allows people to register their own modal types at run time and leverage the functionality of the factory to created them.

        Attachments

          Activity

            People

            Assignee:
            ryanwyllie Ryan Wyllie
            Reporter:
            ryanwyllie Ryan Wyllie
            Peer reviewer:
            Adrian Greeve
            Integrator:
            David Monllaó
            Tester:
            Ankit Agarwal
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              15/May/17