name & version field diasabled in new version dmp
This commit is contained in:
parent
7c6815fef0
commit
1715e8629f
|
@ -80,7 +80,7 @@
|
|||
</button>
|
||||
</div>
|
||||
|
||||
<mat-form-field class="example-full-width">
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Version" disabled [value]="formGroup.get('version').value== undefined ?0 :formGroup.get('version').value">
|
||||
</mat-form-field>
|
||||
|
||||
|
|
|
@ -34,8 +34,10 @@ export class DataManagementPlanWizardComponent implements OnInit {
|
|||
this.dataManagementPlanService.getSingle(this.itemId).map(data => data as DataManagementPlanModel)
|
||||
.subscribe(data => {
|
||||
this.dataManagementPlan = JsonSerializer.fromJSONObject(data, DataManagementPlanModel);
|
||||
this.formGroup = this.dataManagementPlan.buildForm();
|
||||
this.isClone = this.route.snapshot.data.clone;
|
||||
if(this.isClone == false) this.dataManagementPlan.version = this.dataManagementPlan.version + 1;
|
||||
this.formGroup = this.dataManagementPlan.buildForm();
|
||||
|
||||
});
|
||||
})
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<mat-card>
|
||||
<mat-card-content>
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="{{'DMP-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" formControlName="label" required>
|
||||
<input matInput placeholder="{{'DMP-EDITOR.FIELDS.NAME' | translate}}" type="text" name="label" formControlName="label" required [attr.disabled]="labelDisabled">
|
||||
<mat-error *ngIf="formGroup.get('label').errors?.backendError">{{baseErrorModel.label}}</mat-error>
|
||||
<mat-error *ngIf="formGroup.get('label').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
||||
</mat-form-field>
|
||||
|
@ -66,6 +66,10 @@
|
|||
<mat-progress-bar [style.height.px]="2" *ngIf="filteringResearchersAsync" mode="indeterminate"></mat-progress-bar>
|
||||
</td-chips>
|
||||
|
||||
<mat-form-field class="full-width">
|
||||
<input matInput placeholder="Version" formControlName="version"> <!--disabled doesn't work -->
|
||||
</mat-form-field>
|
||||
|
||||
<mat-list *ngIf="associatedUsers?.length" role="list">
|
||||
<h3 mat-subheader>Associated Users</h3>
|
||||
<mat-list-item role="listitem" *ngFor="let user of associatedUsers">
|
||||
|
|
|
@ -47,6 +47,7 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit {
|
|||
organisationsAutoCompleteConfiguration: AutoCompleteChipConfiguration;
|
||||
createNewVersion;
|
||||
associatedUsers: Array<DmpUsersModel>
|
||||
labelDisabled: boolean =false;
|
||||
|
||||
constructor(
|
||||
private dataManagementPlanService: DataManagementPlanService,
|
||||
|
@ -71,6 +72,12 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit {
|
|||
organisationRequestItem.criteria = new BaseCriteria();
|
||||
this.organisationsAutoCompleteConfiguration = new AutoCompleteChipConfiguration(this.externalSourcesService.searchDMPOrganizations.bind(this.externalSourcesService), organisationRequestItem);
|
||||
|
||||
this.route.data.subscribe(value=>{
|
||||
if (value.clone==false && this.formGroup.get("label").value){
|
||||
this.labelDisabled = true;
|
||||
}
|
||||
this.formGroup.controls["version"].disable();
|
||||
})
|
||||
}
|
||||
|
||||
formSubmit(): void {
|
||||
|
|
|
@ -56,7 +56,7 @@ export class DatasetWizardListingComponent implements OnInit {
|
|||
|
||||
|
||||
ngOnInit() {
|
||||
this.route.params.subscribe((params: Params) => {debugger;
|
||||
this.route.params.subscribe((params: Params) => {
|
||||
if (this.dmpId != null)
|
||||
if(params['dmpLabel']!=undefined)
|
||||
this.titlePrefix ="for " + params['dmpLabel'];
|
||||
|
|
Loading…
Reference in New Issue