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