mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
@@ -5,6 +5,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
-->
|
-->
|
||||||
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
|
<div style="overflow: hidden; width: 100%; height: 100%; display: flex; flex-flow: column">
|
||||||
|
<loading-spinner [loading]="isLoading"></loading-spinner>
|
||||||
<div class="notebook-text" style="flex: 0 0 auto;">
|
<div class="notebook-text" style="flex: 0 0 auto;">
|
||||||
<code-component *ngIf="isEditMode" [cellModel]="cellModel" (onContentChanged)="handleContentChanged()" [model]="model" [activeCellId]="activeCellId" [hideVerticalToolbar]=true>
|
<code-component *ngIf="isEditMode" [cellModel]="cellModel" (onContentChanged)="handleContentChanged()" [model]="model" [activeCellId]="activeCellId" [hideVerticalToolbar]=true>
|
||||||
</code-component>
|
</code-component>
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ import { ICellModel } from 'sql/parts/notebook/models/modelInterfaces';
|
|||||||
import { ISanitizer, defaultSanitizer } from 'sql/parts/notebook/outputs/sanitizer';
|
import { ISanitizer, defaultSanitizer } from 'sql/parts/notebook/outputs/sanitizer';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
import { NotebookModel } from 'sql/parts/notebook/models/notebookModel';
|
import { NotebookModel } from 'sql/parts/notebook/models/notebookModel';
|
||||||
|
import { Emitter } from 'vs/base/common/event';
|
||||||
|
import URI from 'vs/base/common/uri';
|
||||||
|
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||||
|
|
||||||
export const TEXT_SELECTOR: string = 'text-cell-component';
|
export const TEXT_SELECTOR: string = 'text-cell-component';
|
||||||
|
|
||||||
@@ -40,15 +43,20 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
|||||||
private _sanitizer: ISanitizer;
|
private _sanitizer: ISanitizer;
|
||||||
private _model: NotebookModel;
|
private _model: NotebookModel;
|
||||||
private _activeCellId: string;
|
private _activeCellId: string;
|
||||||
|
private readonly _onDidClickLink = this._register(new Emitter<URI>());
|
||||||
|
public readonly onDidClickLink = this._onDidClickLink.event;
|
||||||
|
protected isLoading: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(forwardRef(() => CommonServiceInterface)) private _bootstrapService: CommonServiceInterface,
|
@Inject(forwardRef(() => CommonServiceInterface)) private _bootstrapService: CommonServiceInterface,
|
||||||
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
|
||||||
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
|
||||||
@Inject(ICommandService) private _commandService: ICommandService
|
@Inject(ICommandService) private _commandService: ICommandService,
|
||||||
|
@Inject(IOpenerService) private readonly openerService: IOpenerService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this.isEditMode = false;
|
this.isEditMode = false;
|
||||||
|
this.isLoading = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Gets sanitizer from ISanitizer interface
|
//Gets sanitizer from ISanitizer interface
|
||||||
@@ -67,8 +75,14 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
|
|||||||
return this._activeCellId;
|
return this._activeCellId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private setLoading(isLoading: boolean): void {
|
||||||
|
this.isLoading = isLoading;
|
||||||
|
this._changeRef.detectChanges();
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.updatePreview();
|
this.updatePreview();
|
||||||
|
this.setLoading(false);
|
||||||
this._register(this.themeService.onDidColorThemeChange(this.updateTheme, this));
|
this._register(this.themeService.onDidColorThemeChange(this.updateTheme, this));
|
||||||
this.updateTheme(this.themeService.getColorTheme());
|
this.updateTheme(this.themeService.getColorTheme());
|
||||||
this.cellModel.onOutputsChanged(e => {
|
this.cellModel.onOutputsChanged(e => {
|
||||||
|
|||||||
Reference in New Issue
Block a user