Fixed Bugs for Facet Search on Public Dataset Page
This commit is contained in:
parent
6a72f8dbba
commit
6ace88ecda
|
@ -23,53 +23,53 @@ export class ExternalSourcesService {
|
||||||
|
|
||||||
constructor(private http: BaseHttpService) {
|
constructor(private http: BaseHttpService) {
|
||||||
|
|
||||||
this.actionUrl = HostConfiguration.Server + 'external/';
|
this.actionUrl = HostConfiguration.Server + 'external/';
|
||||||
|
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
this.headers = this.headers.set('Content-Type', 'application/json');
|
this.headers = this.headers.set('Content-Type', 'application/json');
|
||||||
this.headers = this.headers.set('Accept', 'application/json');
|
this.headers = this.headers.set('Accept', 'application/json');
|
||||||
}
|
}
|
||||||
|
|
||||||
public searchDatasetRegistry(requestItem: RequestItem<RegistryCriteria>): Observable<ExternalSourcesItemModel[]> {
|
public searchDatasetRegistry(requestItem: RequestItem<RegistryCriteria>): Observable<ExternalSourcesItemModel[]> {
|
||||||
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "registries" + "?query=" + requestItem.criteria.like + "&type=" + requestItem.criteria.type, { headers: this.headers });
|
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + 'registries' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
public searchDatasetRepository(requestItem: RequestItem<DataRepositoryCriteria>): Observable<ExternalSourcesItemModel[]> {
|
public searchDatasetRepository(requestItem: RequestItem<DataRepositoryCriteria>): Observable<ExternalSourcesItemModel[]> {
|
||||||
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "datarepos" + "?query=" + requestItem.criteria.like + "&type=" + requestItem.criteria.type, { headers: this.headers });
|
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + 'datarepos' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
public searchDatasetService(requestItem: RequestItem<ServicesCriteria>): Observable<ExternalSourcesItemModel[]> {
|
public searchDatasetService(requestItem: RequestItem<ServicesCriteria>): Observable<ExternalSourcesItemModel[]> {
|
||||||
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "services" + "?query=" + requestItem.criteria.like + "&type=" + requestItem.criteria.type, { headers: this.headers });
|
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + 'services' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
public searchDatasetTags(requestItem: RequestItem<TagsCriteria>): Observable<ExternalSourcesItemModel[]> {
|
public searchDatasetTags(requestItem: RequestItem<TagsCriteria>): Observable<ExternalSourcesItemModel[]> {
|
||||||
return Observable.of([
|
return Observable.of([
|
||||||
{ id: "1", name: "Tag 1", description: "" },
|
{ id: '1', name: 'Tag 1', description: '' },
|
||||||
{ id: "2", name: "Tag 2", description: "" },
|
{ id: '2', name: 'Tag 2', description: '' },
|
||||||
{ id: "3", name: "Tag 3", description: "" },
|
{ id: '3', name: 'Tag 3', description: '' },
|
||||||
{ id: "4", name: "Tag 4", description: "" },
|
{ id: '4', name: 'Tag 4', description: '' },
|
||||||
{ id: "5", name: "Tag 5", description: "" },
|
{ id: '5', name: 'Tag 5', description: '' },
|
||||||
{ id: "6", name: "Tag 6", description: "" },
|
{ id: '6', name: 'Tag 6', description: '' },
|
||||||
{ id: "7", name: "Tag 7", description: "" },
|
{ id: '7', name: 'Tag 7', description: '' },
|
||||||
{ id: "8", name: "Tag 8", description: "" },
|
{ id: '8', name: 'Tag 8', description: '' },
|
||||||
])
|
]);
|
||||||
//return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "tags" + "?query=" + requestItem.criteria.like + "&type=" + requestItem.criteria.type, { headers: this.headers });
|
//return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "tags" + "?query=" + requestItem.criteria.like + "&type=" + requestItem.criteria.type, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
public searchDatasetSExternalDatasetservice(requestItem: RequestItem<ExternalDatasetCriteria>): Observable<ExternalSourcesItemModel[]> {
|
public searchDatasetSExternalDatasetservice(requestItem: RequestItem<ExternalDatasetCriteria>): Observable<ExternalSourcesItemModel[]> {
|
||||||
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "datasets" + "?query=" + requestItem.criteria.like + "&type=" + requestItem.criteria.type, { headers: this.headers });
|
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + 'datasets' + '?query=' + requestItem.criteria.like + '&type=' + requestItem.criteria.type, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
public searchDMPResearchers(requestItem: RequestItem<ResearcherCriteria>): Observable<ExternalSourcesItemModel[]> {
|
public searchDMPResearchers(requestItem: RequestItem<ResearcherCriteria>): Observable<ExternalSourcesItemModel[]> {
|
||||||
return this.http.post<ExternalSourcesItemModel[]>(HostConfiguration.Server + "/researchers/getWithExternal", requestItem, { headers: this.headers });
|
return this.http.post<ExternalSourcesItemModel[]>(HostConfiguration.Server + '/researchers/getWithExternal', requestItem, { headers: this.headers });
|
||||||
}
|
}
|
||||||
|
|
||||||
public searchDMPOrganizations(like: string): Observable<ExternalSourcesItemModel[]> {
|
public searchDMPOrganizations(like: string): Observable<ExternalSourcesItemModel[]> {
|
||||||
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + "organisations" + "?query=" + like, { headers: this.headers });
|
return this.http.get<ExternalSourcesItemModel[]>(this.actionUrl + 'organisations' + '?query=' + like, { headers: this.headers });
|
||||||
}//organizationscriteria.criteria.like
|
}//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 });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<mat-accordion>
|
<mat-accordion #facetAccordion="matAccordion" [multi]="true">
|
||||||
<mat-expansion-panel>
|
<mat-expansion-panel>
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
<mat-panel-title>
|
<mat-panel-title>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Component, OnInit, ViewEncapsulation, Input, ViewChild, Output, EventEmitter } from '@angular/core';
|
import { Component, OnInit, ViewEncapsulation, Input, ViewChild, Output, EventEmitter, AfterViewInit } from '@angular/core';
|
||||||
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
|
||||||
import { BreadCrumbResolverService } from '../../../services/breadcrumb/breadcrumb-resolver.service';
|
import { BreadCrumbResolverService } from '../../../services/breadcrumb/breadcrumb-resolver.service';
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
@ -9,7 +9,7 @@ import { ProjectService } from '../../../services/project/project.service';
|
||||||
import { ProjectCriteria } from '../../../models/criteria/project/ProjectCriteria';
|
import { ProjectCriteria } from '../../../models/criteria/project/ProjectCriteria';
|
||||||
import { DataTableRequest } from '../../../models/data-table/DataTableRequest';
|
import { DataTableRequest } from '../../../models/data-table/DataTableRequest';
|
||||||
import { ProjectListingModel } from '../../../models/projects/ProjectListingModel';
|
import { ProjectListingModel } from '../../../models/projects/ProjectListingModel';
|
||||||
import { MatSelectionList, MatListOption, MatSelectionListChange } from '@angular/material';
|
import { MatSelectionList, MatListOption, MatSelectionListChange, MatAccordion } from '@angular/material';
|
||||||
import { SelectionModel } from '@angular/cdk/collections';
|
import { SelectionModel } from '@angular/cdk/collections';
|
||||||
import { DatasetProfileService } from '../../../services/dataset-profile.service';
|
import { DatasetProfileService } from '../../../services/dataset-profile.service';
|
||||||
import { DatasetService } from '../../../services/dataset/dataset.service';
|
import { DatasetService } from '../../../services/dataset/dataset.service';
|
||||||
|
@ -28,21 +28,18 @@ import { TranslateService } from '@ngx-translate/core';
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
providers: [ProjectService]
|
providers: [ProjectService]
|
||||||
})
|
})
|
||||||
export class FacetSearchComponent implements OnInit {
|
export class FacetSearchComponent implements OnInit, AfterViewInit {
|
||||||
|
|
||||||
@Input()
|
|
||||||
facetCriteria = new FacetSearchCriteriaModel();
|
|
||||||
|
|
||||||
@Output()
|
|
||||||
facetCriteriaChange = new EventEmitter();
|
|
||||||
|
|
||||||
|
@Input() facetCriteria = new FacetSearchCriteriaModel();
|
||||||
|
@Output() facetCriteriaChange = new EventEmitter();
|
||||||
ProjectStateType = ProjectStateType;
|
ProjectStateType = ProjectStateType;
|
||||||
projects: Observable<ProjectModel[]>;
|
projects: Observable<ProjectModel[]>;
|
||||||
profiles: Observable<DatasetProfileModel[]>;
|
profiles: Observable<DatasetProfileModel[]>;
|
||||||
dmpOrganisations: Observable<ExternalSourcesItemModel[]>;
|
dmpOrganisations: Observable<ExternalSourcesItemModel[]>;
|
||||||
projectOptions: Observable<ProjectModel[]>;
|
projectOptions: Observable<ProjectModel[]>;
|
||||||
|
|
||||||
projectStateOptions: Observable<any[]>;
|
projectStateOptions: Observable<any[]>;
|
||||||
|
@ViewChild('facetAccordion') accordion: MatAccordion;
|
||||||
|
|
||||||
displayProjectStateValue = (option) => option['value'];
|
displayProjectStateValue = (option) => option['value'];
|
||||||
displayProjectStateLabel = (option) => option['label'];
|
displayProjectStateLabel = (option) => option['label'];
|
||||||
|
|
||||||
|
@ -61,8 +58,7 @@ export class FacetSearchComponent implements OnInit {
|
||||||
public languageService: TranslateService,
|
public languageService: TranslateService,
|
||||||
public datasetProfileService: DatasetService,
|
public datasetProfileService: DatasetService,
|
||||||
public externalSourcesService: ExternalSourcesService
|
public externalSourcesService: ExternalSourcesService
|
||||||
) {
|
) { }
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
setTimeout(x => {
|
setTimeout(x => {
|
||||||
|
@ -76,6 +72,10 @@ export class FacetSearchComponent implements OnInit {
|
||||||
this.dmpOrganisations = this.externalSourcesService.searchDMPOrganizations('');
|
this.dmpOrganisations = this.externalSourcesService.searchDMPOrganizations('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngAfterViewInit(): void {
|
||||||
|
this.accordion.openAll();
|
||||||
|
}
|
||||||
|
|
||||||
public projectStatusChanged(event) {
|
public projectStatusChanged(event) {
|
||||||
this.facetCriteria.projectStatus = event.option.value.value;
|
this.facetCriteria.projectStatus = event.option.value.value;
|
||||||
if (!event.option.selected) {
|
if (!event.option.selected) {
|
||||||
|
|
Loading…
Reference in New Issue