Allow string for deployment icons and update a couple (#13076)

* Update to colorized versions of bdc and container deployment icons

* update edge

* Allow string for icons
This commit is contained in:
Charles Gagnon
2020-10-26 13:27:12 -07:00
committed by GitHub
parent 2bc2f7f520
commit 2db51ca243
11 changed files with 288 additions and 171 deletions

View File

@@ -14,7 +14,7 @@ export interface ResourceType {
displayName: string;
description: string;
platforms: string[] | '*';
icon: { light: string; dark: string };
icon: { light: string; dark: string } | string;
options: ResourceTypeOption[];
providers: DeploymentProvider[];
agreement?: AgreementInfo;

View File

@@ -64,8 +64,12 @@ export class ResourceTypeService implements IResourceTypeService {
}
private updatePathProperties(resourceType: ResourceType, extensionPath: string): void {
resourceType.icon.dark = path.join(extensionPath, resourceType.icon.dark);
resourceType.icon.light = path.join(extensionPath, resourceType.icon.light);
if (typeof resourceType.icon === 'string') {
resourceType.icon = path.join(extensionPath, resourceType.icon);
} else {
resourceType.icon.dark = path.join(extensionPath, resourceType.icon.dark);
resourceType.icon.light = path.join(extensionPath, resourceType.icon.light);
}
resourceType.providers.forEach((provider) => {
if (instanceOfNotebookDeploymentProvider(provider)) {
this.updateNotebookPath(provider, extensionPath);
@@ -131,7 +135,7 @@ export class ResourceTypeService implements IResourceTypeService {
private validateResourceType(resourceType: ResourceType, positionInfo: string, errorMessages: string[]): void {
this.validateNameDisplayName(resourceType, 'resource type', positionInfo, errorMessages);
if (!resourceType.icon || !resourceType.icon.dark || !resourceType.icon.light) {
if (!resourceType.icon || (typeof resourceType.icon === 'object' && (!resourceType.icon.dark || !resourceType.icon.light))) {
errorMessages.push(`Icon for resource type is not specified properly. ${positionInfo} `);
}