Skip to content

Commit 3cfe62c

Browse files
IanMatthewHuffIan Huff
andauthored
fix notebook settings links (microsoft#13157)
Co-authored-by: Ian Huff <ianhuff@ravikun-dev2.redmond.corp.microsoft.com>
1 parent c655b55 commit 3cfe62c

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

news/2 Fixes/13156.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix settings links to open correctly in the notebook editor.

src/datascience-ui/history-react/interactiveCell.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ export class InteractiveCell extends React.Component<IInteractiveCellProps> {
160160
enableScroll={this.props.enableScroll}
161161
themeMatplotlibPlots={themeMatplotlibPlots}
162162
widgetFailed={this.props.widgetFailed}
163+
openSettings={this.props.openSettings}
163164
/>
164165
</div>
165166
</div>

src/datascience-ui/interactive-common/cellOutput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ interface ICellOutputProps {
3838
themeMatplotlibPlots?: boolean;
3939
expandImage(imageHtml: string): void;
4040
widgetFailed(ex: Error): void;
41+
openSettings(settings?: string): void;
4142
}
4243

4344
interface ICellOutputData {
@@ -511,7 +512,7 @@ export class CellOutput extends React.Component<ICellOutputProps> {
511512
buffer.push(
512513
<div role="group" key={index} onDoubleClick={transformed.doubleClick} className={className}>
513514
{transformed.extraButton}
514-
<TrimmedOutputMessage></TrimmedOutputMessage>
515+
<TrimmedOutputMessage openSettings={this.props.openSettings} />
515516
<Transform data={transformed.output.data} />
516517
</div>
517518
);

src/datascience-ui/interactive-common/trimmedOutputLink.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22
// Licensed under the MIT License.
33

44
import * as React from 'react';
5-
import { connect } from 'react-redux';
6-
import { actionCreators } from '../history-react/redux/actions';
75
import { getLocString } from '../react-common/locReactSide';
86

97
interface ITrimmedOutputMessage {
10-
openSettings(): void;
8+
openSettings(setting?: string): void;
119
}
1210

13-
class TrimmedOutputMessageComponent extends React.PureComponent<ITrimmedOutputMessage> {
11+
export class TrimmedOutputMessage extends React.PureComponent<ITrimmedOutputMessage> {
1412
constructor(props: ITrimmedOutputMessage) {
1513
super(props);
1614
}
@@ -31,10 +29,6 @@ class TrimmedOutputMessageComponent extends React.PureComponent<ITrimmedOutputMe
3129
);
3230
}
3331
private changeTextOutputLimit = () => {
34-
this.props.openSettings();
32+
this.props.openSettings('python.dataScience.textOutputLimit');
3533
};
3634
}
37-
38-
export const TrimmedOutputMessage = connect(undefined, {
39-
openSettings: () => actionCreators.openSettings('python.dataScience.textOutputLimit')
40-
})(TrimmedOutputMessageComponent);

src/datascience-ui/native-editor/nativeCell.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ export class NativeCell extends React.Component<INativeCellProps> {
822822
enableScroll={this.props.enableScroll}
823823
themeMatplotlibPlots={themeMatplotlibPlots}
824824
widgetFailed={this.props.widgetFailed}
825+
openSettings={this.props.openSettings}
825826
/>
826827
</div>
827828
);

src/datascience-ui/native-editor/redux/reducers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export const reducerMap: Partial<INativeEditorActionMapping> = {
6767
[CommonActionType.CONTINUE]: Execution.continueExec,
6868
[CommonActionType.STEP]: Execution.step,
6969
[CommonActionType.RUN_BY_LINE]: Execution.runByLine,
70+
[CommonActionType.OPEN_SETTINGS]: CommonEffects.openSettings,
7071

7172
// Messages from the webview (some are ignored)
7273
[InteractiveWindowMessages.StartCell]: Creation.startCell,

0 commit comments

Comments
 (0)