Skip to content

Commit d0fcadf

Browse files
committed
Prepare MermaidRulesGraph behind feature flag
1 parent ddc6bd0 commit d0fcadf

3 files changed

Lines changed: 38 additions & 1 deletion

File tree

src/featureFlags.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ const defaultFlags = {
33
newCollaborationSection: true,
44
newLanguageToggle: true,
55
newActivityLog: true,
6-
showNearestCounselingCentre: false
6+
showNearestCounselingCentre: false,
7+
showMermaidRuleGraph: false,
78
};
89

910
const getFeatureFlag = (flag) => {
@@ -17,6 +18,7 @@ const featureFlags = {
1718
newLanguageToggle: getFeatureFlag('newLanguageToggle'),
1819
newActivityLog: getFeatureFlag('newActivityLog'),
1920
showNearestCounselingCentre: getFeatureFlag('showNearestCounselingCentre'),
21+
showMermaidRuleGraph: getFeatureFlag('showMermaidRuleGraph'),
2022
};
2123

2224
export const setFeatureFlag = (flag, value) => {

src/ui/screens/benefit-page/BenefitPageScreen.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import BenefitPageExampleList from './components/BenefitPageExampleList';
1010
import BenefitPageHeader from "./components/BenefitPageHeader";
1111
import AppScreenWrapperContainer from '@/ui/shared-components/app-screen-wrapper/AppScreenWrapperContainer';
1212
import RecursiveRulesTable from './components/RecursiveRulesTable';
13+
import featureFlags from "@/featureFlags";
14+
import MermaidRulesGraph from "@/ui/screens/benefit-page/components/MermaidRulesGraph";
1315

1416
const BenefitPageScreen = ({
1517
t,
@@ -78,6 +80,9 @@ const BenefitPageScreen = ({
7880
)
7981
}
8082
<RecursiveRulesTable graphRoot={matchingGraph?.root} t={t} />
83+
{featureFlags.showMermaidRuleGraph &&
84+
<MermaidRulesGraph graphRoot={matchingGraph?.root} t={t} />
85+
}
8186
</Box>
8287
</VBox>
8388
</AppScreenWrapperContainer>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
import theme from '@/theme';
3+
import { useMetadataStore } from '@/ui/storage/zustand';
4+
import { VBox } from '@/ui/shared-components/LayoutBoxes';
5+
import { Typography } from "@mui/material";
6+
7+
export default function MermaidRulesGraph({ graphRoot, t }) {
8+
const metadata = useMetadataStore(state => state.metadata);
9+
// if (!graphRoot) return null;
10+
11+
return (
12+
<VBox
13+
sx={{
14+
gap: 4,
15+
backgroundColor: 'white.main',
16+
padding: '32px',
17+
borderRadius: theme.shape.borderRadius,
18+
}}
19+
>
20+
<VBox sx={{ gap: 2 }}>
21+
<Typography variant="h2" sx={{ fontWeight: '400', wordBreak: "break-word" }}>
22+
Rules Graph
23+
</Typography>
24+
<Typography variant="body1">
25+
TODO
26+
</Typography>
27+
</VBox>
28+
</VBox>
29+
);
30+
}

0 commit comments

Comments
 (0)