Skip to content

Commit

Permalink
feat(client): added cancel to export dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
sr258 committed Apr 4, 2021
1 parent 26dc97a commit 843e3cd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
10 changes: 10 additions & 0 deletions client/src/state/H5PEditor/H5PEditorActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ export function blurActiveElement(): IBlurActiveElementAction {
};
}

export function cancelExportH5P() {
log.info(`canceling export`);
return async (dispatch: any) => {
dispatch({
payload: {},
type: H5PEDITOR_EXPORT_CANCEL
});
};
}

export function exportH5P(
includeReporter: boolean,
format: 'bundle' | 'external' | 'scorm'
Expand Down
3 changes: 2 additions & 1 deletion client/src/state/H5PEditor/H5PEditorReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ export default function tabReducer(
}
: tab
),
lockDisplay: false
lockDisplay: false,
showExportDialog: false
};

case H5PEDITOR_EXPORT_ERROR:
Expand Down
9 changes: 8 additions & 1 deletion client/src/views/components/H5PEditorExportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default function H5PEditorExportDialog() {
open={open}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
onClose={() => dispatch(actions.h5peditor.cancelExportH5P())}
>
<DialogTitle id="alert-dialog-title">
Export settings
Expand Down Expand Up @@ -116,7 +117,13 @@ export default function H5PEditorExportDialog() {
</FormControl>
</DialogContent>
<DialogActions>
<Button color="secondary">Cancel</Button>
<Button
onClick={() =>
dispatch(actions.h5peditor.cancelExportH5P())
}
>
Cancel
</Button>
<Button
color="primary"
autoFocus
Expand Down

0 comments on commit 843e3cd

Please sign in to comment.