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.2 KiB
Plaintext
52 lines
1.2 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. A Twenty esetében ezeket a munkaterületi szinten állítják be, nem a felhasználói szinten.
|
|
|
|
## Adding a new feature flag
|
|
|
|
In `FeatureFlagKey.ts` add the feature flag:
|
|
|
|
```ts
|
|
type FeatureFlagKey =
|
|
| 'IS_FEATURENAME_ENABLED'
|
|
| ...;
|
|
```
|
|
|
|
Add hozzá az `feature-flag.entity.ts` enumhoz is:
|
|
|
|
```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
|
|
|
|
Módosítsd a megfelelő rekordot a `core.featureFlag` táblában:
|
|
|
|
| azonosító | kulcs | munkaterületId | érték |
|
|
| --------- | ------------------------ | -------------- | ------ |
|
|
| Véletlen | `IS_FEATURENAME_ENABLED` | MunkaterületID | `igaz` |
|