Skip to content

Commit

Permalink
added flow error change
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshamoon committed Nov 17, 2023
1 parent 57930d5 commit a65afff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
14 changes: 4 additions & 10 deletions src/containers/Flow/FlowList/FlowList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,10 @@ export const FlowList = () => {

const [importFlow] = useMutation(IMPORT_FLOW, {
onCompleted: (result: any) => {
const { success } = result.importFlow;
if (!success) {
setNotification(
t(
'Sorry! An error occurred! This could happen if the flow is already present or error in the import file.'
),
'error'
);
} else {
setNotification(t('The flow has been imported successfully.'));
const { status } = result.importFlow;

Check warning on line 94 in src/containers/Flow/FlowList/FlowList.tsx

View check run for this annotation

Codecov / codecov/patch

src/containers/Flow/FlowList/FlowList.tsx#L94

Added line #L94 was not covered by tests
if (status) {
const statusValue = status.map((stat: any) => `${stat.flowName}: ${stat.status}`);
setNotification(t(statusValue.join('\n')));

Check warning on line 97 in src/containers/Flow/FlowList/FlowList.tsx

View check run for this annotation

Codecov / codecov/patch

src/containers/Flow/FlowList/FlowList.tsx#L96-L97

Added lines #L96 - L97 were not covered by tests
}
setImporting(false);
},
Expand Down
7 changes: 3 additions & 4 deletions src/graphql/mutations/Flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,9 @@ export const CREATE_FLOW_COPY = gql`
export const IMPORT_FLOW = gql`
mutation importFlow($flow: Json!) {
importFlow(flow: $flow) {
success
errors {
key
message
status {
flowName
status
}
}
}
Expand Down

0 comments on commit a65afff

Please sign in to comment.