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:
Deepak Kumar
2023-12-18 13:08:25 +05:30
committed by GitHub
parent 65f05ff43a
commit 2507da1b25
4 changed files with 39 additions and 3 deletions

View File

@ -42,6 +42,14 @@ export const SettingsObjectNewFieldStep2 = () => {
'IS_RELATION_FIELD_TYPE_ENABLED',
);
const isSelectFieldTypeEnabled = useIsFeatureEnabled(
'IS_SELECT_FIELD_TYPE_ENABLED',
);
const isRatingFieldTypeEnabled = useIsFeatureEnabled(
'IS_RATING_FIELD_TYPE_ENABLED',
);
const {
formValues,
handleFormChange,
@ -256,8 +264,6 @@ export const SettingsObjectNewFieldStep2 = () => {
FieldMetadataType.Numeric,
FieldMetadataType.Phone,
FieldMetadataType.Probability,
FieldMetadataType.Rating,
FieldMetadataType.Select,
FieldMetadataType.Uuid,
];
@ -265,6 +271,14 @@ export const SettingsObjectNewFieldStep2 = () => {
excludedFieldTypes.push(FieldMetadataType.Relation);
}
if (!isSelectFieldTypeEnabled) {
excludedFieldTypes.push(FieldMetadataType.Select);
}
if (!isRatingFieldTypeEnabled) {
excludedFieldTypes.push(FieldMetadataType.Rating);
}
return (
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
<SettingsPageContainer>