[PAGES-271] Aborting page properties dialog leaves traces in workspace Created: 19/Mar/20  Updated: 23/Aug/21  Resolved: 14/May/20

Status: Closed
Project: Magnolia pages module
Component/s: None
Affects Version/s: 6.2
Fix Version/s: 6.2.1

Type: Bug Priority: Neutral
Reporter: Michael Duerig Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: 0d Remaining Estimate: 0d
Σ Time Spent: 3h 31m Time Spent: 3h 31m
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PDF File create-page.pdf    
Issue Links:
Relates
relates to MGNLUI-5735 Form view does not indicate/highlight... Closed
relates to PAGES-248 A validation error for missing cookie... Closed
relates to MGNLUI-5949 As a dev I want to create multi-step ... Closed
causality
is causing PAGES-470 Concurrent creation of pages/componen... Closed
dependency
is depended upon by PAGES-247 Add page dialog throws exception on e... Closed
supersession
supersedes PAGES-290 Actionbar and selected item state cha... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
PAGES-291 Committing page properties after abor... Sub-task Closed  
PAGES-290 Actionbar and selected item state cha... Sub-task Closed  
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Migrate apps to new UI framework
Sprint: UI Framework 21, UI Framework 22, TE 1, TE 2
Story Points: 5

 Description   

Steps to reproduce

  • In pages app create a new page, give it a name, click next
  • In the pages properties dialog click commit. (A validation error is shown)
  • In the pages properties dialog click cancel.

Observed behaviour

A new page is created however it is missing the mandatory cookie consent wording - compliance type. This can be seen by opening the pages properties dialog for the newly created page.

Expected behaviour

When cancelling the pages properties dialog on a new page, no page should be created at all.

Notes

The page node is already created when clicking next on the initial add node dialog right before the page properties dialog appears. It is at this point where the "invalid" page is persisted.

According to rkovarik there was a decision at some point to not keep unsaved changes in memory between request. As a consequence we need to rethink how to do validation across multiple request.



 Comments   
Comment by Rishab Dhar [ 15/Apr/20 ]

apchelintcev Alternative solution to sharing data between actions to delay page creation until commit has been triggered on Page properties dialog by the user.

There are two side-effects that need to tackled:

  • A custom commit action for pages-app is required to perform page creation. ConfiguredFormDialogDefinition has hardcoded commit Action. In case of page dialogs, this can be easily overridden in yaml, but a way needs to be found that this behavior is not broken, i.e. any custom actions created by customer are triggered after page creation.
  • The current validation logic for page name and page template relies on page being created/not created in CreatePageAction to abort execution of InitPagePropertiesAction. In this incarnation of the solution, the Page in the value context will always be the same.

[^create_page.pdf]

Comment by Rishab Dhar [ 30/Apr/20 ]

Reworks the internal workflow of page creation by wrapping newly created Pages which have a configured dialog into NewRenderableNodeWrapper. The metadata that needs to configured for newly created Page/Component is shared using RenderableNodeMetadata as DTO.

  • Add NewRenderableNodeWrapper to set page/component properties when the JCR Node is interacted with
    Add RenderableNodeMetadata as a DTO for sharing newly created page/component metadata with NewRenderableNodeWrapper.
    Refactor CreatePageAction and CreateComponentAction to use NewRenderableNodeWrapper when a dialog is configured
    Update CloseHandler logic in EditPagePropertiesAction to reset ValueContext to prevent issues PAGES-290 and PAGES-291
  • Adjust CreatePageActionTest for the refactorings
  • Comment out tests related to validation with a TODO reference to PAGES-247
Generated at Mon Feb 12 06:17:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.