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: דגלי תכונות
|
|
image: /images/user-guide/table-views/table.png
|
|
---
|
|
|
|
<Frame>
|
|
<img src="/images/user-guide/table-views/table.png" alt="Header" />
|
|
</Frame>
|
|
|
|
דגלי תכונות משמשים להסתיר תכונות ניסיוניות. ב-Twenty, הם מוגדרים ברמת מרחב העבודה ולא ברמת המשתמש.
|
|
|
|
## הוספת דגל תכונה חדש
|
|
|
|
ב-`FeatureFlagKey.ts` הוסף את דגל התכונה:
|
|
|
|
```ts
|
|
type FeatureFlagKey =
|
|
| 'IS_FEATURENAME_ENABLED'
|
|
| ...;
|
|
```
|
|
|
|
הוסף גם אותו ל-enum ב-`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');
|
|
```
|
|
|
|
## הגדרת דגלי תכונה עבור הפריסה
|
|
|
|
שנה את הרשומה המתאימה בטבלת `core.featureFlag`:
|
|
|
|
| מזהה | מפתח | workspaceId | ערך |
|
|
| ----- | ------------------------ | ----------- | ------ |
|
|
| אקראי | `IS_FEATURENAME_ENABLED` | WorkspaceID | `נכון` |
|