Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

[FEATURE] Conditionnal Demo #34

Open
GuillaumeFalourd opened this issue Dec 22, 2020 · 1 comment
Open

[FEATURE] Conditionnal Demo #34

GuillaumeFalourd opened this issue Dec 22, 2020 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers

Comments

@GuillaumeFalourd
Copy link
Contributor

GuillaumeFalourd commented Dec 22, 2020

What would you like to be added:

A formula demonstration showing how to use the conditionnal opcional fields on the config.json formula file.

More informations here: https://docs.ritchiecli.io/tutorials/formulas/how-to-implement-a-formula/config-file

Obs: The documentation will redirect to the formula's readme afterwards.

Why is this needed:

To give an example to Ritchie users.

@GuillaumeFalourd GuillaumeFalourd added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers labels Dec 22, 2020
@amandaveredas
Copy link

I´m looking at documentation and this example is there:

Conditional input example with Regex pattern:

"inputs": [
    {
      "label": "Select a system:",
      "name": "rit_system",
      "type": "text",
      "items": [
        "LINUX",
        "MACOS",
        "WINDOWS"
      ],
      "required": true,
      "tutorial": "Select a System from the list."
    },
    {
      "condition": {
        "variable":"rit_system",
        "operator":"==",
        "value":"LINUX"
      },
      "label": "Select a LINUX OS:",
      "name": "rit_linux_os",
      "type": "text",
      "items": [
        "UBUNTU",
        "FEDORA",
        "CENTOS"
      ],
      "pattern": {
        "regex": "UBUNTU|FEDORA|CENTOS",
        "mismatchText": "Invalid option"
      },
      "required": false,
      "tutorial": "Select an Linux Operating System from the list."
    }
  ]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants