From d838b5f2c3f67ad104c1a24ca232a90d8015550c Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Fri, 15 Sep 2023 12:43:56 +0200 Subject: [PATCH] 1-1385: hide display of pattern info behind a flag (#4744) Previously, the front end would show info about the pattern if it exists, regardless of whether the feature is active or not. The pattern wouldn't be enforced, but it's confusing anyway, so let's hide it. --- frontend/src/component/feature/FeatureForm/FeatureForm.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/feature/FeatureForm/FeatureForm.tsx b/frontend/src/component/feature/FeatureForm/FeatureForm.tsx index b18aaf01f6..e072b43022 100644 --- a/frontend/src/component/feature/FeatureForm/FeatureForm.tsx +++ b/frontend/src/component/feature/FeatureForm/FeatureForm.tsx @@ -23,6 +23,7 @@ import React from 'react'; import { useAuthPermissions } from 'hooks/api/getters/useAuth/useAuthPermissions'; import { FeatureNamingType } from 'interfaces/project'; import { FeatureNamingPatternInfo } from '../FeatureNamingPatternInfo/FeatureNamingPatternInfo'; +import { useUiFlag } from 'hooks/useUiFlag'; interface IFeatureToggleForm { type: string; @@ -121,12 +122,15 @@ const FeatureForm: React.FC = ({ const navigate = useNavigate(); const { permissions } = useAuthPermissions(); const editable = mode !== 'Edit'; + const featureNamingPatternEnabled = useUiFlag('featureNamingPattern'); const renderToggleDescription = () => { return featureTypes.find(toggle => toggle.id === type)?.description; }; - const displayFeatureNamingInfo = Boolean(featureNaming?.pattern); + const displayFeatureNamingInfo = Boolean( + featureNamingPatternEnabled && featureNaming?.pattern + ); React.useEffect(() => { if (featureNaming?.pattern && validateToggleName && name) {