[Library|Trunk]
Search Pages: - change showAdvancedSearchLink to showSwitchSearchLink and used it to chech for both simple and advanced link - add showBreadcrump choice for search projects, content provider and organization components - customFilter: add promptToAddFilter: boolean in order to display prompt about adding or removing custom filter - entities selection: if advanced search use the advanced search routes, disable selection for advanced pages of connect - community portal git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59265 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
a2ff09bea8
commit
6137dc874c
|
@ -18,7 +18,7 @@
|
|||
[isDisabled]="disableForms"
|
||||
[simpleView]="true" [formPlaceholderText]="formPlaceholderText"
|
||||
|
||||
[selectedFields]="selectedFields" [showAdvancedSearchLink]="true"
|
||||
[selectedFields]="selectedFields" [showSwitchSearchLink]="true"
|
||||
[fieldIdsMap]="fieldIdsMap" [fieldIds]="fieldIds" [entitiesSelection]="true" [customFilter]="customFilter"
|
||||
>
|
||||
</advanced-search-form>
|
||||
|
@ -77,20 +77,20 @@
|
|||
</div>
|
||||
|
||||
<search-research-results *ngIf="activeEntity == 'result'" resultType="result" [includeOnlyResultsAndFilter]="true"
|
||||
(searchPageUpdates)="activeEntityUpdate($event)" [showAdvancedSearchLink]="false"
|
||||
(searchPageUpdates)="activeEntityUpdate($event)" [showSwitchSearchLink]="false"
|
||||
simpleSearchLink="/search/find"></search-research-results>
|
||||
|
||||
<search-projects *ngIf="activeEntity == 'projects'" [includeOnlyResultsAndFilter]="true" [showAdvancedSearchLink]="false"
|
||||
<search-projects *ngIf="activeEntity == 'projects'" [includeOnlyResultsAndFilter]="true" [showSwitchSearchLink]="false"
|
||||
(searchPageUpdates)="activeEntityUpdate($event)"
|
||||
simpleSearchLink="/search/find">
|
||||
</search-projects>
|
||||
|
||||
<search-organizations *ngIf="activeEntity == 'organizations'" [includeOnlyResultsAndFilter]="true" [showAdvancedSearchLink]="false"
|
||||
<search-organizations *ngIf="activeEntity == 'organizations'" [includeOnlyResultsAndFilter]="true" [showSwitchSearchLink]="false"
|
||||
(searchPageUpdates)="activeEntityUpdate($event)"
|
||||
simpleSearchLink="/search/find">
|
||||
</search-organizations>
|
||||
|
||||
<search-dataproviders *ngIf="activeEntity == 'datasources'" [includeOnlyResultsAndFilter]="true" [showAdvancedSearchLink]="false"
|
||||
<search-dataproviders *ngIf="activeEntity == 'datasources'" [includeOnlyResultsAndFilter]="true" [showSwitchSearchLink]="false"
|
||||
(searchPageUpdates)="activeEntityUpdate($event)"
|
||||
simpleSearchLink="/search/find">
|
||||
</search-dataproviders>
|
||||
|
|
|
@ -35,12 +35,12 @@ import {properties} from "../../../environments/environment";
|
|||
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter"
|
||||
[piwikSiteId]=piwikSiteId [hasPrefix]="hasPrefix"
|
||||
[searchFormClass]="type!='deposit'?'datasourcesSearchForm':''"
|
||||
[entitiesSelection]="type=='all'" [showAdvancedSearchLink]="showAdvancedSearchLink"
|
||||
[entitiesSelection]="type=='all'" [showSwitchSearchLink]="showSwitchSearchLink"
|
||||
[filters]="filters"
|
||||
[simpleView]="simpleView" formPlaceholderText="Search by name, description, subject..."
|
||||
[showResultCount]="(type=='all' || type == 'deposit')" [showLastIndex]="type!='deposit'"
|
||||
[tableViewLink]="tableViewLink"
|
||||
[sort]="false">
|
||||
[sort]="false" [showBreadcrumb]="showBreadcrumb">
|
||||
|
||||
</new-search-page>
|
||||
<!-- [filters]="filters"-->
|
||||
|
@ -83,8 +83,8 @@ export class SearchDataProvidersComponent {
|
|||
@Input() openaireLink: string;
|
||||
@Input() includeOnlyResultsAndFilter: boolean = false;
|
||||
@Output() searchPageUpdates = new EventEmitter();
|
||||
@Input() showAdvancedSearchLink:boolean;
|
||||
|
||||
@Input() showSwitchSearchLink:boolean;
|
||||
@Input() showBreadcrumb: boolean = false;
|
||||
subs: any[] = [];
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataProvidersService: SearchDataprovidersService ) {
|
||||
|
@ -96,8 +96,8 @@ export class SearchDataProvidersComponent {
|
|||
ngOnInit() {
|
||||
this.refineFields = DatasourcesHelperClass.getrefineFields(this.type);
|
||||
this.pageTitle = DatasourcesHelperClass.getTitle(this.type);
|
||||
if(this.showAdvancedSearchLink == null){
|
||||
this.showAdvancedSearchLink = (this.type == "all");
|
||||
if(this.showSwitchSearchLink == null){
|
||||
this.showSwitchSearchLink = (this.type == "all");
|
||||
}
|
||||
// this.route.data
|
||||
// .subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
|
|
|
@ -34,7 +34,9 @@ import {properties} from "../../../environments/environment";
|
|||
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter"
|
||||
[sort]="false"
|
||||
[filters]="filters"
|
||||
[simpleView]="simpleView" formPlaceholderText="Search by organization name..." [showAdvancedSearchLink]="showAdvancedSearchLink"
|
||||
[simpleView]="simpleView" formPlaceholderText="Search by organization name..."
|
||||
[showSwitchSearchLink]="showSwitchSearchLink"
|
||||
[showBreadcrumb]="showBreadcrumb"
|
||||
>
|
||||
</new-search-page>
|
||||
`
|
||||
|
@ -71,8 +73,8 @@ export class SearchOrganizationsComponent {
|
|||
@Input() openaireLink: string;
|
||||
@Input() includeOnlyResultsAndFilter: boolean = false;
|
||||
@Output() searchPageUpdates = new EventEmitter();
|
||||
@Input() showAdvancedSearchLink:boolean = true;
|
||||
|
||||
@Input() showSwitchSearchLink:boolean = true;
|
||||
@Input() showBreadcrumb: boolean = false;
|
||||
public resourcesQuery = "(oaftype exact organization)";
|
||||
|
||||
subs: any[] = [];
|
||||
|
|
|
@ -34,8 +34,9 @@ import {properties} from "../../../environments/environment";
|
|||
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter"
|
||||
[filters]="filters"
|
||||
[rangeFilters]="rangeFilters" [rangeFields]="rangeFields"
|
||||
[simpleView]="simpleView" formPlaceholderText="Search by title, acronym, project code..." [showAdvancedSearchLink]="showAdvancedSearchLink"
|
||||
[sort]="false"
|
||||
[simpleView]="simpleView" formPlaceholderText="Search by title, acronym, project code..."
|
||||
[showSwitchSearchLink]="showSwitchSearchLink"
|
||||
[sort]="false" [showBreadcrumb]="showBreadcrumb"
|
||||
>
|
||||
</new-search-page>
|
||||
|
||||
|
@ -77,8 +78,8 @@ export class SearchProjectsComponent {
|
|||
@Input() openaireLink: string;
|
||||
@Input() includeOnlyResultsAndFilter: boolean = false;
|
||||
@Output() searchPageUpdates = new EventEmitter();
|
||||
@Input() showAdvancedSearchLink:boolean = true;
|
||||
|
||||
@Input() showSwitchSearchLink:boolean = true;
|
||||
@Input() showBreadcrumb: boolean = false;
|
||||
subs: any[] = [];
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService ) {
|
||||
|
|
|
@ -35,7 +35,7 @@ import {properties} from "../../../environments/environment";
|
|||
[rangeFilters]="rangeFilters" [rangeFields]="rangeFields"
|
||||
[simpleView]="simpleView" formPlaceholderText="Search by title, author, abstract, DOI, orcid..."
|
||||
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter" [showBreadcrumb]="showBreadcrumb"
|
||||
[showAdvancedSearchLink]="showAdvancedSearchLink"
|
||||
[showSwitchSearchLink]="showSwitchSearchLink"
|
||||
>
|
||||
</new-search-page>
|
||||
|
||||
|
@ -86,7 +86,7 @@ export class SearchResearchResultsComponent {
|
|||
@Input() includeOnlyResultsAndFilter: boolean = false;
|
||||
@Input() showBreadcrumb: boolean = false;
|
||||
@Output() searchPageUpdates = new EventEmitter();
|
||||
@Input() showAdvancedSearchLink: boolean = true;
|
||||
@Input() showSwitchSearchLink: boolean = true;
|
||||
subs: any[] = [];
|
||||
|
||||
constructor(private route: ActivatedRoute, private _searchResearchResultsService: SearchResearchResultsService) {
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
<div *ngIf="!simpleView">
|
||||
<a *ngIf="simpleSearchLink && simpleSearchLink.length > 0" routerLinkActive="router-link-active"
|
||||
<a *ngIf="showSwitchSearchLink && simpleSearchLink && simpleSearchLink.length > 0"
|
||||
routerLinkActive="router-link-active"
|
||||
[routerLink]=simpleSearchLink style="z-index:1;"
|
||||
[class]="(isDisabled)?'uk-float-right uk-disabled uk-link-muted portal-link uk-margin-right ':'uk-float-right portal-link uk-margin-right '">Quick search
|
||||
</a>
|
||||
<div class="uk-h5 uk-margin-small-bottom">
|
||||
<h1 class="uk-h5 uk-margin-small-bottom">
|
||||
Advanced search in
|
||||
<entities-selection [simpleView]="false" [currentEntity]="entityType"
|
||||
[properties]="properties" [customFilter]="customFilter" ></entities-selection>
|
||||
|
||||
</div>
|
||||
</h1>
|
||||
</div>
|
||||
<form *ngIf="!simpleView"
|
||||
[class]="((isDisabled )?'uk-disabled ':'')
|
||||
|
@ -161,7 +162,7 @@
|
|||
class=" uk-button portal-button uk-margin-small-left uk-text-bold uk-padding uk-padding-remove-top uk-padding-remove-bottom">
|
||||
Search
|
||||
</button>
|
||||
<div class="uk-margin-small-top" *ngIf="showAdvancedSearchLink">
|
||||
<div class="uk-margin-small-top" *ngIf="showSwitchSearchLink">
|
||||
<a *ngIf ="this.entityType !='all' && this.entityType == this.selectedEntity && advancedSearchLink" routerLinkActive="router-link-active"
|
||||
[routerLink]="advancedSearchLink" style="z-index:1;" [queryParams]="advancedSearchLinkParameters"
|
||||
[class]="(isDisabled)?' uk-disabled uk-link-muted portal-link uk-margin-left ':' portal-link uk-margin-left '">Advanced search
|
||||
|
|
|
@ -40,7 +40,7 @@ export class AdvancedSearchFormComponent {
|
|||
selectedEntitySimpleUrl;
|
||||
selectedEntityAdvancedUrl;
|
||||
@Input() entitiesSelection:boolean;
|
||||
@Input() showAdvancedSearchLink:boolean = true;
|
||||
@Input() showSwitchSearchLink:boolean = true;
|
||||
constructor (private route: ActivatedRoute, private router: Router) {
|
||||
|
||||
}
|
||||
|
|
|
@ -118,15 +118,17 @@ export class EntitiesSelectionComponent {
|
|||
for (let i = 0; i < data['pages'].length; i++) {
|
||||
showPage["" + data['pages'][i]["route"] + ""] = data['pages'][i]["isEnabled"];
|
||||
}
|
||||
this.showResearchOutcomes = showPage[this.properties.searchLinkToResults] && (showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"]);
|
||||
this.showPublications = showPage[this.properties.searchLinkToResults] && showEntity["publication"];
|
||||
this.showDatasets = showPage[this.properties.searchLinkToResults] && showEntity["dataset"];
|
||||
this.showSoftware = showPage[this.properties.searchLinkToResults] && showEntity["software"];
|
||||
this.showOther = showPage[this.properties.searchLinkToResults] && showEntity["orp"];
|
||||
this.showProjects = showPage[this.properties.searchLinkToProjects] && showEntity["project"];
|
||||
this.showOrganizations = showPage[this.properties.searchLinkToOrganizations] && showEntity["organization"];
|
||||
this.showDataProviders = showPage[this.properties.searchLinkToDataProviders] && showEntity["datasource"];
|
||||
if (this.customFilter && this.customFilter.queryFieldName == "communityId") {
|
||||
this.showResearchOutcomes = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && (showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"]);
|
||||
this.showPublications = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && showEntity["publication"];
|
||||
this.showDatasets = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && showEntity["dataset"];
|
||||
this.showSoftware = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && showEntity["software"];
|
||||
this.showOther = showPage[this.simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults] && showEntity["orp"];
|
||||
this.showProjects = showPage[this.simpleView?this.properties.searchLinkToProjects:this.properties.searchLinkToAdvancedProjects] && showEntity["project"];
|
||||
this.showOrganizations = showPage[this.simpleView?this.properties.searchLinkToOrganizations:this.properties.searchLinkToAdvancedOrganizations] && showEntity["organization"];
|
||||
this.showDataProviders = showPage[this.simpleView?this.properties.searchLinkToDataProviders:this.properties.searchLinkToAdvancedDataProviders] && showEntity["datasource"];
|
||||
if (this.customFilter && this.customFilter.queryFieldName == "communityId" || this.properties.adminToolsCommunity === "connect") {
|
||||
//for community pages: no organization in simple search, only results in advanced
|
||||
this.showAll = false;
|
||||
this.showOrganizations = false;
|
||||
if (!this.simpleView) {
|
||||
this.showProjects = false;
|
||||
|
|
|
@ -177,7 +177,7 @@
|
|||
="this.routerHelper.createQueryParams(this.parameterNames, this.parameterValues)"
|
||||
[pageTitle]=pageTitle [simpleView]="simpleView" [formPlaceholderText]="formPlaceholderText"
|
||||
[resultTypes]="resultTypes" [quickFilter]="quickFilter" [entitiesSelection]="entitiesSelection"
|
||||
[showAdvancedSearchLink]="showAdvancedSearchLink" [customFilter]="customFilter"
|
||||
[showSwitchSearchLink]="showSwitchSearchLink" [customFilter]="customFilter"
|
||||
>
|
||||
</advanced-search-form>
|
||||
<div *ngIf="entityType === 'community' || entityType === 'stakeholder' " class="uk-position-center-right uk-visible@m">
|
||||
|
@ -246,7 +246,7 @@
|
|||
</div>
|
||||
<div *ngIf="includeOnlyResultsAndFilter "
|
||||
class="uk-margin-medium-top uk-margin-medium-bottom">
|
||||
<a *ngIf="showAdvancedSearchLink && advancedSearchLink" routerLinkActive="router-link-active"
|
||||
<a *ngIf="showSwitchSearchLink && advancedSearchLink" routerLinkActive="router-link-active"
|
||||
[routerLink]="advancedSearchLink" style="z-index:1;"
|
||||
[queryParams]="this.routerHelper.createQueryParams(this.parameterNames, this.parameterValues)"
|
||||
[class]="((disableForms || disableRefineForms)?' uk-disabled uk-link-muted ':'') +' portal-link uk-float-right '">Advanced
|
||||
|
@ -286,7 +286,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div *ngIf="customFilter && !customFilter.isHiddenFilter &&
|
||||
customFilter.selected == false"
|
||||
customFilter.selected == false && customFilter.promptToAddFilter"
|
||||
class="uk-alert uk-animation-slide-top-small">
|
||||
Do you want to see results only for {{customFilter.valueName}}? <a
|
||||
(click)="addCustomFilter();">Click
|
||||
|
|
|
@ -106,7 +106,7 @@ export class NewSearchPageComponent {
|
|||
url = null;
|
||||
metaDescription = "";
|
||||
@Input() entitiesSelection:boolean = true;
|
||||
@Input() showAdvancedSearchLink:boolean = true;
|
||||
@Input() showSwitchSearchLink:boolean = true;
|
||||
|
||||
// on 1st load, do not show filters until results query returns.
|
||||
public hideFilters: boolean = true;
|
||||
|
@ -577,7 +577,7 @@ export class NewSearchPageComponent {
|
|||
public removeFilter(value: Value, filter: Filter, forceRemove:boolean = false) {
|
||||
this.currentValueToRemove = value;
|
||||
this.currentFilterToRemove = filter;
|
||||
if(!forceRemove && this.customFilter && this.customFilter.queryFieldName ==filter.filterId && this.customFilter.valueId == value.id ){
|
||||
if(!forceRemove && this.customFilter && this.customFilter.queryFieldName ==filter.filterId && this.customFilter.valueId == value.id && this.customFilter.promptToAddFilter ){
|
||||
this.openRemoveCustomFilterModal();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ export class SearchCustomFilter{
|
|||
valueName:string; // Greece
|
||||
isHiddenFilter:boolean;
|
||||
selected:boolean;
|
||||
promptToAddFilter:boolean;
|
||||
constructor( fieldName:string, queryFieldName:string, valueId:string, valueName:string ){
|
||||
this.isHiddenFilter = true;
|
||||
this.fieldName = fieldName;
|
||||
|
@ -24,6 +25,7 @@ export class SearchCustomFilter{
|
|||
this.valueId = valueId;
|
||||
this.valueName = valueName;
|
||||
this.selected = null;
|
||||
this.promptToAddFilter = false;
|
||||
}
|
||||
// public setFilter(filter:SearchCustomFilter){
|
||||
// if(!filter){
|
||||
|
|
Loading…
Reference in New Issue