Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1200 from Unleash/docs/unleash-context
docs: Flesh out Unleash Context, Strategy constraints, add how-to guides for both
- Loading branch information
Showing
8 changed files
with
172 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: How to add strategy constraints | ||
--- | ||
|
||
:::info Availability | ||
Strategy constraints are available to Unleash Pro and Enterprise users. | ||
::: | ||
|
||
This guide shows you how to add [strategy constraints](../advanced/strategy-constraints.md) to your feature toggles via the admin UI. For information on how to interact with strategy constraints from an [Unleash client SDK](../sdks/index.md), visit the specific SDKs documentation or see [the relevant section in the strategy constraints documentation](../advanced/strategy-constraints.md#sdks "strategy constraints documentation, section on interacting with constraints from client SDKs"). | ||
|
||
## Prerequisites | ||
|
||
You'll need to have an existing feature toggle with a defined strategy to add a constraint. The rest of this guide assumes you have a specific strategy that you're working with. | ||
|
||
## Step 1: Open the constraints menu {#step-1} | ||
|
||
Every strategy will have button labeled "add constraints" when viewed in the admin UI. Interact with this to open the constraints menu. | ||
|
||
![A feature toggle strategy view showing a button labeled with add constraints.](/img/add-constraint.png) | ||
|
||
## Step 2: Configure the constraint {#step-2} | ||
|
||
Refer to [the _constraint structure_ section of the strategy constraints reference](../advanced/strategy-constraints.md#constraint-structure) for a thorough explanation of the fields. | ||
|
||
From the "Context Field" dropdown, select the context field you would like to constrain the strategy on. | ||
|
||
![A strategy constraint form with a constraint set to "region". The "values" input is a dropdown menu containing the options "Africa", "Asia", "Europe", and "North America", as defined in the preceding paragraph.](/img/constraints_legal_values.png) | ||
|
||
## Step 3: Add additional constraints {#step-3} | ||
|
||
To add additional constraints: | ||
1. Repeat [step one](#step-1 "step 1: open the constraints menu") to open the constraints menu. | ||
2. Use the "Add constraint" button to add a new constraint. | ||
|
||
![The add constraint modal menu with an existing constraint. There is a button labeled "add constraint" that is being highlighted by an arrow.](/img/constraints-add-additional.png) | ||
|
||
3. Follow [step two](#step-2 "step 2: configure the constraint") for the new constraint. | ||
|
||
## How to update existing constraints | ||
|
||
You can update any existing constraint by doing one of the following: | ||
|
||
- Open the "add constraints" menu and modify existing constraints. | ||
- Using the constraint's "edit" button to bring up the constraints menu. |
29 changes: 29 additions & 0 deletions
29
website/docs/how-to/how-to-define-custom-context-fields.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: How to define custom context fields | ||
--- | ||
|
||
:::info Availability | ||
Custom context fields are available to Pro and Enterprise users. They were introduced in Unleash 3.2.28. | ||
::: | ||
|
||
This guide shows you how to create [custom context field for the Unleash Context](../user_guide/unleash-context.md#custom-context-fields). You can use custom context fields for [strategy constraints](../advanced/strategy-constraints.md) and for [custom stickiness calculations](../advanced/stickiness.md#custom-stickiness). If there are [standard Unleash Context fields](../user_guide/unleash-context.md#structure) missing from the context fields page, you can use the same steps to add them too. | ||
|
||
## Step 1: Navigate to the context field creation form {#step-1-navigate-to-context-fields} | ||
|
||
In the Unleash Admin UI, navigate to the _context fields_ page: | ||
1. Click the "Configure" button in the top menu to open the configuration dropdown menu. | ||
2. Click the "Context fields" menu item. | ||
|
||
![A visual representation of the tutorial steps described in the preceding paragraph, showing the interaction points in the admin UI in order.](/img/context-fields.png) | ||
|
||
3. On the context fields page, click the "add new context field" button. | ||
|
||
![The "context fields" page with the "add new context field" button highlighted.]( /img/context-field-create-button.png) | ||
|
||
## Step 2: Define the new context field {#step-2-define-new-context-field} | ||
|
||
Define the custom context field by filling out the form. You must at least the field a unique _name_. Everything else is optional. Refer to the [custom context field reference guide](../user_guide/unleash-context.md#custom-context-fields) for a full overview of the parameters and their functions and requirements. | ||
|
||
When you are satisfied with the context field's values, use the "create" button to submit the form and save the context field. | ||
|
||
![A "create context field" form. It contains data for a custom context field called "region". Its description is "allows you to constrain on specific regions" and its legal values are "Africa", "Asia", "Europe", and "North America". Its custom stickiness value is not shown.](/img/new_context_field.png) |
Oops, something went wrong.
73b05ec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: