Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to correctly type portlet configuration #59

Open
jwanner83 opened this issue Nov 10, 2023 · 0 comments
Open

Add option to correctly type portlet configuration #59

jwanner83 opened this issue Nov 10, 2023 · 0 comments

Comments

@jwanner83
Copy link
Owner

Currently, the configuration feature of portlets, doesn't output the required type.

For these configurations:

{
  "system": {
  },
  "portletInstance": {
    "fields": {
      "a-float": {
        "type": "float",
        "name": "A float",
        "description": "A floating point number",
        "default": "1.1"
      },
      "a-number": {
        "type": "number",
        "name": "A number",
        "description": "An integer number",
        "default": "48"
      },
      "a-string": {
        "type": "string",
        "name": "A string",
        "description": "An arbitrary length string",
        "default": "this is a string"
      },
      "a-boolean": {
        "type": "boolean",
        "name": "A boolean",
        "description": "A true / false value",
        "default": true
      },
      "an-option": {
        "type": "string",
        "name": "An option",
        "description": "A restricted values option",
        "required": true,
        "default": "A",
        "options": {
          "A": "Option a",
          "B": "Option b"
        }
      }
    }
  }
}

... the following configuration is available in the portlet:

{
  "portletInstance": {
    "a-string": "this is a string",
    "a-boolean": "true",
    "a-float": "1.1",
    "a-number": "48",
    "an-option": "A"
  },
  "system": {}
}

Add an option to the liferay npm bundler improved which corrects the output according to the given types and, as well, adds the default values, even when the config hasn't been saved.

Maybe add a flag like --correct-configuration or an option to the .npmbundlerrc

@jwanner83 jwanner83 added this to the Version 1.5.0 milestone Nov 10, 2023
@jwanner83 jwanner83 removed this from the Version 1.5.0 milestone Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant