feat: introduce feature flag for new flow editor

This commit is contained in:
kasia.oczkowska
2024-04-18 14:38:10 +01:00
committed by Ali BARIN
parent b5839390fd
commit bac4ab5aa4
2 changed files with 21 additions and 1 deletions

View File

@@ -20,6 +20,9 @@ import * as URLS from 'config/urls';
import { TopBar } from './style'; import { TopBar } from './style';
import useFlow from 'hooks/useFlow'; import useFlow from 'hooks/useFlow';
import { useQueryClient } from '@tanstack/react-query'; import { useQueryClient } from '@tanstack/react-query';
import EditorNew from 'components/EditorNew/EditorNew';
const useNewFlowEditor = process.env.REACT_APP_USE_NEW_FLOW_EDITOR === 'true';
export default function EditorLayout() { export default function EditorLayout() {
const { flowId } = useParams(); const { flowId } = useParams();
@@ -136,7 +139,12 @@ export default function EditorLayout() {
<EditorProvider value={{ readOnly: !!flow?.active }}> <EditorProvider value={{ readOnly: !!flow?.active }}>
{!flow && !isFlowLoading && 'not found'} {!flow && !isFlowLoading && 'not found'}
{flow && <Editor flow={flow} />} {flow &&
(useNewFlowEditor ? (
<EditorNew flow={flow} />
) : (
<Editor flow={flow} />
))}
</EditorProvider> </EditorProvider>
</Container> </Container>
</Stack> </Stack>

View File

@@ -0,0 +1,12 @@
import * as React from 'react';
import { FlowPropType } from 'propTypes/propTypes';
function EditorNew(props) {
return <div>new editor comes here</div>;
}
EditorNew.propTypes = {
flow: FlowPropType.isRequired,
};
export default EditorNew;