mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
add preview flag for table designer (#18253)
This commit is contained in:
@@ -501,12 +501,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "mssql.designTable",
|
"command": "mssql.designTable",
|
||||||
"when": "connectionProvider == MSSQL && nodeType == Table && config.tableDesigner.enableFeature",
|
"when": "connectionProvider == MSSQL && nodeType == Table && config.workbench.enablePreviewFeatures",
|
||||||
"group": "0_query@3"
|
"group": "0_query@3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "mssql.newTable",
|
"command": "mssql.newTable",
|
||||||
"when": "connectionProvider == MSSQL && nodeType == Folder && nodeLabel == Tables && config.tableDesigner.enableFeature",
|
"when": "connectionProvider == MSSQL && nodeType == Folder && nodeLabel == Tables && config.workbench.enablePreviewFeatures",
|
||||||
"group": "0_query@1"
|
"group": "0_query@1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -10,13 +10,25 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-designer-main-container .actionbar-container {
|
.table-designer-main-container .top-row-container .actionbar-container {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-designer-main-container .designer-container {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-designer-main-container .top-row-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
border-width: 0 0 1px 0;
|
border-width: 0 0 1px 0;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-designer-main-container .designer-container {
|
.table-designer-main-container .top-row-container .preview-flag-container {
|
||||||
flex: 1 1 auto;
|
flex: 0 0 auto;
|
||||||
|
padding-left: 20px;
|
||||||
|
background-position: left;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
|||||||
import { Registry } from 'vs/platform/registry/common/platform';
|
import { Registry } from 'vs/platform/registry/common/platform';
|
||||||
import { EditorPaneDescriptor, IEditorPaneRegistry } from 'vs/workbench/browser/editor';
|
import { EditorPaneDescriptor, IEditorPaneRegistry } from 'vs/workbench/browser/editor';
|
||||||
import { EditorExtensions } from 'vs/workbench/common/editor';
|
import { EditorExtensions } from 'vs/workbench/common/editor';
|
||||||
import { localize } from 'vs/nls';
|
|
||||||
import { IConfigurationRegistry, Extensions as ConfigExtensions } from 'vs/platform/configuration/common/configurationRegistry';
|
|
||||||
|
|
||||||
const tableDesignerDescriptor = EditorPaneDescriptor.create(
|
const tableDesignerDescriptor = EditorPaneDescriptor.create(
|
||||||
TableDesignerEditor,
|
TableDesignerEditor,
|
||||||
@@ -20,16 +18,3 @@ const tableDesignerDescriptor = EditorPaneDescriptor.create(
|
|||||||
|
|
||||||
Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane)
|
Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane)
|
||||||
.registerEditorPane(tableDesignerDescriptor, [new SyncDescriptor(TableDesignerInput)]);
|
.registerEditorPane(tableDesignerDescriptor, [new SyncDescriptor(TableDesignerInput)]);
|
||||||
|
|
||||||
Registry.as<IConfigurationRegistry>(ConfigExtensions.Configuration).registerConfiguration({
|
|
||||||
id: 'tableDesigner',
|
|
||||||
title: localize('tableDesigner.configTitle', "Table Designer"),
|
|
||||||
type: 'object',
|
|
||||||
properties: {
|
|
||||||
'tableDesigner.enableFeature': {
|
|
||||||
'type': 'boolean',
|
|
||||||
'default': false,
|
|
||||||
'description': localize('tableDesigner.featureEnabledDescription', "Controls whether the table designer feature is enabled. Default value is false.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { PublishTableChangesAction } from 'sql/workbench/contrib/tableDesigner/b
|
|||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
import { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||||
import { DesignerPaneSeparator } from 'sql/platform/theme/common/colorRegistry';
|
import { DesignerPaneSeparator } from 'sql/platform/theme/common/colorRegistry';
|
||||||
|
import { localize } from 'vs/nls';
|
||||||
|
|
||||||
export class TableDesignerEditor extends EditorPane {
|
export class TableDesignerEditor extends EditorPane {
|
||||||
public static readonly ID: string = 'workbench.editor.tableDesigner';
|
public static readonly ID: string = 'workbench.editor.tableDesigner';
|
||||||
@@ -50,7 +51,10 @@ export class TableDesignerEditor extends EditorPane {
|
|||||||
protected createEditor(parent: HTMLElement): void {
|
protected createEditor(parent: HTMLElement): void {
|
||||||
// The editor is only created once per editor group.
|
// The editor is only created once per editor group.
|
||||||
const container = parent.appendChild(DOM.$('.table-designer-main-container'));
|
const container = parent.appendChild(DOM.$('.table-designer-main-container'));
|
||||||
const actionbarContainer = container.appendChild(DOM.$('.actionbar-container'));
|
const topRowContainer = container.appendChild(DOM.$('.top-row-container'));
|
||||||
|
const actionbarContainer = topRowContainer.appendChild(DOM.$('.actionbar-container'));
|
||||||
|
const previewFlag = topRowContainer.appendChild(DOM.$('.preview-flag-container.codicon.info'));
|
||||||
|
previewFlag.innerText = localize('tableDesigner.PreviewFeature', "Preview feature");
|
||||||
const designerContainer = container.appendChild(DOM.$('.designer-container'));
|
const designerContainer = container.appendChild(DOM.$('.designer-container'));
|
||||||
const actionbar = new ActionBar(actionbarContainer);
|
const actionbar = new ActionBar(actionbarContainer);
|
||||||
this._register(actionbar);
|
this._register(actionbar);
|
||||||
@@ -63,7 +67,7 @@ export class TableDesignerEditor extends EditorPane {
|
|||||||
this._register(registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
this._register(registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||||
const border = theme.getColor(DesignerPaneSeparator);
|
const border = theme.getColor(DesignerPaneSeparator);
|
||||||
if (border) {
|
if (border) {
|
||||||
collector.addRule(`.table-designer-main-container .actionbar-container { border-color: ${border};}`);
|
collector.addRule(`.table-designer-main-container .top-row-container { border-color: ${border};}`);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user