mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
TSGops -image (Light version of ADSWeb) (#17768)
* rough changes for adsweb-lite * commit id of latest quality * fix for aria label * distro commit id changes * merged latest changes distro id * python path changes + quality name change * Hide container views/settings/panel for ADSWeb * undo unintentional change * No python prompt changes for tsgops-image * distro id changed for tsgops quality name * changed quality name to tsgops * changed name to tsgops-image * python address change * unintended changes undo * correct python installation path for tsgops * enable preview features tsgops * no prompt for tsgops-lite image * revert preview feature change * Fixes for few comments * removed extra line * add deleted line * Addressed comments * Addressed final comments * eslint error fix * fix Co-authored-by: Monica Gupta <mogupt@microsoft.com>
This commit is contained in:
@@ -133,18 +133,24 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
||||
private readonly _requiredPackagesSet: Set<string>;
|
||||
|
||||
private readonly _runningOnSAW: boolean;
|
||||
private readonly _tsgopsweb: boolean;
|
||||
|
||||
constructor(extensionPath: string, outputChannel: vscode.OutputChannel) {
|
||||
this.extensionPath = extensionPath;
|
||||
this.outputChannel = outputChannel;
|
||||
|
||||
this._runningOnSAW = vscode.env.appName.toLowerCase().indexOf('saw') > 0;
|
||||
this._tsgopsweb = vscode.env.appName.toLowerCase().indexOf('tsgops') > 0;
|
||||
void vscode.commands.executeCommand(constants.BuiltInCommands.SetContext, 'notebook:runningOnSAW', this._runningOnSAW);
|
||||
|
||||
if (this._runningOnSAW) {
|
||||
this._pythonInstallationPath = `${vscode.env.appRoot}\\ads-python`;
|
||||
this._usingExistingPython = true;
|
||||
} else {
|
||||
} else if (this._tsgopsweb) {
|
||||
this._pythonInstallationPath = `/usr`;
|
||||
this._usingExistingPython = true;
|
||||
}
|
||||
else {
|
||||
this._pythonInstallationPath = JupyterServerInstallation.getPythonInstallPath();
|
||||
this._usingExistingPython = JupyterServerInstallation.getExistingPythonSetting();
|
||||
}
|
||||
@@ -497,7 +503,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
||||
* Opens a dialog for configuring the installation path for the Notebook Python dependencies.
|
||||
*/
|
||||
public async promptForPythonInstall(kernelDisplayName: string): Promise<void> {
|
||||
if (this._runningOnSAW) {
|
||||
if (this._runningOnSAW || this._tsgopsweb) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (this._installInProgress) {
|
||||
|
||||
@@ -36,6 +36,7 @@ export const FILE_QUERY_EDITOR_TYPEID = 'workbench.editorInput.fileQueryInput';
|
||||
export const RESOURCE_VIEWER_TYPEID = 'workbench.editorInput.resourceViewerInput';
|
||||
|
||||
export const JUPYTER_PROVIDER_ID = 'jupyter';
|
||||
export const TSGOPS_WEB_QUALITY = 'tsgops-image';
|
||||
|
||||
// The version of the notebook file format that we support
|
||||
export const NBFORMAT = 4;
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { HideActivityBarViewContainers, HideSettings, HidePanel } from 'sql/workbench/contrib/tsgops/browser/tsgopsActions';
|
||||
import { IWorkbenchContribution, Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { TSGOPS_WEB_QUALITY } from 'sql/workbench/common/constants';
|
||||
export class ADSWebLite implements IWorkbenchContribution {
|
||||
constructor(
|
||||
@ICommandService private commandService: ICommandService,
|
||||
) {
|
||||
void this.createTSGOpsImage();
|
||||
}
|
||||
|
||||
private async createTSGOpsImage(): Promise<void> {
|
||||
await this.commandService.executeCommand('workbench.action.hideSettings');
|
||||
await this.commandService.executeCommand('workbench.action.hidePanel');
|
||||
await this.commandService.executeCommand('workbench.action.hideActivityBarViewContainers');
|
||||
}
|
||||
}
|
||||
|
||||
if (product.quality === TSGOPS_WEB_QUALITY) {
|
||||
// Global Actions
|
||||
const actionRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions);
|
||||
|
||||
actionRegistry.registerWorkbenchAction(
|
||||
SyncActionDescriptor.create(
|
||||
HideActivityBarViewContainers,
|
||||
HideActivityBarViewContainers.ID,
|
||||
HideActivityBarViewContainers.LABEL
|
||||
),
|
||||
HideActivityBarViewContainers.LABEL
|
||||
);
|
||||
actionRegistry.registerWorkbenchAction(
|
||||
SyncActionDescriptor.create(
|
||||
HideSettings,
|
||||
HideSettings.ID,
|
||||
HideSettings.LABEL
|
||||
),
|
||||
HideSettings.LABEL
|
||||
);
|
||||
actionRegistry.registerWorkbenchAction(
|
||||
SyncActionDescriptor.create(
|
||||
HidePanel,
|
||||
HidePanel.ID,
|
||||
HidePanel.LABEL
|
||||
),
|
||||
HidePanel.LABEL
|
||||
);
|
||||
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
|
||||
.registerWorkbenchContribution(ADSWebLite, LifecyclePhase.Restored);
|
||||
}
|
||||
64
src/sql/workbench/contrib/tsgops/browser/tsgopsActions.ts
Normal file
64
src/sql/workbench/contrib/tsgops/browser/tsgopsActions.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { localize } from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { IActivityBarService } from 'vs/workbench/services/activityBar/browser/activityBarService';
|
||||
|
||||
export class HidePanel extends Action {
|
||||
static readonly ID = 'workbench.action.hidePanel';
|
||||
static readonly LABEL = localize('hidePanel', "Hide the panel");
|
||||
|
||||
constructor(
|
||||
id: string = HidePanel.ID,
|
||||
label: string = HidePanel.LABEL,
|
||||
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
override async run(): Promise<void> {
|
||||
this.layoutService.setPanelHidden(true);
|
||||
}
|
||||
}
|
||||
|
||||
export class HideSettings extends Action {
|
||||
static readonly ID = 'workbench.action.hideSettings';
|
||||
static readonly LABEL = localize('hideSettings', "Hide the settings icon");
|
||||
|
||||
constructor(
|
||||
id: string = HideSettings.ID,
|
||||
label: string = HideSettings.LABEL,
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
override async run(): Promise<void> {
|
||||
let allActionItems = Array.from(document.getElementsByClassName('action-item icon'));
|
||||
let manageElement = allActionItems.filter((el) => el.getAttribute('aria-label') === 'Manage');
|
||||
manageElement[0].parentNode.removeChild(manageElement[0]);
|
||||
}
|
||||
}
|
||||
|
||||
export class HideActivityBarViewContainers extends Action {
|
||||
static readonly ID = 'workbench.action.hideActivityBarViewContainers';
|
||||
static readonly LABEL = localize('hideActivityBarViewContainers', "Hide the extension viewlet");
|
||||
|
||||
constructor(
|
||||
id: string = HideActivityBarViewContainers.ID,
|
||||
label: string = HideActivityBarViewContainers.LABEL,
|
||||
@IActivityBarService private readonly activityBarService: IActivityBarService,
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
override async run(): Promise<void> {
|
||||
let viewsToHide = ['workbench.view.search', 'workbench.view.explorer', 'workbench.view.scm', 'workbench.view.extensions'];
|
||||
for (let j = 0; j < viewsToHide.length; j++) {
|
||||
this.activityBarService.hideViewContainer(viewsToHide[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -753,6 +753,10 @@ export class ActivitybarPart extends Part implements IActivityBarService {
|
||||
.map(v => v.id);
|
||||
}
|
||||
|
||||
hideViewContainer(id: string): void { // {{SQL CARBON EDIT}}
|
||||
this.compositeBar.unpin(id);
|
||||
}
|
||||
|
||||
focusActivityBar(): void {
|
||||
this.compositeBar.focus();
|
||||
}
|
||||
|
||||
@@ -38,50 +38,54 @@ import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { IsMacNativeContext, IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { TSGOPS_WEB_QUALITY } from 'sql/workbench/common/constants';
|
||||
|
||||
export type IOpenRecentAction = IAction & { uri: URI, remoteAuthority?: string };
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
|
||||
submenu: MenuId.MenubarFileMenu,
|
||||
title: {
|
||||
value: 'File',
|
||||
original: 'File',
|
||||
mnemonicTitle: localize({ key: 'mFile', comment: ['&& denotes a mnemonic'] }, "&&File"),
|
||||
},
|
||||
order: 1
|
||||
});
|
||||
if (product.quality !== TSGOPS_WEB_QUALITY) { // {{SQL CARBON EDIT}}
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
|
||||
submenu: MenuId.MenubarFileMenu,
|
||||
title: {
|
||||
value: 'File',
|
||||
original: 'File',
|
||||
mnemonicTitle: localize({ key: 'mFile', comment: ['&& denotes a mnemonic'] }, "&&File"),
|
||||
},
|
||||
order: 1
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
|
||||
submenu: MenuId.MenubarEditMenu,
|
||||
title: {
|
||||
value: 'Edit',
|
||||
original: 'Edit',
|
||||
mnemonicTitle: localize({ key: 'mEdit', comment: ['&& denotes a mnemonic'] }, "&&Edit")
|
||||
},
|
||||
order: 2
|
||||
});
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
|
||||
submenu: MenuId.MenubarEditMenu,
|
||||
title: {
|
||||
value: 'Edit',
|
||||
original: 'Edit',
|
||||
mnemonicTitle: localize({ key: 'mEdit', comment: ['&& denotes a mnemonic'] }, "&&Edit")
|
||||
},
|
||||
order: 2
|
||||
});
|
||||
|
||||
/* {{SQL CARBON EDIT}} - Disable unused menus
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
|
||||
submenu: MenuId.MenubarSelectionMenu,
|
||||
title: {
|
||||
value: 'Selection',
|
||||
original: 'Selection',
|
||||
mnemonicTitle: localize({ key: 'mSelection', comment: ['&& denotes a mnemonic'] }, "&&Selection")
|
||||
},
|
||||
order: 3
|
||||
});
|
||||
*/
|
||||
/* {{SQL CARBON EDIT}} - Disable unused menus
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
|
||||
submenu: MenuId.MenubarSelectionMenu,
|
||||
title: {
|
||||
value: 'Selection',
|
||||
original: 'Selection',
|
||||
mnemonicTitle: localize({ key: 'mSelection', comment: ['&& denotes a mnemonic'] }, "&&Selection")
|
||||
},
|
||||
order: 3
|
||||
});
|
||||
*/
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
|
||||
submenu: MenuId.MenubarViewMenu,
|
||||
title: {
|
||||
value: 'View',
|
||||
original: 'View',
|
||||
mnemonicTitle: localize({ key: 'mView', comment: ['&& denotes a mnemonic'] }, "&&View")
|
||||
},
|
||||
order: 4
|
||||
});
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
|
||||
submenu: MenuId.MenubarViewMenu,
|
||||
title: {
|
||||
value: 'View',
|
||||
original: 'View',
|
||||
mnemonicTitle: localize({ key: 'mView', comment: ['&& denotes a mnemonic'] }, "&&View")
|
||||
},
|
||||
order: 4
|
||||
});
|
||||
}
|
||||
|
||||
/* {{SQL CARBON EDIT}} - Disable unused menus
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarMainMenu, {
|
||||
|
||||
@@ -27,6 +27,11 @@ export interface IActivityBarService {
|
||||
*/
|
||||
getVisibleViewContainerIds(): string[];
|
||||
|
||||
/**
|
||||
* Hides View container.
|
||||
*/
|
||||
hideViewContainer(string): void; // {{SQL CARBON EDIT}}
|
||||
|
||||
/**
|
||||
* Focuses the activity bar.
|
||||
*/
|
||||
|
||||
@@ -527,6 +527,9 @@ import 'sql/workbench/contrib/resourceDeployment/browser/resourceDeployment.cont
|
||||
// Extension
|
||||
import 'sql/workbench/contrib/extensions/browser/extensions.contribution';
|
||||
|
||||
// TSGOps ads light image
|
||||
import 'sql/workbench/contrib/tsgops/browser/tsgops.contribution';
|
||||
|
||||
// Azure
|
||||
import 'sql/workbench/contrib/azure/browser/azure.contribution';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user