@elyra/application
Advanced tools
Comparing version 0.8.0-dev to 0.8.0
import '../style/index.css'; | ||
export * from './parsing'; | ||
export * from './services'; | ||
export * from './submission'; |
@@ -18,3 +18,4 @@ /* | ||
export * from './parsing'; | ||
export * from './services'; | ||
export * from './submission'; | ||
//# sourceMappingURL=index.js.map |
@@ -20,15 +20,20 @@ /* | ||
import * as React from 'react'; | ||
const MESSAGE_DISPLAY = 'elyra-pipelineSubmission-messageDisplay'; | ||
const ERROR_DISPLAY_BUTTON = 'elyra-pipelineSubmission-errDisplayButton'; | ||
const DOWN_ICON_CLASS = 'elyra-pipelineSubmission-errDisplayButton-down'; | ||
const UP_ICON_CLASS = 'elyra-pipelineSubmission-errDisplayButton-up'; | ||
const ERROR_DETAILS_VISIBLE = 'elyra-pipelineSubmission-error-visible'; | ||
const ERROR_DETAILS_HIDDEN = 'elyra-pipelineSubmission-error-hidden'; | ||
export class SubmissionHandler { | ||
static handleError(response, submissionType) { | ||
let res_body = response['message'] ? response['message'] : ''; | ||
res_body = response['reason'] | ||
? res_body + ': ' + response['reason'] | ||
: res_body; | ||
const default_body = 'Check the JupyterLab log for more details.'; | ||
const reason = response.reason ? response.reason : ''; | ||
const message = response.message ? response.message : ''; | ||
const timestamp = response.timestamp ? response.timestamp : ''; | ||
const traceback = response.traceback ? response.traceback : ''; | ||
const default_body = response.timestamp | ||
? 'Check the JupyterLab log for more details at ' + response.timestamp | ||
: 'Check the JupyterLab log for more details'; | ||
return showDialog({ | ||
title: 'Error submitting ' + submissionType, | ||
body: res_body ? (React.createElement("p", null, | ||
res_body, | ||
React.createElement("br", null), | ||
default_body)) : (React.createElement("p", null, default_body)), | ||
body: reason || message ? (React.createElement(ErrorDialogContent, { reason: reason, message: message, timestamp: timestamp, traceback: traceback, default_msg: default_body })) : (React.createElement("p", null, default_body)), | ||
buttons: [Dialog.okButton()] | ||
@@ -93,2 +98,32 @@ }); | ||
} | ||
class ErrorDialogContent extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { expanded: false }; | ||
} | ||
toggleMsgDisplay() { | ||
// Switch expanded flag | ||
const expanded = !this.state.expanded; | ||
this.setState({ expanded: expanded }); | ||
} | ||
render() { | ||
const details = this.props.traceback ? (React.createElement("div", null, | ||
React.createElement("br", null), | ||
React.createElement("div", null, | ||
React.createElement("button", { className: ERROR_DISPLAY_BUTTON + | ||
' ' + | ||
(this.state.expanded ? UP_ICON_CLASS : DOWN_ICON_CLASS), onClick: () => { | ||
this.toggleMsgDisplay(); | ||
} }), | ||
'Error details: '), | ||
React.createElement("br", null), | ||
React.createElement("div", { className: this.state.expanded ? ERROR_DETAILS_VISIBLE : ERROR_DETAILS_HIDDEN }, this.props.traceback))) : null; | ||
return (React.createElement("div", { className: MESSAGE_DISPLAY }, | ||
this.props.message, | ||
React.createElement("br", null), | ||
details, | ||
React.createElement("br", null), | ||
React.createElement("div", null, this.props.default_msg))); | ||
} | ||
} | ||
//# sourceMappingURL=submission.js.map |
{ | ||
"name": "@elyra/application", | ||
"version": "0.8.0-dev", | ||
"version": "0.8.0", | ||
"description": "JupyterLab - Widgets and utilities for use in elyra", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "2e5fe86713e5fb08e90569c08b556d732333de9e" | ||
"gitHead": "ba6813b7d6c1480238343585663a53f300d8a120" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39978
18
335