[Trunk | Library]: dataProvider.component & organization.component & project.component: Use <search-tab> (common view for tabs with search results) - also used in community first page.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58813 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-05-31 13:44:52 +00:00
parent cf7ed8a085
commit dfb98fffcc
7 changed files with 218 additions and 271 deletions

View File

@ -1,52 +1,52 @@
<ng-template #search_box let-fetch="fetch" let-type="type" let-typeName="typeName" <!--<ng-template #search_box let-fetch="fetch" let-type="type" let-typeName="typeName"-->
let-searchLinkToAdvancedPage="searchLinkToAdvancedPage" let-params="params"> <!-- let-searchLinkToAdvancedPage="searchLinkToAdvancedPage" let-params="params">-->
<!-- *ngIf="fetch.searchUtils.totalResults > 0"--> <!--&lt;!&ndash; *ngIf="fetch.searchUtils.totalResults > 0"&ndash;&gt;-->
<div *ngIf="fetch.searchUtils.totalResults > 0"> <!-- <div *ngIf="fetch.searchUtils.totalResults > 0">-->
<div class="uk-position-relative"> <!-- <div class="uk-position-relative">-->
<a [queryParams]="params" target="_blank" <!-- <a [queryParams]="params" target="_blank"-->
[routerLink]="searchLinkToAdvancedPage"> <!-- [routerLink]="searchLinkToAdvancedPage">-->
<span class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span> <!-- <span class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span>-->
<div class="header target uk-text-bold">{{typeName}}</div> <!-- <div class="header target uk-text-bold">{{typeName}}</div>-->
<div class="icon uk-position-center" uk-icon="icon: search;"></div> <!-- <div class="icon uk-position-center" uk-icon="icon: search;"></div>-->
<div class="footer target uk-position-relative"> <!-- <div class="footer target uk-position-relative">-->
<span class="uk-text-bold uk-position-center">{{fetch.searchUtils.totalResults | number}}</span> <!-- <span class="uk-text-bold uk-position-center">{{fetch.searchUtils.totalResults | number}}</span>-->
</div> <!-- </div>-->
</a> <!-- </a>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</ng-template> <!--</ng-template>-->
<ng-template #search_tab let-fetch="fetch" let-type="type" let-urlParam="urlParam" <!--<ng-template #search_tab let-fetch="fetch" let-type="type" let-urlParam="urlParam"-->
let-searchLinkToAdvancedPage="searchLinkToAdvancedPage" let-params="params"> <!-- let-searchLinkToAdvancedPage="searchLinkToAdvancedPage" let-params="params">-->
<errorMessages [status]="[fetch.searchUtils.status]" [type]="getEntityName(type, true, true)" <!-- <errorMessages [status]="[fetch.searchUtils.status]" [type]="getEntityName(type, true, true)"-->
tab_error_class=true></errorMessages> <!-- tab_error_class=true></errorMessages>-->
<div *ngIf="fetch.searchUtils.status == errorCodes.DONE"> <!-- <div *ngIf="fetch.searchUtils.status == errorCodes.DONE">-->
<div class="tab-header"> <!-- <div class="tab-header">-->
<span *ngIf="type != 'organization' && type != 'dataprovider' && type != 'project'">Recent</span> <!-- <span *ngIf="type != 'organization' && type != 'dataprovider' && type != 'project'">Recent</span>-->
{{getEntityName(type, true, true)}} <!-- {{getEntityName(type, true, true)}}-->
</div> <!-- </div>-->
<div class="uk-text-right"> <!-- <div class="uk-text-right">-->
<a class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage"> <!-- <a class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage">-->
View all {{getEntityName(type, true, true)}} <!-- View all {{getEntityName(type, true, true)}}-->
<span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span> <!-- <span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span>-->
</a> <!-- </a>-->
</div> <!-- </div>-->
<search-result [properties]="properties" <!-- <search-result [properties]="properties"-->
[results]="fetch.results" <!-- [results]="fetch.results"-->
[status]="fetch.searchUtils.status" <!-- [status]="fetch.searchUtils.status"-->
[type]="type" urlParam="articleId"> <!-- [type]="type" urlParam="articleId">-->
</search-result> <!-- </search-result>-->
<div class="uk-text-right"> <!-- <div class="uk-text-right">-->
<a class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage"> <!-- <a class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage">-->
View all {{getEntityName(type, true, true)}} <!-- View all {{getEntityName(type, true, true)}}-->
<span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span> <!-- <span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span>-->
</a> <!-- </a>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</ng-template> <!--</ng-template>-->
<div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle"> <div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle">
<div *ngIf="!showFeedback" uk-grid> <div *ngIf="!showFeedback" uk-grid>
@ -623,23 +623,25 @@
<ng-template #projects_tab> <ng-template #projects_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchProjects" resultType="project"
context: { fetch: fetchProjects, type: 'project', urlParam: 'projectId', [params]="getParamsForSearchLink()"
searchLinkToAdvancedPage: properties.searchLinkToAdvancedProjects, [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedProjects"
params: getParamsForSearchLink()}"> [properties]="properties">
</ng-container> </search-tab>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
</div> </div>
</ng-template> </ng-template>
<ng-template #datasources_tab> <ng-template #datasources_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
context: { fetch: fetchDataproviders, type: 'dataprovider', urlParam: 'datasourceId', [params]="getParamsForSearchLink()"
searchLinkToAdvancedPage: properties.searchLinkToAdvancedDataProviders, [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
params: getParamsForSearchLink()}"> [properties]="properties">
</ng-container> </search-tab>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
</div> </div>
</ng-template> </ng-template>
<ng-template #relatedDatasources_tab> <ng-template #relatedDatasources_tab>
@ -660,45 +662,49 @@
<ng-template #publications_tab> <ng-template #publications_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchPublications" resultType="publication"
context: { fetch: fetchPublications, type: 'publication', urlParam: 'articleId', [params]="getParamsForSearchLink('publications')"
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
params: getParamsForSearchLink('publications')}"> [properties]="properties">
</ng-container> </search-tab>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
</div> </div>
</ng-template> </ng-template>
<ng-template #datasets_tab> <ng-template #datasets_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchDatasets" resultType="dataset"
context: { fetch: fetchDatasets, type: 'dataset', urlParam: 'datasetId', [params]="getParamsForSearchLink('datasets')"
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
params: getParamsForSearchLink('datasets')}"> [properties]="properties">
</ng-container> </search-tab>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
</div> </div>
</ng-template> </ng-template>
<ng-template #software_tab> <ng-template #software_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchSoftware" resultType="software"
context: { fetch: fetchSoftware, type: 'software', urlParam: 'softwareId', [params]="getParamsForSearchLink('software')"
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
params: getParamsForSearchLink('software')}"> [properties]="properties">
</ng-container> </search-tab>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
</div> </div>
</ng-template> </ng-template>
<ng-template #other_tab> <ng-template #other_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchOrps" resultType="other"
context: { fetch: fetchOrps, type: 'other', urlParam: 'orpId', [params]="getParamsForSearchLink('other')"
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
params: getParamsForSearchLink('other')}"> [properties]="properties">
</ng-container> </search-tab>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column"></div>-->
</div> </div>
</ng-template> </ng-template>
<ng-template #statistics_tab> <ng-template #statistics_tab>

View File

@ -20,7 +20,6 @@ import {ProjectsTabComponent} from './projectsTab.component';
import {DatasourcesTabComponent} from './datasourcesTab.component'; import {DatasourcesTabComponent} from './datasourcesTab.component';
import {OrganizationsTabComponent} from './organizationsTab.component'; import {OrganizationsTabComponent} from './organizationsTab.component';
import {RelatedDatasourcesTabComponent} from './relatedDatasourcesTab.component'; import {RelatedDatasourcesTabComponent} from './relatedDatasourcesTab.component';
// import {TabsComponent} from './tabs.component';
import {DataProviderComponent} from './dataProvider.component'; import {DataProviderComponent} from './dataProvider.component';
import {DataProviderService} from './dataProvider.service'; import {DataProviderService} from './dataProvider.service';
@ -38,9 +37,8 @@ import {LandingHeaderModule} from "../landing-utils/landing-header/landing-heade
import {AlertModalModule} from "../../utils/modal/alertModal.module"; import {AlertModalModule} from "../../utils/modal/alertModal.module";
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module"; import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
import {FeedbackModule} from "../feedback/feedback.module"; import {FeedbackModule} from "../feedback/feedback.module";
//import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
import {TabsModule} from "../../utils/tabs/tabs.module"; import {TabsModule} from "../../utils/tabs/tabs.module";
import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.module"; import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module";
@NgModule({ @NgModule({
imports: imports:
@ -49,7 +47,7 @@ import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.m
DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule, DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule,
PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule,
LandingHeaderModule, AlertModalModule, NoLoadPaging, FeedbackModule, LandingHeaderModule, AlertModalModule, NoLoadPaging, FeedbackModule,
TabsModule, SearchResultsModule//, ResultPreviewModule TabsModule, SearchTabModule
], ],
declarations: declarations:
[PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent, [PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent,

View File

@ -1,25 +1,25 @@
<ng-template #search_tab let-fetch="fetch" let-type="type"> <!--<ng-template #search_tab let-fetch="fetch" let-type="type">-->
<errorMessages [status]="[fetch.searchUtils.status]" [type]="getEntityName(type, true, true)" <!-- <errorMessages [status]="[fetch.searchUtils.status]" [type]="getEntityName(type, true, true)"-->
tab_error_class=true></errorMessages> <!-- tab_error_class=true></errorMessages>-->
<div *ngIf="fetch.searchUtils.status == errorCodes.DONE"> <!-- <div *ngIf="fetch.searchUtils.status == errorCodes.DONE">-->
<div *ngIf="fetch.searchUtils.totalResults > searchNumber" class="uk-inline uk-flex uk-flex-right"> <!-- <div *ngIf="fetch.searchUtils.totalResults > searchNumber" class="uk-inline uk-flex uk-flex-right">-->
<span class="uk-text-uppercase uk-position-left uk-text-middle uk-flex-middle uk-flex"> <!-- <span class="uk-text-uppercase uk-position-left uk-text-middle uk-flex-middle uk-flex">-->
<span>Top {{searchNumber}}</span><span class="space uk-text-muted">{{getEntityName(type, true, true)}}</span> <!-- <span>Top {{searchNumber}}</span><span class="space uk-text-muted">{{getEntityName(type, true, true)}}</span>-->
</span> <!-- </span>-->
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, getEntityName(type, true, false), 'false'])" <!-- <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, getEntityName(type, true, false), 'false'])"-->
[routerLink]="properties.searchLinkToAdvancedResults"> <!-- [routerLink]="properties.searchLinkToAdvancedResults">-->
<button class="uk-button uk-button-small portal-button"> <!-- <button class="uk-button uk-button-small portal-button">-->
<span uk-icon="search"></span> <!-- <span uk-icon="search"></span>-->
View all <!-- View all-->
</button> <!-- </button>-->
</a> <!-- </a>-->
</div> <!-- </div>-->
<search-result [results]="fetch.results" [status]="fetch.searchUtils.status" <!-- <search-result [results]="fetch.results" [status]="fetch.searchUtils.status"-->
[type]="getEntityName(type, false, true)" [showLoading]="true" [properties]="properties"> <!-- [type]="getEntityName(type, false, true)" [showLoading]="true" [properties]="properties">-->
</search-result> <!-- </search-result>-->
</div> <!-- </div>-->
</ng-template> <!--</ng-template>-->
<div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle"> <div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle">
<div *ngIf="!showFeedback" class="uk-grid"> <div *ngIf="!showFeedback" class="uk-grid">
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
@ -121,27 +121,11 @@
<ng-template #data_providers_tab> <ng-template #data_providers_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<errorMessages [status]="[fetchDataproviders.searchUtils.status]" [type]="'content providers'" <search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
tab_error_class=true></errorMessages> [params]="getParamsForSearchLink()"
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE"> [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
<div *ngIf="fetchDataproviders.searchUtils.totalResults > searchNumber" [properties]="properties">
class="uk-inline uk-flex uk-flex-right"> </search-tab>
<span class="uk-text-uppercase uk-position-left uk-text-middle uk-flex-middle uk-flex">
<span>Top {{searchNumber}}</span><span class="space uk-text-muted">content providers</span>
</span>
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0'], ['relorganizationid', organizationId])"
[routerLink]="properties.searchLinkToAdvancedDataProviders">
<button class="uk-button uk-button-small portal-button">
<span uk-icon="search"></span>
View all
</button>
</a>
</div>
<search-result [results]="fetchDataproviders.results"
[status]="fetchDataproviders.searchUtils.status"
[type]="'content provider'" [showLoading]="true" [properties]="properties">
</search-result>
</div>
</div> </div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>--> <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>
@ -149,9 +133,11 @@
<ng-template #publications_tab> <ng-template #publications_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchPublications" resultType="publication"
context: { fetch: fetchPublications, type: 'publication'}"> [params]="getParamsForSearchLink('publications')"
</ng-container> [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
</search-tab>
</div> </div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>--> <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>
@ -159,9 +145,11 @@
<ng-template #datasets_tab> <ng-template #datasets_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchDatasets" resultType="dataset"
context: { fetch: fetchDatasets, type: 'dataset'}"> [params]="getParamsForSearchLink('datasets')"
</ng-container> [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
</search-tab>
</div> </div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>--> <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>
@ -169,9 +157,11 @@
<ng-template #software_tab> <ng-template #software_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchSoftware" resultType="software"
context: { fetch: fetchSoftware, type: 'software'}"> [params]="getParamsForSearchLink('software')"
</ng-container> [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
</search-tab>
</div> </div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>--> <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>
@ -179,9 +169,11 @@
<ng-template #other_tab> <ng-template #other_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchOrps" resultType="other"
context: { fetch: fetchOrps, type: 'other'}"> [params]="getParamsForSearchLink('other')"
</ng-container> [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
</search-tab>
</div> </div>
<!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>--> <!--<div class="uk-width-1-3@m uk-width-1-1 right-column uk-padding-remove"></div>-->
</div> </div>

View File

@ -614,6 +614,14 @@ export class OrganizationComponent {
this.downloadFunderReportModal.alertTitle = "Download funder report"; this.downloadFunderReportModal.alertTitle = "Download funder report";
this.downloadFunderReportModal.open(); this.downloadFunderReportModal.open();
} }
public getParamsForSearchLink(type: string = "") {
if(type) {
return this.routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf', 'sortBy'], ['relorganizationid', this.organizationId, type, 'false', 'resultdateofacceptance,descending']);
} else {
return this.routerHelper.createQueryParams(['f0', 'fv0'], ['relorganizationid', this.organizationId]);
}
}
public onSelectActiveTab(activeTabId) { public onSelectActiveTab(activeTabId) {
if (this.activeTab != activeTabId) { // tab really changed if (this.activeTab != activeTabId) { // tab really changed

View File

@ -26,9 +26,9 @@ import {OrganizationsDeletedByInferenceModule} from "./deletedByInference/delete
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module"; import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
import {FeedbackModule} from "../feedback/feedback.module"; import {FeedbackModule} from "../feedback/feedback.module";
import {MatSelectModule} from "@angular/material/select"; import {MatSelectModule} from "@angular/material/select";
import {TabsModule} from "../../utils/tabs/tabs.module";
import {ModalSelectModule} from "../../utils/modal-select/modal-select.module"; import {ModalSelectModule} from "../../utils/modal-select/modal-select.module";
import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.module"; import {TabsModule} from "../../utils/tabs/tabs.module";
import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module";
@NgModule({ @NgModule({
@ -45,7 +45,9 @@ import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.m
SearchResearchResultsServiceModule, SearchResearchResultsServiceModule,
ProjectsServiceModule, ProjectsServiceModule,
Schema2jsonldModule, SEOServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, HelperModule,
OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, MatSelectModule, TabsModule, ModalSelectModule, SearchResultsModule OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule,
MatSelectModule, ModalSelectModule,
TabsModule, SearchTabModule
], ],
declarations: [ declarations: [
OrganizationComponent, OrganizationComponent,

View File

@ -75,78 +75,53 @@
</ul> </ul>
</ng-template> </ng-template>
<ng-template #search_box let-fetch="fetch" let-type="type" let-typeName="typeName"> <!--<ng-template #search_box let-fetch="fetch" let-type="type" let-typeName="typeName">-->
<div *ngIf="fetch.searchUtils.totalResults > 0"> <!-- <div *ngIf="fetch.searchUtils.totalResults > 0">-->
<div class="uk-position-relative"> <!-- <div class="uk-position-relative">-->
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relprojectid', projectId, type, 'false'])" <!-- <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relprojectid', projectId, type, 'false'])"-->
[routerLink]="properties.searchLinkToAdvancedResults" target="_blank"> <!-- [routerLink]="properties.searchLinkToAdvancedResults" target="_blank">-->
<span class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span> <!-- <span class="custom-external uk-position-top-right uk-margin-small-right uk-margin-small-top"></span>-->
<div class="header target uk-text-bold">{{typeName}}</div> <!-- <div class="header target uk-text-bold">{{typeName}}</div>-->
<div class="icon uk-position-center" uk-icon="icon: search;"></div> <!-- <div class="icon uk-position-center" uk-icon="icon: search;"></div>-->
<div class="footer target uk-position-relative"> <!-- <div class="footer target uk-position-relative">-->
<span class="uk-text-bold uk-position-center">{{fetch.searchUtils.totalResults | number}}</span> <!-- <span class="uk-text-bold uk-position-center">{{fetch.searchUtils.totalResults | number}}</span>-->
</div> <!-- </div>-->
</a>
</div>
</div>
</ng-template>
<ng-template #search_tab let-fetch="fetch" let-type="type" let-urlParam="urlParam"
let-searchLinkToAdvancedPage="searchLinkToAdvancedPage" let-params="params">
<errorMessages [status]="[fetch.searchUtils.status]" [type]="getEntityName(type, true, true)"
tab_error_class=true></errorMessages>
<div *ngIf="fetch.searchUtils.status == errorCodes.DONE">
<!-- <div *ngIf="fetch.searchUtils.totalResults > searchNumber" class="uk-inline uk-flex uk-flex-right">-->
<!-- <span class="uk-text-uppercase uk-position-left uk-text-middle uk-flex-middle uk-flex">-->
<!-- <span>Top {{searchNumber}}</span><span class="space uk-text-muted">{{getEntityName(type, true, true)}}</span>-->
<!-- </span>-->
<!-- <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relprojectid', projectId, getEntityName(type, true, false), 'false'])"-->
<!-- [routerLink]="properties.searchLinkToAdvancedResults">-->
<!-- <button class="uk-button uk-button-small portal-button">-->
<!-- <span uk-icon="search"></span>-->
<!-- View all-->
<!-- </button>-->
<!-- </a>--> <!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!--</ng-template>-->
<!--<ng-template #search_tab let-fetch="fetch" let-type="type" let-urlParam="urlParam"-->
<!-- let-searchLinkToAdvancedPage="searchLinkToAdvancedPage" let-params="params">-->
<!-- <errorMessages [status]="[fetch.searchUtils.status]" [type]="getEntityName(type, true, true)"-->
<!-- tab_error_class=true></errorMessages>-->
<!-- <div *ngIf="fetch.searchUtils.status == errorCodes.DONE">-->
<!-- <div class="tab-header">-->
<!-- <span *ngIf="type != 'organization' && type != 'dataprovider' && type != 'project'">Recent</span>-->
<!-- {{getEntityName(type, true, true)}}-->
<!-- </div>-->
<!-- <div class="uk-text-right">-->
<!-- <a class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage">-->
<!-- View all {{getEntityName(type, true, true)}}-->
<!-- <span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span>-->
<!-- </a>-->
<!-- </div>--> <!-- </div>-->
<div class="tab-header"> <!-- <search-result [properties]="properties"-->
<span *ngIf="type != 'organization' && type != 'dataprovider' && type != 'project'">Recent</span> <!-- [results]="fetch.results"-->
{{getEntityName(type, true, true)}} <!-- [status]="fetch.searchUtils.status"-->
</div> <!-- [type]="type" urlParam="articleId">-->
<div class="uk-text-right"> <!-- </search-result>-->
<a class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage">
View all {{getEntityName(type, true, true)}}
<span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span>
</a>
</div>
<!-- <ul class="uk-list-divider uk-list uk-margin uk-margin-top">--> <!-- <div class="uk-text-right">-->
<!-- <errorMessages [status]="[fetch.searchUtils.status]" [type]="'results'"></errorMessages>--> <!-- <a class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage">-->
<!-- <li *ngFor="let result of fetch.results" class="uk-animation-fade">--> <!-- View all {{getEntityName(type, true, true)}}-->
<!-- <div>--> <!-- <span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span>-->
<!-- <result-preview [properties]="properties" [showOrganizations]="true"--> <!-- </a>-->
<!-- [showSubjects]="true" [result]="getResultPreview(result, type)">--> <!-- </div>-->
<!-- </result-preview>--> <!-- </div>-->
<!-- </div>--> <!--</ng-template>-->
<!-- </li>-->
<!-- </ul>-->
<search-result [properties]="properties"
[results]="fetch.results"
[status]="fetch.searchUtils.status"
[type]="type" urlParam="articleId">
</search-result>
<div class="uk-text-right">
<a class="el-content uk-button uk-button-text" [queryParams]="params" [routerLink]="searchLinkToAdvancedPage">
View all {{getEntityName(type, true, true)}}
<span *ngIf="fetch.searchUtils.totalResults <= searchNumber">in search page</span>
</a>
</div>
</div>
</ng-template>
<div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle"> <div id="tm-main" class="landing uk-section uk-padding-remove-top tm-middle">
<div *ngIf="!showFeedback" uk-grid> <div *ngIf="!showFeedback" uk-grid>
@ -905,46 +880,16 @@
<!-- [tabId]="'publications'">--> <!-- [tabId]="'publications'">-->
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<!-- <errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"--> <search-tab [fetch]="fetchPublications" resultType="publication"
<!-- tab_error_class=true></errorMessages>--> [params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
<!-- <div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">--> [properties]="properties">
<!-- <div class="uk-inline uk-flex uk-flex-right">--> </search-tab>
<!-- <span class="uk-position-left uk-text-middle uk-flex-middle uk-flex">-->
<!-- <span>Top 10</span><span class="space uk-text-muted">PUBLICATION</span>-->
<!-- </span>-->
<!-- <a [queryParams]="routerHelper.createQueryParams(['project', 'po'], [projectId, 'and'])"-->
<!-- routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications">-->
<!-- <button *ngIf="fetchPublications.searchUtils.totalResults > 10"-->
<!-- class="uk-button uk-button-small portal-button">-->
<!-- <span uk-icon="search"></span>-->
<!-- View more-->
<!-- </button>-->
<!-- </a>-->
<!-- </div>-->
<!-- <search-result [results]="fetchPublications.results"-->
<!-- [status]="fetchPublications.searchUtils.status"-->
<!-- type="publication" urlParam="articleId"-->
<!-- dividerNotCard="true">-->
<!-- </search-result>-->
<!-- </div>-->
<ng-container *ngTemplateOutlet="search_tab;
context: { fetch: fetchPublications, type: 'publication', urlParam: 'articleId',
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
params: getParamsForSearchLink('publications')}">
</ng-container>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column">-->
<!-- <div class="uk-width-1-3@m uk-padding right-column">--> <!-- <div>test publications</div>-->
<!-- <div>test publications</div>--> <!-- </div>-->
<!-- </div>-->
</div> </div>
<!-- <ng-container *ngTemplateOutlet="tab_content; context: {-->
<!-- resultType: 'publication', results: publicationResults,-->
<!-- totalResults: publicationTotal, type: 'publication', typeName: 'publication'}">-->
<!-- </ng-container>-->
<!-- </my-tab>--> <!-- </my-tab>-->
</ng-template> </ng-template>
<ng-template #datasets_tab> <ng-template #datasets_tab>
@ -953,32 +898,30 @@
<!-- [tabId]="'datasets'">--> <!-- [tabId]="'datasets'">-->
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchDatasets" resultType="dataset"
context: { fetch: fetchDatasets, type: 'dataset', urlParam: 'datasetId', [params]="getParamsForSearchLink('datasets')"
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
params: getParamsForSearchLink('datasets')}"> [properties]="properties">
</ng-container> </search-tab>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column">-->
<!-- <div class="uk-width-1-3@m uk-padding right-column">--> <!-- <div>test research data</div>-->
<!-- <div>test research data</div>--> <!-- </div>-->
<!-- </div>-->
</div> </div>
<!-- </my-tab>--> <!-- </my-tab>-->
</ng-template> </ng-template>
<ng-template #software_tab> <ng-template #software_tab>
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchSoftware" resultType="software"
context: { fetch: fetchSoftware, type: 'software', urlParam: 'softwareId', [params]="getParamsForSearchLink('software')"
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
params: getParamsForSearchLink('software')}"> [properties]="properties">
</ng-container> </search-tab>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column">-->
<!-- <div class="uk-width-1-3@m uk-padding right-column">--> <!-- <div>test software</div>-->
<!-- <div>test software</div>--> <!-- </div>-->
<!-- </div>-->
</div> </div>
</ng-template> </ng-template>
<ng-template #other_tab> <ng-template #other_tab>
@ -987,16 +930,15 @@
<!-- [tabId]="'other'">--> <!-- [tabId]="'other'">-->
<div class="uk-grid uk-margin-remove"> <div class="uk-grid uk-margin-remove">
<div class="uk-width-expand uk-padding"> <div class="uk-width-expand uk-padding">
<ng-container *ngTemplateOutlet="search_tab; <search-tab [fetch]="fetchOrps" resultType="other"
context: { fetch: fetchOrps, type: 'other', urlParam: 'orpId', [params]="getParamsForSearchLink('other')"
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
params: getParamsForSearchLink('other')}"> [properties]="properties">
</ng-container> </search-tab>
</div> </div>
<!-- <div class="uk-width-1-3@m uk-padding right-column">-->
<!-- <div class="uk-width-1-3@m uk-padding right-column">--> <!-- <div>test other research products</div>-->
<!-- <div>test other research products</div>--> <!-- </div>-->
<!-- </div>-->
</div> </div>
<!-- </my-tab>--> <!-- </my-tab>-->
</ng-template> </ng-template>

View File

@ -28,9 +28,8 @@ import {SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {FeedbackModule} from "../feedback/feedback.module"; import {FeedbackModule} from "../feedback/feedback.module";
import {AltMetricsModule} from "../../utils/altmetrics.module"; import {AltMetricsModule} from "../../utils/altmetrics.module";
import {TabsModule} from "../../utils/tabs/tabs.module"; import {TabsModule} from "../../utils/tabs/tabs.module";
import {SearchResultsModule} from "../../searchPages/searchUtils/searchResults.module";
//import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
import {ModalSelectModule} from "../../utils/modal-select/modal-select.module"; import {ModalSelectModule} from "../../utils/modal-select/modal-select.module";
import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module";
@NgModule({ @NgModule({
imports: [ imports: [
@ -40,7 +39,7 @@ import {ModalSelectModule} from "../../utils/modal-select/modal-select.module";
SearchResearchResultsServiceModule, ProjectServiceModule, SearchResearchResultsServiceModule, ProjectServiceModule,
Schema2jsonldModule, SEOServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, HelperModule,
LandingHeaderModule, MatSelectModule, FeedbackModule, AltMetricsModule, LandingHeaderModule, MatSelectModule, FeedbackModule, AltMetricsModule,
TabsModule, ModalSelectModule, SearchResultsModule//, ResultPreviewModule TabsModule, ModalSelectModule, SearchTabModule
], ],
declarations: [ declarations: [
ProjectComponent ProjectComponent