Fixed Bugs for Facet Search on Public Dataset Page
This commit is contained in:
parent
6a72f8dbba
commit
6ace88ecda
|
@ -31,45 +31,45 @@ export class ExternalSourcesService {
|
|||
}
|
||||
|
||||
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[]> {
|
||||
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[]> {
|
||||
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[]> {
|
||||
return Observable.of([
|
||||
{ id: "1", name: "Tag 1", description: "" },
|
||||
{ id: "2", name: "Tag 2", description: "" },
|
||||
{ id: "3", name: "Tag 3", description: "" },
|
||||
{ id: "4", name: "Tag 4", description: "" },
|
||||
{ id: "5", name: "Tag 5", description: "" },
|
||||
{ id: "6", name: "Tag 6", description: "" },
|
||||
{ id: "7", name: "Tag 7", description: "" },
|
||||
{ id: "8", name: "Tag 8", description: "" },
|
||||
])
|
||||
{ id: '1', name: 'Tag 1', description: '' },
|
||||
{ id: '2', name: 'Tag 2', description: '' },
|
||||
{ id: '3', name: 'Tag 3', description: '' },
|
||||
{ id: '4', name: 'Tag 4', description: '' },
|
||||
{ id: '5', name: 'Tag 5', description: '' },
|
||||
{ id: '6', name: 'Tag 6', description: '' },
|
||||
{ id: '7', name: 'Tag 7', 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 });
|
||||
}
|
||||
|
||||
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[]> {
|
||||
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[]> {
|
||||
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
|
||||
|
||||
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-header>
|
||||
<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 { BreadCrumbResolverService } from '../../../services/breadcrumb/breadcrumb-resolver.service';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
|
@ -9,7 +9,7 @@ import { ProjectService } from '../../../services/project/project.service';
|
|||
import { ProjectCriteria } from '../../../models/criteria/project/ProjectCriteria';
|
||||
import { DataTableRequest } from '../../../models/data-table/DataTableRequest';
|
||||
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 { DatasetProfileService } from '../../../services/dataset-profile.service';
|
||||
import { DatasetService } from '../../../services/dataset/dataset.service';
|
||||
|
@ -28,21 +28,18 @@ import { TranslateService } from '@ngx-translate/core';
|
|||
encapsulation: ViewEncapsulation.None,
|
||||
providers: [ProjectService]
|
||||
})
|
||||
export class FacetSearchComponent implements OnInit {
|
||||
|
||||
@Input()
|
||||
facetCriteria = new FacetSearchCriteriaModel();
|
||||
|
||||
@Output()
|
||||
facetCriteriaChange = new EventEmitter();
|
||||
export class FacetSearchComponent implements OnInit, AfterViewInit {
|
||||
|
||||
@Input() facetCriteria = new FacetSearchCriteriaModel();
|
||||
@Output() facetCriteriaChange = new EventEmitter();
|
||||
ProjectStateType = ProjectStateType;
|
||||
projects: Observable<ProjectModel[]>;
|
||||
profiles: Observable<DatasetProfileModel[]>;
|
||||
dmpOrganisations: Observable<ExternalSourcesItemModel[]>;
|
||||
projectOptions: Observable<ProjectModel[]>;
|
||||
|
||||
projectStateOptions: Observable<any[]>;
|
||||
@ViewChild('facetAccordion') accordion: MatAccordion;
|
||||
|
||||
displayProjectStateValue = (option) => option['value'];
|
||||
displayProjectStateLabel = (option) => option['label'];
|
||||
|
||||
|
@ -61,8 +58,7 @@ export class FacetSearchComponent implements OnInit {
|
|||
public languageService: TranslateService,
|
||||
public datasetProfileService: DatasetService,
|
||||
public externalSourcesService: ExternalSourcesService
|
||||
) {
|
||||
}
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
setTimeout(x => {
|
||||
|
@ -76,6 +72,10 @@ export class FacetSearchComponent implements OnInit {
|
|||
this.dmpOrganisations = this.externalSourcesService.searchDMPOrganizations('');
|
||||
}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this.accordion.openAll();
|
||||
}
|
||||
|
||||
public projectStatusChanged(event) {
|
||||
this.facetCriteria.projectStatus = event.option.value.value;
|
||||
if (!event.option.selected) {
|
||||
|
|
Loading…
Reference in New Issue