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

Correct usage of debounce calls within event handlers

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MDL-77352-401
    • Hide

      Existing Behat scenarios will confirm the search functionality being changed still works, here we can assert the debouncing now functions correctly when typing quickly:

      1. Log in as admin
      2. Navigate to Language > Language packs in site administration
      3. Quickly type a long string of characters into the Search field
      4. Confirm the Available language packs element only updates once you've finished typing
      5. Navigate to Reports from user menu
      6. Create a new report from Users report source
      7. Quickly type a long string of characters into the Search field
      8. Confirm the column list only updates once you've finished typing
      Show
      Existing Behat scenarios will confirm the search functionality being changed still works, here we can assert the debouncing now functions correctly when typing quickly: Log in as admin Navigate to Language > Language packs in site administration Quickly type a long string of characters into the Search field Confirm the Available language packs element only updates once you've finished typing Navigate to Reports from user menu Create a new report from Users report source Quickly type a long string of characters into the Search field Confirm the column list only updates once you've finished typing

      As noted by dobedobedoh while reviewing MDL-77172 - we need to define the debouncer method outside the event, otherwise (when using keyup event) every time the event is triggered it will create a new debouncer

      The point of the debounce usage when searching is to allow the user to finish typing before the search action is executed, but this isn't currently happening (effectively making the debounce use redundant):

      We should fix that

        1. 400_lang.gif
          400_lang.gif
          62 kB
        2. 400_report.gif
          400_report.gif
          102 kB
        3. 401_lang.gif
          401_lang.gif
          122 kB
        4. 401_report.gif
          401_report.gif
          109 kB
        5. langimport.gif
          langimport.gif
          63 kB
        6. master_lang.gif
          master_lang.gif
          107 kB
        7. master_report.gif
          master_report.gif
          125 kB
        8. reportbuilder.gif
          reportbuilder.gif
          79 kB

            pholden Paul Holden
            pholden Paul Holden
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 59 minutes
                59m

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