feat: Add feature flags to Select & Rating custom fields (#3037)
* Add feature flag key for select and rating * Use feature flag boolean to decide if select & rating are enabled * Enable select and rating in demo & core
This commit is contained in:
@ -1,4 +1,6 @@
|
|||||||
export type FeatureFlagKey =
|
export type FeatureFlagKey =
|
||||||
| 'IS_MESSAGING_ENABLED'
|
| 'IS_MESSAGING_ENABLED'
|
||||||
| 'IS_NOTE_CREATE_IMAGES_ENABLED'
|
| 'IS_NOTE_CREATE_IMAGES_ENABLED'
|
||||||
| 'IS_RELATION_FIELD_TYPE_ENABLED';
|
| 'IS_RELATION_FIELD_TYPE_ENABLED'
|
||||||
|
| 'IS_SELECT_FIELD_TYPE_ENABLED'
|
||||||
|
| 'IS_RATING_FIELD_TYPE_ENABLED';
|
||||||
|
|||||||
@ -42,6 +42,14 @@ export const SettingsObjectNewFieldStep2 = () => {
|
|||||||
'IS_RELATION_FIELD_TYPE_ENABLED',
|
'IS_RELATION_FIELD_TYPE_ENABLED',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isSelectFieldTypeEnabled = useIsFeatureEnabled(
|
||||||
|
'IS_SELECT_FIELD_TYPE_ENABLED',
|
||||||
|
);
|
||||||
|
|
||||||
|
const isRatingFieldTypeEnabled = useIsFeatureEnabled(
|
||||||
|
'IS_RATING_FIELD_TYPE_ENABLED',
|
||||||
|
);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
formValues,
|
formValues,
|
||||||
handleFormChange,
|
handleFormChange,
|
||||||
@ -256,8 +264,6 @@ export const SettingsObjectNewFieldStep2 = () => {
|
|||||||
FieldMetadataType.Numeric,
|
FieldMetadataType.Numeric,
|
||||||
FieldMetadataType.Phone,
|
FieldMetadataType.Phone,
|
||||||
FieldMetadataType.Probability,
|
FieldMetadataType.Probability,
|
||||||
FieldMetadataType.Rating,
|
|
||||||
FieldMetadataType.Select,
|
|
||||||
FieldMetadataType.Uuid,
|
FieldMetadataType.Uuid,
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -265,6 +271,14 @@ export const SettingsObjectNewFieldStep2 = () => {
|
|||||||
excludedFieldTypes.push(FieldMetadataType.Relation);
|
excludedFieldTypes.push(FieldMetadataType.Relation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isSelectFieldTypeEnabled) {
|
||||||
|
excludedFieldTypes.push(FieldMetadataType.Select);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isRatingFieldTypeEnabled) {
|
||||||
|
excludedFieldTypes.push(FieldMetadataType.Rating);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
||||||
<SettingsPageContainer>
|
<SettingsPageContainer>
|
||||||
|
|||||||
@ -18,6 +18,16 @@ export const seedFeatureFlags = async (
|
|||||||
workspaceId: workspaceId,
|
workspaceId: workspaceId,
|
||||||
value: true,
|
value: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'IS_SELECT_FIELD_TYPE_ENABLED',
|
||||||
|
workspaceId: workspaceId,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'IS_RATING_FIELD_TYPE_ENABLED',
|
||||||
|
workspaceId: workspaceId,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
])
|
])
|
||||||
.execute();
|
.execute();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,6 +28,16 @@ export const seedFeatureFlags = async (
|
|||||||
workspaceId: workspaceId,
|
workspaceId: workspaceId,
|
||||||
value: true,
|
value: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'IS_SELECT_FIELD_TYPE_ENABLED',
|
||||||
|
workspaceId: workspaceId,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'IS_RATING_FIELD_TYPE_ENABLED',
|
||||||
|
workspaceId: workspaceId,
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
])
|
])
|
||||||
.execute();
|
.execute();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user