Skip to content

Commit

Permalink
Added support for externally provisioned workspaces (#1103)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
andrewbrazzatti authored Jul 8, 2022
1 parent eba5671 commit 67e77e2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion angular/shared/form/field-relatedobjectdata.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class RelatedObjectDataField extends FieldBase<any> {

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) {
Expand Down
3 changes: 3 additions & 0 deletions angular/shared/form/field-simple.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ Based on: https://bootstrap-datepicker.readthedocs.io/en/stable/
@Component({
selector: 'date-time',
template: `
<ng-container *ngIf="field.visible">
<div *ngIf="field.editMode" [formGroup]='form' class="form-group">
<span class="label-font">
{{field.label}} {{ getRequiredLabelStr()}}
Expand All @@ -823,6 +824,8 @@ Based on: https://bootstrap-datepicker.readthedocs.io/en/stable/
<span class="key" *ngIf="field.label">{{field.label}}</span>
<span class="value">{{field.formatValueForDisplay()}}</span>
</li>
</ng-container>
`
})
export class DateTimeComponent extends SimpleComponent {
Expand Down
4 changes: 2 additions & 2 deletions angular/shared/form/workspace-selector.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export class WorkspaceSelectorComponent extends SimpleComponent {
<div class="col-md-8 col-sm-8 col-xs-8 col-lg-8">
<h5>{{ field.workspaceApp.subtitle }}</h5>
<span *ngIf="field.allowAdd">
<p>{{ field.workspaceApp.description }}</p>
<button type='button' (click)="saveAndOpenWorkspace()" class="btn btn-primary">{{ field.open }}</button>
<p [innerHtml]="field.workspaceApp.description"></p>
<button *ngIf="field.workspaceApp.externallyProvisioned != true" type='button' (click)="saveAndOpenWorkspace()" class="btn btn-primary">{{ field.open }}</button>
</span>
<span *ngIf="!field.allowAdd">
<p class="text-danger">
Expand Down
4 changes: 4 additions & 0 deletions api/models/WorkspaceType.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ module.exports = {
},
description: {
type: 'string'
},
externallyProvisioned: {
type: 'boolean',
defaultsTo: false
}
}
}
3 changes: 2 additions & 1 deletion typescript/api/services/WorkspaceTypesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']
})
)
}
Expand Down

0 comments on commit 67e77e2

Please sign in to comment.