Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Components are re-usable so you can have many instances of the same component with different settings for the custom fields each one hassettings. You can add/, remove and change custom fields for each component:

Expand
titleStep1 - STEP 1: In the translator click on config.json to open and edit the custom fields
Image Added
  1. Click on config.

Image Removed
  1. json

  2. Click EDIT to edit the fields

Expand
titleStep STEP 2 - : Add a test field and save.
Image RemovedNOTE:
Expand
titleStep STEP 3 - : Commit these changes by pressing the commit button.
Image Added
Panel
panelIconIdatlassian-warning
panelIcon:warning:
bgColor#FFFAE6

If you do not want to commit these changes, you can change the Using Commit: to

DEVELOPER,

DEVELOPMENT in the next step

,

so it will use the changes made in the translator without a commit.

Expand
titleStep STEP 4 - : Exit the translator and change the commit to the new one or select Development mode
Image RemovedNOTE: Image Added
  1. Click the ellipses to change the commit. If you do not want to commit

these
  1. the changes you made, you can change the Using Commit: to

DEVELOPER
  1. DEVELOPMENT so it will use the changes made in the translator without a commit.

  2. The custom field you created in the translator, TestField, now shows up.

Some more information:

Expand
titleHow does the Lua script get access to the fields

To get programatic access of the values of the custom fields, there is this api call:

Code Block
languagelua
local Fields = component.fields();

This returns a Lua table with the custom fields and their values for the component.

See COUNT Library

<instance root>/IguanaX/configurations/fields/<component guid>.json

For example:

Expand
titleWhere are the custom field values defined for each component
Code Block
languagejson
{
    "fields": {
        "Folder": "/Folder/",
        "Number": "1e3",
        "Password": "4E4D90C9F91E21FCD59F9F31D88F71FB",
        "Port": "64000",
        "String": "A String"
    }
}
Expand
titleWhat is the format of config.json the definition for for the fields in each component

This is what the format looks like:

Code Block
languagejson
{
    "fields": [
        {
            "default": "/ff/",
            "name": "Folder",
            "type": "folder"
        },
        {
            "default": "fdsf",
            "name": "File",
            "type": "file"
        },
        {
            "default": "",
            "name": "String",
            "type": "string"
        },
        {
            "default": "1",
            "name": "Number",
            "type": "number"
        },
        {
            "default": "true",
            "name": "Boolean",
            "type": "bool"
        },
        {
            "default": "",
            "name": "Password",
            "type": "password"
        },
        {
            "default": "",
            "name": "Port",
            "type": "port"
        }
    ]
}
Expand
titleThe Count library is a useful library which takes advantage of custom fields to do a custom incrementing counter
How to programmatically modify an existing custom field to set a new value

You can use the component.setField{} API.

Expand
titleWhere are the custom field values defined for each component

Custom Field values set in the component card are encrypted and stored locally in components.json file in the component configuration directory.

Code Block
<working directory>/config/comps/<component guid>/component.json

The custom fields and default values, stored in config.json are stored in the component repository files and checked into Git. See Component Configuration Files.