td support indexes (#18121)

* support indexes

* add pending action warning

* vbump STS
This commit is contained in:
Alan Ren
2022-01-18 22:20:45 -08:00
committed by GitHub
parent e05335e461
commit 5847bd302d
7 changed files with 132 additions and 31 deletions

View File

@@ -639,7 +639,7 @@ export class Designer extends Disposable implements IThemable {
autoEdit: true,
dataItemColumnValueExtractor: (data: any, column: Slick.Column<Slick.SlickData>): string => {
if (column.field) {
return data[column.field].value;
return data[column.field]?.value;
} else {
return undefined;
}

View File

@@ -14,6 +14,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { onUnexpectedError } from 'vs/base/common/errors';
import { Schemas } from 'sql/base/common/schemas';
import { INotificationService } from 'vs/platform/notification/common/notification';
const NewTable: string = localize('tableDesigner.newTable', "New Table");
@@ -27,7 +28,8 @@ export class TableDesignerInput extends EditorInput {
private _provider: TableDesignerProvider,
private _tableInfo: azdata.designers.TableInfo,
@IInstantiationService private readonly _instantiationService: IInstantiationService,
@IEditorService editorService: IEditorService) {
@IEditorService editorService: IEditorService,
@INotificationService private readonly _notificationService: INotificationService) {
super();
this._designerComponentInput = this._instantiationService.createInstance(TableDesignerComponentInput, this._provider, this._tableInfo);
this._register(this._designerComponentInput.onStateChange((e) => {
@@ -81,7 +83,11 @@ export class TableDesignerInput extends EditorInput {
}
override async save(group: GroupIdentifier, options?: ISaveOptions): Promise<IEditorInput | undefined> {
await this._designerComponentInput.openPublishDialog();
if (this._designerComponentInput.pendingAction) {
this._notificationService.warn(localize('tableDesigner.OperationInProgressWarning', "The operation cannot be performed while another operation is in progress."));
} else {
await this._designerComponentInput.openPublishDialog();
}
return this;
}