|
|
@ -38,7 +38,7 @@ import { |
|
|
|
import { AbstractWidgetComponent } from 'core-app/shared/components/grids/widgets/abstract-widget.component'; |
|
|
|
import { AbstractWidgetComponent } from 'core-app/shared/components/grids/widgets/abstract-widget.component'; |
|
|
|
import { I18nService } from 'core-app/core/i18n/i18n.service'; |
|
|
|
import { I18nService } from 'core-app/core/i18n/i18n.service'; |
|
|
|
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service'; |
|
|
|
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service'; |
|
|
|
import { SchemaResource } from 'core-app/features/hal/resources/schema-resource'; |
|
|
|
import { SchemaAttributeObject, SchemaResource } from 'core-app/features/hal/resources/schema-resource'; |
|
|
|
import { Observable } from 'rxjs'; |
|
|
|
import { Observable } from 'rxjs'; |
|
|
|
import { ProjectResource } from 'core-app/features/hal/resources/project-resource'; |
|
|
|
import { ProjectResource } from 'core-app/features/hal/resources/project-resource'; |
|
|
|
import { HalResourceEditingService } from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service'; |
|
|
|
import { HalResourceEditingService } from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service'; |
|
|
@ -67,21 +67,23 @@ export class WidgetProjectDetailsComponent extends AbstractWidgetComponent imple |
|
|
|
super(i18n, injector); |
|
|
|
super(i18n, injector); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit() { |
|
|
|
ngOnInit():void { |
|
|
|
this.loadAndRender(); |
|
|
|
this.loadAndRender(); |
|
|
|
|
|
|
|
if (this.currentProject.id) { |
|
|
|
this.project$ = this |
|
|
|
this.project$ = this |
|
|
|
.apiV3Service |
|
|
|
.apiV3Service |
|
|
|
.projects |
|
|
|
.projects |
|
|
|
.id(this.currentProject.id!) |
|
|
|
.id(this.currentProject.id) |
|
|
|
.requireAndStream(); |
|
|
|
.requireAndStream(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public get isEditable() { |
|
|
|
public get isEditable():boolean { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private loadAndRender() { |
|
|
|
private loadAndRender():void { |
|
|
|
Promise.all([ |
|
|
|
void Promise.all([ |
|
|
|
this.loadProjectSchema(), |
|
|
|
this.loadProjectSchema(), |
|
|
|
]) |
|
|
|
]) |
|
|
|
.then(([schema]) => { |
|
|
|
.then(([schema]) => { |
|
|
@ -89,7 +91,7 @@ export class WidgetProjectDetailsComponent extends AbstractWidgetComponent imple |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private loadProjectSchema() { |
|
|
|
private loadProjectSchema():Promise<SchemaResource> { |
|
|
|
return this |
|
|
|
return this |
|
|
|
.apiV3Service |
|
|
|
.apiV3Service |
|
|
|
.projects |
|
|
|
.projects |
|
|
@ -101,7 +103,7 @@ export class WidgetProjectDetailsComponent extends AbstractWidgetComponent imple |
|
|
|
private setCustomFields(schema:SchemaResource) { |
|
|
|
private setCustomFields(schema:SchemaResource) { |
|
|
|
Object.entries(schema).forEach(([key, keySchema]) => { |
|
|
|
Object.entries(schema).forEach(([key, keySchema]) => { |
|
|
|
if (/customField\d+/.exec(key)) { |
|
|
|
if (/customField\d+/.exec(key)) { |
|
|
|
this.customFields.push({ key, label: keySchema.name }); |
|
|
|
this.customFields.push({ key, label: (keySchema as SchemaAttributeObject).name }); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|