diff --git a/claims/claim-utils/displayClaims/displayClaims.module.ts b/claims/claim-utils/displayClaims/displayClaims.module.ts index 6ecda833..99134994 100644 --- a/claims/claim-utils/displayClaims/displayClaims.module.ts +++ b/claims/claim-utils/displayClaims/displayClaims.module.ts @@ -17,7 +17,6 @@ import {HelperModule} from '../../../utils/helper/helper.module'; import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module'; import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module'; import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module"; -import {PiwikServiceModule} from "../../../utils/piwik/piwikService.module"; import {SearchInputModule} from '../../../sharedComponents/search-input/search-input.module'; import {InputModule} from '../../../sharedComponents/input/input.module'; import {LoadingModule} from '../../../utils/loading/loading.module'; @@ -30,7 +29,7 @@ import {link} from "../../../utils/icons/icons"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule, - ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, PiwikServiceModule, + ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, IndexInfoServiceModule, MatSelectModule, SearchInputModule, MatAutocompleteModule, MatChipsModule, MatFormFieldModule, MatSlideToggleModule, InputModule, LoadingModule, NoLoadPaging, IconsModule, DropdownFilterModule ], diff --git a/claims/claimsAdmin/claimsAdmin.module.ts b/claims/claimsAdmin/claimsAdmin.module.ts index ace19292..89caa0d6 100644 --- a/claims/claimsAdmin/claimsAdmin.module.ts +++ b/claims/claimsAdmin/claimsAdmin.module.ts @@ -3,9 +3,6 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../../../openaireLibrary/shared/shared.module'; import { ClaimsAdminComponent } from './claimsAdmin.component'; import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module'; -import { AdminLoginGuard} from'../../login/adminLoginGuard.guard'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; @NgModule({ imports: [ @@ -13,7 +10,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; DisplayClaimsModule ], - providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled], + providers:[], declarations: [ ClaimsAdminComponent ], diff --git a/claims/directLinking/directLinking.module.ts b/claims/directLinking/directLinking.module.ts index a9bea79c..9505f79d 100644 --- a/claims/directLinking/directLinking.module.ts +++ b/claims/directLinking/directLinking.module.ts @@ -5,9 +5,6 @@ import { DirectLinkingComponent } from './directLinking.component'; import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module'; import {SearchResearchResultsServiceModule} from '../../services/searchResearchResultsService.module'; -import {LoginGuard} from'../../login/loginGuard.guard'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import {LinkingGenericModule} from '../linking/linkingGeneric.module'; @@ -18,7 +15,7 @@ import {LinkingGenericModule} from '../linking/linkingGeneric.module'; EntitySearchServiceModule, SearchResearchResultsServiceModule, Schema2jsonldModule, SEOServiceModule, LinkingGenericModule ], - providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], + providers:[], declarations: [ DirectLinkingComponent ], exports:[DirectLinkingComponent] diff --git a/claims/linking/bulkClaim/bulkClaim.component.ts b/claims/linking/bulkClaim/bulkClaim.component.ts index fac882b3..79654726 100644 --- a/claims/linking/bulkClaim/bulkClaim.component.ts +++ b/claims/linking/bulkClaim/bulkClaim.component.ts @@ -269,11 +269,16 @@ export class BulkClaimComponent { } }, err => { - //console.log(err); + // console.log(err); BulkClaimComponent.handleError("Error getting crossref by DOIs: " + id, err); - this.notFoundIds.push(id); - this.notFoundIdsRow.push(row); - this.endOfFetching(); + + if(err.status == 404) { + this.searchInDatacite(id, accessMode, date, row); + } else { + this.notFoundIds.push(id); + this.notFoundIdsRow.push(row); + this.endOfFetching(); + } } )); } diff --git a/claims/linking/linkingGeneric.module.ts b/claims/linking/linkingGeneric.module.ts index 5d49a3b5..0ec6eafe 100644 --- a/claims/linking/linkingGeneric.module.ts +++ b/claims/linking/linkingGeneric.module.ts @@ -7,20 +7,16 @@ import {SelectedContextsModule} from './selected/selectedContexts.module'; import {SelectedPublicationsModule} from './selected/selectedResults.module'; import {LinkingGenericComponent} from './linkingGeneric.component'; import {StartOverModule} from '../claim-utils/startOver.module'; -import {LoginGuard} from '../../login/loginGuard.guard'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; import {ClaimContextSearchFormModule} from '../claim-utils/claimContextSearchForm.module'; import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module'; import {BulkClaimModule} from './bulkClaim/bulkClaim.module'; import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module'; import {HelperModule} from '../../utils/helper/helper.module'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module'; import {MetadataPreviewModule} from './selected/metadataPreview.module'; import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module"; import {AlertModalModule} from '../../utils/modal/alertModal.module'; -import {PiwikServiceModule} from "../../utils/piwik/piwikService.module"; import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module"; import {StepperModule} from "../../sharedComponents/stepper/stepper.module"; import {IconsModule} from "../../utils/icons/icons.module"; @@ -34,10 +30,9 @@ import {link} from "../../utils/icons/icons"; StartOverModule, ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule, - PiwikServiceModule, MatSelectModule, BreadcrumbsModule, StepperModule, IconsModule ], - providers: [LoginGuard, PreviousRouteRecorder, IsRouteEnabled], + providers: [], declarations: [ LinkingGenericComponent ], exports: [ diff --git a/claims/myClaims/myClaims.module.ts b/claims/myClaims/myClaims.module.ts index 20d97331..bb87055d 100644 --- a/claims/myClaims/myClaims.module.ts +++ b/claims/myClaims/myClaims.module.ts @@ -3,9 +3,6 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../../../openaireLibrary/shared/shared.module'; import { MyClaimsComponent } from './myClaims.component'; import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module'; -import {LoginGuard} from'../../login/loginGuard.guard'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; @NgModule({ imports: [ @@ -13,7 +10,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; DisplayClaimsModule ], - providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], + providers:[], declarations: [ MyClaimsComponent ], exports: [MyClaimsComponent] diff --git a/dashboard/divId/divIds.module.ts b/dashboard/divId/divIds.module.ts index eca996e6..dbdcb477 100644 --- a/dashboard/divId/divIds.module.ts +++ b/dashboard/divId/divIds.module.ts @@ -15,9 +15,10 @@ import {LoadingModule} from "../../utils/loading/loading.module"; @NgModule({ imports: [ + ClassesRoutingModule, CommonModule, RouterModule, FormsModule, AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, - AdminTabsModule, PageContentModule, ClassesRoutingModule, SearchInputModule, IconsModule, LoadingModule + AdminTabsModule, PageContentModule, SearchInputModule, IconsModule, LoadingModule ], declarations: [DivIdsComponent], exports: [DivIdsComponent] diff --git a/dashboard/divhelpcontent/class-help-content-form.module.ts b/dashboard/divhelpcontent/class-help-content-form.module.ts index 5f0bec5c..9e0b061a 100644 --- a/dashboard/divhelpcontent/class-help-content-form.module.ts +++ b/dashboard/divhelpcontent/class-help-content-form.module.ts @@ -16,9 +16,10 @@ import {PageContentModule} from '../sharedComponents/page-content/page-content.m @NgModule({ imports: [ + ClassHelpContentFormRoutingModule, CommonModule, FormsModule, RouterModule, SafeHtmlPipeModule, CKEditorModule, - AlertModalModule, ReactiveFormsModule, ClassHelpContentFormRoutingModule, AdminToolServiceModule, InputModule, MatSlideToggleModule, IconsModule, LoadingModule, PageContentModule + AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, MatSlideToggleModule, IconsModule, LoadingModule, PageContentModule ], declarations: [ ClassContentFormComponent diff --git a/dashboard/divhelpcontent/class-help-contents.module.ts b/dashboard/divhelpcontent/class-help-contents.module.ts index 8e350d1d..ecd80574 100644 --- a/dashboard/divhelpcontent/class-help-contents.module.ts +++ b/dashboard/divhelpcontent/class-help-contents.module.ts @@ -19,8 +19,9 @@ import {PageContentModule} from '../sharedComponents/page-content/page-content.m @NgModule({ imports: [ + ClassHelpContentsRoutingModule, CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule, - AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, ClassHelpContentsRoutingModule, + AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule, PageContentModule ], declarations: [ diff --git a/dashboard/entity/entities.module.ts b/dashboard/entity/entities.module.ts index 52843fb9..a112018c 100644 --- a/dashboard/entity/entities.module.ts +++ b/dashboard/entity/entities.module.ts @@ -17,8 +17,9 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module"; @NgModule({ imports: [ + EntitiesRoutingModule, CommonModule, RouterModule, FormsModule, AdminToolServiceModule, - AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, EntitiesRoutingModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule + AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule ], declarations: [EntitiesComponent], exports: [EntitiesComponent] diff --git a/dashboard/helpTexts/page-help-content-form.module.ts b/dashboard/helpTexts/page-help-content-form.module.ts index 27e34ae4..714ee256 100644 --- a/dashboard/helpTexts/page-help-content-form.module.ts +++ b/dashboard/helpTexts/page-help-content-form.module.ts @@ -16,9 +16,10 @@ import {MatSlideToggleModule} from "@angular/material/slide-toggle"; @NgModule({ imports: [ + PageHelpContentFormRoutingModule, CommonModule, FormsModule, RouterModule, SafeHtmlPipeModule, CKEditorModule, - AlertModalModule, ReactiveFormsModule, PageHelpContentFormRoutingModule, AdminToolServiceModule, InputModule, IconsModule, PageContentModule, LoadingModule, MatSlideToggleModule + AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, IconsModule, PageContentModule, LoadingModule, MatSlideToggleModule ], declarations: [PageContentFormComponent], exports: [PageContentFormComponent] diff --git a/dashboard/helpTexts/page-help-contents.module.ts b/dashboard/helpTexts/page-help-contents.module.ts index 10bc383f..8a2876df 100644 --- a/dashboard/helpTexts/page-help-contents.module.ts +++ b/dashboard/helpTexts/page-help-contents.module.ts @@ -17,8 +17,9 @@ import {HTMLToStringPipeModule} from '../../utils/pipes/HTMLToStringPipe.module' @NgModule({ imports: [ + PageHelpContentsRoutingModule, CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule, - AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, PageHelpContentsRoutingModule, PageContentModule, + AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, PageContentModule, SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule ], declarations: [ diff --git a/dashboard/menu/menu.module.ts b/dashboard/menu/menu.module.ts index db77cef3..53e90331 100644 --- a/dashboard/menu/menu.module.ts +++ b/dashboard/menu/menu.module.ts @@ -18,8 +18,9 @@ import {LogoUrlPipeModule} from '../../utils/pipes/logoUrlPipe.module'; @NgModule({ imports: [ + MenuRoutingModule, CommonModule, RouterModule, FormsModule, AdminToolServiceModule, - AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, MenuRoutingModule, SearchInputModule, IconsModule, LoadingModule, + AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, SearchInputModule, IconsModule, LoadingModule, TransitionGroupModule, LogoUrlPipeModule ], declarations: [MenuComponent], diff --git a/dashboard/page/pages.module.ts b/dashboard/page/pages.module.ts index 111f1af4..369723fb 100644 --- a/dashboard/page/pages.module.ts +++ b/dashboard/page/pages.module.ts @@ -20,8 +20,9 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module"; @NgModule({ imports: [ + PagesRoutingModule, CommonModule, RouterModule, FormsModule, AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, - MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, PagesRoutingModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule + MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule ], declarations: [PagesComponent], exports: [PagesComponent] diff --git a/dashboard/portal/portals.module.ts b/dashboard/portal/portals.module.ts index 3c6ff447..50aaf92b 100644 --- a/dashboard/portal/portals.module.ts +++ b/dashboard/portal/portals.module.ts @@ -15,9 +15,10 @@ import {LoadingModule} from "../../utils/loading/loading.module"; @NgModule({ imports: [ + PortalsRoutingModule, CommonModule, FormsModule, AlertModalModule, ReactiveFormsModule, - RouterModule, AdminToolServiceModule, InputModule, AdminTabsModule, PageContentModule, PortalsRoutingModule, IconsModule, SearchInputModule, LoadingModule + RouterModule, AdminToolServiceModule, InputModule, AdminTabsModule, PageContentModule, IconsModule, SearchInputModule, LoadingModule ], declarations: [PortalsComponent], exports: [PortalsComponent] diff --git a/dashboard/users/subscribers/subscribers.component.ts b/dashboard/users/subscribers/subscribers.component.ts index 5b7976e7..fcc49978 100644 --- a/dashboard/users/subscribers/subscribers.component.ts +++ b/dashboard/users/subscribers/subscribers.component.ts @@ -141,8 +141,8 @@ export class SubscribersComponent implements OnInit, OnDestroy, OnChanges { this.createRoleModal.okButtonLeft = false; this.createRoleModal.okButtonText = 'create'; this.roleFb = this.fb.group({ - name: this.fb.control(Role.mapType(this.type) + '.' + this.id, Validators.required), - description: this.fb.control(Role.mapType(this.type) + ' ' + this.id, Validators.required) + name: this.fb.control(Role.roleName(this.type, this.id), Validators.required), + description: this.fb.control(Role.roleName(this.type, this.id), Validators.required) }); setTimeout(() => { this.roleFb.get('name').disable(); diff --git a/deposit/depositFirstPage.module.ts b/deposit/depositFirstPage.module.ts index c91e19b0..197b0ff3 100644 --- a/deposit/depositFirstPage.module.ts +++ b/deposit/depositFirstPage.module.ts @@ -5,7 +5,6 @@ import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; -import {PiwikServiceModule} from '../utils/piwik/piwikService.module'; import {HelperModule} from '../utils/helper/helper.module'; import {Schema2jsonldModule} from '../sharedComponents/schema2jsonld/schema2jsonld.module'; import { SEOServiceModule } from '../sharedComponents/SEO/SEOService.module'; @@ -18,7 +17,6 @@ import {FullScreenModalModule} from '../utils/modal/full-screen-modal/full-scree imports: [ CommonModule, FormsModule, RouterModule, - PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, SearchInputModule, FullScreenModalModule diff --git a/deposit/searchDataprovidersToDeposit.module.ts b/deposit/searchDataprovidersToDeposit.module.ts index c6fb9f0a..d7959e48 100644 --- a/deposit/searchDataprovidersToDeposit.module.ts +++ b/deposit/searchDataprovidersToDeposit.module.ts @@ -9,7 +9,6 @@ import {SearchResultsModule } from '../searchPages/searchUtils/searchResults.mod import {DataProvidersServiceModule} from '../services/dataProvidersService.module'; import {SearchFormModule} from '../searchPages/searchUtils/searchForm.module'; -import {IsRouteEnabled} from '../error/isRouteEnabled.guard'; import {SearchDataProvidersModule} from "../searchPages/searchDataProviders.module"; import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; import {SearchInputModule} from "../sharedComponents/search-input/search-input.module"; @@ -25,7 +24,7 @@ import {SearchInputModule} from "../sharedComponents/search-input/search-input.m declarations: [ SearchDataprovidersToDepositComponent ], - providers:[ IsRouteEnabled], + providers:[], exports: [ SearchDataprovidersToDepositComponent ] diff --git a/error/isRouteEnabled.guard.ts b/error/isRouteEnabled.guard.ts index 2dca90fb..a49e53d0 100644 --- a/error/isRouteEnabled.guard.ts +++ b/error/isRouteEnabled.guard.ts @@ -6,7 +6,9 @@ import {ConfigurationService} from '../utils/configuration/configuration.service import {ConnectHelper} from '../connect/connectHelper'; import {properties} from "../../../environments/environment"; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class IsRouteEnabled { constructor(private router: Router, diff --git a/fos/fos.module.ts b/fos/fos.module.ts index d0f1f833..9264a6e9 100644 --- a/fos/fos.module.ts +++ b/fos/fos.module.ts @@ -2,13 +2,11 @@ import {CommonModule} from "@angular/common"; import {NgModule} from "@angular/core"; import {FormsModule} from "@angular/forms"; import {RouterModule} from "@angular/router"; -import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard"; import {IconsModule} from "../utils/icons/icons.module"; import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module"; import {SearchInputModule} from "../sharedComponents/search-input/search-input.module"; import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module"; -import {PiwikService} from "../utils/piwik/piwik.service"; import {FosRoutingModule} from './fos-routing.module'; import {FosComponent} from './fos.component'; @@ -22,9 +20,7 @@ import {FosComponent} from './fos.component'; declarations: [ FosComponent ], - providers: [ - PreviousRouteRecorder, PiwikService - ], + providers: [], exports: [ FosComponent ] diff --git a/landingPages/dataProvider/dataProvider-routing.module.ts b/landingPages/dataProvider/dataProvider-routing.module.ts new file mode 100644 index 00000000..fb878479 --- /dev/null +++ b/landingPages/dataProvider/dataProvider-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard"; +import { DataProviderComponent } from "./dataProvider.component"; + + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: DataProviderComponent, canDeactivate: [PreviousRouteRecorder] }]) + ] +}) +export class DataProviderRoutingModule { } diff --git a/landingPages/dataProvider/dataProvider.module.ts b/landingPages/dataProvider/dataProvider.module.ts index 6cbdf9b4..c6716f47 100644 --- a/landingPages/dataProvider/dataProvider.module.ts +++ b/landingPages/dataProvider/dataProvider.module.ts @@ -36,10 +36,12 @@ import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.modu import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-screen-modal.module'; import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; +import {DataProviderRoutingModule} from "./dataProvider-routing.module"; @NgModule({ imports: [CommonModule, FormsModule, RouterModule, + DataProviderRoutingModule, IFrameModule, ErrorMessagesModule, LandingModule, DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule, diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 4a6d28f6..85fef1ea 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -22,7 +22,7 @@ import {RouterHelper} from "../../utils/routerHelper.class"; -
- {{sliceString(availableOn[0].downloadNames.join("; "), 20)}} @@ -108,7 +108,7 @@ import {RouterHelper} from "../../utils/routerHelper.class"; {{instance.license}}
-
+
Full-Text: diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts index d9e0cf98..0378f127 100644 --- a/landingPages/landing-utils/entity-metadata.component.ts +++ b/landingPages/landing-utils/entity-metadata.component.ts @@ -118,8 +118,9 @@ import {RouterHelper} from "../../utils/routerHelper.class"; - - + + Compatibility: + @@ -137,10 +138,11 @@ import {RouterHelper} from "../../utils/routerHelper.class"; {{compatibility.name}} - - - {{compatibilityString}} - + + + Compatibility: + {{compatibilityString}} + OpenAIRE Text Mining @@ -152,9 +154,9 @@ import {RouterHelper} from "../../utils/routerHelper.class"; Publicly funded - - {{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}} + + Funded by: + {{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}} +{{projects.length - projectsLimit | number}} projects @@ -166,9 +168,9 @@ import {RouterHelper} from "../../utils/routerHelper.class"; - - {{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}} + + Partners: + {{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}} +{{organizations.length - organizationsLimit | number}} partners @@ -180,9 +182,10 @@ import {RouterHelper} from "../../utils/routerHelper.class"; - + {{subjects.slice(0, 3).join(', ')}} + {{provenanceAction}} diff --git a/landingPages/landing-utils/fundedBy.component.ts b/landingPages/landing-utils/fundedBy.component.ts index c03a5ea1..b7852a4a 100644 --- a/landingPages/landing-utils/fundedBy.component.ts +++ b/landingPages/landing-utils/fundedBy.component.ts @@ -20,14 +20,16 @@ import {RouterHelper} from "../../utils/routerHelper.class";
- +
- + + +
, @@ -35,13 +37,13 @@ import {RouterHelper} from "../../utils/routerHelper.class";
- + -
- +
+
@@ -54,7 +56,7 @@ import {RouterHelper} from "../../utils/routerHelper.class"; | {{ item['acronym'] ? item['acronym'] : item['title']}} - +
Project
@@ -84,7 +86,7 @@ import {RouterHelper} from "../../utils/routerHelper.class"; Funding stream: {{item.funding}} -
+
Validated by funder | {{item.provenanceAction}} @@ -105,8 +107,15 @@ export class FundedByComponent { public url = properties.searchLinkToProject.split('?')[0]; public title: string = "Funded by"; @Input() provenanceActionVocabulary = null; - public provenancesCalculated: boolean[] = []; + // public provenancesCalculated: boolean[] = []; public routerHelper:RouterHelper = new RouterHelper(); + public dropClicked: boolean = false; + + public ngOnInit() { + this.fundedByProjects.forEach((project, index) => { + this.getVocabularyLabel(project, this.provenanceActionVocabulary, index); + }) + } public viewAllClick() { if(this.fundedByProjects.length <= this.threshold*2) { @@ -124,11 +133,11 @@ export class FundedByComponent { } public getVocabularyLabel(item: any, vocabulary: any, index: number) { - if(!this.provenancesCalculated[index]) { - this.provenancesCalculated[index] = true; + // if(!this.provenancesCalculated[index]) { + // this.provenancesCalculated[index] = true; item.provenanceAction = HelperFunctions.getVocabularyLabel(item.provenanceAction, vocabulary, false); - } - return item.provenanceAction; + // } + // return item.provenanceAction; } public addEoscPrevInParams(obj) { diff --git a/landingPages/landing-utils/landing.module.ts b/landingPages/landing-utils/landing.module.ts index a7ae76f1..3eedae91 100644 --- a/landingPages/landing-utils/landing.module.ts +++ b/landingPages/landing-utils/landing.module.ts @@ -8,19 +8,15 @@ import { RouterModule } from '@angular/router'; import {TabPagingComponent} from './tabPaging.component'; import {ShowTitleComponent} from './showTitle.component'; import {AddThisComponent} from './addThis.component'; -import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; -import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard'; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, PiwikServiceModule + CommonModule, FormsModule, RouterModule ], declarations: [ TabPagingComponent, ShowTitleComponent, AddThisComponent ], - providers:[ - PreviousRouteRecorder - ], + providers:[], exports: [ TabPagingComponent, ShowTitleComponent, AddThisComponent ] diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 105c54cf..d5d614a3 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -42,7 +42,7 @@ export class ParsingFunctions { "funderShortname": "", "funderName": "", "funding": "", "code": "", "provenanceAction": "", "validated": false }; - + if (relation.title != 'unidentified') { fundedByProject['id'] = relation['to'].content; fundedByProject['acronym'] = relation.acronym; @@ -538,7 +538,8 @@ export class ParsingFunctions { if (pid.hasOwnProperty("classid") && pid['classid'] != "") { if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data" - || pid.classid == "swhid") { + || pid.classid == "swhid" + || pid.classid == "ROR" || pid.classid == "ISNI" || pid.classid == "Wikidata" || pid.classid == "FundRef") { if (!identifiers.has(pid.classid)) { identifiers.set(pid.classid, new Array()); } @@ -547,7 +548,8 @@ export class ParsingFunctions { } else { for (let i = 0; i < pid.length; i++) { if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data" - || pid[i].classid == "swhid") { + || pid[i].classid == "swhid" + || pid[i].classid == "ROR" || pid[i].classid == "ISNI" || pid[i].classid == "Wikidata" || pid[i].classid == "FundRef") { if (!identifiers.has(pid[i].classid)) { identifiers.set(pid[i].classid, new Array()); } diff --git a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts index 6c0d059a..3a547a27 100644 --- a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts +++ b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts @@ -15,34 +15,36 @@ import {StringUtils} from "../../../utils/string-utils.class"; template: ` - - -
-
- -
Thank you for your feedback.
-
Before sending us your options, would you like to leave us your e-mail to notify you about the reporting status?
-
- (Optional) + + + +
+
+ +
Thank you for your feedback.
+
Before sending us your options, would you like to leave us your e-mail to notify you about the reporting status?
+
+ (Optional) +
+
+ + +
+
+ +

Your feedback is successfully received and it will soon be reviewed by our graph experts!

+ +
+ -
- - -
- - -

Your feedback is successfully received and it will soon be reviewed by our graph experts!

- -
-
-
+
` }) @@ -62,6 +64,7 @@ export class SdgFosSuggestComponent { public sent: boolean = false; public error: boolean = false; subscriptions: Subscription[] = []; + isOpen: boolean = false; constructor(private emailService: EmailService, private fb: FormBuilder, private cdr: ChangeDetectorRef) {} diff --git a/landingPages/landing-utils/showIdentifiers.component.ts b/landingPages/landing-utils/showIdentifiers.component.ts index 8a0b4680..11a15f14 100644 --- a/landingPages/landing-utils/showIdentifiers.component.ts +++ b/landingPages/landing-utils/showIdentifiers.component.ts @@ -26,8 +26,9 @@ import {properties} from "../../../../environments/environment"; {{key}}: - + {{item}} , @@ -113,7 +114,10 @@ export class ShowIdentifiersComponent implements AfterViewInit { }); } - public getUrl(key: string): string { + public getUrl(key: string, value: string): string { + if(value.includes("http://") || value.includes("https://")) { + return ""; + } if(key == "doi") { return properties.doiURL; } else if(key == "pmc") { @@ -126,6 +130,14 @@ export class ShowIdentifiersComponent implements AfterViewInit { return properties.r3DataURL; } else if(key == "swhid") { return properties.swhURL; + } else if(key == "ROR") { + return properties.rorURL; + } else if(key == "ISNI") { + return properties.isniURL; + } else if(key == "Wikidata") { + return properties.wikiDataURL; + } else if(key == "FundRef") { + return properties.fundRefURL; } } diff --git a/landingPages/landing-utils/showPublisher.component.ts b/landingPages/landing-utils/showPublisher.component.ts index 37c0838b..bbb8c177 100644 --- a/landingPages/landing-utils/showPublisher.component.ts +++ b/landingPages/landing-utils/showPublisher.component.ts @@ -5,7 +5,8 @@ import {EnvProperties} from "../../utils/properties/env-properties"; selector: 'showPublisher, [showPublisher]', template: ` - {{publisher}} + Publisher: + {{publisher}} @@ -14,7 +15,8 @@ import {EnvProperties} from "../../utils/properties/env-properties"; || journal['volume'] || journal['eissn'] || journal['issue'])"> - + + Journal: {{journal['journal']}} , diff --git a/landingPages/organization/organization-routing.module.ts b/landingPages/organization/organization-routing.module.ts new file mode 100644 index 00000000..4e48b2b8 --- /dev/null +++ b/landingPages/organization/organization-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard"; +import { OrganizationComponent } from "./organization.component"; + + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: OrganizationComponent, canDeactivate: [PreviousRouteRecorder] }]) + ] +}) +export class OrganizationRoutingModule { } diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html index 04f4235a..09f004f2 100644 --- a/landingPages/organization/organization.component.html +++ b/landingPages/organization/organization.component.html @@ -19,57 +19,28 @@
- - -
-
-
- - - Powered by OpenAIRE graph - - - Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} - +
+
+ + + Powered by OpenAIRE graph + + + Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} + - -
- Found an issue? - Give us feedback -
-
-
+ +
+ Found an issue? + Give us feedback +
+
+
- -
- - -
- - + Country: {{organizationInfo.country}}
+ +
+ +
@@ -257,9 +207,7 @@
-
- -
+ @@ -270,12 +218,12 @@
+ + +
- - -
@@ -287,6 +235,23 @@ && organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null" [entityType]="'organization'" [prevPath]="prevPath"> +
+ + + +
+ Country: {{organizationInfo.country}} +
+ +
+ +
+

@@ -406,10 +371,7 @@ [type]="'organizations'" [prevPath]="prevPath"> - - - - +
diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 814d7bb9..f313a196 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -77,7 +77,6 @@ export class OrganizationComponent { @ViewChild('downloadReportsFsModal') downloadReportsFsModal: FullScreenModalComponent; // @ViewChild('downloadReportModal') downloadReportModal; // @ViewChild('downloadFunderReportModal') downloadFunderReportModal; - @ViewChild('addThisModal') addThisModal; @ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent; @ViewChild(ModalLoading) loading: ModalLoading; @@ -717,13 +716,6 @@ export class OrganizationComponent { this.downloadReportsModal.cancel(); } - public openAddThisModal() { - this.addThisModal.cancelButton = false; - this.addThisModal.okButton = false; - this.addThisModal.alertTitle = "Share this "+OpenaireEntities.ORGANIZATION+" in your social networks"; - this.addThisModal.open(); - } - public getParamsForSearchLink(type: string = "") { if(type) { return this.routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf', 'sortBy'], ['relorganizationid', this.organizationId, type, 'false', 'resultdateofacceptance,descending']); diff --git a/landingPages/organization/organization.module.ts b/landingPages/organization/organization.module.ts index 9a4a2737..c7b2d24c 100644 --- a/landingPages/organization/organization.module.ts +++ b/landingPages/organization/organization.module.ts @@ -33,11 +33,14 @@ import {graph, versions} from "../../utils/icons/icons"; import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; +import {OrganizationRoutingModule} from "./organization-routing.module"; +import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, + OrganizationRoutingModule, LoadingModalModule, AlertModalModule, ErrorMessagesModule, LandingModule, DataProvidersServiceModule, @@ -49,7 +52,7 @@ import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.mod ProjectsServiceModule, Schema2jsonldModule, SEOServiceModule, HelperModule, OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, - TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EGIDataTransferModule, EntityActionsModule + TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EntityActionsModule, ResultLandingUtilsModule ], declarations: [ OrganizationComponent, diff --git a/landingPages/project/project-routing.module.ts b/landingPages/project/project-routing.module.ts new file mode 100644 index 00000000..3cec4ec2 --- /dev/null +++ b/landingPages/project/project-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard"; +import { ProjectComponent } from "./project.component"; + + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: ProjectComponent, canDeactivate: [PreviousRouteRecorder] }]) + ] +}) +export class ProjectRoutingModule { } diff --git a/landingPages/project/project.module.ts b/landingPages/project/project.module.ts index 713c9f1f..b2d6d649 100644 --- a/landingPages/project/project.module.ts +++ b/landingPages/project/project.module.ts @@ -32,9 +32,11 @@ import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-sc import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; +import {ProjectRoutingModule} from "./project-routing.module"; @NgModule({ imports: [ + ProjectRoutingModule, CommonModule, FormsModule, RouterModule, LandingModule, LoadingModalModule, AlertModalModule, ErrorMessagesModule, IFrameModule, ReportsServiceModule, diff --git a/landingPages/result/resultLanding-routing.module.ts b/landingPages/result/resultLanding-routing.module.ts new file mode 100644 index 00000000..51aac48d --- /dev/null +++ b/landingPages/result/resultLanding-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard"; +import { ResultLandingComponent } from "./resultLanding.component"; + + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: ResultLandingComponent, canDeactivate: [PreviousRouteRecorder] }]) + ] +}) +export class ResultLandingRoutingModule { } diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 1d64f1f3..3a2de7e2 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -4,8 +4,8 @@ [searchActionRoute]="properties.searchLinkToResults"> -
-
+
+
- - - -
@@ -166,54 +102,6 @@
- - -
- - - - - - - -
- - -
-
- -
-
@@ -232,48 +120,15 @@ [publiclyFunded]="resultLandingInfo.publiclyFunded" [projects]="resultLandingInfo.fundedByProjects"> - - -
- - -
- -
+ +
-
- - - - - -
-
- -
- -
-
-
-
-
+
- -
@@ -886,16 +719,18 @@ - + - + + + -
+
@@ -1327,6 +1162,7 @@
+ - + + \ No newline at end of file diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index f51645f3..769f1975 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -74,6 +74,8 @@ export class ResultLandingComponent { public linkToSearchPage: string = null; public citeThisClicked: boolean; + public addThisClicked: boolean; + public descriptionClicked: boolean; // Metrics tab variables public metricsClicked: boolean; @@ -197,6 +199,9 @@ export class ResultLandingComponent { private userManagementService: UserManagementService, private layoutService: LayoutService, private _contextService: ContextsService) { + if(route.snapshot.data && route.snapshot.data['type']) { + this.type = route.snapshot.data['type']; + } } ngOnInit() { @@ -864,6 +869,7 @@ export class ResultLandingComponent { } public openAddThisModal() { + this.addThisClicked = true; this.addThisModal.cancelButton = false; this.addThisModal.okButton = false; this.addThisModal.alertTitle = "Share this " + this.getTypeName() + " in your social networks"; @@ -1076,6 +1082,7 @@ export class ResultLandingComponent { this.sdgFosSuggest.subjectType="fos"; } this.cdr.detectChanges(); + this.sdgFosSuggest.isOpen = true; this.sdgFosSuggest.openSelectionModal(); } @@ -1090,6 +1097,7 @@ export class ResultLandingComponent { } public openDescriptionModal() { + this.descriptionClicked = true; this.descriptionModal.alertFooter = false; this.descriptionModal.alertTitle = "Abstract"; this.descriptionModal.open(); diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index 247c8a99..8554f354 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -37,10 +37,12 @@ import {SdgFosSuggestModule} from '../landing-utils/sdg-fos-suggest/sdg-fos-sugg import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; +import {ResultLandingRoutingModule} from "./resultLanding-routing.module"; @NgModule({ imports: [ CommonModule, FormsModule, LandingModule, SharedModule, RouterModule, + ResultLandingRoutingModule, CiteThisModule, PagingModule, IFrameModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule, DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, diff --git a/login/freeGuard.guard.ts b/login/freeGuard.guard.ts index 13d5941e..9d2b2b0c 100644 --- a/login/freeGuard.guard.ts +++ b/login/freeGuard.guard.ts @@ -3,7 +3,7 @@ import { Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@a import {Observable} from 'rxjs'; import {LoginErrorCodes} from './utils/guardHelper.class'; -@Injectable() +@Injectable({providedIn: 'root'}) export class FreeGuard { constructor(private router: Router) { diff --git a/login/user.module.ts b/login/user.module.ts index f592e6b8..13e493d6 100644 --- a/login/user.module.ts +++ b/login/user.module.ts @@ -7,16 +7,13 @@ import {UserRoutingModule} from './user-routing.module'; import {UserComponent} from './user.component'; -import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; import {LoadingModule} from "../utils/loading/loading.module"; @NgModule({ imports: [ CommonModule, FormsModule, UserRoutingModule, RouterModule, LoadingModule ], - providers: [ - PreviousRouteRecorder - ], + providers: [], declarations: [ UserComponent ], diff --git a/login/utils/helper.class.ts b/login/utils/helper.class.ts index 92c2a62e..6f2a2951 100644 --- a/login/utils/helper.class.ts +++ b/login/utils/helper.class.ts @@ -239,7 +239,7 @@ export class Role { } else if (type == "organization") { type = "institution"; } - return Role.GROUP + type; + return type; } /** diff --git a/monitor-admin/general/general.module.ts b/monitor-admin/general/general.module.ts index 7f4e7064..8f4aef96 100644 --- a/monitor-admin/general/general.module.ts +++ b/monitor-admin/general/general.module.ts @@ -1,7 +1,6 @@ import {NgModule} from "@angular/core"; import {GeneralComponent} from "./general.component"; import {GeneralRoutingModule} from "./general-routing.module"; -import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; import {CommonModule} from "@angular/common"; import {RouterModule} from "@angular/router"; import {InputModule} from "../../sharedComponents/input/input.module"; @@ -30,9 +29,7 @@ import { LogoUrlPipeModule, SidebarMobileToggleModule ], - providers: [ - PreviousRouteRecorder, - ], + providers: [], exports: [GeneralComponent] }) export class GeneralModule { diff --git a/monitor-admin/manageStakeholders/manageStakeholders.component.html b/monitor-admin/manageStakeholders/manageStakeholders.component.html index cf96dbc3..a876d32a 100644 --- a/monitor-admin/manageStakeholders/manageStakeholders.component.html +++ b/monitor-admin/manageStakeholders/manageStakeholders.component.html @@ -12,14 +12,13 @@
-
-
-
+
+
-
diff --git a/monitor-admin/manageStakeholders/manageStakeholders.module.ts b/monitor-admin/manageStakeholders/manageStakeholders.module.ts index 5ea2b818..2d2bd224 100644 --- a/monitor-admin/manageStakeholders/manageStakeholders.module.ts +++ b/monitor-admin/manageStakeholders/manageStakeholders.module.ts @@ -1,7 +1,6 @@ import {NgModule} from "@angular/core"; import {ManageStakeholdersComponent} from "./manageStakeholders.component"; import {ManageStakeholdersRoutingModule} from "./manageStakeholders-routing.module"; -import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; import {CommonModule} from "@angular/common"; import {RouterModule} from "@angular/router"; import {InputModule} from "../../sharedComponents/input/input.module"; @@ -40,9 +39,7 @@ import {PagingModule} from "../../utils/paging.module"; SliderTabsModule, PagingModule ], - providers: [ - PreviousRouteRecorder, - ], + providers: [], exports: [ManageStakeholdersComponent] }) export class ManageStakeholdersModule { diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index e5723eb8..05144592 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -271,6 +271,12 @@ [options]="indicatorUtils.formats" type="select">
+
+
+
@@ -327,6 +333,20 @@
+
@@ -400,6 +420,8 @@ placeholder="Year (From)">
+
{ + this.statsProfiles = [null].concat(statsProfiles); + }, error => { + this.statsProfiles = []; + })); + } else { + this.statsProfiles = []; + } } ngOnDestroy(): void { @@ -400,7 +412,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.getJsonPath(index).disable(); } indicatorPath.get('result').setErrors({validating: true}); - this.subscriptions.push(this.statisticsService.getNumbers(null, indicatorPath.get('url').value).subscribe(response => { + this.subscriptions.push(this.statisticsService.getNumbers(indicatorPath.get('source').value, this.indicatorUtils.getFullUrl(this.stakeholder, this.indicator.indicatorPaths[index])).subscribe(response => { let result = JSON.parse(JSON.stringify(response)); this.getJsonPath(index).controls.forEach(jsonPath => { if (result) { @@ -448,12 +460,16 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple return this.section.indicators[this.index].indicatorPaths[index].jsonPath; } - public getParameters(index: number): UntypedFormArray { - return this.chartIndicatorPaths.at(index).get('parameters') as UntypedFormArray; + public getParameters(index: number, type: IndicatorType = 'chart'): UntypedFormArray { + if(type === 'chart') { + return this.chartIndicatorPaths.at(index).get('parameters') as UntypedFormArray; + } else { + return this.numberIndicatorPaths.at(index).get('parameters') as UntypedFormArray; + } } - public getParameter(index: number, key: string): UntypedFormControl { - return this.getParameters(index).controls.filter(control => control.value.key === key)[0] as UntypedFormControl; + public getParameter(index: number, key: string, type: IndicatorType = 'chart'): UntypedFormControl { + return this.getParameters(index, type).controls.filter(control => control.value.key === key)[0] as UntypedFormControl; } private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) { @@ -474,6 +490,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple jsonPath: jsonPath, result: this.fb.control(0, Validators.required), source: this.fb.control(source, Validators.required), + parameters: parameters, format: this.fb.control(format, Validators.required) } )); @@ -506,6 +523,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple if (indicatorPath.source) { this.numberIndicatorPaths.at(index).get('source').setValue(indicatorPath.source); } + (this.numberIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath)); if (indicatorPath.jsonPath.length > 1 && this.getJsonPath(index).length == 1) { let paths = indicatorPath.jsonPath; for (let i = 0; i < paths.length; i++) { @@ -568,8 +586,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } this.checkForSchemaEnhancements(this.chartIndicatorPaths.at(index).get('url').value); (this.chartIndicatorPaths.at(index) as UntypedFormGroup).get('type').setValue(indicatorPath.type); - let parameters = this.getParametersAsFormArray(indicatorPath); - (this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', parameters); + (this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath)); if (!this.indicator.indicatorPaths[index]) { this.indicator.indicatorPaths[index] = indicatorPath; this.indicator.indicatorPaths[index].safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); @@ -642,7 +659,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple defaultId: this.fb.control(this.indicator.defaultId) }); this.indicator.indicatorPaths.forEach(indicatorPath => { - this.addNumberIndicatorPath(this.indicatorUtils.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)), indicatorPath.parameters, indicatorPath.source, this.getJsonPathAsFormArray(indicatorPath), indicatorPath.format); + this.addNumberIndicatorPath(this.indicatorUtils.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)), this.getParametersAsFormArray(indicatorPath), indicatorPath.source, this.getJsonPathAsFormArray(indicatorPath), indicatorPath.format); }); } else { this.indicator = new Indicator('', '', '', 'number', 'small', 'small', "PUBLIC", []); @@ -754,11 +771,11 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.editing = true; if (this.indicator.type === 'chart') { this.chartIndicatorFb.get('description').enable(); - this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type, true); + this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type); this.section = this.charts.find(section => section._id === this.section._id); } else { this.numberIndicatorFb.get('description').enable(); - this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type, false); + this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type); this.section = this.numbers.find(section => section._id === this.section._id); } let path = [ @@ -917,16 +934,27 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple })); } - hasDifference(index: number): boolean { + hasDifference(index: number, type: IndicatorType = 'chart'): boolean { let hasDifference = false; - this.chartIndicatorPaths.at(index).value.parameters.forEach((parameter) => { - if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { - hasDifference = true; - return; - } - }); - return hasDifference || this.indicator.indicatorPaths[index].safeResourceUrl.toString() !== - this.getSecureUrlByStakeHolder(this.indicator.indicatorPaths[index]).toString(); + if(type === 'chart') { + this.chartIndicatorPaths.at(index).value.parameters.forEach(parameter => { + if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { + hasDifference = true; + return; + } + }); + return hasDifference || this.indicator.indicatorPaths[index].safeResourceUrl.toString() !== + this.getSecureUrlByStakeHolder(this.indicator.indicatorPaths[index]).toString(); + } else if(type === 'number') { + let indicatorPath = this.numberIndicatorPaths.at(index).value; + indicatorPath.parameters.forEach(parameter => { + if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { + hasDifference = true; + return; + } + }); + } + return hasDifference; } public get isAdministrator(): boolean { @@ -937,11 +965,18 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple return this.isAdministrator || Session.isCurator(this.stakeholder.type, this.user); } - refreshIndicator() { - this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart', true); - this.indicator.indicatorPaths.forEach(indicatorPath => { - indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); - }); + refreshIndicator(type: IndicatorType = 'chart') { + if(type === 'chart') { + this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart'); + this.indicator.indicatorPaths.forEach(indicatorPath => { + indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); + }); + } else if(type === 'number') { + this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, 'number'); + this.indicator.indicatorPaths.forEach((indicatorPath, index) => { + this.validateJsonPath(index); + }); + } } deleteIndicatorOpen(section: Section, indicatorId: string, type: string, childrenAction: string = null) { diff --git a/monitor-admin/topic/topic.module.ts b/monitor-admin/topic/topic.module.ts index 748b6572..71e9b9d9 100644 --- a/monitor-admin/topic/topic.module.ts +++ b/monitor-admin/topic/topic.module.ts @@ -1,9 +1,6 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; - -import {PiwikService} from '../../utils/piwik/piwik.service'; import {TopicComponent} from "./topic.component"; import {TopicRoutingModule} from "./topic-routing.module"; import {RouterModule} from "@angular/router"; @@ -22,9 +19,7 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module"; import {TransitionGroupModule} from "../../utils/transition-group/transition-group.module"; import {NumberRoundModule} from "../../utils/pipes/number-round.module"; import {SideBarModule} from "../../dashboard/sharedComponents/sidebar/sideBar.module"; -import { - SidebarMobileToggleModule -} from "../../dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module"; +import {SidebarMobileToggleModule} from "../../dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module"; @NgModule({ imports: [ @@ -34,10 +29,7 @@ import { declarations: [ TopicComponent, IndicatorsComponent ], - providers: [ - PreviousRouteRecorder, - PiwikService - ], + providers: [], exports: [ TopicComponent ] diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index 7397b837..9360c228 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -85,7 +85,7 @@ export class StakeholderUtils { visibilityIcon: Map = new Map(this.visibilities.map(option => [option.value, option.icon])); defaultValue(options: Option[]) { - return options.length === 1?options[0].value:null; + return options.length === 1 ? options[0].value : null; } showField(options: Option[]) { @@ -94,7 +94,7 @@ export class StakeholderUtils { getLabel(options: Option[], value) { let option = options.find(option => option.value === value); - return option?option.label:null; + return option ? option.label : null; } getTypesByUserRoles(user, id: string = null): Option[] { @@ -317,9 +317,14 @@ export class IndicatorUtils { public getFullUrl(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null): string { let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url; - if (stakeholder.statsProfile) { + if (indicatorPath.parameters.statsProfile) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.parameters.statsProfile) + } else if (stakeholder.statsProfile) { replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile) } + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(stakeholder.index_id); + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(stakeholder.index_shortName); + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(stakeholder.index_name); if (indicatorPath.parameters) { Object.keys(indicatorPath.parameters).forEach(key => { let replacedValue = indicatorPath.parameters[key]; @@ -329,16 +334,6 @@ export class IndicatorUtils { if (endYear && key == "end_year" && indicatorPath.filters["end_year"]) { replacedValue = (replacedValue > endYear) ? endYear : replacedValue; } - if (key == "index_id") { - replacedValue = stakeholder.index_id; - } - if (key == "index_name") { - replacedValue = stakeholder.index_name; - } - if (key == "index_shortName") { - replacedValue = stakeholder.index_shortName.toLowerCase(); - } - replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue) }); } @@ -392,19 +387,24 @@ export class IndicatorUtils { return (indicatorPath.chartObject ? indicatorPath.url + encodeURIComponent(replacedUrl) : replacedUrl); } - public getFullUrlWithFilters(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null, coFunded: boolean = false, foslvl1:string[]=[], foslvl2:string[]=[], publiclyFunded: "all"| "true"| "false"= "all" ): string { + public getFullUrlWithFilters(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null, coFunded: boolean = false, foslvl1: string[] = [], foslvl2: string[] = [], publiclyFunded: "all" | "true" | "false" = "all"): string { let filterSubtitleText = []; indicatorPath.filtersApplied = 0; let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url; - if (stakeholder.statsProfile) { - replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile); + if (indicatorPath.parameters.statsProfile) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.parameters.statsProfile) + } else if (stakeholder.statsProfile) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile) } + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(stakeholder.index_id); + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(stakeholder.index_shortName); + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(stakeholder.index_name); if (fundingL0) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { let filterResults = this.addFilter(replacedUrl, 'fundingL0', fundingL0); replacedUrl = filterResults.url; indicatorPath.filtersApplied += filterResults.filtersApplied; - filterSubtitleText.push( "Funding level 0: " ) ; + filterSubtitleText.push("Funding level 0: "); } } if (startYear) { @@ -421,7 +421,7 @@ export class IndicatorUtils { indicatorPath.filtersApplied += filterResults.filtersApplied; } } - if(startYear || endYear) { + if (startYear || endYear) { filterSubtitleText.push(startYear && endYear ? (startYear + ' - ' + endYear) : (endYear ? ('until ' + endYear) : '')); } if (coFunded) { @@ -429,33 +429,33 @@ export class IndicatorUtils { let filterResults = this.addFilter(replacedUrl, 'co-funded', coFunded); replacedUrl = filterResults.url; indicatorPath.filtersApplied += filterResults.filtersApplied; - filterSubtitleText.push( "Co-funded: " + (coFunded?'yes':'no') ) ; + filterSubtitleText.push("Co-funded: " + (coFunded ? 'yes' : 'no')); } } - if (publiclyFunded && publiclyFunded !="all") { + if (publiclyFunded && publiclyFunded != "all") { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { let filterResults = this.addFilter(replacedUrl, 'publicly-funded', publiclyFunded); replacedUrl = filterResults.url; indicatorPath.filtersApplied += filterResults.filtersApplied; - filterSubtitleText.push( "Publicly funded: " + (publiclyFunded?'yes':'no') ) ; + filterSubtitleText.push("Publicly funded: " + (publiclyFunded ? 'yes' : 'no')); } } if (foslvl1) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { - let filterResults = this.addFilter(replacedUrl, 'foslvl1', foslvl1); - replacedUrl = filterResults.url; - indicatorPath.filtersApplied +=filterResults.filtersApplied?foslvl1.length:0; + let filterResults = this.addFilter(replacedUrl, 'foslvl1', foslvl1); + replacedUrl = filterResults.url; + indicatorPath.filtersApplied += filterResults.filtersApplied ? foslvl1.length : 0; } } if (foslvl2) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { - let filterResults = this.addFilter(replacedUrl, 'foslvl2', foslvl2); - replacedUrl = filterResults.url; - indicatorPath.filtersApplied += filterResults.filtersApplied?foslvl2.length:0; + let filterResults = this.addFilter(replacedUrl, 'foslvl2', foslvl2); + replacedUrl = filterResults.url; + indicatorPath.filtersApplied += filterResults.filtersApplied ? foslvl2.length : 0; } } - if((foslvl1 && foslvl1.length > 0) || (foslvl2 && foslvl2.length > 0)){ - filterSubtitleText.push( "Field of Science: " + foslvl1.join(', ') + ( foslvl1.length > 0 && foslvl2.length > 0? ', ': '') + foslvl2.join(", ") ) ; + if ((foslvl1 && foslvl1.length > 0) || (foslvl2 && foslvl2.length > 0)) { + filterSubtitleText.push("Field of Science: " + foslvl1.join(', ') + (foslvl1.length > 0 && foslvl2.length > 0 ? ', ' : '') + foslvl2.join(", ")); } if (indicatorPath.parameters) { Object.keys(indicatorPath.parameters).forEach(key => { @@ -470,17 +470,8 @@ export class IndicatorUtils { //if there is a parameter that is filtered and the value of the parameter changes, count the filter as applied indicatorPath.filtersApplied++; } - if (key == "index_id") { - replacedValue = stakeholder.index_id; - } - if (key == "index_name") { - replacedValue = stakeholder.index_name; - } - if (key == "index_shortName") { - replacedValue = stakeholder.index_shortName.toLowerCase(); - } if (key == "subtitle" && filterSubtitleText.length > 0) { - replacedValue = replacedValue + (replacedValue.length > 0 ? ' - ':'') + ' Active filters: ('+filterSubtitleText.join(", ") + ')'; + replacedValue = replacedValue + (replacedValue.length > 0 ? ' - ' : '') + ' Active filters: (' + filterSubtitleText.join(", ") + ')'; } replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue) }); @@ -573,7 +564,7 @@ export class IndicatorUtils { /*Chart with proper json object*/ //apply the filter in any select fields for (let select of queries["query"]["select"]) { - let filterString = IndicatorFilterUtils.getFilter(select["field"], filterType,filterValue); + let filterString = IndicatorFilterUtils.getFilter(select["field"], filterType, filterValue); if (filterString) { let filter = JSON.parse(filterString); //check if filter already exists @@ -635,21 +626,19 @@ export class IndicatorUtils { return values.length > 1; } - generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[], type: IndicatorType, addParameters: boolean = true): Indicator { + generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[], type: IndicatorType): Indicator { let indicator: Indicator = new Indicator(form.name, form.description, form.additionalDescription, type, form.width, form.height, form.visibility, indicatorPaths, form.defaultId); indicator._id = form._id; form.indicatorPaths.forEach((indicatorPath, index) => { indicator.indicatorPaths[index].type = indicatorPath.type; indicator.indicatorPaths[index].format = indicatorPath.format; - if (addParameters) { - indicatorPath.parameters.forEach(parameter => { - indicator.indicatorPaths[index].parameters[parameter.key] = parameter.value; - if (parameter.key === 'type') { - indicator.indicatorPaths[index].type = parameter.value; - } - }); - } + indicatorPath.parameters.forEach(parameter => { + indicator.indicatorPaths[index].parameters[parameter.key] = parameter.value; + if (parameter.key === 'type') { + indicator.indicatorPaths[index].type = parameter.value; + } + }); }); return indicator; } @@ -663,6 +652,7 @@ export class IndicatorUtils { let chart = JSON.parse(indicatorPath.chartObject); this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder); this.extractStakeHolders(chart, indicatorPath, stakeholder); + this.addProfile(indicatorPath); indicatorPath.chartObject = JSON.stringify(chart); if (!jsonPath || jsonPath.length == 0 || (jsonPath.length == 1 && jsonPath[0] == "")) { indicatorPath.jsonPath = ["data", "0", "0", "0"]; @@ -722,6 +712,7 @@ export class IndicatorUtils { this.extractStakeHolders(chart, indicatorPath, stakeholder); this.extractStartYear(chart, indicatorPath); this.extractEndYear(chart, indicatorPath); + this.addProfile(indicatorPath); indicatorPath.chartObject = JSON.stringify(chart); } } else if (source === 'old') { @@ -801,11 +792,11 @@ export class IndicatorUtils { for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { //ignore field No Of Funders - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1 ) || - (gfilter["field"].indexOf(".funder") != -1) || - (gfilter["field"].indexOf(".funder.id") != -1)) { + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); + if (replacedValue) { // don't proceed in replacement if no replaced value matches + if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1) || + (gfilter["field"].indexOf(".funder") != -1) || + (gfilter["field"].indexOf(".funder.id") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -827,10 +818,10 @@ export class IndicatorUtils { } for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); + if (replacedValue) { // don't proceed in replacement if no replaced value matches if ((gfilter["field"].indexOf(".context.name") != -1) - || (gfilter["field"].indexOf(".context.id") != -1)) { + || (gfilter["field"].indexOf(".context.id") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -854,10 +845,10 @@ export class IndicatorUtils { } for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".organization.name") != -1)|| - (gfilter["field"].indexOf(".organization.id") != -1)) { + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); + if (replacedValue) { // don't proceed in replacement if no replaced value matches + if ((gfilter["field"].indexOf(".organization.name") != -1) || + (gfilter["field"].indexOf(".organization.id") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -865,6 +856,7 @@ export class IndicatorUtils { } } } + private extractDatasource(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) { // works for .datasource.name and .HostedBy datasource // and .datasource.id @@ -880,10 +872,10 @@ export class IndicatorUtils { } for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1)|| - (gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) { + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); + if (replacedValue) { // don't proceed in replacement if no replaced value matches + if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1) || + (gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -891,6 +883,7 @@ export class IndicatorUtils { } } } + private extractResearcher(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) { // works for .orcid if (stakeholder.type != "researcher") { @@ -905,9 +898,9 @@ export class IndicatorUtils { } for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".orcid") != -1 )) { + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); + if (replacedValue) { // don't proceed in replacement if no replaced value matches + if ((gfilter["field"].indexOf(".orcid") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -915,19 +908,18 @@ export class IndicatorUtils { } } } - private replaceIndexValues(currentValue, stakeholder, parameters ){ - if(currentValue == stakeholder.index_name){ - parameters["index_name"] = stakeholder.index_name; + + private replaceIndexValues(currentValue, stakeholder) { + if (currentValue == stakeholder.index_name) { return ChartHelper.prefix + "index_name" + ChartHelper.suffix; - }else if(currentValue == stakeholder.index_id){ - parameters["index_id"] = stakeholder.index_id; + } else if (currentValue == stakeholder.index_id) { return ChartHelper.prefix + "index_id" + ChartHelper.suffix; - }else if(currentValue == stakeholder.index_shortName) { - parameters["index_shortName"] = stakeholder.index_shortName; + } else if (currentValue == stakeholder.index_shortName) { return ChartHelper.prefix + "index_shortName" + ChartHelper.suffix; } } + private extractStartYear(obj, indicatorPath: IndicatorPath) { let start_year; for (let query of obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)]) { @@ -964,6 +956,10 @@ export class IndicatorUtils { } } + private addProfile(indicatorPath: IndicatorPath) { + indicatorPath.parameters['statsProfile'] = null; + } + private parameterizeDefaultQuery(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) { let name = ""; for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) { @@ -990,13 +986,10 @@ export class IndicatorUtils { for (let i of index) { if (name.split('.').length > 3 && name.split('.')[3] == "id") { parameters[i] = ChartHelper.prefix + "index_id" + ChartHelper.suffix; - indicatorPath.parameters["index_id"] = stakeholder.index_id; } else if (name.split('.').length > 3 && name.split('.')[3] == "shortname") { parameters[i] = ChartHelper.prefix + "index_shortName" + ChartHelper.suffix; - indicatorPath.parameters["index_shortName"] = stakeholder.index_shortName.toLowerCase(); } else if (name.split('.').length > 3 && name.split('.')[3] == "name") { parameters[i] = ChartHelper.prefix + "index_name" + ChartHelper.suffix; - indicatorPath.parameters["index_name"] = stakeholder.index_name; } } } diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index 474456c4..49c8e755 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -1,6 +1,6 @@ import {SafeResourceUrl} from "@angular/platform-browser"; -import {properties} from "../../../../environments/environment"; import {Session, User} from "../../login/utils/helper.class"; +import {StringUtils} from "../../utils/string-utils.class"; export const ChartHelper = { prefix: "((__", @@ -52,6 +52,17 @@ export class Stakeholder { this.description = description; this.topics = []; } + + static checkIsUpload(response: Stakeholder | Stakeholder[]): any | any[] { + if (Array.isArray(response)) { + response.forEach(value => { + value.isUpload = value.logoUrl && !StringUtils.isValidUrl(value.logoUrl); + }); + } else { + response.isUpload = response.logoUrl && !StringUtils.isValidUrl(response.logoUrl); + } + return response; + } } export class StakeholderInfo extends Stakeholder { diff --git a/monitor/monitor-indicator-stakeholder-base.component.ts b/monitor/monitor-indicator-stakeholder-base.component.ts index 9a7a3648..4573dee4 100644 --- a/monitor/monitor-indicator-stakeholder-base.component.ts +++ b/monitor/monitor-indicator-stakeholder-base.component.ts @@ -50,10 +50,10 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator selectedFromAndToValues: "" }; rangeFilter: RangeFilterComponent; - + minYear = Dates.currentYear - 20; + maxYear = Dates.currentYear; public numberResults: Map = new Map(); public chartsActiveType: Map = new Map(); - public currentYear = new Date().getFullYear(); public clipboard; /** Services */ @@ -179,12 +179,12 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator protected validateYearRange(navigateTo: boolean = false) { let validYears = true; - if (this.periodFilter.selectedToValue && (this.periodFilter.selectedToValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedToValue, Dates.currentYear - 20, Dates.currentYear))) { - this.periodFilter.selectedToValue = Dates.currentYear + ""; + if (this.periodFilter.selectedToValue && (this.periodFilter.selectedToValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedToValue, this.minYear, this.maxYear))) { + this.periodFilter.selectedToValue = this.maxYear + ""; validYears = false; } - if (this.periodFilter.selectedFromValue && (this.periodFilter.selectedFromValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedFromValue, Dates.currentYear - 20, Dates.currentYear))) { - this.periodFilter.selectedFromValue = Dates.currentYear - 20 + ""; + if (this.periodFilter.selectedFromValue && (this.periodFilter.selectedFromValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedFromValue, this.minYear, this.maxYear))) { + this.periodFilter.selectedFromValue = this.minYear + ""; validYears = false; } if (this.periodFilter.selectedFromValue && this.periodFilter.selectedFromValue.length && this.periodFilter.selectedToValue && this.periodFilter.selectedToValue.length > 0 && parseInt(this.periodFilter.selectedFromValue, 10) > parseInt(this.periodFilter.selectedToValue, 10)) { @@ -208,6 +208,8 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator } protected setIndicators() { + this.activeSubCategory.numbers = this.activeSubCategory.numbers.filter(section => section.indicators.length > 0); + this.activeSubCategory.charts = this.activeSubCategory.charts.filter(section => section.indicators.length > 0); this.periodFilter.selectedFromAndToValues = (this.periodFilter.selectedFromValue || this.periodFilter.selectedToValue ? ((this.periodFilter.selectedFromValue && !this.periodFilter.selectedToValue ? "From " : "") + (!this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? "Until " : "") + (this.periodFilter.selectedFromValue ? this.periodFilter.selectedFromValue : "") + (this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? " - " : "") + (this.periodFilter.selectedToValue ? this.periodFilter.selectedToValue : "")) : ""); //clear numbers when filters change diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index 37fd7a3c..3f0f3a11 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -6,7 +6,6 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {map} from "rxjs/operators"; import {properties} from "../../../../environments/environment"; import {CustomOptions} from "../../services/servicesUtils/customOptions.class"; -import {StringUtils} from "../../utils/string-utils.class"; export interface Reorder { action: 'moved' | 'added' | 'removed', @@ -41,7 +40,7 @@ export class StakeholderService { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias || shouldUpdate) { this.promise = new Promise((resolve, reject) => { this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => { - return this.formalize(this.checkIsUpload(stakeholder)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { this.stakeholderSubject.next(stakeholder); resolve(); @@ -53,23 +52,24 @@ export class StakeholderService { } return from(this.getStakeholderAsync()); } - getResearcherStakeholder( orcid, name, results, shouldUpdate: boolean = false): Observable { + + getResearcherStakeholder(orcid, name, results, shouldUpdate: boolean = false): Observable { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== orcid || shouldUpdate) { this.promise = new Promise((resolve, reject) => { this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent("researcher"), CustomOptions.registryOptions()).pipe(map(stakeholder => { - return this.formalize(this.checkIsUpload(stakeholder)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { stakeholder.index_id = orcid; stakeholder.index_name = name; stakeholder.name = name; stakeholder.alias = orcid; - if(results <7 && stakeholder.topics[0]?.categories[0]?.subCategories[0]){ - stakeholder.topics[0].categories[0].subCategories[0].charts=[]; // keep only numbers - charts wont show much anyway + if (results < 7 && stakeholder.topics[0]?.categories[0]?.subCategories[0]) { + stakeholder.topics[0].categories[0].subCategories[0].charts = []; // keep only numbers - charts wont show much anyway } this.stakeholderSubject.next(stakeholder); resolve(); }, error => { - let stakeholder = new Stakeholder(null,"researcher", orcid,name,name,orcid,"PUBLIC", null, null,""); + let stakeholder = new Stakeholder(null, "researcher", orcid, name, name, orcid, "PUBLIC", null, null, ""); this.stakeholderSubject.next(stakeholder); resolve(); }); @@ -89,25 +89,25 @@ export class StakeholderService { getAlias(url: string): Observable { return this.http.get(url + '/stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => { - return this.formalize(stakeholders); + return HelperFunctions.copy(stakeholders); })); } getStakeholders(url: string, type: string = null, defaultId: string = null): Observable<(Stakeholder & StakeholderInfo)[]> { return this.http.get(url + '/stakeholder' + ((type) ? ('?type=' + type) : '') + ((!type && defaultId) ? ('?defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { - return this.formalize(this.checkIsUpload(stakeholders)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders)); })); } getMyStakeholders(url: string, type: string = null): Observable<(Stakeholder & StakeholderInfo)[]> { return this.http.get(url + '/my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { - return this.formalize(this.checkIsUpload(stakeholders)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders)); })); } getDefaultStakeholders(url: string, type: string = null): Observable { return this.http.get(url + '/stakeholder/default' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { - return this.formalize(this.checkIsUpload(stakeholders)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders)); })); } @@ -116,7 +116,7 @@ export class StakeholderService { stakeholder.alias = stakeholder.alias.slice(1); } return this.http.post(url + '/build-stakeholder', stakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => { - return this.formalize(this.checkIsUpload(stakeholder)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })); } @@ -130,11 +130,11 @@ export class StakeholderService { } path = HelperFunctions.encodeArray(path); return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + - '/save', element, CustomOptions.registryOptions()).pipe(map(element => { + '/save', element, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { - return this.formalize(this.checkIsUpload(element)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); } else { - return this.formalize(element); + return HelperFunctions.copy(element); } })); } @@ -142,11 +142,11 @@ export class StakeholderService { saveBulkElements(url: string, indicators, path: string[] = []): Observable { path = HelperFunctions.encodeArray(path); return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + - '/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => { + '/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { - return this.formalize(this.checkIsUpload(element)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); } else { - return this.formalize(element); + return HelperFunctions.copy(element); } })); } @@ -154,8 +154,8 @@ export class StakeholderService { saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable
{ path = HelperFunctions.encodeArray(path); return this.http.post
(url + ((path.length > 0) ? '/' : '') + path.join('/') + - '/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => { - return this.formalize(element); + '/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => { + return HelperFunctions.copy(element); })); } @@ -176,7 +176,7 @@ export class StakeholderService { reorderIndicators(url: string, path: string[], reorder: Reorder, type: string = 'chart'): Observable { path = HelperFunctions.encodeArray(path); return this.http.post(url + '/' + path.join('/') + '/' + type + '/reorder', reorder, CustomOptions.registryOptions()).pipe(map(indicators => { - return this.formalize(indicators); + return HelperFunctions.copy(indicators); })); } @@ -187,19 +187,4 @@ export class StakeholderService { setStakeholder(stakeholder: Stakeholder) { this.stakeholderSubject.next(stakeholder); } - - private checkIsUpload(response: Stakeholder | Stakeholder[]): any | any[] { - if (Array.isArray(response)) { - response.forEach(value => { - value.isUpload = value.logoUrl && !StringUtils.isValidUrl(value.logoUrl); - }); - } else { - response.isUpload = response.logoUrl && !StringUtils.isValidUrl(response.logoUrl); - } - return response; - } - - private formalize(element: any) { - return HelperFunctions.copy(element); - } } diff --git a/orcid/my-orcid-links/myOrcidLinks-routing.module.ts b/orcid/my-orcid-links/myOrcidLinks-routing.module.ts new file mode 100644 index 00000000..58cc1201 --- /dev/null +++ b/orcid/my-orcid-links/myOrcidLinks-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import {LoginGuard} from "../../login/loginGuard.guard"; +import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; +import {MyOrcidLinksComponent} from "./myOrcidLinks.component"; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: MyOrcidLinksComponent, + canActivate: [LoginGuard], canDeactivate: [PreviousRouteRecorder] + } + + ]) + ] +}) +export class MyOrcidLinksRoutingModule { } diff --git a/orcid/my-orcid-links/myOrcidLinks.module.ts b/orcid/my-orcid-links/myOrcidLinks.module.ts index 82bfb099..10cd7552 100644 --- a/orcid/my-orcid-links/myOrcidLinks.module.ts +++ b/orcid/my-orcid-links/myOrcidLinks.module.ts @@ -9,14 +9,15 @@ import {MyOrcidLinksComponent} from "./myOrcidLinks.component"; import {SearchResearchResultsServiceModule} from "../../services/searchResearchResultsService.module"; import {SearchMyOrcidResultsModule} from "./searchMyOrcidResults.module"; import {AlertModalModule} from "../../utils/modal/alertModal.module"; -import {PiwikServiceModule} from "../../utils/piwik/piwikService.module"; +import {MyOrcidLinksRoutingModule} from "./myOrcidLinks-routing.module"; @NgModule({ imports: [ CommonModule, FormsModule, + MyOrcidLinksRoutingModule, RouterModule, ErrorMessagesModule, ResultPreviewModule, SearchResearchResultsServiceModule, SearchMyOrcidResultsModule, - AlertModalModule, PiwikServiceModule + AlertModalModule ], declarations: [ MyOrcidLinksComponent diff --git a/orcid/orcid-routing.module.ts b/orcid/orcid-routing.module.ts new file mode 100644 index 00000000..1d786595 --- /dev/null +++ b/orcid/orcid-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import {LoginGuard} from "../login/loginGuard.guard"; +import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard"; +import {OrcidComponent} from './orcid.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: OrcidComponent, + canActivate: [LoginGuard], + canDeactivate: [PreviousRouteRecorder] } + ]) + ] +}) +export class OrcidRoutingModule { } diff --git a/orcid/orcid.module.ts b/orcid/orcid.module.ts index 097be324..54bae78b 100644 --- a/orcid/orcid.module.ts +++ b/orcid/orcid.module.ts @@ -5,8 +5,6 @@ import {RouterModule} from '@angular/router'; import {OrcidComponent} from './orcid.component'; import {OrcidService} from './orcid.service'; -import {FreeGuard} from '../login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; import {OrcidWorkComponent} from './orcid-work.component'; import {AlertModalModule} from '../utils/modal/alertModal.module'; import {ResultLandingService} from '../landingPages/result/resultLanding.service'; @@ -17,10 +15,11 @@ import {IconsService} from "../utils/icons/icons.service"; import {orcid_add, orcid_bin} from "../utils/icons/icons"; import {FullScreenModalModule} from "../utils/modal/full-screen-modal/full-screen-modal.module"; import {LogServiceModule} from "../utils/log/LogService.module"; +import {OrcidRoutingModule} from "./orcid-routing.module"; @NgModule({ imports: [ - CommonModule, RouterModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule, + CommonModule, RouterModule, OrcidRoutingModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule, IconsModule, FullScreenModalModule, LogServiceModule ], declarations: [ @@ -28,7 +27,6 @@ import {LogServiceModule} from "../utils/log/LogService.module"; OrcidWorkComponent ], providers:[ - FreeGuard, PreviousRouteRecorder, OrcidService, ResultLandingService ], exports: [ diff --git a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid-routing.module.ts b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid-routing.module.ts new file mode 100644 index 00000000..970f5c9a --- /dev/null +++ b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import {LoginGuard} from "../../login/loginGuard.guard"; +import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; +import {SearchRecommendedResultsForOrcidComponent} from "./searchRecommendedResultsForOrcid.component"; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: SearchRecommendedResultsForOrcidComponent, + canActivate: [LoginGuard], + canDeactivate: [PreviousRouteRecorder] + } + + ]) + ] +}) +export class SearchRecommendedResultsForOrcidRoutingModule { } diff --git a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts index d23ade61..b4eaa38a 100644 --- a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts +++ b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts @@ -8,22 +8,23 @@ import {SearchRecommendedResultsForOrcidComponent} from './searchRecommendedResu import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module'; import {SearchFormModule} from '../../searchPages/searchUtils/searchForm.module'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {SearchResearchResultsModule} from "../../searchPages/searchResearchResults.module"; import {OrcidService} from "../orcid.service"; +import {SearchRecommendedResultsForOrcidRoutingModule} from "./searchRecommendedResultsForOrcid-routing.module"; // import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, + SearchRecommendedResultsForOrcidRoutingModule, SearchFormModule, SearchResearchResultsModule, // , BreadcrumbsModule ], declarations: [ SearchRecommendedResultsForOrcidComponent ], - providers:[ IsRouteEnabled, OrcidService], + providers:[OrcidService], exports: [ SearchRecommendedResultsForOrcidComponent ] diff --git a/reload/reload.module.ts b/reload/reload.module.ts index 788e3b5e..7574440d 100644 --- a/reload/reload.module.ts +++ b/reload/reload.module.ts @@ -6,8 +6,6 @@ import { RouterModule } from '@angular/router'; import{ReloadRoutingModule } from './reload-routing.module'; import{ReloadComponent} from './reload.component'; - -import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; import {LoadingModule} from "../utils/loading/loading.module"; @NgModule({ @@ -19,9 +17,7 @@ import {LoadingModule} from "../utils/loading/loading.module"; declarations: [ ReloadComponent ], - providers:[ - PreviousRouteRecorder - ], + providers:[], exports: [ ReloadComponent ] diff --git a/sdg/sdg.module.ts b/sdg/sdg.module.ts index 258d0e01..1888b381 100644 --- a/sdg/sdg.module.ts +++ b/sdg/sdg.module.ts @@ -2,14 +2,11 @@ import {CommonModule} from "@angular/common"; import {NgModule} from "@angular/core"; import {FormsModule} from "@angular/forms"; import {RouterModule} from "@angular/router"; -import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard"; import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; import {RefineFieldResultsServiceModule} from "../services/refineFieldResultsService.module"; import {LoadingModule} from "../utils/loading/loading.module"; import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module"; import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module"; -import {PiwikService} from "../utils/piwik/piwik.service"; - import {SdgRoutingModule} from './sdg-routing.module'; import {SdgComponent} from './sdg.component'; @@ -22,9 +19,7 @@ import {SdgComponent} from './sdg.component'; declarations: [ SdgComponent ], - providers: [ - PreviousRouteRecorder, PiwikService - ], + providers: [], exports: [ SdgComponent ] diff --git a/searchPages/find/searchAll.component.ts b/searchPages/find/searchAll.component.ts index 27af8480..f70ac38b 100644 --- a/searchPages/find/searchAll.component.ts +++ b/searchPages/find/searchAll.component.ts @@ -23,7 +23,8 @@ import {EnvProperties} from '../../utils/properties/env-properties'; import {SEOService} from '../../sharedComponents/SEO/SEO.service'; import {StringUtils} from '../../utils/string-utils.class'; import {SearchCustomFilter} from "../searchUtils/searchUtils.class"; -import {Subscription} from "rxjs"; +import {combineLatest, Subscription} from "rxjs"; +import {debounceTime, map} from "rxjs/operators"; import {AdvancedField, Filter} from "../searchUtils/searchHelperClasses.class"; import {SearchResearchResultsComponent} from "../searchResearchResults.component"; import {SearchProjectsComponent} from "../searchProjects.component"; @@ -219,9 +220,14 @@ export class SearchAllComponent { loadAll() { this.reloadTabs(); + // https://github.com/angular/angular/issues/26764 + this.subs.push(combineLatest([this.route.params, this.route.queryParams]) + .pipe(debounceTime(0)) + .pipe(map(results => ({params: results[0], query: results[1]}))) + .subscribe(results => { + let params = results['params']; + let queryParams = results['query']; - this.subs.push(this.route.params.subscribe(params => { - this.subs.push(this.route.queryParams.subscribe(queryParams => { this.parameters = Object.assign({}, queryParams); this.keyword = (queryParams['keyword']) ? queryParams['keyword'] : (queryParams["q"] ? queryParams["q"] : (queryParams["f0"] && queryParams["f0"] == "q" && queryParams["fv0"]?queryParams["fv0"]:"")); this.selectedFields[0].value = StringUtils.URIDecode(this.keyword); @@ -237,9 +243,8 @@ export class SearchAllComponent { active = ((["result","projects","organizations","datasources","services"]).indexOf(queryParams["active"])!= -1)?queryParams["active"]:null; delete this.parameters['active']; } - - if(this.activeEntity == null) { - if (this.activeEntity == null && (!params["entity"] || params["entity"].length == 0)) { + // if(this.activeEntity == null) { + if (this.activeEntity == null && (!params["entity"] || params["entity"].length == 0) && (!active || this.activeEntity != active)) { if (active) { this.activeEntity = active; if ((typeof document !== 'undefined')) { @@ -261,7 +266,7 @@ export class SearchAllComponent { } this.activeEntity = ((["result", "projects", "organizations", "datasources", "services"]).indexOf(entity) != -1) ? entity : this.getDefaultEntityToShow(); } - } + // } if (this.activeEntity == "result") { this.searchResults(); } else if (this.activeEntity == "projects") { @@ -274,7 +279,7 @@ export class SearchAllComponent { this.searchOrganizations(); } this.count(); - })); + // })); })); } diff --git a/searchPages/find/searchAll.module.ts b/searchPages/find/searchAll.module.ts index e35f830f..ffa0832f 100644 --- a/searchPages/find/searchAll.module.ts +++ b/searchPages/find/searchAll.module.ts @@ -12,7 +12,6 @@ import {SearchResearchResultsServiceModule} from '../../services/searchResearchR import {OrganizationsServiceModule} from '../../services/organizationsService.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; -import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import {SearchAllComponent} from "./searchAll.component"; import {AdvancedSearchFormModule} from "../searchUtils/advancedSearchForm.module"; @@ -20,7 +19,6 @@ import {SearchResearchResultsModule} from "../searchResearchResults.module"; import {SearchProjectsModule} from "../searchProjects.module"; import {SearchOrganizationsModule} from "../searchOrganizations.module"; import {SearchDataProvidersModule} from "../searchDataProviders.module"; -import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module"; import {SliderTabsModule} from "../../sharedComponents/tabs/slider-tabs.module"; import {NumberRoundModule} from "../../utils/pipes/number-round.module"; @@ -31,15 +29,13 @@ import {GroupedRequestsServiceModule} from "../../services/groupedRequestsServic CommonModule, FormsModule, RouterModule, DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule, OrganizationsServiceModule, - SearchResultsModule, PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, AdvancedSearchFormModule, SearchResearchResultsModule, SearchProjectsModule, SearchOrganizationsModule, SearchDataProvidersModule, BreadcrumbsModule, SliderTabsModule, NumberRoundModule, + SearchResultsModule, Schema2jsonldModule, SEOServiceModule, AdvancedSearchFormModule, SearchResearchResultsModule, SearchProjectsModule, SearchOrganizationsModule, SearchDataProvidersModule, BreadcrumbsModule, SliderTabsModule, NumberRoundModule, GroupedRequestsServiceModule ], declarations: [ SearchAllComponent ], - providers:[ - PreviousRouteRecorder - ], + providers:[], exports: [ SearchAllComponent ] diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts index c5483431..876f7dc2 100644 --- a/searchPages/searchDataProviders.component.ts +++ b/searchPages/searchDataProviders.component.ts @@ -370,7 +370,7 @@ export class SearchDataProvidersComponent { this.searchFiltersSub = this._searchDataProvidersService.advancedSearchDataproviders(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe( // this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, this.entityType, this.properties, this.refineQuery).subscribe( res => { - let filter: Filter = res[1][0]; + let filter: Filter = res[2][0]; if(filter.values.length == 0) { filter = oldFilter; filter.countAllValues = 0; diff --git a/searchPages/searchOrganizations.component.ts b/searchPages/searchOrganizations.component.ts index 50deb4a2..415ee722 100644 --- a/searchPages/searchOrganizations.component.ts +++ b/searchPages/searchOrganizations.component.ts @@ -329,7 +329,7 @@ export class SearchOrganizationsComponent { this.searchFiltersSub = this._searchOrganizationsService.advancedSearchOrganizations(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe( // this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "organization", this.properties, this.refineQuery).subscribe( res => { - let filter: Filter = res[1][0]; + let filter: Filter = res[2][0]; if(filter.values.length == 0) { filter = oldFilter; filter.countAllValues = 0; diff --git a/searchPages/searchOrganizations.module.ts b/searchPages/searchOrganizations.module.ts index 664c3ab7..2e6b0056 100644 --- a/searchPages/searchOrganizations.module.ts +++ b/searchPages/searchOrganizations.module.ts @@ -1,7 +1,6 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {FormsModule} from '@angular/forms'; -import {IsRouteEnabled} from '../error/isRouteEnabled.guard'; import {NewSearchPageModule} from "./searchUtils/newSearchPage.module"; import {OrganizationsServiceModule} from "../services/organizationsService.module"; import {SearchOrganizationsComponent} from "./searchOrganizations.component"; diff --git a/searchPages/searchProjects.component.ts b/searchPages/searchProjects.component.ts index 5e4e36c5..bb76455c 100644 --- a/searchPages/searchProjects.component.ts +++ b/searchPages/searchProjects.component.ts @@ -358,7 +358,7 @@ export class SearchProjectsComponent { this.searchFiltersSub = this._searchProjectsService.advancedSearchProjects(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe( // this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "project", this.properties, this.refineQuery).subscribe( res => { - let filter: Filter = res[1][0]; + let filter: Filter = res[2][0]; if(filter.values.length == 0) { filter = oldFilter; filter.countAllValues = 0; diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 51dc82fa..f9143437 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -1,101 +1,103 @@ -

-
-
-
-
    - - -
  • - - {{customFilter.valueName}} +

    +
    +
      + + +
    • + + {{customFilter.valueName}} + +
    • +
      +
      + + + +
    • + + {{type.name}} + + +
    • +
      +
      +
      + + + +
    • + + {{filter.selectedFromAndToValues}} + + +
    • +
      +
      +
      + + + +
    • + + + + {{filter.title}}: + {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}} + + + + + {{value.name | slice:0:filterPillCharactersLimit}}... + + + {{value.name}} + + -
    • + + +
      -
      - - - -
    • - - {{type.name}} - - -
    • -
      -
      -
      - - - -
    • - - {{filter.selectedFromAndToValues}} - - -
    • -
      -
      -
      - - - -
    • - - - - - {{filter.title}}: - {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}} - - - - + + + + + +
    • + + + + {{filter.title}}: + {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}} + + + + + {{value.name | slice:0:filterPillCharactersLimit}}... + + {{value.name}} - - - -
    • -
      -
      + + + + + +
      - - - -
    • - - - - {{filter.title}}: - {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}} - - - - {{value.name}} - - - -
    • -
      -
      -
      -
    -
    - - -

+ + +

@@ -170,10 +172,6 @@
  • - - - -
  • @@ -190,31 +188,7 @@
    - -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    -
    +
    @@ -294,9 +268,6 @@
    -
    - -
    @@ -315,7 +286,7 @@
    -
    +
    OpenAIRE - Explore.
    -
    - -
    - - {{searchUtils.totalResults|number}} - {{type}} - - for - {{searchTerm}} - - - ({{advancedSearchTerms}} rule{{advancedSearchTerms == 1 ? '' : 's'}} applied) - - - - {{oldTotalResults|number}} - {{type}}, page - {{searchUtils.page | number}} - of {{(totalPages(oldTotalResults)|number)}} - -
    +
    + class="uk-margin-small-bottom uk-flex uk-flex-center">
    -
    -
    - -
    -
    - + +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + + + + + Data dump + + +
    +
    diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 5f62d7d6..cf9f105a 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -131,6 +131,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { public parameterNames: string[] = []; public parameterValues: string[] = []; + filterPillCharactersLimit: number = 35; public csvLimit: number = 0; public pagingLimit: number = 0; public resultsPerPage: number = 0; diff --git a/searchPages/searchUtils/newSearchPage.module.ts b/searchPages/searchUtils/newSearchPage.module.ts index 9be5ebd5..2ec3c8b5 100644 --- a/searchPages/searchUtils/newSearchPage.module.ts +++ b/searchPages/searchUtils/newSearchPage.module.ts @@ -13,8 +13,6 @@ import {SearchPagingModule} from './searchPaging.module'; import {SearchSortingModule} from './searchSorting.module'; import {SearchDownloadModule} from './searchDownload.module'; import {ModalModule} from '../../utils/modal/modal.module'; -import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; import {HelperModule} from '../../utils/helper/helper.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module'; @@ -39,7 +37,7 @@ import {graph} from "../../utils/icons/icons"; LoadingModalModule, ReportsServiceModule, SearchPagingModule, SearchSortingModule, SearchDownloadModule, ModalModule, SearchFilterModule, RangeFilterModule, - PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule, + HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule, SearchResultsInDepositModule, SearchResultsForOrcidModule, AdvancedSearchFormModule, QuickSelectionsModule, BreadcrumbsModule, AlertModalModule, ClickModule, IconsModule, LoadingModule, InputModule @@ -47,9 +45,7 @@ import {graph} from "../../utils/icons/icons"; declarations: [ NewSearchPageComponent ], - providers: [ - PreviousRouteRecorder - ], + providers: [], exports: [ NewSearchPageComponent ] diff --git a/searchPages/searchUtils/searchDownload.component.ts b/searchPages/searchUtils/searchDownload.component.ts index 39448aec..2a506fb1 100644 --- a/searchPages/searchUtils/searchDownload.component.ts +++ b/searchPages/searchUtils/searchDownload.component.ts @@ -15,12 +15,11 @@ import {properties} from "../../../../environments/environment"; selector: 'search-download', template: ` diff --git a/searchPages/searchUtils/searchSorting.component.ts b/searchPages/searchUtils/searchSorting.component.ts index 88afac19..92a50b1d 100644 --- a/searchPages/searchUtils/searchSorting.component.ts +++ b/searchPages/searchUtils/searchSorting.component.ts @@ -7,7 +7,7 @@ import {properties} from "../../../../environments/environment"; template: `
    diff --git a/services/organization.service.ts b/services/organization.service.ts index 722d1338..b74bd92f 100644 --- a/services/organization.service.ts +++ b/services/organization.service.ts @@ -8,9 +8,11 @@ import {OrganizationInfo} from '../utils/entities/organizationInfo'; import{EnvProperties} from '../utils/properties/env-properties'; import {map} from "rxjs/operators"; import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class"; +import {properties} from "../../../environments/environment"; @Injectable() export class OrganizationService { + public parsingFunctions: ParsingFunctions = new ParsingFunctions(); constructor(private http: HttpClient ) {} @@ -92,6 +94,10 @@ export class OrganizationService { } } } + + if(organization['pid'] && properties.environment != "production") { + this.organizationInfo.identifiers = this.parsingFunctions.parseIdentifiers(organization['pid']); + } } //Comment Parsing Projects info diff --git a/services/searchOrganizations.service.ts b/services/searchOrganizations.service.ts index 488b0e87..019b8146 100644 --- a/services/searchOrganizations.service.ts +++ b/services/searchOrganizations.service.ts @@ -9,9 +9,11 @@ import{EnvProperties} from '../utils/properties/env-properties'; import {StringUtils} from '../utils/string-utils.class'; import {map} from "rxjs/operators"; import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class"; +import {properties} from "../../../environments/environment"; @Injectable() export class SearchOrganizationsService { + public parsingFunctions: ParsingFunctions = new ParsingFunctions(); constructor(private http: HttpClient ) {} @@ -173,7 +175,11 @@ export class SearchOrganizationsService { result.country = resData.country.classname; } - results.push(result); + if(resData['pid'] && properties.environment != "production") { + result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']); + } + + results.push(result); } return results; diff --git a/sharedComponents/bottom.component.html b/sharedComponents/bottom.component.html index c978bf51..45389b2d 100644 --- a/sharedComponents/bottom.component.html +++ b/sharedComponents/bottom.component.html @@ -1,5 +1,5 @@ -
    +
    flag black white low
    @@ -64,7 +64,7 @@ height="50px" class="el-image" alt="OpenAIRE" loading="lazy">
    -
    +
    @@ -208,7 +208,7 @@ height="50px" class="el-image" alt="OpenAIRE" loading="lazy">
    -
    +
    diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index 35a0f12d..83f7114a 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -336,7 +336,12 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() set options(options: (Option | string | number) []) { this.optionsArray = options.map(option => { - if (typeof option === 'string' || typeof option === 'number') { + if(option === null) { + return { + label: this.noValueSelected, + value: '' + }; + } else if (typeof option === 'string' || typeof option === 'number') { return { label: option.toString(), value: option diff --git a/sharedComponents/quick-contact/quick-contact.component.html b/sharedComponents/quick-contact/quick-contact.component.html index 116060f7..d43d55d4 100644 --- a/sharedComponents/quick-contact/quick-contact.component.html +++ b/sharedComponents/quick-contact/quick-contact.component.html @@ -1,12 +1,12 @@
    -
    -
    +
    Send a message diff --git a/sharedComponents/quick-contact/quick-contact.component.ts b/sharedComponents/quick-contact/quick-contact.component.ts index bf8f75e9..ccf17492 100644 --- a/sharedComponents/quick-contact/quick-contact.component.ts +++ b/sharedComponents/quick-contact/quick-contact.component.ts @@ -11,6 +11,7 @@ declare var UIkit; styleUrls: ['quick-contact.component.less'] }) export class QuickContactComponent implements OnInit, OnDestroy { + public quickContactClicked: boolean = false; public showDrop: boolean = false; @Input() public contactForm: FormGroup; diff --git a/timeout-interceptor.service.ts b/timeout-interceptor.service.ts index 224e585e..3b5c2fff 100644 --- a/timeout-interceptor.service.ts +++ b/timeout-interceptor.service.ts @@ -13,7 +13,7 @@ export class TimeoutInterceptor implements HttpInterceptor { private static TIMEOUT_WHITELIST = [ properties.csvAPIURL, properties.registryUrl, properties.claimsAPIURL, properties.searchCrossrefAPIURL, properties.searchDataciteAPIURL, - properties.statisticsAPIURL, properties.searchAPIURLLAst, properties.monitorStatsFrameUrl]; + properties.statisticsAPIURL, properties.monitorStatsFrameUrl]; constructor(@Inject(DEFAULT_TIMEOUT) protected defaultTimeout: number, @Inject(PLATFORM_ID) private platformId: any) { } diff --git a/utils/entities/organizationInfo.ts b/utils/entities/organizationInfo.ts index 6bd9b68f..5194f076 100644 --- a/utils/entities/organizationInfo.ts +++ b/utils/entities/organizationInfo.ts @@ -26,4 +26,5 @@ export class OrganizationInfo { // organizations: {name: string; url: string}[]}[]; deletedByInferenceIds: string[]; + identifiers: Map; //key is the classname } diff --git a/utils/entity-actions/entity-actions.component.ts b/utils/entity-actions/entity-actions.component.ts index f2e07c77..bf2c628a 100644 --- a/utils/entity-actions/entity-actions.component.ts +++ b/utils/entity-actions/entity-actions.component.ts @@ -14,8 +14,7 @@ import {EnvProperties} from "../properties/env-properties";
    Embed @@ -99,6 +95,7 @@ export class EntityActionsComponent implements OnInit { @Input() embed: boolean = false; @Input() url: string; @Input() isMobile: boolean = false; + @Input() showTooltip: boolean = true; public citeThisClicked: boolean; public routerHelper: RouterHelper = new RouterHelper(); @ViewChild('citeModal') citeModal; diff --git a/utils/piwik/previousRouteRecorder.guard.ts b/utils/piwik/previousRouteRecorder.guard.ts index 4d050618..31959034 100644 --- a/utils/piwik/previousRouteRecorder.guard.ts +++ b/utils/piwik/previousRouteRecorder.guard.ts @@ -6,7 +6,7 @@ import {properties} from "../../../../environments/environment"; @Injectable({ providedIn: 'root' -}) // do not forget to register this class as a provider +}) export class PreviousRouteRecorder { constructor(private router: Router) { } diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index b6e3b370..f740381d 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -45,6 +45,10 @@ export interface EnvProperties { openDoarURL?: string; r3DataURL?: string; swhURL?: string; + rorURL?: string; + isniURL?: string; + wikiDataURL?: string; + fundRefURL?: string; fairSharingURL?: string, eoscMarketplaceURL?: string, sherpaURL?: string; diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index f462caeb..fb86e5d4 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -6,7 +6,7 @@ export let common: EnvProperties = { useNewStatistisTool: true, openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=", searchCrossrefAPIURL: "https://api.crossref.org/works", - searchDataciteAPIURL: "https://api.datacite.org/works", + searchDataciteAPIURL: "https://api.datacite.org/dois", searchOrcidURL: "https://pub.orcid.org/v2.1/", orcidURL: "https://orcid.org/", orcidAPIURL: "https://services.openaire.eu/uoa-orcid-service/", @@ -20,6 +20,10 @@ export let common: EnvProperties = { openDoarURL: "http://v2.sherpa.ac.uk/id/repository/", r3DataURL: "http://service.re3data.org/repository/", swhURL: "https://archive.softwareheritage.org/", + rorURL: "https://ror.org/", + isniURL: "https://isni.org/isni/", + wikiDataURL: "https://www.wikidata.org/wiki/", + fundRefURL: "https://api.crossref.org/funders/", fairSharingURL: "https://fairsharing.org/", eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/", sherpaURL: "http://sherpa.ac.uk/romeo/issn/", @@ -77,7 +81,7 @@ export let common: EnvProperties = { b2noteAPIURL: 'https://b2note.eudat.eu/', myOrcidLinksPage: "/my-orcid-links", - footerGrantText: "OpenAIRE has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541 and 101017452", + footerGrantText: "OpenAIRE has received funding from a series of EU funded projects.", //connect enermapsURL: "https://lab.idiap.ch/enermaps", @@ -86,6 +90,9 @@ export let common: EnvProperties = { afterLoginRedirectLink: '/myCommunities', searchLinkToCommunities: '/search/find/communities', openOrgsUrl:"https://beta.orgs.openaire.eu", + + // monitor + searchLinkToStakeholders: "/browse" } export let commonDev: EnvProperties = { diff --git a/utils/rangeFilter/rangeFilter.component.ts b/utils/rangeFilter/rangeFilter.component.ts index dcf0d9a3..3c7e5e48 100644 --- a/utils/rangeFilter/rangeFilter.component.ts +++ b/utils/rangeFilter/rangeFilter.component.ts @@ -21,7 +21,7 @@ export class RangeFilterComponent { @Input() yearMax: number = Dates.yearMax; @Input() mandatoryRange:boolean = false; public currentYear: number = Dates.currentYear; - public yearValidators = [StringUtils.inValidYearValidator(this.yearMin, this.yearMax)]; + public yearValidators; public formValidators = [StringUtils.fromYearAfterToYearValidator]; public rangeForm: UntypedFormGroup; public yearRange: YearRange = { @@ -41,6 +41,11 @@ export class RangeFilterComponent { constructor(private _router: Router, private route: ActivatedRoute, private _fb: UntypedFormBuilder) {} ngOnInit() { + this.yearValidators = [StringUtils.inValidYearValidator(this.yearMin, this.yearMax)]; + this.yearRange = { + from: {control: 'yearFrom', placeholder: this.yearMin.toString()}, + to: {control: 'yearTo', placeholder: this.yearMax.toString()} + } if(this.mandatoryRange) { this.formValidators.push(StringUtils.rangeRequired(this.mandatoryRange)); } diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 8854bebc..7e1c1d56 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -187,7 +187,8 @@ [deposit]="deposit" [embed]="embed" [type]="result.resultType" [result]="result" [id]="result.objId?result.objId:result.id" - [url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id"> + [url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id" + [showTooltip]="false"> Access Routes -
    +
    @@ -263,7 +264,7 @@ {{formatNumber(result.measure.bip[0].value)}}{{result.measure.bip[0].value}} -
    +
    @@ -289,7 +290,7 @@ [name]="result.measure.counts[0].icon">{{formatNumber(result.measure.counts[0].value)}} -
    +
    @@ -331,7 +332,8 @@ [type]="result.resultType" [result]="result" [id]="result.objId?result.objId:result.id" [url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id" - [isMobile]="isMobile"> + [isMobile]="isMobile" + [showTooltip]="false">