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

Make it easier to create adhoc modal types

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.3
    • 3.2
    • JavaScript
    • MOODLE_32_STABLE
    • MOODLE_33_STABLE
    • MDL-57280-master
    • 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

      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.

            ryanwyllie Ryan Wyllie
            ryanwyllie Ryan Wyllie
            Adrian Greeve Adrian Greeve
            David Monllaó David Monllaó
            Ankit Agarwal Ankit Agarwal
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.