[MGNLUI-4328] ModalityLevel#NON_MODAL has to be same between the name and its constant value Created: 23/Nov/17  Updated: 08/Mar/21  Resolved: 08/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.5.7, 5.6
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Ilgun Ilgun Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: quickwin
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

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:

 Description   
public static enum ModalityLevel {
        STRONG("strong", "modality-strong"),
        LIGHT("light", "modality-light center-vertical"),
        NON_MODAL("non-modal", "modality-non-modal");
}

When one defines a dialogDefinition with modalityLevel and set it to 'NON-MODAL', our system doesn't pick up the correct enum constant for that, simply because we check for the info.magnolia.ui.api.overlay.OverlayLayer.ModalityLevel#getName() method . However, If user tries to define it as 'NON_MODAL' which is the constant value, then system will not pick it up because info.magnolia.ui.api.overlay.OverlayLayer.ModalityLevel#getName() method is not able to find it and our configuration sources is not complaining about it at this time.

So to sum up:

  • Define as 'non_modal' -> dialog doesn't work but configuration sources do not complain.
  • Define as 'non-modal' -> dialog works but configuration sources complain.

FYI: It's also reproducible in JCR

A quick solution could be to simply have those values equal.

Quick Dialog Definition:

modalityLevel: non_modal
form:
  tabs:
    - name: tabText
      label: Text
      fields:
        - name: title
          class: info.magnolia.ui.form.field.definition.TextFieldDefinition
          label: Title
actions:
  commit:
    class: info.magnolia.ui.admincentral.dialog.action.SaveDialogActionDefinition
    label: Save
  cancel:
    class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition
    label: Cancel


 Comments   
Comment by Roman Kovařík [ 08/Mar/21 ]

Closing this as ModalityLevel is deprecated.

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