Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-4328

ModalityLevel#NON_MODAL has to be same between the name and its constant value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Neutral Neutral
    • None
    • 5.5.7, 5.6
    • None

      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
      

        Acceptance criteria

              Unassigned Unassigned
              ilgun Ilgun Ilgun
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD