Skip to content

Commit

Permalink
Merge pull request #2088 from glific/fix/multiple-editors-flow
Browse files Browse the repository at this point in the history
Multiple flow editor fix for issue #2086
  • Loading branch information
kurund authored Aug 4, 2022
2 parents ecd098b + 55847b6 commit 03d1726
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/components/floweditor/FlowEditor.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
.DialogDescription {
text-align: center;
margin: 0;
margin-bottom: 16px;
font-size: 14px;
font-weight: 400;
color: #073f24;
Expand Down
2 changes: 1 addition & 1 deletion src/components/floweditor/FlowEditor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ test('check if someone else is using a flow', async () => {
expect(getByText('The flow is being edited by NGO Main Account')).toBeInTheDocument();
});

fireEvent.click(getByText('Okay'));
fireEvent.click(getByText('Go Back'));
});

test('publish flow which has error', async () => {
Expand Down
12 changes: 10 additions & 2 deletions src/components/floweditor/FlowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,21 @@ export const FlowEditor = (props: FlowEditorProps) => {
title={dialogMessage}
alignButtons="center"
skipCancel
buttonOk="Okay"
buttonOk="Take Over"
buttonMiddle="Go Back"
handleOk={() => {
getFreeFlow({ variables: { id: flowId, isForced: true } });
setCurrentEditDialogBox(false);
}}
handleMiddle={() => {
setConfirmedNavigation(true);
history.push('/flow');
}}
>
<p className={styles.DialogDescription}>Please try again later or contact the user.</p>
<p className={styles.DialogDescription}>
You can either go back and edit it later or <br /> &lsquo;Take Over&rsquo; this flow to
start editing now.
</p>
</DialogBox>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/queries/Flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ export const TERMINATE_FLOW = gql`
`;

export const GET_FREE_FLOW = gql`
query flowGet($id: ID!) {
flowGet(id: $id) {
query flowGet($id: ID!, $isForced: Boolean) {
flowGet(id: $id, isForced: $isForced) {
flow {
id
uuid
Expand Down

0 comments on commit 03d1726

Please sign in to comment.