Merge branch 'dmp-refactoring' of code-repo.d4science.org:MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
bf08b6abb7
|
@ -1,4 +1,4 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
import { UntypedFormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
import { IsActive } from '@app/core/common/enum/is-active.enum';
|
||||||
|
@ -24,6 +24,8 @@ export class DescriptionBaseFieldsEditorComponent extends BaseComponent {
|
||||||
@Input() description: Description;
|
@Input() description: Description;
|
||||||
availableDescriptionTemplates: DescriptionTemplate[] = [];
|
availableDescriptionTemplates: DescriptionTemplate[] = [];
|
||||||
viewOnly = false; //TODO: not used.
|
viewOnly = false; //TODO: not used.
|
||||||
|
|
||||||
|
@Output() refresh: EventEmitter<any> = new EventEmitter<any>();
|
||||||
|
|
||||||
constructor(private dialog: MatDialog,
|
constructor(private dialog: MatDialog,
|
||||||
private descriptionService: DescriptionService) {
|
private descriptionService: DescriptionService) {
|
||||||
|
@ -67,9 +69,7 @@ export class DescriptionBaseFieldsEditorComponent extends BaseComponent {
|
||||||
})
|
})
|
||||||
.subscribe(
|
.subscribe(
|
||||||
result => {
|
result => {
|
||||||
if (result) {
|
this.refresh.emit(result);
|
||||||
this.loadDescriptionTemplates();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error => console.error(error));
|
error => console.error(error));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -121,7 +121,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto form" id="description-editor-form">
|
<div class="col-auto form" id="description-editor-form">
|
||||||
<app-description-base-fields-editor-component [hidden]="this.step !== 0" [formGroup]="formGroup" [description]="item" (formChanged)="formChanged()"></app-description-base-fields-editor-component>
|
<app-description-base-fields-editor-component [hidden]="this.step !== 0" [formGroup]="formGroup" [description]="item" (formChanged)="formChanged()" (refresh)="fireRefreshDataEvent($event)"></app-description-base-fields-editor-component>
|
||||||
<app-description-form
|
<app-description-form
|
||||||
*ngIf="formGroup && formGroup.get('properties')"
|
*ngIf="formGroup && formGroup.get('properties')"
|
||||||
[propertiesFormGroup]="formGroup.get('properties')"
|
[propertiesFormGroup]="formGroup.get('properties')"
|
||||||
|
|
|
@ -604,6 +604,12 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fireRefreshDataEvent(event: boolean): void {
|
||||||
|
if (event) {
|
||||||
|
this.refreshData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
refreshData(): void {
|
refreshData(): void {
|
||||||
this.getItem(this.editorModel.id, (data: Description) => this.prepareForm(data));
|
this.getItem(this.editorModel.id, (data: Description) => this.prepareForm(data));
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
<mat-select placeholder="{{'PREFILL-DESCRIPTION-DIALOG.DESCRIPTION-TEMPLATE'| translate}}" [required]="true" [compareWith]="compareWith" [formControl]="prefillForm.get('descriptionTemplateId')">
|
<mat-select placeholder="{{'PREFILL-DESCRIPTION-DIALOG.DESCRIPTION-TEMPLATE'| translate}}" [required]="true" [compareWith]="compareWith" [formControl]="prefillForm.get('descriptionTemplateId')">
|
||||||
<mat-option *ngFor="let descriptionTemplate of availableDescriptionTemplates" [value]="descriptionTemplate.id">
|
<mat-option *ngFor="let descriptionTemplate of availableDescriptionTemplates" [value]="descriptionTemplate.id">
|
||||||
<div>
|
<div>
|
||||||
{{descriptionTemplate.label}}
|
<span>{{descriptionTemplate.label}}, </span>
|
||||||
|
<span>{{'DESCRIPTION-EDITOR.BASE-INFO.FIELDS.DESCRIPTION-TEMPLATE-VERSION'| translate}} {{descriptionTemplate.version}}</span>
|
||||||
</div>
|
</div>
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
|
|
Loading…
Reference in New Issue