[BUG FIX] [MER-5610] Fix all pages duplication#6565
[BUG FIX] [MER-5610] Fix all pages duplication#6565darrensiegel wants to merge 1 commit intomasterfrom
Conversation
AI Review — performanceNo issues found |
AI Review — uiUnhandled multiple parent containers can crash duplicate actionfile: lib/oli_web/live/resources/pages_view.ex Unhandled multiple parent containers can crash duplicate actionfile: lib/oli_web/live/workspaces/course_author/pages_live.ex |
AI Review — securityMissing containment check allows duplicating pages without a parentfile: lib/oli/authoring/editing/container_editor.ex |
AI Review — elixirDuplicate action can crash on pages with multiple parentsfile: lib/oli_web/live/resources/pages_view.ex Duplicate action can crash on pages with multiple parentsfile: lib/oli_web/live/workspaces/course_author/pages_live.ex |
There were two different implementations for page duplication, one in the Curriculum view and one in the All Pages view. The latter was broken, badly. This was proven in a unit tests (now deleted) that shows it reversed activities and didn't duplicate them.
This PR refactors to allow the correct Curriculum impl to be used in both places.
The added unit test demonstrates that the Curriculum impl has the properties that we need: preserving order or and duplicating activities.
Tested locally and works as expected.