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 =
|
||||
| 'IS_MESSAGING_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',
|
||||
);
|
||||
|
||||
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>
|
||||
|
||||
@ -18,6 +18,16 @@ export const seedFeatureFlags = async (
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: 'IS_SELECT_FIELD_TYPE_ENABLED',
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: 'IS_RATING_FIELD_TYPE_ENABLED',
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
};
|
||||
|
||||
@ -28,6 +28,16 @@ export const seedFeatureFlags = async (
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: 'IS_SELECT_FIELD_TYPE_ENABLED',
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: 'IS_RATING_FIELD_TYPE_ENABLED',
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user