Created by Github action --------- Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: github-actions <github-actions@twenty.com>
52 lines
1.4 KiB
Plaintext
52 lines
1.4 KiB
Plaintext
---
|
||
title: Feature Flags
|
||
image: /images/user-guide/table-views/table.png
|
||
---
|
||
|
||
<Frame>
|
||
<img src="/images/user-guide/table-views/table.png" alt="Header" />
|
||
</Frame>
|
||
|
||
Feature flags are used to hide experimental features. За Twenty, оне су постављене на нивоу радног окружења, а не на нивоу корисника.
|
||
|
||
## Adding a new feature flag
|
||
|
||
In `FeatureFlagKey.ts` add the feature flag:
|
||
|
||
```ts
|
||
type FeatureFlagKey =
|
||
| 'IS_FEATURENAME_ENABLED'
|
||
| ...;
|
||
```
|
||
|
||
Такође додајте га у енум у `feature-flag.entity.ts`:
|
||
|
||
```ts
|
||
enum FeatureFlagKeys {
|
||
IsFeatureNameEnabled = 'IS_FEATURENAME_ENABLED',
|
||
...
|
||
}
|
||
```
|
||
|
||
To apply a feature flag on a **backend** feature use:
|
||
|
||
```ts
|
||
@Gate({
|
||
featureFlag: 'IS_FEATURENAME_ENABLED',
|
||
})
|
||
```
|
||
|
||
To apply a feature flag on a **frontend** feature use:
|
||
|
||
```ts
|
||
const isFeatureNameEnabled = useIsFeatureEnabled('IS_FEATURENAME_ENABLED');
|
||
```
|
||
|
||
## Configure feature flags for the deployment
|
||
|
||
Промените одговарајући запис у Табели `core.featureFlag`:
|
||
|
||
| ид | кључ | идентификатор радног окружења | вредност |
|
||
| -------- | ------------------------ | ----------------------------- | -------- |
|
||
| Случајан | `IS_FEATURENAME_ENABLED` | Идентификатор радног окружења | `истина` |
|