web - allow to override product config as API

This commit is contained in:
Benjamin Pasero
2020-06-16 07:48:50 +02:00
parent aab2c890fd
commit dcd3480cde
2 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ class BrowserMain extends Disposable {
serviceCollection.set(IWorkbenchEnvironmentService, environmentService);
// Product
const productService: IProductService = { _serviceBrand: undefined, ...product };
const productService: IProductService = { _serviceBrand: undefined, ...product, ...this.configuration.productConfiguration };
serviceCollection.set(IProductService, productService);
// Remote
+15 -3
View File
@@ -17,6 +17,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { IWorkspaceProvider, IWorkspace } from 'vs/workbench/services/host/browser/browserHostService';
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { IProductConfiguration } from 'vs/platform/product/common/productService';
interface IResourceUriProvider {
(uri: URI): URI;
@@ -282,15 +283,25 @@ interface IWorkbenchConstructionOptions {
*/
readonly commands?: readonly ICommand[];
/**
* Optional default layout to apply on first time the workspace is opened.
*/
readonly defaultLayout?: IDefaultLayout;
//#endregion
//#region Branding
/**
* Optional home indicator to appear above the hamburger menu in the activity bar.
*/
readonly homeIndicator?: IHomeIndicator;
/**
* Optional default layout to apply on first time the workspace is opened.
* Optional override for the product configuration properties.
*/
readonly defaultLayout?: IDefaultLayout;
readonly productConfiguration?: Partial<IProductConfiguration>;
//#endregion
@@ -438,8 +449,9 @@ export {
ICommand,
commands,
// Home Indicator
// Branding
IHomeIndicator,
IProductConfiguration,
// Default layout
IDefaultView,