[PAGES-259] When creating a page I should eventually be taken into edit mode Created: 11/Mar/20  Updated: 25/Mar/21  Resolved: 23/Mar/21

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

Type: Improvement Priority: Low
Reporter: Richard Gange Assignee: Unassigned
Resolution: Workaround exists Votes: 1
Labels: ux
Remaining Estimate: 0d
Time Spent: 0.25d
Original Estimate: Not Specified

Issue Links:
relation
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)
Date of First Response:

 Description   

From a UX perspective I think the flow of creating a new page should be:

  • Click "Add Page"
  • Present the page properties dialog
  • Open the page for editing

So in the end I am looking at the new page in edit mode rather than returning back to the page browser. Much like how Confluence works. You click create and land in edit mode.

This also solves the corner case when a page that has inherited content. Consider a 404 page that doesn't need to be edited but inherits the footer from the site. If the page is never opened for editing then the footer area node is never created. If it get's created for the first time on public this can lead to a permissions exception as the node is created by the anonymous user.

mgnl:createdBy = System [anonymous]

The anonymous user only has read permission.

Caused by: javax.jcr.ItemExistsException: Same name sibling not allowed for node /fe2/404/footerNavigation by definition * (declaring type mgnl:content)

The reproduce the issue:

  • Create new page that contains an area node
  • Do not open in editMode but publish directly
  • Open page on public in incognito mode (= not logged in)
  • Go to node in JCR app on public
  • see property mgnl:created=System[anonymous] on newly created area node
  • Open page on author instance in edit mode and edit something
  • Try to re-publish the page --> unsuccessful

Dev Notes

  • It should be configurable that I am taken into edit mode or stay in the browser.
  • Move to a configured action chain in the dialog and deprecate CreatePageChainedActionDefinition
    /pages-app/dialogs/createPage.yaml
    actions:
      close:
        $type: closeAction
        availability:
          root: true
      commit:
        $type: chainedAction
        actions:
          createPage:
            class: info.magnolia.pages.app.action.browser.CreatePageActionDefinition
          editProperties:
            class: info.magnolia.pages.app.action.browser.EditPagePropertiesActionDefinition
            populate: false
            availability:
              root: true
              rules:
                isValidFormRule:
                  class: info.magnolia.pages.app.action.browser.IsValidFormRuleDefinition
    

Workaround
On the page properties dialog configure the action to open the detail subapp:

actions:
  close:
    $type: closeAction
    availability:
      root: true
  commit:
    $type: chainedAction
    actions:
      commit:
        $type: commitAction
      openDetailSubapp:
        $type: openDetailSubappAction
        appName: pages-app
        subAppName: detail
        viewType: edit


 Comments   
Comment by Richard Gange [ 23/Mar/21 ]

I think in this case the workaround is acceptable. Which ever page types should open in edit mode add the appropriate config to the dialog.

Comment by Vivian Steller [ 25/Mar/21 ]

Thanks Richard for your response.

Though, I would have preferred to see a "true" and clean solution to this. Precisely: the logic to execute auto-creation should be removed from the view/rendering layer (the area element/directive) and should be better moved into an observer, for instance.

This way, cool use cases would be possible:

  • graduate the feature and re-use it for content-types to auto-create structures
  • decouple from editing, e.g. auto-creation would work when you created the page via a command without direct author interaction (e.g. an archive page created on a monthly basis) or by some import
  • also adding areas / auto created content to a page definition after a page has been created would be supported; in that case pages would be automatically being synched with their definition which would be an awesome time saver since it avoids very complicated migration scripts; effectively it would be something like live-copy but on a more static layer

The observer would have to observe page creation and page/component definition changes.

Moreover, architecturally it'd be a much more proper solution.

Generated at Mon Feb 12 06:17:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.