Skip to content

Commit e4ef50c

Browse files
committed
[frontend] Add feature flagging
1 parent 25ba4bf commit e4ef50c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

opencti-platform/opencti-front/src/private/components/settings/sub_types/Root.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Suspense } from 'react';
33
import { Navigate, Route, Routes, useParams } from 'react-router-dom';
44
import ErrorNotFound from '../../../../components/ErrorNotFound';
55
import Loader from '../../../../components/Loader';
6+
import useHelper from '../../../../utils/hooks/useHelper';
67
import FintelTemplate from './fintel_templates/FintelTemplate';
78
import SubType from './SubType';
89
import EntitySettingAttributesCard from './entity_setting/EntitySettingAttributesCard';
@@ -40,6 +41,8 @@ const SubTypeIndexRedirect = () => {
4041

4142
const RootSubType = () => {
4243
const { subTypeId } = useParams<{ subTypeId?: string }>();
44+
const { isFeatureEnable } = useHelper();
45+
const isCustomViewFeatureEnabled = isFeatureEnable('CUSTOM_VIEW');
4346

4447
if (!subTypeId) return <ErrorNotFound />;
4548

@@ -52,7 +55,7 @@ const RootSubType = () => {
5255
<Route path="templates" element={<FintelTemplatesManager />} />
5356
<Route path="attributes" element={<EntitySettingAttributesCard />} />
5457
<Route path="overview-layout" element={<EntitySettingCustomOverview />} />
55-
<Route path="custom-views" element={<CustomViewsSettings />} />
58+
{isCustomViewFeatureEnabled ? <Route path="custom-views" element={<CustomViewsSettings />} /> : null}
5659
</Route>
5760
<Route
5861
path="/templates/:templateId"

opencti-platform/opencti-front/src/private/components/settings/sub_types/SubType.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ const SubTypeComponent: React.FC<SubTypeProps> = ({ queryRef }) => {
8181

8282
const isCustomOverviewLayoutEnabled = !!entitySetting?.overview_layout_customization;
8383

84-
const isCustomViewsEnabled = customViewsSettings.canEntityTypeHaveCustomViews;
84+
const isCustomViewFeatureEnabled = isFeatureEnable('CUSTOM_VIEW');
85+
const isCustomViewsEnabled = customViewsSettings.canEntityTypeHaveCustomViews
86+
&& isCustomViewFeatureEnabled;
8587

8688
const tabs: SubTypeTabs = {
8789
workflow: isWorkflowConfigurationEnabled,

0 commit comments

Comments
 (0)