-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Concat uiSideErrors in Cell output #11364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,6 +200,9 @@ export class CellOutput extends React.Component<ICellOutputProps> { | |
if (nextProps.cellVM.cell.data.outputs !== this.props.cellVM.cell.data.outputs) { | ||
return true; | ||
} | ||
if (nextProps.cellVM.uiSideError !== this.props.cellVM.uiSideError) { | ||
return true; | ||
} | ||
if ( | ||
!this.isCodeCell() && | ||
nextProps.cellVM.cell.id !== Identifiers.EditCellId && | ||
|
@@ -272,7 +275,7 @@ export class CellOutput extends React.Component<ICellOutputProps> { | |
// tslint:disable: react-no-dangerous-html | ||
if (this.props.cellVM.uiSideError) { | ||
outputs.push( | ||
<div className="cell-output-uiSideError"> | ||
<div key={'uiError'} className="cell-output-uiSideError"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Key required by react. |
||
<div dangerouslySetInnerHTML={{ __html: this.props.cellVM.uiSideError }} /> | ||
</div> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,9 +243,11 @@ export namespace CommonEffects { | |
"Widgets require us to download supporting files from a 3rd party website. Click <a href='https://command:python.datascience.enableLoadingWidgetScriptsFromThirdPartySource'>here</a> to enable this or click <a href='https://aka.ms/PVSCIPyWidgets'>here</a> for more information. (Error loading {0}:{1})." | ||
).format(arg.payload.data.moduleName, arg.payload.data.moduleVersion); | ||
} | ||
// Preserve existing error messages. | ||
const existingErrorMessage = current.uiSideError ? `${current.uiSideError}\n` : ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure we concat errors. |
||
newVMs[index] = Helpers.asCellViewModel({ | ||
...current, | ||
uiSideError: errorMessage | ||
uiSideError: `${existingErrorMessage}${errorMessage}` | ||
}); | ||
|
||
// Make sure to tell the extension so it can log telemetry. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what was missing, the first time we rendered a cell errors wouldn't get dispalyed, have to run again (as pointed out by @rich)