Skip to content

Commit

Permalink
docs(fix): correct custom activation strategies param types (#1547)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Apr 29, 2022
1 parent a36a19c commit 581fc76
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions website/docs/advanced/custom-activation-strategy.md
Expand Up @@ -40,19 +40,17 @@ Each parameter consists of three parts:

Each parameter has one of five different parameter types. A parameter's type impacts the kind of controls shown in the admin UI and how it's represented in code.

Here's an overview over how the types are represented in the JSON payload returned from the Unleash server. The exact types will vary based on your programming language's type system.
The below table lists the types and how they're represented in the JSON payload returned from the Unleash server. When parsed, the exact types will vary based on your programming language's type system.

:::note Unset values
Values of *all types* have an empty string (`""`) as the default value. As such, if you don't interact with a control or otherwise set a value, the value will be an empty string, regardless of the value's type.
:::
All values have an **empty string (`""`) as the default value**. As such, if you don't interact with a control or otherwise set a value, the value will be an empty string.

| type name | code representation | example value | UI control |
|------------|----------------------------------------|---------------|--------------------------|
| string | `string` | `"a string"` | A standard input field |
| percentage | an `int` between 0 and 100 (inclusive) | `99` | A value slider |
| list | `string` (values are comma-separated) | `"one,two"` | A multi-input text field |
| number | `string` | `"123"` | A numeric text field |
| boolean | `"true"` or `"false"` | `"true"` | An on/off toggle |
| type name | code representation | example value | UI control |
|------------|----------------------------------------------------------------|---------------|--------------------------|
| string | `string` | `"a string"` | A standard input field |
| percentage | a `string` representing a number between 0 and 100 (inclusive) | `"99"` | A value slider |
| list | `string` (values are comma-separated) | `"one,two"` | A multi-input text field |
| number | `string` | `"123"` | A numeric text field |
| boolean | a `string`: one of `"true"` or `"false"` | `"true"` | An on/off toggle |


![A strategy with five parameters, one of each type.](/img/strategy-parameters-ui-controls.png)
Expand Down

5 comments on commit 581fc76

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 91.2% 5171/5670
🟡 Branches 79.31% 805/1015
🟢 Functions 86.18% 1216/1411
🟢 Lines 91.12% 5050/5542

Test suite run success

860 tests passing in 124 suites.

Report generated by 🧪jest coverage report action from b4622f9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 91.2% 5171/5670
🟡 Branches 79.31% 805/1015
🟢 Functions 86.18% 1216/1411
🟢 Lines 91.12% 5050/5542

Test suite run success

860 tests passing in 124 suites.

Report generated by 🧪jest coverage report action from b81180d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 91.2% 5171/5670
🟡 Branches 79.31% 805/1015
🟢 Functions 86.18% 1216/1411
🟢 Lines 91.12% 5050/5542

Test suite run success

860 tests passing in 124 suites.

Report generated by 🧪jest coverage report action from 580b720

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 91.2% 5171/5670
🟡 Branches 79.31% 805/1015
🟢 Functions 86.18% 1216/1411
🟢 Lines 91.12% 5050/5542

Test suite run success

860 tests passing in 124 suites.

Report generated by 🧪jest coverage report action from d39f815

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 91.2% 5171/5670
🟡 Branches 79.31% 805/1015
🟢 Functions 86.18% 1216/1411
🟢 Lines 91.12% 5050/5542

Test suite run success

860 tests passing in 124 suites.

Report generated by 🧪jest coverage report action from 463b65c

Please sign in to comment.