organisations without chips

This commit is contained in:
annampak 2018-02-23 14:12:58 +02:00
parent 5d635d0bb5
commit 7c6815fef0
5 changed files with 39 additions and 35 deletions

View File

@ -41,11 +41,11 @@
<!-- <button mat-button (click)="availableProfiles()">View All</button> --> <!-- <button mat-button (click)="availableProfiles()">View All</button> -->
<a style="float:right" href="#" (click)="availableProfiles()">View All</a> <a style="float:right" href="#" (click)="availableProfiles()">View All</a>
<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">
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.name.substring(0, 1).toUpperCase()}}</div> <div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.name.substring(0, 1).toUpperCase()}}</div>
@ -57,7 +57,7 @@
</div> </div>
</ng-template> </ng-template>
<mat-progress-bar [style.height.px]="2" *ngIf="filteringOrganisationsAsync" mode="indeterminate"></mat-progress-bar> <mat-progress-bar [style.height.px]="2" *ngIf="filteringOrganisationsAsync" mode="indeterminate"></mat-progress-bar>
</td-chips> --> </td-chips>
<div layout="row" layout-align="start center"> <div layout="row" layout-align="start center">
<td-chips style="margin-bottom:25px; display:inline-block; width:90%" color="accent" [items]="filteredResearchers" formControlName="researchers" <td-chips style="margin-bottom:25px; display:inline-block; width:90%" color="accent" [items]="filteredResearchers" formControlName="researchers"
@ -80,6 +80,10 @@
</button> </button>
</div> </div>
<mat-form-field class="example-full-width">
<input matInput placeholder="Version" disabled [value]="formGroup.get('version').value== undefined ?0 :formGroup.get('version').value">
</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>

View File

@ -148,24 +148,24 @@ export class DataManagementPlanEditorComponent implements AfterViewInit {
this.router.navigate(['/invite/' + this.dataManagementPlan.id]); this.router.navigate(['/invite/' + this.dataManagementPlan.id]);
} }
// filterOrganisations(value: string): void { filterOrganisations(value: string): void {
// this.filteredOrganisations = undefined; this.filteredOrganisations = undefined;
// if (value) { if (value) {
// this.filteringOrganisationsAsync = true; this.filteringOrganisationsAsync = true;
// this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => { this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => {
// this.filteredOrganisations = items; this.filteredOrganisations = items;
// this.filteringOrganisationsAsync = false; this.filteringOrganisationsAsync = false;
// // this.filteredOrganisations = items.filter((filteredObj: any) => { // this.filteredOrganisations = items.filter((filteredObj: any) => {
// // return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true; // return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true;
// // }); // });
// }); });
// } }
// } }
filterResearchers(value: string): void { filterResearchers(value: string): void {

View File

@ -34,11 +34,11 @@
<mat-error style="font-size:10.5px" *ngIf="formGroup.get('profiles').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error style="font-size:10.5px" *ngIf="formGroup.get('profiles').errors?.required">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</td-chips> </td-chips>
<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">
<div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.name.substring(0, 1).toUpperCase()}}</div> <div class="tc-grey-100 bgc-teal-700" td-chip-avatar>{{chip.name.substring(0, 1).toUpperCase()}}</div>
@ -50,7 +50,7 @@
</div> </div>
</ng-template> </ng-template>
<mat-progress-bar [style.height.px]="2" *ngIf="filteringOrganisationsAsync" mode="indeterminate"></mat-progress-bar> <mat-progress-bar [style.height.px]="2" *ngIf="filteringOrganisationsAsync" mode="indeterminate"></mat-progress-bar>
</td-chips> --> </td-chips>
<td-chips style="margin-bottom:25px;" color="accent" [items]="filteredResearchers" formControlName="researchers" placeholder="{{'DMP-EDITOR.FIELDS.RESEARCHERS' | translate}}" <td-chips style="margin-bottom:25px;" color="accent" [items]="filteredResearchers" formControlName="researchers" placeholder="{{'DMP-EDITOR.FIELDS.RESEARCHERS' | translate}}"
(inputChange)="filterResearchers($event)" requireMatch> (inputChange)="filterResearchers($event)" requireMatch>

View File

@ -117,20 +117,20 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit {
filterOrganisations(value: string): void { filterOrganisations(value: string): void {
this.filteredOrganisations = undefined; this.filteredOrganisations = undefined;
// if (value) { if (value) {
// this.filteringOrganisationsAsync = true; this.filteringOrganisationsAsync = true;
// this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => { this.externalSourcesService.searchDMPOrganizations(value).subscribe(items => {
// this.filteredOrganisations = items; this.filteredOrganisations = items;
// this.filteringOrganisationsAsync = false; this.filteringOrganisationsAsync = false;
// // this.filteredOrganisations = items.filter((filteredObj: any) => { // this.filteredOrganisations = items.filter((filteredObj: any) => {
// // return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true; // return this.objectsModel ? this.objectsModel.indexOf(filteredObj) < 0 : true;
// // }); // });
// }); });
// } }
} }
filterResearchers(value: string): void { filterResearchers(value: string): void {

View File

@ -44,9 +44,9 @@ export class ExternalSourcesService {
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "researchers" + "?query=" + like, { headers: this.headers }); return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "researchers" + "?query=" + like, { headers: this.headers });
} }
public searchDMPOrganizations(organizationscriteria: RequestItem<BaseCriteria>): Observable<ExternalSourcesItemModel[]> { public searchDMPOrganizations(like: string): Observable<ExternalSourcesItemModel[]> {
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "organisations" + "?query=" + organizationscriteria.criteria.like, { headers: this.headers }); return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "organisations" + "?query=" + like, { headers: this.headers });
} }//organizationscriteria.criteria.like
public searchDMPProfiles(like: string): Observable<ExternalSourcesItemModel[]> { public searchDMPProfiles(like: string): Observable<ExternalSourcesItemModel[]> {
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "datasetprofiles/get" + "?query=" + like, { headers: this.headers }); return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "datasetprofiles/get" + "?query=" + like, { headers: this.headers });