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

Inplace editable loading icon stopped spinning since conversion to SVG

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-82909-403
    • MDL-82909-404
    • Hide

      Setup

      1. In order to test this, it's easier to see the result if we introduce artificial delays in order to observe the loading icon in effect
      2. Apply the following patch:

        $ git diff
        diff --git a/lib/table/classes/external/dynamic/get.php b/lib/table/classes/external/dynamic/get.php
        index 32fbce7e5e0..f61541b304b 100644
        --- a/lib/table/classes/external/dynamic/get.php
        +++ b/lib/table/classes/external/dynamic/get.php
        @@ -214,6 +214,8 @@ class get extends external_api {
                     throw new \UnexpectedValueException("The filter specified ({$filtersetclass}) is invalid.");
                 }
         
        +        sleep(2);
        +
                 $filterset = new $filtersetclass();
                 $filterset->set_join_type($jointype);
                 foreach ($filters as $rawfilter) {
        diff --git a/reportbuilder/classes/output/column_aggregation_editable.php b/reportbuilder/classes/output/column_aggregation_editable.php
        index 1b42f83c287..5434cfb6709 100644
        --- a/reportbuilder/classes/output/column_aggregation_editable.php
        +++ b/reportbuilder/classes/output/column_aggregation_editable.php
        @@ -75,6 +75,7 @@ class column_aggregation_editable extends inplace_editable {
                 $column = new column($columnid);
         
                 $report = $column->get_report();
        +        sleep(2);
         
                 external_api::validate_context($report->get_context());
                 permission::require_can_edit_report($report);
        

      Test

      1. Log in as admin
      2. Navigate to Reports from user menu
      3. Create new report from Users report source
        • Include default setup: Yes
      4. Set User > Username aggregation to Count
      5. Confirm the icon next to the Count element shows a rotating spinner
      6. Confirm the inner table element shows a larger rotating spinner as it reloads (after the editable component has completed)
      Show
      Setup In order to test this, it's easier to see the result if we introduce artificial delays in order to observe the loading icon in effect Apply the following patch: $ git diff diff --git a/lib/table/classes/external/dynamic/get.php b/lib/table/classes/external/dynamic/get.php index 32fbce7e5e0..f61541b304b 100644 --- a/lib/table/classes/external/dynamic/get.php +++ b/lib/table/classes/external/dynamic/get.php @@ -214,6 +214,8 @@ class get extends external_api { throw new \UnexpectedValueException("The filter specified ({$filtersetclass}) is invalid."); } + sleep(2); + $filterset = new $filtersetclass(); $filterset->set_join_type($jointype); foreach ($filters as $rawfilter) { diff --git a/reportbuilder/classes/output/column_aggregation_editable.php b/reportbuilder/classes/output/column_aggregation_editable.php index 1b42f83c287..5434cfb6709 100644 --- a/reportbuilder/classes/output/column_aggregation_editable.php +++ b/reportbuilder/classes/output/column_aggregation_editable.php @@ -75,6 +75,7 @@ class column_aggregation_editable extends inplace_editable { $column = new column($columnid); $report = $column->get_report(); + sleep(2); external_api::validate_context($report->get_context()); permission::require_can_edit_report($report); Test Log in as admin Navigate to Reports from user menu Create new report from Users report source Include default setup: Yes Set User > Username aggregation to Count Confirm the icon next to the Count element shows a rotating spinner Confirm the inner table element shows a larger rotating spinner as it reloads (after the editable component has completed)

      I noticed this when fixing MDL-82811

      The inplace editable component prior to 4.3 displayed a loading spinner while updating:

      Since SVG files were added in MDL-67271 (4.3), they took precedence over gif icons, which means the following is shown instead of the loading spinner:

      The static SVG has been recently updated in MDL-82497 but the problem remains

      The inplace editable module itself shouldn't be trying to implement this loading icon anyway, as we already have a module to do just that ('core/loadingicon') so we should just use it

        1. (1) 5 Passed -- (Main)MDL-82909.png
          (1) 5 Passed -- (Main)MDL-82909.png
          69 kB
        2. (1) 6 Passed -- (Main)MDL-82909.png
          (1) 6 Passed -- (Main)MDL-82909.png
          109 kB
        3. 402.gif
          402.gif
          30 kB
        4. main.gif
          main.gif
          20 kB

            pholden Paul Holden
            pholden Paul Holden
            Odei Alba Odei Alba
            Ilya Tregubov Ilya Tregubov
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 12 minutes
                4h 12m

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