From 67e77e257836ee92730347a0c537f3815d711211 Mon Sep 17 00:00:00 2001 From: andrewbrazzatti Date: Fri, 8 Jul 2022 12:32:04 +0930 Subject: [PATCH] Added support for externally provisioned workspaces (#1103) * Removed error object from responses. Logging errors to the server log instead * Allowed the description of the workspace to support HTML. Added support for external provisioned workspaces that are just a description (which may include a link to the service) and don't have a form to provision * Fixed issue where a property that should have a label has a value of null, causes front end errors * Added model and bootstrap settings to support externallyProvisioned workspace types * Added show/hide support to DateTimeComponent --- angular/shared/form/field-relatedobjectdata.component.ts | 2 +- angular/shared/form/field-simple.component.ts | 3 +++ angular/shared/form/workspace-selector.component.ts | 4 ++-- api/models/WorkspaceType.js | 4 ++++ typescript/api/services/WorkspaceTypesService.ts | 3 ++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/angular/shared/form/field-relatedobjectdata.component.ts b/angular/shared/form/field-relatedobjectdata.component.ts index 79d3242ef8..a3b29127fd 100644 --- a/angular/shared/form/field-relatedobjectdata.component.ts +++ b/angular/shared/form/field-relatedobjectdata.component.ts @@ -140,7 +140,7 @@ export class RelatedObjectDataField extends FieldBase { getPropertyLabel(item: any, columnConf: any) { const val = this.getPropertyValue(item, columnConf); - return this.getTranslated(val['label'], val['label']); + return this.getTranslated(_.get(val,'label',null), _.get(val,'label','')); } isMultiValue(item: any, columnConf: any) { diff --git a/angular/shared/form/field-simple.component.ts b/angular/shared/form/field-simple.component.ts index 8d78657cd2..b8ee623707 100644 --- a/angular/shared/form/field-simple.component.ts +++ b/angular/shared/form/field-simple.component.ts @@ -807,6 +807,7 @@ Based on: https://bootstrap-datepicker.readthedocs.io/en/stable/ @Component({ selector: 'date-time', template: ` +
{{field.label}} {{ getRequiredLabelStr()}} @@ -823,6 +824,8 @@ Based on: https://bootstrap-datepicker.readthedocs.io/en/stable/ {{field.label}} {{field.formatValueForDisplay()}} + + ` }) export class DateTimeComponent extends SimpleComponent { diff --git a/angular/shared/form/workspace-selector.component.ts b/angular/shared/form/workspace-selector.component.ts index aba7470f35..02fe1929ca 100644 --- a/angular/shared/form/workspace-selector.component.ts +++ b/angular/shared/form/workspace-selector.component.ts @@ -59,8 +59,8 @@ export class WorkspaceSelectorComponent extends SimpleComponent {
{{ field.workspaceApp.subtitle }}
-

{{ field.workspaceApp.description }}

- +

+

diff --git a/api/models/WorkspaceType.js b/api/models/WorkspaceType.js index a588fb254f..193f1cbd54 100644 --- a/api/models/WorkspaceType.js +++ b/api/models/WorkspaceType.js @@ -29,6 +29,10 @@ module.exports = { }, description: { type: 'string' + }, + externallyProvisioned: { + type: 'boolean', + defaultsTo: false } } } diff --git a/typescript/api/services/WorkspaceTypesService.ts b/typescript/api/services/WorkspaceTypesService.ts index 27659039b1..3e21414e82 100644 --- a/typescript/api/services/WorkspaceTypesService.ts +++ b/typescript/api/services/WorkspaceTypesService.ts @@ -79,7 +79,8 @@ export module Services { branding: brand.id, subtitle: workspaceType['subtitle'], description: workspaceType['description'], - logo: workspaceType['logo'] + logo: workspaceType['logo'], + externallyProvisioned: workspaceType['externallyProvisioned'] }) ) }