kx.as.code icon indicating copy to clipboard operation
kx.as.code copied to clipboard

Enable input to component installations and available_tasks

Open patdel76 opened this issue 1 year ago • 1 comments

Hi @burakkylp ,

Let's find a way to get input from the user in the frontend if it is detailed in metadata.json. Below is what I am thinking at the moment - adding an input_arguments[] to the main block for the component installation, and also to available_tasks[], in case input is required to execute the task.

Maybe we can ask for input via a pop-up? Let me know your thoughts. Thanks. :-)

{
  "name": "hipster-shop",
  "namespace": "shop-example",
  "installation_type": "script",
  "installation_group_folder": "examples",
  "input_arguments": [
    {
      "argumentKey": "branch",
      "argumentDefaultValue": "main",
      "fieldType": "alphaNumeric",
      "fieldLength": 32,
      "mandatory": false
    },
    {
      "argumentKey": "replicas",
      "argumentDefaultValue": 1,
      "minValue": 1,
      "maxValue": 10,
      "fieldType": "numeric",
      "mandatory": false
    }
  ]
}

Here an example message to put on the queue once the inout is collected.

{
  "install_folder": "examples",
  "name": "hipster-shop",
  "action": "install",
  "retries": "0",
  "input_parameters": {
    "branch": "main",
    "replicas": 1
  }
}

As discussed, some additional points.

  • When is an input_arguments array in metadata.json, when the user click on install, the UI should switch to the detail page and request the inputs via input fields
  • If there are any mandatory fields, these must be completed before clicking on install on the details page. If not mandatory, installation can continue without passing the blank field values to the action json
  • If there is an "argumentDefaultValue" defined for an input argument, then these should be pre-populated in the input field and the user can optionally change these

patdel76 avatar Sep 15 '22 11:09 patdel76