improve block dimension saving to DB on block resize

Bug #1893591 reported by Cecilia Vela Gurovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned
20.04
Fix Released
Medium
Unassigned
20.10
Fix Released
Medium
Unassigned
21.04
Fix Released
Medium
Unassigned

Bug Description

When editing a page, the way we save the block dimensions is not efficient and can be improved.

When resizing a block there are multiple ajax calls even before the resizing stops.

Changed in mahara:
status: New → In Progress
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
Changed in mahara:
importance: Undecided → Medium
milestone: none → 20.10.0
Changed in mahara:
milestone: 20.10.0 → 21.04.0
Revision history for this message
Cecilia Vela Gurovic (ceciliavg) wrote :
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/11391

Revision history for this message
Rangi Daymond (rangid) wrote : Re: improve block dimension saving on DB
Download full text (3.5 KiB)

Gerrit: https://reviews.mahara.org/#/c/11391/ patch set 3
Platforms: Ubuntu-Firefox, Win10-Chrome, Win10-Edge, iOS14-Safari & Android10-Chrome
Theme: Raw

Preconditions:
a) the 19.04_STABLE codebase is present with a clean database
b) The logged in Mahara site administrator account creates:
   - 'Original 19.04 single block - page1' with one large text block, and,
   - 'Original 19.04 4 block - page2', use 3 column layout & populate with:
      * text block in column1
      * image block in column2
      * files to download block in column3
      * image gallery block in column2 underneath the image block
c) The logged in account creates 5 copies (one for use in each browser above) of each page created in b)
d) Apply the patch and upgrade the database.

Repeat the following 3 test scenarios for each of the five platforms given above, vary the site theme on each.

Test scenario 1: Verify that a simple page created in Mahara 19.04 can be upgraded to gridstack and successfully edited in Mahara 20.10.
Test steps:
1.1 Log in using the above Mahara account.
1.2 Navigate to 'Main menu' > 'Create' > 'Pages and collections' and select to view copy1 of page1.
Expected result: 'copy1.1 page1' displays successfully.
1.3 Select to edit 'copy1.1 page1' and agree to upgrade just this page to use grid stack.
Expected result: 'copy1.1 page1' displays in edit mode.
1.4 Select to add a new text block with content:
    - after the existing text block, and then,
    - before the existing text block.
Expected result: The new blocks and their content are added successfully.
1.5 Resize each of the blocks so they can be positioned next to each other in 3 columns then view the page.
Expected result: The blocks are resized and repositioned successfully, the page view is as expected.

Test scenario 2: Verify that a page with multiple different blocks created in Mahara 19.04 can be upgraded to gridstack and successfully edited in Mahara 20.10.
Test steps:
1.1 Log in using the above Mahara account.
1.2 Navigate to 'Main menu' > 'Create' > 'Pages and collections' and select to view copy1 of page2.
Expected result: 'copy1.1 page2' displays successfully.
1.3 Select to edit 'copy1.1 page2' and agree to upgrade just this page to use grid stack.
Expected result: 'copy1.1 page2' displays in edit mode.
1.4 Select to add a new block with content:
    - before the existing blocks, and then,
    - after the existing blocks.
Expected result: The new blocks and their content are added successfully.
1.5 Resize and reposition the blocks then view the page.
Expected result: The blocks are resized and repositioned successfully, the page view is as expected.

Test scenario 3: Verify that a page created in Mahara 19.04 can be copied and successfully edited in Mahara 20.10.
Test steps:
1.1 Log in using the above Mahara account.
1.2 Navigate to 'Main menu' > 'Create' > 'Pages and collections' and select to copy the original page2 then view it.
Expected result: copied 'copy1.2 page2 displays successfully.
1.3 Select to edit 'copy1.2 page2'
Expected result: 'copy1.2 page2' displays in edit mode - no upgrade prompt is displayed.
1.4 Select to add a new block with content:
    - before the exist...

Read more...

Revision history for this message
Rangi Daymond (rangid) wrote :

Catalyst QA Testing - FAILED
Gerrit: https://reviews.mahara.org/#/c/11391/ patch set 3
Platforms:
  ✘ Ubuntu-Firefox Theme: Raw
  ✘ Win10-Chrome Theme: Primary school
  ✘ Win10-Edge Theme: Default
  ✘ iOS14-Safari Theme: Default
  n/a Android10-Chrome Theme: Default

In all cases test scenario 1 test case 1.4 failed. When the updated page with two new blocks (first added after the existing one and the second added before the existing one) was displayed, the newly added blocks were automatically re-positioned incorrectly (in various ways - please see comments on the patch).

When test scenario 4 was executed (new page, populate first block with several paragraphs of text then resize it to use entire width of the page, add block 2 to the bottom of the page and add block 3 to the top of the page --> display the page) the same problems occurred.

Changed in mahara:
assignee: Cecilia Vela Gurovic (ceciliavg) → nobody
milestone: 21.04.0 → 21.10.0
Revision history for this message
Robert Lyon (robertl-9) wrote :

The patch https://reviews.mahara.org/#/c/11391/ is meant to fix part of the problems mentioned here

To test:
Load up a page with 3 blocks on it
Then open developer tools (F12) in FF and go to console tab and then turn off all the options at the right except XHR
Resize one block

In core
As you drag the resize arrow it sends off XHR calls to save the data and the more you drag it the more calls

In patch
There is only saving of blocks once you let go of the resizer - one save per block

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11391
Committed: https://git.mahara.org/mahara/mahara/commit/d1e1b6146553cf2ca1b9264197c3fd4d1747f6cc
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit d1e1b6146553cf2ca1b9264197c3fd4d1747f6cc
Author: Robert Lyon <email address hidden>
Date: Tue Oct 20 10:12:52 2020 +1300

Bug 1893591: triggering block dimension saving correctly

Also avoiding doing the saving of the resized block twice

Change-Id: I20945288b5e019d3806c220ae9b1f2db0d06d648
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9)
summary: - improve block dimension saving on DB
+ improve block dimension saving to DB on block resize
description: updated
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "20.10_STABLE" branch: https://reviews.mahara.org/11967

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "20.04_STABLE" branch: https://reviews.mahara.org/11968

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/11968
Committed: https://git.mahara.org/mahara/mahara/commit/e0451d746cb51111c613aa43f5bb1c04a7c4ea79
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.04_STABLE

commit e0451d746cb51111c613aa43f5bb1c04a7c4ea79
Author: Robert Lyon <email address hidden>
Date: Tue Oct 20 10:12:52 2020 +1300

Bug 1893591: triggering block dimension saving correctly

Also avoiding doing the saving of the resized block twice

Change-Id: I20945288b5e019d3806c220ae9b1f2db0d06d648
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit d1e1b6146553cf2ca1b9264197c3fd4d1747f6cc)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/11967
Committed: https://git.mahara.org/mahara/mahara/commit/adcff6e93471f2dec90a069e5a0229ab88dacaf5
Submitter: Robert Lyon (<email address hidden>)
Branch: 20.10_STABLE

commit adcff6e93471f2dec90a069e5a0229ab88dacaf5
Author: Robert Lyon <email address hidden>
Date: Tue Oct 20 10:12:52 2020 +1300

Bug 1893591: triggering block dimension saving correctly

Also avoiding doing the saving of the resized block twice

Change-Id: I20945288b5e019d3806c220ae9b1f2db0d06d648
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit d1e1b6146553cf2ca1b9264197c3fd4d1747f6cc)

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/11966
Committed: https://git.mahara.org/mahara/mahara/commit/e5255a376ec56cb9d8eea8d8da26a66fdfd05b4d
Submitter: Robert Lyon (<email address hidden>)
Branch: 21.04_STABLE

commit e5255a376ec56cb9d8eea8d8da26a66fdfd05b4d
Author: Robert Lyon <email address hidden>
Date: Tue Oct 20 10:12:52 2020 +1300

Bug 1893591: triggering block dimension saving correctly

Also avoiding doing the saving of the resized block twice

Change-Id: I20945288b5e019d3806c220ae9b1f2db0d06d648
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit d1e1b6146553cf2ca1b9264197c3fd4d1747f6cc)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "main" branch: https://reviews.mahara.org/12082

no longer affects: mahara/21.10
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.