[MGNLUI-8640] JcrHasChildrenRule includes not persisted items Created: 22/Dec/23  Updated: 15/Jan/24  Resolved: 11/Jan/24

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.41
Fix Version/s: 6.3.0, 6.2.42

Type: Bug Priority: Neutral
Reporter: Carlos Cantalapiedra Assignee: Roman Kovařík
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Team: Nucleus
Work Started:
Approved:
Yes

 Description   

Steps to reproduce

  1.  Go to a content app definition file (it happens for all, but I will reproduce the steps for Categories app)
  2.  Edit the categories-app.yaml file
  3. At the AddCategory" action, include under the _notDeleted rule the following:
    hasNode:
      $type: jcrHasChildrenRule
      nodeTypes:
        - mgnl:category
      negate: true
  1. Now set the displayName as required field (this is for allowing the Cancel action)
  2. Go to Categories App, select a Category which has no Childs and check the _Add category" action is enabled
  3. Click on it and try to save the dialog (check the required field is highlighted)
  4. Close the detail subApp and check that the Add category action is disabled
  5. If you click on another category and back to the one you tried to create the nested category, you will se the action is enabled again

For pages app:

  1. Go to Resources app and edit the pages-app definition file
  2. At the "Add" action, include under the NotDeleted rule the following snippet:
    hasNode:
      $type: jcrHasChildrenRule
      negate: true
  1. Now go to pages app, select a page with no Childs (as /travel/destinations) and click on the Add page action.
  2. Full fill the first Dialog screen (Page name and template) and click on "Next"
  3. Click on "Cancel"
  4. Check the "Add page" action is disabled

Expected results

You do not need to refresh the browser or switch between items to get the action enabled again

Actual results

The action is disabled till you perform a browser refresh or switch between items

Workaround

The mentioned above

Development notes

N/A


Generated at Mon Feb 12 09:57:01 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.