import {Component, Input, OnInit} from '@angular/core'; import {Plugin} from "../../../../utils/entities/adminTool/plugin"; import {PluginTemplate} from "../../../../utils/entities/adminTool/pluginTemplate"; import {SearchResearchResultsService} from "../../../../services/searchResearchResults.service"; import {FetchResearchResults} from "../../../../utils/fetchEntitiesClasses/fetchResearchResults.class"; import {EnvProperties} from "../../../../utils/properties/env-properties"; import { properties } from 'src/environments/environment'; import {RouterHelper} from "../../../../utils/routerHelper.class"; import {OpenaireEntities} from "../../../../utils/properties/searchFields"; import {PluginBaseComponent} from "../../utils/base-plugin.component"; export class PluginResultsNumbers{ publicationsOnOff:boolean; datasetsOnOff:boolean; softwareOnOff:boolean; otherOnOff:boolean; } @Component({ selector: 'plugin-results-numbers', template: `
{{openaireEntities.PUBLICATIONS}}
` }) export class PluginResultsNumbersComponent extends PluginBaseComponent{ get pluginObject():PluginResultsNumbers{ return this.plugin.object; } get pluginDefaultObject():PluginResultsNumbers{ return this.pluginTemplate.object; } // Variables for publications, research data, projects, content providers, related content providers tabs public fetchPublications: FetchResearchResults; public fetchDatasets: FetchResearchResults; public fetchSoftware: FetchResearchResults; public fetchOrps: FetchResearchResults; public fetchFeaturedDatasets: FetchResearchResults; searchLinkToResults: string = null; properties: EnvProperties = properties; public routerHelper: RouterHelper = new RouterHelper(); openaireEntities= OpenaireEntities; constructor(private _searchResearchResultsService: SearchResearchResultsService,) { super(); this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService); this.fetchDatasets = new FetchResearchResults(this._searchResearchResultsService); this.fetchSoftware = new FetchResearchResults(this._searchResearchResultsService); this.fetchOrps = new FetchResearchResults(this._searchResearchResultsService); this.fetchFeaturedDatasets = new FetchResearchResults(this._searchResearchResultsService); } ngOnInit(): void { this.searchLinkToResults = this.properties.searchLinkToResults; } public getParamsForSearchLink(type: string = "") { if (type) { return this.routerHelper.createQueryParams(['type', 'qf', 'sortBy'], [type, 'false', 'resultdateofacceptance,descending']); } else { return {}; } } }