diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.html b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.html index 9603ca29c3..904fbf9c4c 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.html +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.html @@ -5,7 +5,7 @@ *--------------------------------------------------------------------------------------------*/ -->
- +
diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts index 8b16a9944c..d1d1b9d817 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.ts @@ -27,6 +27,7 @@ import { CellToggleMoreActions } from 'sql/workbench/contrib/notebook/browser/ce import { CodeComponent } from 'sql/workbench/contrib/notebook/browser/cellViews/code.component'; import { NotebookRange, ICellEditorProvider } from 'sql/workbench/services/notebook/browser/notebookService'; import { IColorTheme } from 'vs/platform/theme/common/themeService'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; export const TEXT_SELECTOR: string = 'text-cell-component'; const USER_SELECT_CLASS = 'actionselect'; @@ -87,11 +88,13 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { private _hover: boolean; private markdownRenderer: NotebookMarkdownRenderer; private markdownResult: IMarkdownRenderResult; + public previewFeaturesEnabled: boolean = false; constructor( @Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef, @Inject(IInstantiationService) private _instantiationService: IInstantiationService, @Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService, + @Inject(IConfigurationService) private _configurationService: IConfigurationService ) { super(); this.isEditMode = true; @@ -102,6 +105,9 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { this.markdownResult.dispose(); } })); + this._register(this._configurationService.onDidChangeConfiguration(e => { + this.previewFeaturesEnabled = this._configurationService.getValue('workbench.enablePreviewFeatures'); + })); } public get cellEditors(): ICellEditorProvider[] { @@ -134,6 +140,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { } ngOnInit() { + this.previewFeaturesEnabled = this._configurationService.getValue('workbench.enablePreviewFeatures'); this._register(this.themeService.onDidColorThemeChange(this.updateTheme, this)); this.updateTheme(this.themeService.getColorTheme()); this._cellToggleMoreActions.onInit(this.moreActionsElementRef, this.model, this.cellModel); diff --git a/src/sql/workbench/contrib/notebook/browser/notebook.component.ts b/src/sql/workbench/contrib/notebook/browser/notebook.component.ts index 1874f9edfb..1932f38486 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebook.component.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebook.component.ts @@ -57,10 +57,8 @@ import { IColorTheme } from 'vs/platform/theme/common/themeService'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; - export const NOTEBOOK_SELECTOR: string = 'notebook-component'; - @Component({ selector: NOTEBOOK_SELECTOR, templateUrl: decodeURI(require.toUrl('./notebook.component.html'))