Merge branch 'ui-refactoring' of https://gitlab.eudat.eu/dmp/OpenAIRE-EUDAT-DMP-service-pilot into ui-refactoring
This commit is contained in:
commit
cdec34cc1e
|
@ -24,9 +24,9 @@ public class ResearcherDaoImpl extends DatabaseAccess<Researcher> implements Res
|
|||
public QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria) {
|
||||
QueryableList<Researcher> query = asQueryable();
|
||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
||||
query.where((builder, root) ->builder.or(builder.like(root.get("reference"), "%" + criteria.getLike().toUpperCase() + "%")));
|
||||
query.where((builder, root) ->builder.or(builder.like(builder.upper(root.get("reference")), "%" + criteria.getLike().toUpperCase() + "%")));
|
||||
if (criteria.getName() != null && !criteria.getName().isEmpty())
|
||||
query.where((builder, root) ->builder.or(builder.like(root.get("label"), "%" + criteria.getName().toUpperCase() + "%")));
|
||||
query.where((builder, root) ->builder.or(builder.like(builder.upper(root.get("label")), "%" + criteria.getName().toUpperCase() + "%")));
|
||||
return query;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 2/5/2018.
|
||||
|
@ -40,7 +41,6 @@ public class ResearcherManager {
|
|||
.build();
|
||||
researchers.add(researcher);
|
||||
}
|
||||
researchers.stream().distinct();
|
||||
return researchers;
|
||||
return researchers.stream().distinct().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ export class ExternalSourcesService {
|
|||
}
|
||||
|
||||
public searchDMPResearchers(requestItem: RequestItem<ResearcherCriteria>): Observable<ExternalSourceItemModel[]> {
|
||||
return this.http.post<ExternalSourceItemModel[]>(environment.Server + '/researchers/getWithExternal', requestItem, { headers: this.headers });
|
||||
return this.http.post<ExternalSourceItemModel[]>(environment.Server + 'researchers/getWithExternal', requestItem, { headers: this.headers });
|
||||
}
|
||||
|
||||
public searchDMPOrganizations(like: string): Observable<ExternalSourceItemModel[]> {
|
||||
|
|
|
@ -7,6 +7,7 @@ import { Observable, of as observableOf, Subject } from 'rxjs';
|
|||
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, tap } from 'rxjs/operators';
|
||||
import { AutoCompleteGroup } from '../auto-complete-group';
|
||||
import { MultipleAutoCompleteConfiguration } from './multiple-auto-complete-configuration';
|
||||
import { switchMap } from 'rxjs/internal/operators/switchMap';
|
||||
|
||||
@Component({
|
||||
selector: 'app-multiple-auto-complete',
|
||||
|
@ -189,7 +190,7 @@ export class MultipleAutoCompleteComponent implements OnInit, MatFormFieldContro
|
|||
debounceTime(this.requestDelay),
|
||||
distinctUntilChanged(),
|
||||
tap(() => { this.loading = true; }),
|
||||
mergeMap(query => {
|
||||
switchMap(query => {
|
||||
// If its a valid object, a selection just made and the object is set as the value of the form control. That means we should fire an extra request to the server.
|
||||
if (this._isValidObject(query)) { return observableOf([]); }
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import { Observable, of as observableOf, Subject } from 'rxjs';
|
|||
import { debounceTime, distinctUntilChanged, map, mergeMap, startWith, tap } from 'rxjs/operators';
|
||||
import { AutoCompleteGroup } from '../auto-complete-group';
|
||||
import { SingleAutoCompleteConfiguration } from './single-auto-complete-configuration';
|
||||
import { switchMap } from 'rxjs/internal/operators/switchMap';
|
||||
|
||||
|
||||
@Component({
|
||||
|
@ -167,7 +168,7 @@ export class SingleAutoCompleteComponent implements OnInit, MatFormFieldControl<
|
|||
debounceTime(this.requestDelay),
|
||||
distinctUntilChanged(),
|
||||
tap(() => { this.loading = true; }),
|
||||
mergeMap(query => {
|
||||
switchMap(query => {
|
||||
// If its a valid object, a selection just made and the object is set as the value of the form control. That means we should fire an extra request to the server.
|
||||
if (this._isValidObject(query)) { return observableOf([]); }
|
||||
|
||||
|
|
Loading…
Reference in New Issue