Merge pull request 'Production release March 2024 [EXPLORE]' (#35) from develop into master

Reviewed-on: #35
This commit is contained in:
Konstantina Galouni 2024-03-04 17:44:23 +01:00
commit 6ab50b04cc
86 changed files with 745 additions and 787 deletions

View File

@ -17,7 +17,6 @@ import {HelperModule} from '../../../utils/helper/helper.module';
import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module'; import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module';
import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module"; import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module";
import {PiwikServiceModule} from "../../../utils/piwik/piwikService.module";
import {SearchInputModule} from '../../../sharedComponents/search-input/search-input.module'; import {SearchInputModule} from '../../../sharedComponents/search-input/search-input.module';
import {InputModule} from '../../../sharedComponents/input/input.module'; import {InputModule} from '../../../sharedComponents/input/input.module';
import {LoadingModule} from '../../../utils/loading/loading.module'; import {LoadingModule} from '../../../utils/loading/loading.module';
@ -30,7 +29,7 @@ import {link} from "../../../utils/icons/icons";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule, 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 IndexInfoServiceModule, MatSelectModule, SearchInputModule, MatAutocompleteModule, MatChipsModule, MatFormFieldModule, MatSlideToggleModule, InputModule, LoadingModule, NoLoadPaging, IconsModule, DropdownFilterModule
], ],

View File

@ -3,9 +3,6 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../../../openaireLibrary/shared/shared.module'; import { SharedModule } from '../../../openaireLibrary/shared/shared.module';
import { ClaimsAdminComponent } from './claimsAdmin.component'; import { ClaimsAdminComponent } from './claimsAdmin.component';
import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module'; 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({ @NgModule({
imports: [ imports: [
@ -13,7 +10,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
DisplayClaimsModule DisplayClaimsModule
], ],
providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled], providers:[],
declarations: [ declarations: [
ClaimsAdminComponent ClaimsAdminComponent
], ],

View File

@ -5,9 +5,6 @@ import { DirectLinkingComponent } from './directLinking.component';
import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module'; import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module';
import {SearchResearchResultsServiceModule} from '../../services/searchResearchResultsService.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 {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {LinkingGenericModule} from '../linking/linkingGeneric.module'; import {LinkingGenericModule} from '../linking/linkingGeneric.module';
@ -18,7 +15,7 @@ import {LinkingGenericModule} from '../linking/linkingGeneric.module';
EntitySearchServiceModule, SearchResearchResultsServiceModule, EntitySearchServiceModule, SearchResearchResultsServiceModule,
Schema2jsonldModule, SEOServiceModule, LinkingGenericModule Schema2jsonldModule, SEOServiceModule, LinkingGenericModule
], ],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], providers:[],
declarations: [ declarations: [
DirectLinkingComponent DirectLinkingComponent
], exports:[DirectLinkingComponent] ], exports:[DirectLinkingComponent]

View File

@ -269,11 +269,16 @@ export class BulkClaimComponent {
} }
}, },
err => { err => {
//console.log(err); // console.log(err);
BulkClaimComponent.handleError("Error getting crossref by DOIs: " + id, err); BulkClaimComponent.handleError("Error getting crossref by DOIs: " + id, err);
this.notFoundIds.push(id);
this.notFoundIdsRow.push(row); if(err.status == 404) {
this.endOfFetching(); this.searchInDatacite(id, accessMode, date, row);
} else {
this.notFoundIds.push(id);
this.notFoundIdsRow.push(row);
this.endOfFetching();
}
} }
)); ));
} }

View File

@ -7,20 +7,16 @@ import {SelectedContextsModule} from './selected/selectedContexts.module';
import {SelectedPublicationsModule} from './selected/selectedResults.module'; import {SelectedPublicationsModule} from './selected/selectedResults.module';
import {LinkingGenericComponent} from './linkingGeneric.component'; import {LinkingGenericComponent} from './linkingGeneric.component';
import {StartOverModule} from '../claim-utils/startOver.module'; 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 {ClaimContextSearchFormModule} from '../claim-utils/claimContextSearchForm.module';
import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module'; import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module';
import {BulkClaimModule} from './bulkClaim/bulkClaim.module'; import {BulkClaimModule} from './bulkClaim/bulkClaim.module';
import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module'; import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module';
import {HelperModule} from '../../utils/helper/helper.module'; import {HelperModule} from '../../utils/helper/helper.module';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module'; import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
import {MetadataPreviewModule} from './selected/metadataPreview.module'; import {MetadataPreviewModule} from './selected/metadataPreview.module';
import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module"; import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module";
import {AlertModalModule} from '../../utils/modal/alertModal.module'; import {AlertModalModule} from '../../utils/modal/alertModal.module';
import {PiwikServiceModule} from "../../utils/piwik/piwikService.module";
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module"; import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
import {StepperModule} from "../../sharedComponents/stepper/stepper.module"; import {StepperModule} from "../../sharedComponents/stepper/stepper.module";
import {IconsModule} from "../../utils/icons/icons.module"; import {IconsModule} from "../../utils/icons/icons.module";
@ -34,10 +30,9 @@ import {link} from "../../utils/icons/icons";
StartOverModule, StartOverModule,
ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule,
HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule, HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule,
PiwikServiceModule,
MatSelectModule, BreadcrumbsModule, StepperModule, IconsModule MatSelectModule, BreadcrumbsModule, StepperModule, IconsModule
], ],
providers: [LoginGuard, PreviousRouteRecorder, IsRouteEnabled], providers: [],
declarations: [ declarations: [
LinkingGenericComponent LinkingGenericComponent
], exports: [ ], exports: [

View File

@ -3,9 +3,6 @@ import { NgModule } from '@angular/core';
import { SharedModule } from '../../../openaireLibrary/shared/shared.module'; import { SharedModule } from '../../../openaireLibrary/shared/shared.module';
import { MyClaimsComponent } from './myClaims.component'; import { MyClaimsComponent } from './myClaims.component';
import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module'; 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({ @NgModule({
imports: [ imports: [
@ -13,7 +10,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
DisplayClaimsModule DisplayClaimsModule
], ],
providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], providers:[],
declarations: [ declarations: [
MyClaimsComponent MyClaimsComponent
], exports: [MyClaimsComponent] ], exports: [MyClaimsComponent]

View File

@ -15,9 +15,10 @@ import {LoadingModule} from "../../utils/loading/loading.module";
@NgModule({ @NgModule({
imports: [ imports: [
ClassesRoutingModule,
CommonModule, RouterModule, FormsModule, CommonModule, RouterModule, FormsModule,
AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule,
AdminTabsModule, PageContentModule, ClassesRoutingModule, SearchInputModule, IconsModule, LoadingModule AdminTabsModule, PageContentModule, SearchInputModule, IconsModule, LoadingModule
], ],
declarations: [DivIdsComponent], declarations: [DivIdsComponent],
exports: [DivIdsComponent] exports: [DivIdsComponent]

View File

@ -16,9 +16,10 @@ import {PageContentModule} from '../sharedComponents/page-content/page-content.m
@NgModule({ @NgModule({
imports: [ imports: [
ClassHelpContentFormRoutingModule,
CommonModule, FormsModule, RouterModule, CommonModule, FormsModule, RouterModule,
SafeHtmlPipeModule, CKEditorModule, SafeHtmlPipeModule, CKEditorModule,
AlertModalModule, ReactiveFormsModule, ClassHelpContentFormRoutingModule, AdminToolServiceModule, InputModule, MatSlideToggleModule, IconsModule, LoadingModule, PageContentModule AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, MatSlideToggleModule, IconsModule, LoadingModule, PageContentModule
], ],
declarations: [ declarations: [
ClassContentFormComponent ClassContentFormComponent

View File

@ -19,8 +19,9 @@ import {PageContentModule} from '../sharedComponents/page-content/page-content.m
@NgModule({ @NgModule({
imports: [ imports: [
ClassHelpContentsRoutingModule,
CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule, CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule,
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, ClassHelpContentsRoutingModule, AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule,
SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule, PageContentModule SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule, PageContentModule
], ],
declarations: [ declarations: [

View File

@ -17,8 +17,9 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module";
@NgModule({ @NgModule({
imports: [ imports: [
EntitiesRoutingModule,
CommonModule, RouterModule, FormsModule, AdminToolServiceModule, 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], declarations: [EntitiesComponent],
exports: [EntitiesComponent] exports: [EntitiesComponent]

View File

@ -16,9 +16,10 @@ import {MatSlideToggleModule} from "@angular/material/slide-toggle";
@NgModule({ @NgModule({
imports: [ imports: [
PageHelpContentFormRoutingModule,
CommonModule, FormsModule, RouterModule, CommonModule, FormsModule, RouterModule,
SafeHtmlPipeModule, CKEditorModule, SafeHtmlPipeModule, CKEditorModule,
AlertModalModule, ReactiveFormsModule, PageHelpContentFormRoutingModule, AdminToolServiceModule, InputModule, IconsModule, PageContentModule, LoadingModule, MatSlideToggleModule AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, IconsModule, PageContentModule, LoadingModule, MatSlideToggleModule
], ],
declarations: [PageContentFormComponent], declarations: [PageContentFormComponent],
exports: [PageContentFormComponent] exports: [PageContentFormComponent]

View File

@ -17,8 +17,9 @@ import {HTMLToStringPipeModule} from '../../utils/pipes/HTMLToStringPipe.module'
@NgModule({ @NgModule({
imports: [ imports: [
PageHelpContentsRoutingModule,
CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule, CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule,
AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, PageHelpContentsRoutingModule, PageContentModule, AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, PageContentModule,
SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule
], ],
declarations: [ declarations: [

View File

@ -18,8 +18,9 @@ import {LogoUrlPipeModule} from '../../utils/pipes/logoUrlPipe.module';
@NgModule({ @NgModule({
imports: [ imports: [
MenuRoutingModule,
CommonModule, RouterModule, FormsModule, AdminToolServiceModule, 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 TransitionGroupModule, LogoUrlPipeModule
], ],
declarations: [MenuComponent], declarations: [MenuComponent],

View File

@ -20,8 +20,9 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module";
@NgModule({ @NgModule({
imports: [ imports: [
PagesRoutingModule,
CommonModule, RouterModule, FormsModule, AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, 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], declarations: [PagesComponent],
exports: [PagesComponent] exports: [PagesComponent]

View File

@ -15,9 +15,10 @@ import {LoadingModule} from "../../utils/loading/loading.module";
@NgModule({ @NgModule({
imports: [ imports: [
PortalsRoutingModule,
CommonModule, FormsModule, AlertModalModule, CommonModule, FormsModule, AlertModalModule,
ReactiveFormsModule, ReactiveFormsModule,
RouterModule, AdminToolServiceModule, InputModule, AdminTabsModule, PageContentModule, PortalsRoutingModule, IconsModule, SearchInputModule, LoadingModule RouterModule, AdminToolServiceModule, InputModule, AdminTabsModule, PageContentModule, IconsModule, SearchInputModule, LoadingModule
], ],
declarations: [PortalsComponent], declarations: [PortalsComponent],
exports: [PortalsComponent] exports: [PortalsComponent]

View File

@ -141,8 +141,8 @@ export class SubscribersComponent implements OnInit, OnDestroy, OnChanges {
this.createRoleModal.okButtonLeft = false; this.createRoleModal.okButtonLeft = false;
this.createRoleModal.okButtonText = 'create'; this.createRoleModal.okButtonText = 'create';
this.roleFb = this.fb.group({ this.roleFb = this.fb.group({
name: 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.mapType(this.type) + ' ' + this.id, Validators.required) description: this.fb.control(Role.roleName(this.type, this.id), Validators.required)
}); });
setTimeout(() => { setTimeout(() => {
this.roleFb.get('name').disable(); this.roleFb.get('name').disable();

View File

@ -5,7 +5,6 @@ import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import {PiwikServiceModule} from '../utils/piwik/piwikService.module';
import {HelperModule} from '../utils/helper/helper.module'; import {HelperModule} from '../utils/helper/helper.module';
import {Schema2jsonldModule} from '../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../sharedComponents/schema2jsonld/schema2jsonld.module';
import { SEOServiceModule } from '../sharedComponents/SEO/SEOService.module'; import { SEOServiceModule } from '../sharedComponents/SEO/SEOService.module';
@ -18,7 +17,6 @@ import {FullScreenModalModule} from '../utils/modal/full-screen-modal/full-scree
imports: [ imports: [
CommonModule, FormsModule, CommonModule, FormsModule,
RouterModule, RouterModule,
PiwikServiceModule,
HelperModule, HelperModule,
Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, SearchInputModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, SearchInputModule,
FullScreenModalModule FullScreenModalModule

View File

@ -9,7 +9,6 @@ import {SearchResultsModule } from '../searchPages/searchUtils/searchResults.mod
import {DataProvidersServiceModule} from '../services/dataProvidersService.module'; import {DataProvidersServiceModule} from '../services/dataProvidersService.module';
import {SearchFormModule} from '../searchPages/searchUtils/searchForm.module'; import {SearchFormModule} from '../searchPages/searchUtils/searchForm.module';
import {IsRouteEnabled} from '../error/isRouteEnabled.guard';
import {SearchDataProvidersModule} from "../searchPages/searchDataProviders.module"; import {SearchDataProvidersModule} from "../searchPages/searchDataProviders.module";
import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
import {SearchInputModule} from "../sharedComponents/search-input/search-input.module"; import {SearchInputModule} from "../sharedComponents/search-input/search-input.module";
@ -25,7 +24,7 @@ import {SearchInputModule} from "../sharedComponents/search-input/search-input.m
declarations: [ declarations: [
SearchDataprovidersToDepositComponent SearchDataprovidersToDepositComponent
], ],
providers:[ IsRouteEnabled], providers:[],
exports: [ exports: [
SearchDataprovidersToDepositComponent SearchDataprovidersToDepositComponent
] ]

View File

@ -6,7 +6,9 @@ import {ConfigurationService} from '../utils/configuration/configuration.service
import {ConnectHelper} from '../connect/connectHelper'; import {ConnectHelper} from '../connect/connectHelper';
import {properties} from "../../../environments/environment"; import {properties} from "../../../environments/environment";
@Injectable() @Injectable({
providedIn: 'root'
})
export class IsRouteEnabled { export class IsRouteEnabled {
constructor(private router: Router, constructor(private router: Router,

View File

@ -2,13 +2,11 @@ import {CommonModule} from "@angular/common";
import {NgModule} from "@angular/core"; import {NgModule} from "@angular/core";
import {FormsModule} from "@angular/forms"; import {FormsModule} from "@angular/forms";
import {RouterModule} from "@angular/router"; import {RouterModule} from "@angular/router";
import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard";
import {IconsModule} from "../utils/icons/icons.module"; import {IconsModule} from "../utils/icons/icons.module";
import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module"; import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module";
import {SearchInputModule} from "../sharedComponents/search-input/search-input.module"; import {SearchInputModule} from "../sharedComponents/search-input/search-input.module";
import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module"; import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module";
import {PiwikService} from "../utils/piwik/piwik.service";
import {FosRoutingModule} from './fos-routing.module'; import {FosRoutingModule} from './fos-routing.module';
import {FosComponent} from './fos.component'; import {FosComponent} from './fos.component';
@ -22,9 +20,7 @@ import {FosComponent} from './fos.component';
declarations: [ declarations: [
FosComponent FosComponent
], ],
providers: [ providers: [],
PreviousRouteRecorder, PiwikService
],
exports: [ exports: [
FosComponent FosComponent
] ]

View File

@ -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 { }

View File

@ -36,10 +36,12 @@ import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.modu
import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-screen-modal.module'; import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-screen-modal.module';
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
import {DataProviderRoutingModule} from "./dataProvider-routing.module";
@NgModule({ @NgModule({
imports: imports:
[CommonModule, FormsModule, RouterModule, [CommonModule, FormsModule, RouterModule,
DataProviderRoutingModule,
IFrameModule, ErrorMessagesModule, LandingModule, IFrameModule, ErrorMessagesModule, LandingModule,
DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule, DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule,
PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule,

View File

@ -22,7 +22,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
</ng-container> </ng-container>
<ng-container *ngIf="!inModal"> <ng-container *ngIf="!inModal">
<div *ngIf="properties.environment != 'production' && availableOn[0].fulltext" class="uk-flex uk-flex-middle" <div *ngIf="availableOn[0].fulltext" class="uk-flex uk-flex-middle"
[ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'"> [ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'">
<a [href]="availableOn[0].fulltext" target="_blank" <a [href]="availableOn[0].fulltext" target="_blank"
class="uk-flex uk-flex-middle uk-button-link" class="uk-flex uk-flex-middle uk-button-link"
@ -40,7 +40,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon> <icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
</span> </span>
<ng-container *ngIf="!isMobile"> <ng-container *ngIf="!isMobile">
<a uk-tooltip="Source" target="_blank" <a target="_blank"
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder"> class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder">
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span> <span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
<span> <span>
@ -108,7 +108,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
</a> </a>
<ng-template #elseBlock> {{instance.license}}</ng-template> <ng-template #elseBlock> {{instance.license}}</ng-template>
</div> </div>
<div *ngIf="properties.environment != 'production' && instance.fulltext" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.fulltext"> <div *ngIf="instance.fulltext" class="uk-text-meta uk-text-truncate" uk-tooltip [title]="instance.fulltext">
Full-Text: Full-Text:
<a *ngIf="isUrl(instance.fulltext); else elseBlock" <a *ngIf="isUrl(instance.fulltext); else elseBlock"
[href]="instance.fulltext" target="_blank" class="custom-external uk-link-text"> [href]="instance.fulltext" target="_blank" class="custom-external uk-link-text">

View File

@ -118,8 +118,9 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<showPublisher *ngIf="publisher || journal" [publisher]="publisher" [journal]="journal" <showPublisher *ngIf="publisher || journal" [publisher]="publisher" [journal]="journal"
[properties]="properties"></showPublisher> [properties]="properties"></showPublisher>
<!-- data provider labels --> <!-- data provider labels -->
<ng-container *ngIf="compatibility && !(compatibility.info == 'not available' && type == 'service')"> <span *ngIf="compatibility && !(compatibility.info == 'not available' && type == 'service')">
<span uk-tooltip title="Compatibility"> <span class="uk-text-meta uk-margin-xsmall-right">Compatibility:</span>
<span>
<a *ngIf="compatibility.id" <a *ngIf="compatibility.id"
[queryParams]="addEoscPrevInParams({datasourceId: compatibility.id})" routerLinkActive="router-link-active" [queryParams]="addEoscPrevInParams({datasourceId: compatibility.id})" routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToDataProvider.split('?')[0]"> [routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
@ -137,10 +138,11 @@ import {RouterHelper} from "../../utils/routerHelper.class";
{{compatibility.name}} {{compatibility.name}}
</span> </span>
</span> </span>
</ng-container> </span>
<ng-container *ngIf="compatibilityString"> <span *ngIf="compatibilityString">
<span uk-tooltip title="Compatibility">{{compatibilityString}}</span> <span class="uk-text-meta uk-margin-xsmall-right">Compatibility:</span>
</ng-container> <span>{{compatibilityString}}</span>
</span>
<ng-container <ng-container
*ngIf="aggregationStatus && aggregationStatus.fulltexts && aggregationStatus.fulltexts > 0"> *ngIf="aggregationStatus && aggregationStatus.fulltexts && aggregationStatus.fulltexts > 0">
<span>OpenAIRE Text Mining</span> <span>OpenAIRE Text Mining</span>
@ -152,9 +154,9 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<span>Publicly funded</span> <span>Publicly funded</span>
</ng-container> </ng-container>
<!-- Projects --> <!-- Projects -->
<span *ngIf="projects && projects.length > 0" <span *ngIf="projects && projects.length > 0">
[attr.uk-tooltip]="projects.length > projectsLimit ? 'cls: uk-invisible' : 'pos: top; cls: uk-active'" title="Funded by"> <span class="uk-text-meta uk-margin-xsmall-right">Funded by:</span>
{{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}} <span>{{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}}</span>
<span *ngIf="projects.length > projectsLimit"> <span *ngIf="projects.length > projectsLimit">
<a *ngIf="!showInline" (click)="viewAllProjectsClick();" class="uk-background-muted custom-extra-entities"> <a *ngIf="!showInline" (click)="viewAllProjectsClick();" class="uk-background-muted custom-extra-entities">
+{{projects.length - projectsLimit | number}} projects +{{projects.length - projectsLimit | number}} projects
@ -166,9 +168,9 @@ import {RouterHelper} from "../../utils/routerHelper.class";
</span> </span>
</span> </span>
<!-- Organizations --> <!-- Organizations -->
<span *ngIf="organizations && organizations.length > 0" <span *ngIf="organizations && organizations.length > 0">
[attr.uk-tooltip]="organizations.length > organizationsLimit ? 'cls: uk-invisible' : 'pos: top; cls: uk-active'" title="Partners"> <span class="uk-text-meta uk-margin-xsmall-right">Partners:</span>
{{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}} <span>{{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}}</span>
<span *ngIf="organizations.length > organizationsLimit"> <span *ngIf="organizations.length > organizationsLimit">
<a *ngIf="!showInline" (click)="viewAllPartnersClick();" class="uk-background-muted custom-extra-entities"> <a *ngIf="!showInline" (click)="viewAllPartnersClick();" class="uk-background-muted custom-extra-entities">
+{{organizations.length - organizationsLimit | number}} partners +{{organizations.length - organizationsLimit | number}} partners
@ -180,9 +182,10 @@ import {RouterHelper} from "../../utils/routerHelper.class";
</span> </span>
</span> </span>
<!-- Subjects --> <!-- Subjects -->
<span uk-tooltip="Subjects" *ngIf="subjects && subjects.length > 0" [class.truncated]="subjects.length > 3"> <span *ngIf="subjects && subjects.length > 0" [class.truncated]="subjects.length > 3">
{{subjects.slice(0, 3).join(', ')}} {{subjects.slice(0, 3).join(', ')}}
</span> </span>
<!-- For tabs in landing -->
<ng-container *ngIf="provenanceAction"> <ng-container *ngIf="provenanceAction">
<span>{{provenanceAction}}</span> <span>{{provenanceAction}}</span>
</ng-container> </ng-container>

View File

@ -20,14 +20,16 @@ import {RouterHelper} from "../../utils/routerHelper.class";
</div> </div>
<div *ngIf="!isMobile"> <div *ngIf="!isMobile">
<span *ngFor="let item of fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold) let i=index"> <span *ngFor="let item of fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold) let i=index">
<span class="uk-text-emphasis"> <span class="uk-text-emphasis" (click)="dropClicked=true">
<a class="uk-link uk-link-text"> <a class="uk-link uk-link-text">
<ng-container *ngTemplateOutlet="funder; context: {item: item}"></ng-container> <ng-container *ngTemplateOutlet="funder; context: {item: item}"></ng-container>
</a> </a>
</span> </span>
<div class="default-dropdown uk-margin-remove-top uk-dropdown" <div class="default-dropdown uk-margin-remove-top uk-dropdown"
uk-dropdown="pos: bottom-left; mode:click"> uk-dropdown="pos: bottom-left; mode:click">
<ng-container *ngTemplateOutlet="dropInfo; context: { item: item}"></ng-container> <ng-container *ngIf="dropClicked">
<ng-container *ngTemplateOutlet="dropInfo; context: { item: item, index: i}"></ng-container>
</ng-container>
</div> </div>
<span *ngIf="i < (fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold).length - 1)">, </span> <span *ngIf="i < (fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold).length - 1)">, </span>
</span> </span>
@ -35,13 +37,13 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<div *ngIf="isMobile"> <div *ngIf="isMobile">
<div *ngFor="let item of fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold) let i=index" <div *ngFor="let item of fundedByProjects.slice(0, viewAll?fundedByProjects.length:threshold) let i=index"
class="uk-flex uk-flex-middle uk-margin-small-bottom"> class="uk-flex uk-flex-middle uk-margin-small-bottom">
<span class="uk-text-emphasis uk-width-expand"> <span class="uk-text-emphasis uk-width-expand" (click)="dropClicked=true">
<ng-container *ngTemplateOutlet="funder; context: {item: item}"></ng-container> <ng-container *ngTemplateOutlet="funder; context: {item: item}"></ng-container>
</span> </span>
<a #toggle><icon name="info" visuallyHidden="info" [type]="'outlined'"></icon></a> <a #toggle><icon name="info" visuallyHidden="info" [type]="'outlined'"></icon></a>
<mobile-dropdown [toggle]="toggle"> <mobile-dropdown [toggle]="toggle">
<div class="uk-margin-remove-top"> <div *ngIf="dropClicked" class="uk-margin-remove-top">
<ng-container *ngTemplateOutlet="dropInfo; context: { item: item}"></ng-container> <ng-container *ngTemplateOutlet="dropInfo; context: { item: item, index: i}"></ng-container>
</div> </div>
</mobile-dropdown> </mobile-dropdown>
</div> </div>
@ -54,7 +56,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym'] ? item['acronym'] : item['title']}}</span> <span *ngIf="item['acronym'] || item['title']">| {{ item['acronym'] ? item['acronym'] : item['title']}}</span>
</ng-template> </ng-template>
<ng-template #dropInfo let-item=item> <ng-template #dropInfo let-item=item let-index=index>
<div class="uk-padding-small"> <div class="uk-padding-small">
<span>Project</span> <span>Project</span>
<div class="uk-margin-bottom"> <div class="uk-margin-bottom">
@ -84,7 +86,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<span class="uk-text-meta">Funding stream: </span>{{item.funding}} <span class="uk-text-meta">Funding stream: </span>{{item.funding}}
</li> </li>
</ul> </ul>
<div *ngIf="getVocabularyLabel(item, provenanceActionVocabulary, i) || item.validated" class="uk-text-meta"> <div *ngIf="item.provenanceAction || item.validated" class="uk-text-meta">
<span *ngIf="item.validated">Validated by funder</span> <span *ngIf="item.validated">Validated by funder</span>
<span *ngIf="item.provenanceAction && item.validated"> | </span> <span *ngIf="item.provenanceAction && item.validated"> | </span>
<span *ngIf="item.provenanceAction">{{item.provenanceAction}}</span> <span *ngIf="item.provenanceAction">{{item.provenanceAction}}</span>
@ -105,8 +107,15 @@ export class FundedByComponent {
public url = properties.searchLinkToProject.split('?')[0]; public url = properties.searchLinkToProject.split('?')[0];
public title: string = "Funded by"; public title: string = "Funded by";
@Input() provenanceActionVocabulary = null; @Input() provenanceActionVocabulary = null;
public provenancesCalculated: boolean[] = []; // public provenancesCalculated: boolean[] = [];
public routerHelper:RouterHelper = new RouterHelper(); public routerHelper:RouterHelper = new RouterHelper();
public dropClicked: boolean = false;
public ngOnInit() {
this.fundedByProjects.forEach((project, index) => {
this.getVocabularyLabel(project, this.provenanceActionVocabulary, index);
})
}
public viewAllClick() { public viewAllClick() {
if(this.fundedByProjects.length <= this.threshold*2) { if(this.fundedByProjects.length <= this.threshold*2) {
@ -124,11 +133,11 @@ export class FundedByComponent {
} }
public getVocabularyLabel(item: any, vocabulary: any, index: number) { public getVocabularyLabel(item: any, vocabulary: any, index: number) {
if(!this.provenancesCalculated[index]) { // if(!this.provenancesCalculated[index]) {
this.provenancesCalculated[index] = true; // this.provenancesCalculated[index] = true;
item.provenanceAction = HelperFunctions.getVocabularyLabel(item.provenanceAction, vocabulary, false); item.provenanceAction = HelperFunctions.getVocabularyLabel(item.provenanceAction, vocabulary, false);
} // }
return item.provenanceAction; // return item.provenanceAction;
} }
public addEoscPrevInParams(obj) { public addEoscPrevInParams(obj) {

View File

@ -8,19 +8,15 @@ import { RouterModule } from '@angular/router';
import {TabPagingComponent} from './tabPaging.component'; import {TabPagingComponent} from './tabPaging.component';
import {ShowTitleComponent} from './showTitle.component'; import {ShowTitleComponent} from './showTitle.component';
import {AddThisComponent} from './addThis.component'; import {AddThisComponent} from './addThis.component';
import {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, RouterModule, PiwikServiceModule CommonModule, FormsModule, RouterModule
], ],
declarations: [ declarations: [
TabPagingComponent, ShowTitleComponent, AddThisComponent TabPagingComponent, ShowTitleComponent, AddThisComponent
], ],
providers:[ providers:[],
PreviousRouteRecorder
],
exports: [ exports: [
TabPagingComponent, ShowTitleComponent, AddThisComponent TabPagingComponent, ShowTitleComponent, AddThisComponent
] ]

View File

@ -42,7 +42,7 @@ export class ParsingFunctions {
"funderShortname": "", "funderName": "", "funderShortname": "", "funderName": "",
"funding": "", "code": "", "provenanceAction": "", "validated": false "funding": "", "code": "", "provenanceAction": "", "validated": false
}; };
if (relation.title != 'unidentified') { if (relation.title != 'unidentified') {
fundedByProject['id'] = relation['to'].content; fundedByProject['id'] = relation['to'].content;
fundedByProject['acronym'] = relation.acronym; fundedByProject['acronym'] = relation.acronym;
@ -538,7 +538,8 @@ export class ParsingFunctions {
if (pid.hasOwnProperty("classid") && pid['classid'] != "") { if (pid.hasOwnProperty("classid") && pid['classid'] != "") {
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data" 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)) { if (!identifiers.has(pid.classid)) {
identifiers.set(pid.classid, new Array<string>()); identifiers.set(pid.classid, new Array<string>());
} }
@ -547,7 +548,8 @@ export class ParsingFunctions {
} else { } else {
for (let i = 0; i < pid.length; i++) { 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" 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)) { if (!identifiers.has(pid[i].classid)) {
identifiers.set(pid[i].classid, new Array<string>()); identifiers.set(pid[i].classid, new Array<string>());
} }

View File

@ -15,34 +15,36 @@ import {StringUtils} from "../../../utils/string-utils.class";
template: ` template: `
<modal-alert #selectionModal [large]="true" (alertOutput)="modalOutput()" (cancelOutput)="modalCancel()" <modal-alert #selectionModal [large]="true" (alertOutput)="modalOutput()" (cancelOutput)="modalCancel()"
[okDisabled]="!sent && !selectionStep1 && (form.invalid || sending)"> [okDisabled]="!sent && !selectionStep1 && (form.invalid || sending)">
<sdg-selection *ngIf="subjects && subjectType == 'sdg'" #selection [class.uk-hidden]="!selectionStep1" <ng-container *ngIf="isOpen">
[subjects]="subjects" [entityType]="entityType"></sdg-selection> <sdg-selection *ngIf="subjects && subjectType == 'sdg'" #selection [class.uk-hidden]="!selectionStep1"
<fos-selection *ngIf="subjects && subjectType == 'fos'" #selection [class.uk-hidden]="!selectionStep1" [subjects]="subjects" [entityType]="entityType"></sdg-selection>
[subjects]="subjects" [contentHeight]="selectionModal.bodyHeight" [inModal]="true"></fos-selection> <fos-selection *ngIf="subjects && subjectType == 'fos'" #selection [class.uk-hidden]="!selectionStep1"
<div [class.uk-hidden]="selectionStep1"> [subjects]="subjects" [contentHeight]="selectionModal.bodyHeight" [inModal]="true"></fos-selection>
<div class="uk-flex uk-flex-column uk-flex-middle"> <div [class.uk-hidden]="selectionStep1">
<ng-container *ngIf="!sent && !error"> <div class="uk-flex uk-flex-column uk-flex-middle">
<div>Thank you for your feedback.</div> <ng-container *ngIf="!sent && !error">
<div>Before sending us your options, would you like to leave us your e-mail to notify you about the reporting status?</div> <div>Thank you for your feedback.</div>
<div input class="uk-width-1-2 uk-margin-medium-top uk-margin-medium-bottom" <div>Before sending us your options, would you like to leave us your e-mail to notify you about the reporting status?</div>
[formInput]="form.get('email')" placeholder="E-mail"> <div input class="uk-width-1-2 uk-margin-medium-top uk-margin-medium-bottom"
<span note>(Optional)</span> [formInput]="form.get('email')" placeholder="E-mail">
<span note>(Optional)</span>
</div>
<div>
<re-captcha (resolved)="handleRecaptcha($event)" [siteKey]="properties.reCaptchaSiteKey"
[ngClass]="sending ? 'uk-hidden':''"></re-captcha>
<loading [ngClass]="sending ? '':'uk-hidden'"></loading>
</div>
</ng-container>
<ng-container *ngIf="sent">
<p>Your feedback is successfully received and it will soon be reviewed by our graph experts!</p>
<icon customClass="uk-text-background" name="check" [ratio]="4"></icon>
</ng-container>
<div *ngIf="error" class="uk-alert uk-alert-danger uk-text-center uk-width-large ng-star-inserted"
role="alert">Email sent failed! Please try again.
</div> </div>
<div>
<re-captcha (resolved)="handleRecaptcha($event)" [siteKey]="properties.reCaptchaSiteKey"
[ngClass]="sending ? 'uk-hidden':''"></re-captcha>
<loading [ngClass]="sending ? '':'uk-hidden'"></loading>
</div>
</ng-container>
<ng-container *ngIf="sent">
<p>Your feedback is successfully received and it will soon be reviewed by our graph experts!</p>
<icon customClass="uk-text-background" name="check" [ratio]="4"></icon>
</ng-container>
<div *ngIf="error" class="uk-alert uk-alert-danger uk-text-center uk-width-large ng-star-inserted"
role="alert">Email sent failed! Please try again.
</div> </div>
</div> </div>
</div> </ng-container>
</modal-alert> </modal-alert>
` `
}) })
@ -62,6 +64,7 @@ export class SdgFosSuggestComponent {
public sent: boolean = false; public sent: boolean = false;
public error: boolean = false; public error: boolean = false;
subscriptions: Subscription[] = []; subscriptions: Subscription[] = [];
isOpen: boolean = false;
constructor(private emailService: EmailService, private fb: FormBuilder, private cdr: ChangeDetectorRef) {} constructor(private emailService: EmailService, private fb: FormBuilder, private cdr: ChangeDetectorRef) {}

View File

@ -26,8 +26,9 @@ import {properties} from "../../../../environments/environment";
<span class="uk-text-meta uk-text-small" [class.uk-text-uppercase]="key != 're3data'">{{key}}: </span> <span class="uk-text-meta uk-text-small" [class.uk-text-uppercase]="key != 're3data'">{{key}}: </span>
<span [class.uk-margin-small-left]="modal"> <span [class.uk-margin-small-left]="modal">
<ng-container *ngFor="let item of identifiers.get(key) let j=index"> <ng-container *ngFor="let item of identifiers.get(key) let j=index">
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid'" <a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid'
[href]="getUrl(key) + item" target="_blank" class="uk-display-inline-block custom-external"> || key == 'ROR' || key == 'ISNI' || key == 'Wikidata' || key == 'FundRef'"
[href]="getUrl(key, item) + item" target="_blank" class="uk-display-inline-block custom-external">
{{item}} {{item}}
</a> </a>
<ng-container *ngIf="(j !== (identifiers.get(key).length - 1))">, </ng-container> <ng-container *ngIf="(j !== (identifiers.get(key).length - 1))">, </ng-container>
@ -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") { if(key == "doi") {
return properties.doiURL; return properties.doiURL;
} else if(key == "pmc") { } else if(key == "pmc") {
@ -126,6 +130,14 @@ export class ShowIdentifiersComponent implements AfterViewInit {
return properties.r3DataURL; return properties.r3DataURL;
} else if(key == "swhid") { } else if(key == "swhid") {
return properties.swhURL; 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;
} }
} }

View File

@ -5,7 +5,8 @@ import {EnvProperties} from "../../utils/properties/env-properties";
selector: 'showPublisher, [showPublisher]', selector: 'showPublisher, [showPublisher]',
template: ` template: `
<ng-container *ngIf="publisher"> <ng-container *ngIf="publisher">
<span [attr.uk-tooltip]="'cls: uk-active'" [title]="'Publisher'">{{publisher}}</span> <span class="uk-text-meta uk-margin-xsmall-right">Publisher:</span>
<span>{{publisher}}</span>
<span *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn'] <span *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn']
|| journal['volume'] || journal['eissn'] || journal['issue'])" || journal['volume'] || journal['eissn'] || journal['issue'])"
class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span> class="uk-margin-xsmall-left uk-margin-xsmall-right bullet"></span>
@ -14,7 +15,8 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|| journal['volume'] || journal['eissn'] || journal['issue'])"> || journal['volume'] || journal['eissn'] || journal['issue'])">
<ng-container *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn'] <ng-container *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn']
|| journal['volume'] || journal['eissn'] || journal['issue'])"> || journal['volume'] || journal['eissn'] || journal['issue'])">
<span [attr.uk-tooltip]="'cls: uk-active'" [title]="'Journal'"> <span>
<span class="uk-text-meta uk-margin-xsmall-right">Journal:</span>
<span *ngIf="journal['journal']">{{journal['journal']}}</span> <span *ngIf="journal['journal']">{{journal['journal']}}</span>
<span *ngIf="journal['journal'] && (journal['volume'] || journal['issue'])">, </span> <span *ngIf="journal['journal'] && (journal['volume'] || journal['issue'])">, </span>
<ng-container *ngIf="journal['volume']"> <ng-container *ngIf="journal['volume']">

View File

@ -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 { }

View File

@ -19,57 +19,28 @@
</div> </div>
</div> </div>
<div *ngIf="!showFeedback" class="uk-grid uk-margin-remove-left" uk-grid> <div *ngIf="!showFeedback" class="uk-grid uk-margin-remove-left" uk-grid>
<!-- left column -->
<!-- <div id="landing-left-sidebar" *ngIf="organizationInfo" class="uk-visible@s uk-padding-remove-horizontal">
<div class="uk-flex uk-flex-column uk-flex-right uk-sticky"
uk-sticky="end: true" [attr.offset]="offset">
<div class="uk-margin-large-bottom uk-align-center">
<div class="uk-text-meta uk-text-uppercase">Actions</div>
<ul class="uk-list">
<li class="uk-text-center">
<a (click)="openAddThisModal()" [title]="'Share this '+openaireEntities.ORGANIZATION+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="share" visuallyHidden="share"></icon>
</span>
</a>
</li>
<li class="uk-text-center"
[title]="'Download reports'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="buildFunderOptions(); openDownloadReportsModal()">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="download" visuallyHidden="download"></icon>
</span>
</a>
</li>
</ul>
</div>
</div>
</div> -->
<!-- center/right column --> <!-- center/right column -->
<div id="landing-center-content" class="uk-width-expand uk-padding-remove uk-background-default"> <div id="landing-center-content" class="uk-width-expand uk-padding-remove uk-background-default">
<!-- Graph and feedback --> <!-- Graph and feedback -->
<ng-template #graph_and_feedback_template> <ng-template #graph_and_feedback_template>
<div class="uk-padding-xsmall"> <div class="uk-padding-xsmall">
<div class="uk-container uk-container-xlarge uk-flex uk-flex-between uk-flex-wrap uk-margin-small-top uk-margin-small-bottom" [class.uk-invisible]="!organizationInfo"> <div class="uk-container uk-container-xlarge uk-flex uk-flex-between uk-flex-wrap uk-margin-small-top uk-margin-small-bottom" [class.uk-invisible]="!organizationInfo">
<!-- Last Index Info--> <!-- Last Index Info-->
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l"> <a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@l">
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;"> <img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 15px;">
</a> </a>
<span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l"> <span *ngIf="indexUpdateDate" class="uk-text-baseline uk-text-meta uk-width-1-1 uk-width-auto@l">
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
</span> </span>
<!--Feedback--> <!--Feedback-->
<div *ngIf="properties.reCaptchaSiteKey" class="uk-width-1-1 uk-width-auto@l"> <div *ngIf="properties.reCaptchaSiteKey" class="uk-width-1-1 uk-width-auto@l">
<span class="uk-text-meta uk-text-xsmall">Found an issue? </span> <span class="uk-text-meta uk-text-xsmall">Found an issue? </span>
<a (click)="showFeedback = true; scroll()" class="uk-text-xsmall">Give us feedback</a> <a (click)="showFeedback = true; scroll()" class="uk-text-xsmall">Give us feedback</a>
</div> </div>
</div> </div>
</div> </div>
</ng-template> </ng-template>
<div #graph_and_feedback id="graph_and_feedback" class="uk-blur-background uk-text-xsmall uk-visible@m" <div #graph_and_feedback id="graph_and_feedback" class="uk-blur-background uk-text-xsmall uk-visible@m"
@ -123,35 +94,10 @@
<!-- Main content --> <!-- Main content -->
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')"> <div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
<!-- Actions for mobile viewport -->
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
<div class="uk-margin-small-right">
<a (click)="openAddThisModal()" [title]="'Share this '+openaireEntities.ORGANIZATION+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="share" visuallyHidden="share"></icon>
</span>
</a>
</div>
<div [title]="'Download reports'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="buildFunderOptions(); openDownloadReportsModal()">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="download" visuallyHidden="download"></icon>
</span>
</a>
</div>
</div>
<!-- Helper --> <!-- Helper -->
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper> [texts]="pageContents['top']"></helper>
<!-- Versions -->
<!-- <span *ngIf="organizationInfo.deletedByInferenceIds" class="uk-text-primary uk-flex uk-flex-middle">
<icon flex="true" ratio="0.8" name="auto_awesome_motion"></icon>
<a (click)="openDeletedByInference()" class="uk-text-primary uk-text-small uk-margin-small-left">
View all {{organizationInfo.deletedByInferenceIds.length}} versions
</a>
</span> -->
<!-- Landing header --> <!-- Landing header -->
<landing-header [properties]="properties" [title]="organizationInfo.title.name" <landing-header [properties]="properties" [title]="organizationInfo.title.name"
[subTitle]="(organizationInfo.name [subTitle]="(organizationInfo.name
@ -171,6 +117,10 @@
<div *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')"> <div *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')">
<span class="uk-text-meta">Country: </span>{{organizationInfo.country}} <span class="uk-text-meta">Country: </span>{{organizationInfo.country}}
</div> </div>
<!-- Identifiers -->
<div *ngIf="organizationInfo.identifiers && organizationInfo.identifiers.size > 0" class="uk-margin-small-top">
<showIdentifiers [identifiers]="organizationInfo.identifiers" [showViewAll]="true"></showIdentifiers>
</div>
</div> </div>
</div> </div>
<!-- Tabs section --> <!-- Tabs section -->
@ -257,9 +207,7 @@
</search-tab> </search-tab>
</div> </div>
</div> </div>
<div class="uk-text-xsmall uk-hidden@m">
<ng-container *ngTemplateOutlet="graph_and_feedback_template"></ng-container>
</div>
<!-- Helper --> <!-- Helper -->
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" <helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"> [texts]="pageContents['bottom']">
@ -270,12 +218,12 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Feedback -->
<feedback *ngIf="showFeedback && organizationInfo && properties.reCaptchaSiteKey" [organizationInfo]="organizationInfo"
[properties]="properties" [entityType]="'organization'" [fields]="feedbackFields"
[(showForm)]="showFeedback">
</feedback>
</div> </div>
<!-- Feedback -->
<feedback *ngIf="organizationInfo && properties.reCaptchaSiteKey" [organizationInfo]="organizationInfo"
[properties]="properties" [entityType]="'organization'" [fields]="feedbackFields"
[(showForm)]="showFeedback">
</feedback>
</div> </div>
<!-- Mobile view --> <!-- Mobile view -->
@ -287,6 +235,23 @@
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null" && organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
[entityType]="'organization'" [prevPath]="prevPath"> [entityType]="'organization'" [prevPath]="prevPath">
</landing-header> </landing-header>
<div class="uk-text-small">
<!-- Web Page -->
<div *ngIf="organizationInfo.title && organizationInfo.title.url" class="uk-margin-small-bottom uk-display-inline-block">
<span class="uk-text-meta">Web page: </span>
<a [href]="organizationInfo.title.url" target="_blank" class="uk-button uk-button-text uk-text-lowercase uk-text-normal custom-external">
{{organizationInfo.title.url}}
</a>
</div>
<!-- Country -->
<div *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')">
<span class="uk-text-meta">Country: </span>{{organizationInfo.country}}
</div>
<!-- Identifiers -->
<div *ngIf="organizationInfo.identifiers && organizationInfo.identifiers.size > 0" class="uk-margin-small-top">
<showIdentifiers [identifiers]="organizationInfo.identifiers" [showViewAll]="true" [isMobile]="true"></showIdentifiers>
</div>
</div>
<div class="uk-section uk-margin-top uk-text-large uk-text-empashis uk-text-bold"> <div class="uk-section uk-margin-top uk-text-large uk-text-empashis uk-text-bold">
<hr> <hr>
<ng-container> <ng-container>
@ -406,10 +371,7 @@
[type]="'organizations'" [prevPath]="prevPath"> [type]="'organizations'" [prevPath]="prevPath">
</organizationsDeletedByInference> </organizationsDeletedByInference>
</modal-alert> </modal-alert>
<!-- Share -->
<modal-alert *ngIf="organizationInfo" #addThisModal classBody="uk-flex uk-flex-center uk-flex-middle">
<addThis></addThis>
</modal-alert>
<!-- Download --> <!-- Download -->
<modal-alert *ngIf="organizationInfo" #downloadReportsModal large="true"> <modal-alert *ngIf="organizationInfo" #downloadReportsModal large="true">
<div class="uk-padding-small uk-margin-small-left uk-margin-small-right"> <div class="uk-padding-small uk-margin-small-left uk-margin-small-right">

View File

@ -77,7 +77,6 @@ export class OrganizationComponent {
@ViewChild('downloadReportsFsModal') downloadReportsFsModal: FullScreenModalComponent; @ViewChild('downloadReportsFsModal') downloadReportsFsModal: FullScreenModalComponent;
// @ViewChild('downloadReportModal') downloadReportModal; // @ViewChild('downloadReportModal') downloadReportModal;
// @ViewChild('downloadFunderReportModal') downloadFunderReportModal; // @ViewChild('downloadFunderReportModal') downloadFunderReportModal;
@ViewChild('addThisModal') addThisModal;
@ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent; @ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent;
@ViewChild(ModalLoading) loading: ModalLoading; @ViewChild(ModalLoading) loading: ModalLoading;
@ -717,13 +716,6 @@ export class OrganizationComponent {
this.downloadReportsModal.cancel(); 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 = "") { public getParamsForSearchLink(type: string = "") {
if(type) { if(type) {
return this.routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf', 'sortBy'], ['relorganizationid', this.organizationId, type, 'false', 'resultdateofacceptance,descending']); return this.routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf', 'sortBy'], ['relorganizationid', this.organizationId, type, 'false', 'resultdateofacceptance,descending']);

View File

@ -33,11 +33,14 @@ import {graph, versions} from "../../utils/icons/icons";
import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module";
import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module";
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
import {OrganizationRoutingModule} from "./organization-routing.module";
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, RouterModule, CommonModule, FormsModule, RouterModule,
OrganizationRoutingModule,
LoadingModalModule, AlertModalModule, ErrorMessagesModule, LoadingModalModule, AlertModalModule, ErrorMessagesModule,
LandingModule, LandingModule,
DataProvidersServiceModule, DataProvidersServiceModule,
@ -49,7 +52,7 @@ import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.mod
ProjectsServiceModule, ProjectsServiceModule,
Schema2jsonldModule, SEOServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, HelperModule,
OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule,
TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EGIDataTransferModule, EntityActionsModule TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EntityActionsModule, ResultLandingUtilsModule
], ],
declarations: [ declarations: [
OrganizationComponent, OrganizationComponent,

View File

@ -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 { }

View File

@ -32,9 +32,11 @@ import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-sc
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module";
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
import {ProjectRoutingModule} from "./project-routing.module";
@NgModule({ @NgModule({
imports: [ imports: [
ProjectRoutingModule,
CommonModule, FormsModule, RouterModule, LandingModule, CommonModule, FormsModule, RouterModule, LandingModule,
LoadingModalModule, AlertModalModule, ErrorMessagesModule, LoadingModalModule, AlertModalModule, ErrorMessagesModule,
IFrameModule, ReportsServiceModule, IFrameModule, ReportsServiceModule,

View File

@ -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 { }

View File

@ -4,8 +4,8 @@
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld> [searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
<!-- Desktop view --> <!-- Desktop view -->
<div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle"> <div *ngIf="!isMobile" id="tm-main" class="landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main"> <div class="tm-main">
<div class="publication"> <div class="publication">
<div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar"> <div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar">
<div class="uk-light uk-container uk-container-large uk-margin-left uk-height-1-1"> <div class="uk-light uk-container uk-container-large uk-margin-left uk-height-1-1">
@ -18,70 +18,6 @@
</div> </div>
</div> </div>
<div *ngIf="!showFeedback" class="uk-grid uk-margin-remove-left" uk-grid> <div *ngIf="!showFeedback" class="uk-grid uk-margin-remove-left" uk-grid>
<!-- left box/sidebar - actions -->
<!-- <div id="landing-left-sidebar" *ngIf="resultLandingInfo" class="uk-visible@s uk-padding-remove-horizontal">
<div class="uk-flex uk-flex-column uk-flex-between uk-flex-center uk-sticky"
uk-sticky="end: true" [attr.offset]="offset">
<div class="uk-align-center uk-text-center uk-margin-medium-top uk-flex uk-flex-column uk-flex-between">
<ng-container *ngIf="resultLandingInfo && (hasAltMetrics || hasMetrics)">
<metrics *ngIf="hasMetrics" class="uk-margin-bottom"
[pageViews]="pageViews"
[id]="id" [entityType]="'results'" [entity]="title"
[viewsFrameUrl]="viewsFrameUrl" [downloadsFrameUrl]="downloadsFrameUrl"
(metricsResults)="metricsResults($event)" [properties]=properties
[prevPath]="prevPath">
</metrics>
<altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers?.get('doi')[0]}}" type="doi"></altmetrics>
</ng-container>
</div>
<div class="uk-margin-large-bottom uk-align-center">
<div class="uk-text-meta uk-text-uppercase">Actions</div>
<ul class="uk-list">
<li class="uk-text-center">
<a (click)="openAddThisModal()"
[title]="'Share this '+getTypeName() + ' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="share" visuallyHidden="share"></icon>
</span>
</a>
</li>
<li *ngIf="isRouteAvailable('participate/direct-claim')" class="uk-text-center"
[title]="'<span class=\'uk-flex uk-flex-middle\'>Link this '+getTypeName()+' to ...<span class=\'material-icons uk-margin-small-left\'>east</span></span>'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="link" visuallyHidden="link"></icon>
</span>
</a>
</li>
<li class="uk-text-center">
<a (click)="openCiteModal()"
[title]="'Cite this '+getTypeName()"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="quotes" visuallyHidden="cite"></icon>
</span>
</a>
</li>
<li *ngIf="properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community' || properties.adminToolsPortalType == 'aggregator'"
class="uk-text-center">
<orcid-work [resultId]="id" [resultTitle]="resultLandingInfo.title" [resultLandingInfo]="resultLandingInfo"
[pids]="pidsArrayString" [pageType]="'landing'">
</orcid-work>
</li>
<li *ngIf=" properties.enableEoscDataTransfer && resultLandingInfo.resultType == 'dataset' &&
resultLandingInfo.identifiers && resultLandingInfo.identifiers.get('doi')"
class="uk-text-center">
<egi-transfer-data [dois]="resultLandingInfo.identifiers.get('doi')" [isOpen]="egiTransferModalOpen"></egi-transfer-data>
</li>
</ul>
</div>
</div>
</div> -->
<!-- center box--> <!-- center box-->
<div id="landing-center-content" class="uk-width-expand uk-padding-remove uk-background-default"> <div id="landing-center-content" class="uk-width-expand uk-padding-remove uk-background-default">
@ -166,54 +102,6 @@
<!-- in small screens there is no sticky #graph_and_feedback so margin-top is medium (40px) --> <!-- in small screens there is no sticky #graph_and_feedback so margin-top is medium (40px) -->
<!-- else margin is medium (40px) - the actual height of uk-sticky-placeholder (graph_height - 20px -> margins of #graph_and_feedback) --> <!-- else margin is medium (40px) - the actual height of uk-sticky-placeholder (graph_height - 20px -> margins of #graph_and_feedback) -->
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')"> <div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
<!-- Actions for mobile viewport -->
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
<!-- Share -->
<div class="uk-margin-small-right">
<a (click)="openAddThisModal()"
[title]="'Share this '+getTypeName() + ' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="share" visuallyHidden="share"></icon>
</span>
</a>
</div>
<!-- Link to -->
<div *ngIf="isRouteAvailable('participate/direct-claim')" class="uk-margin-small-right"
[title]="'<span class=\'uk-flex uk-flex-middle\'>Link this '+getTypeName()+' to ...<span class=\'material-icons uk-margin-small-left\'>east</span></span>'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'project'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="link" visuallyHidden="link"></icon>
</span>
</a>
</div>
<!-- Cite this -->
<div class="uk-margin-small-right">
<a (click)="openCiteModal()"
[title]="'Cite this '+getTypeName()"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="quotes" visuallyHidden="cite"></icon>
</span>
</a>
</div>
<!-- ORCID -->
<div *ngIf="properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'community' || properties.adminToolsPortalType == 'aggregator'"
class="uk-margin-small-right">
<orcid-work [resultId]="id" [resultTitle]="resultLandingInfo.title" [resultLandingInfo]="resultLandingInfo"
[pids]="pidsArrayString" [pageType]="'landing'">
</orcid-work>
</div>
<div *ngIf=" properties.enableEoscDataTransfer && resultLandingInfo.resultType == 'dataset' &&
resultLandingInfo.identifiers && resultLandingInfo.identifiers.get('doi') &&
resultLandingInfo.identifiers.get('doi').join('').indexOf('zenodo.')!=-1"
class="">
<egi-transfer-data [dois]="resultLandingInfo.identifiers.get('doi')" [isOpen]="egiTransferModalOpen"></egi-transfer-data>
</div>
</div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper> [texts]="pageContents['top']"></helper>
@ -232,48 +120,15 @@
[publiclyFunded]="resultLandingInfo.publiclyFunded" [publiclyFunded]="resultLandingInfo.publiclyFunded"
[projects]="resultLandingInfo.fundedByProjects"> [projects]="resultLandingInfo.fundedByProjects">
</landing-header> </landing-header>
<!-- Labels -->
<!-- Not used anymore - access labels will be in action bars, languages in the landing-header component -->
<!-- <div class="uk-margin-bottom uk-grid uk-grid-small uk-flex-middle" uk-grid>
<ng-container *ngIf="resultLandingInfo.accessMode && resultLandingInfo.accessMode.toLowerCase() !== 'not available'">
<div>
<span [class]="'uk-label uk-text-truncate '+ (accessClass(resultLandingInfo.accessMode) == 'open' ? 'uk-label-success' : '')"
title="Access Mode">{{resultLandingInfo.accessMode}}
</span>
</div>
</ng-container>
<ng-container *ngIf="resultLandingInfo.languages &&
removeUnknown(resultLandingInfo.languages).length > 0">
<ng-container *ngFor="let language of removeUnknown(resultLandingInfo.languages)">
<div>
<span class="uk-label custom-label label-language" title="Language">{{language}}</span>
</div>
</ng-container>
</ng-container>
<ng-container *ngIf="resultLandingInfo.programmingLanguages && resultLandingInfo.programmingLanguages.length > 0">
<ng-container *ngFor="let programmingLanguage of resultLandingInfo.programmingLanguages">
<div>
<span class="uk-label custom-label label-language"
title="Programming Language">{{programmingLanguage}}</span>
</div>
</ng-container>
</ng-container>
</div> -->
<div class="uk-text-small"> <div class="uk-text-small">
<!-- Identifiers --> <!-- Identifiers -->
<div *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0" class="uk-margin-small-top"> <div *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0" class="uk-margin-small-top">
<showIdentifiers [identifiers]="resultLandingInfo.identifiers" [showViewAll]="true"></showIdentifiers> <showIdentifiers [identifiers]="resultLandingInfo.identifiers" [showViewAll]="true"></showIdentifiers>
</div> </div>
<!--Published Date, Journal and Publisher-->
<!-- Moved inside landing-header component -->
<!-- <div showPublisher [publisher]="resultLandingInfo.publisher"
[publishDate]="resultLandingInfo.dateofacceptance"
[journal]="resultLandingInfo.journal" [properties]="properties" class="uk-margin-small-top"></div> -->
</div> </div>
</div> </div>
<div id="main-tabs-div" class="uk-sticky uk-blur-background" <div id="main-tabs-div" class="uk-sticky uk-blur-background" uk-sticky="end: true; media: @m" [attr.offset]="offset">
uk-sticky="end: true; media: @m" [attr.offset]="offset">
<div class="uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom"> <div class="uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom">
<landing-header [ngClass]="stickyHeader ? 'uk-visible@m' : 'uk-invisible'" <landing-header [ngClass]="stickyHeader ? 'uk-visible@m' : 'uk-invisible'"
[properties]="properties" [title]="resultLandingInfo.title" [properties]="properties" [title]="resultLandingInfo.title"
@ -282,7 +137,6 @@
[date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate" [date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate"
isSticky="true" [prevPath]="prevPath"> isSticky="true" [prevPath]="prevPath">
</landing-header> </landing-header>
<!-- <showTitle *ngIf="stickyHeader" [titleName]="resultLandingInfo.title" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>-->
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader"> <my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader">
<my-tab tabTitle="Summary" [tabId]="'summary'" [active]="true"></my-tab> <my-tab tabTitle="Summary" [tabId]="'summary'" [active]="true"></my-tab>
<my-tab *ngIf="hasSubjects" <my-tab *ngIf="hasSubjects"
@ -362,26 +216,6 @@
</ng-container> </ng-container>
</div> </div>
<!-- right box/ sidebar-->
<ng-container *ngIf="!showFeedback && resultLandingInfo && hasRightSidebarInfo">
<a id="landing-right-sidebar-switcher" uk-toggle href="#right-column-offcanvas"
class="uk-offcanvas-switcher uk-flex uk-link-reset uk-flex-center uk-flex-middle uk-hidden@m"
(click)="rightSidebarOffcanvasClicked = true;">
<icon name="more" [ratio]="1.5" customClass="uk-text-primary" [flex]="true" visuallyHidden="sidebar"></icon>
</a>
<div id="right-column-offcanvas" class="uk-offcanvas" uk-offcanvas="flip: true; overlay: true;">
<div class="uk-offcanvas-bar">
<button class="uk-offcanvas-close uk-close uk-icon" type="button"
(click)="rightSidebarOffcanvasClicked = false">
<icon name="close" [ratio]="1.5" visuallyHidden="close"></icon>
</button>
<div *ngIf="rightSidebarOffcanvasClicked">
<ng-container *ngTemplateOutlet="right_column"></ng-container>
</div>
</div>
</div>
</ng-container>
<ng-template #right_column> <ng-template #right_column>
<!-- new metrics box --> <!-- new metrics box -->
<div *ngIf="resultLandingInfo && resultLandingInfo.measure && (resultLandingInfo.measure.bip.length || resultLandingInfo.measure.counts.length) && !viewAll" <div *ngIf="resultLandingInfo && resultLandingInfo.measure && (resultLandingInfo.measure.bip.length || resultLandingInfo.measure.counts.length) && !viewAll"
@ -509,11 +343,10 @@
</div> </div>
</ng-template> </ng-template>
</div> </div>
<feedback *ngIf="showFeedback && resultLandingInfo && properties.reCaptchaSiteKey" [resultLandingInfo]="resultLandingInfo"
[properties]="properties" [entityType]="getTypeName()" [fields]="feedbackFields"
[(showForm)]="showFeedback" [preSelectedField]="feedbackPreSelectedField"></feedback>
</div> </div>
<feedback *ngIf="resultLandingInfo && properties.reCaptchaSiteKey" [resultLandingInfo]="resultLandingInfo"
[properties]="properties" [entityType]="getTypeName()" [fields]="feedbackFields"
[(showForm)]="showFeedback" [preSelectedField]="feedbackPreSelectedField"></feedback>
</div> </div>
<!-- Mobile view --> <!-- Mobile view -->
@ -886,16 +719,18 @@
</modal-alert> </modal-alert>
<modal-alert *ngIf="resultLandingInfo" #addThisModal classBody="uk-flex uk-flex-center uk-flex-middle"> <modal-alert *ngIf="resultLandingInfo" #addThisModal classBody="uk-flex uk-flex-center uk-flex-middle">
<addThis></addThis> <addThis *ngIf="addThisClicked"></addThis>
</modal-alert> </modal-alert>
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.organizations" #organizationsModal> <modal-alert *ngIf="resultLandingInfo && resultLandingInfo.organizations" #organizationsModal>
<ng-container *ngTemplateOutlet="organizations_template; context: { threshold: resultLandingInfo.organizations.length}"></ng-container> <ng-container *ngIf="viewAllOrganizations">
<ng-container *ngTemplateOutlet="organizations_template; context: { threshold: resultLandingInfo.organizations.length}"></ng-container>
</ng-container>
</modal-alert> </modal-alert>
<modal-alert *ngIf="!isMobile && resultLandingInfo?.description" #descriptionModal <modal-alert *ngIf="!isMobile && resultLandingInfo?.description" #descriptionModal
[large]="true"> [large]="true">
<div [innerHTML]="resultLandingInfo.description"></div> <div *ngIf="descriptionClicked" [innerHTML]="resultLandingInfo.description"></div>
</modal-alert> </modal-alert>
<!--<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.sdg?.length > 0"--> <!--<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.sdg?.length > 0"-->
@ -1327,6 +1162,7 @@
</div> </div>
</ng-template> </ng-template>
<ng-container *ngIf="isMobile">
<fs-modal *ngIf="resultLandingInfo && resultLandingInfo.deletedByInferenceIds" #AlertModalDeletedByInferenceFS classTitle="uk-tile-default uk-border-bottom"> <fs-modal *ngIf="resultLandingInfo && resultLandingInfo.deletedByInferenceIds" #AlertModalDeletedByInferenceFS classTitle="uk-tile-default uk-border-bottom">
<deletedByInference *ngIf="type == 'publication' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'publication' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
@ -1352,5 +1188,6 @@
</fs-modal> </fs-modal>
<fs-modal *ngIf="resultLandingInfo" #addThisFsModal classTitle="uk-tile-default uk-border-bottom" classBody="uk-flex uk-flex-center uk-flex-middle"> <fs-modal *ngIf="resultLandingInfo" #addThisFsModal classTitle="uk-tile-default uk-border-bottom" classBody="uk-flex uk-flex-center uk-flex-middle">
<addThis></addThis> <addThis *ngIf="addThisClicked"></addThis>
</fs-modal> </fs-modal>
</ng-container>

View File

@ -74,6 +74,8 @@ export class ResultLandingComponent {
public linkToSearchPage: string = null; public linkToSearchPage: string = null;
public citeThisClicked: boolean; public citeThisClicked: boolean;
public addThisClicked: boolean;
public descriptionClicked: boolean;
// Metrics tab variables // Metrics tab variables
public metricsClicked: boolean; public metricsClicked: boolean;
@ -197,6 +199,9 @@ export class ResultLandingComponent {
private userManagementService: UserManagementService, private userManagementService: UserManagementService,
private layoutService: LayoutService, private layoutService: LayoutService,
private _contextService: ContextsService) { private _contextService: ContextsService) {
if(route.snapshot.data && route.snapshot.data['type']) {
this.type = route.snapshot.data['type'];
}
} }
ngOnInit() { ngOnInit() {
@ -864,6 +869,7 @@ export class ResultLandingComponent {
} }
public openAddThisModal() { public openAddThisModal() {
this.addThisClicked = true;
this.addThisModal.cancelButton = false; this.addThisModal.cancelButton = false;
this.addThisModal.okButton = false; this.addThisModal.okButton = false;
this.addThisModal.alertTitle = "Share this " + this.getTypeName() + " in your social networks"; this.addThisModal.alertTitle = "Share this " + this.getTypeName() + " in your social networks";
@ -1076,6 +1082,7 @@ export class ResultLandingComponent {
this.sdgFosSuggest.subjectType="fos"; this.sdgFosSuggest.subjectType="fos";
} }
this.cdr.detectChanges(); this.cdr.detectChanges();
this.sdgFosSuggest.isOpen = true;
this.sdgFosSuggest.openSelectionModal(); this.sdgFosSuggest.openSelectionModal();
} }
@ -1090,6 +1097,7 @@ export class ResultLandingComponent {
} }
public openDescriptionModal() { public openDescriptionModal() {
this.descriptionClicked = true;
this.descriptionModal.alertFooter = false; this.descriptionModal.alertFooter = false;
this.descriptionModal.alertTitle = "Abstract"; this.descriptionModal.alertTitle = "Abstract";
this.descriptionModal.open(); this.descriptionModal.open();

View File

@ -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 {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module";
import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module';
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
import {ResultLandingRoutingModule} from "./resultLanding-routing.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule, CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
ResultLandingRoutingModule,
CiteThisModule, PagingModule, IFrameModule, CiteThisModule, PagingModule, IFrameModule,
AltMetricsModule, Schema2jsonldModule, SEOServiceModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule,
DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule,

View File

@ -3,7 +3,7 @@ import { Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@a
import {Observable} from 'rxjs'; import {Observable} from 'rxjs';
import {LoginErrorCodes} from './utils/guardHelper.class'; import {LoginErrorCodes} from './utils/guardHelper.class';
@Injectable() @Injectable({providedIn: 'root'})
export class FreeGuard { export class FreeGuard {
constructor(private router: Router) { constructor(private router: Router) {

View File

@ -7,16 +7,13 @@ import {UserRoutingModule} from './user-routing.module';
import {UserComponent} from './user.component'; import {UserComponent} from './user.component';
import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard';
import {LoadingModule} from "../utils/loading/loading.module"; import {LoadingModule} from "../utils/loading/loading.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, UserRoutingModule, RouterModule, LoadingModule CommonModule, FormsModule, UserRoutingModule, RouterModule, LoadingModule
], ],
providers: [ providers: [],
PreviousRouteRecorder
],
declarations: [ declarations: [
UserComponent UserComponent
], ],

View File

@ -239,7 +239,7 @@ export class Role {
} else if (type == "organization") { } else if (type == "organization") {
type = "institution"; type = "institution";
} }
return Role.GROUP + type; return type;
} }
/** /**

View File

@ -1,7 +1,6 @@
import {NgModule} from "@angular/core"; import {NgModule} from "@angular/core";
import {GeneralComponent} from "./general.component"; import {GeneralComponent} from "./general.component";
import {GeneralRoutingModule} from "./general-routing.module"; import {GeneralRoutingModule} from "./general-routing.module";
import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard";
import {CommonModule} from "@angular/common"; import {CommonModule} from "@angular/common";
import {RouterModule} from "@angular/router"; import {RouterModule} from "@angular/router";
import {InputModule} from "../../sharedComponents/input/input.module"; import {InputModule} from "../../sharedComponents/input/input.module";
@ -30,9 +29,7 @@ import {
LogoUrlPipeModule, LogoUrlPipeModule,
SidebarMobileToggleModule SidebarMobileToggleModule
], ],
providers: [ providers: [],
PreviousRouteRecorder,
],
exports: [GeneralComponent] exports: [GeneralComponent]
}) })
export class GeneralModule { export class GeneralModule {

View File

@ -12,14 +12,13 @@
</div> </div>
<div actions> <div actions>
<div class="uk-section-xsmall"> <div class="uk-section-xsmall">
<div class="uk-flex uk-flex-center uk-flex-wrap uk-flex-middle" <div class="uk-flex uk-flex-center uk-flex-wrap uk-flex-middle uk-flex-between@m">
[ngClass]="properties.dashboard == 'irish' ? 'uk-flex-between@m' : 'uk-flex-right@m'"> <div class="uk-width-medium uk-margin-small-bottom">
<div *ngIf="properties.dashboard == 'irish'" class="uk-width-medium uk-margin-small-bottom"> <div input type="select" placeholder="Type" [disabled]="loading"
<div input type="select" placeholder="Type"
[options]="typeOptions" [formInput]="filters.get('type')"> [options]="typeOptions" [formInput]="filters.get('type')">
</div> </div>
</div> </div>
<div search-input [searchControl]="filters.get('keyword')" [expandable]="true" <div search-input [searchControl]="filters.get('keyword')" [expandable]="true" [disabled]="loading"
placeholder="Search Profiles" searchInputClass="outer" placeholder="Search Profiles" searchInputClass="outer"
class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1 uk-flex uk-flex-right"></div> class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1 uk-flex uk-flex-right"></div>
</div> </div>

View File

@ -1,7 +1,6 @@
import {NgModule} from "@angular/core"; import {NgModule} from "@angular/core";
import {ManageStakeholdersComponent} from "./manageStakeholders.component"; import {ManageStakeholdersComponent} from "./manageStakeholders.component";
import {ManageStakeholdersRoutingModule} from "./manageStakeholders-routing.module"; import {ManageStakeholdersRoutingModule} from "./manageStakeholders-routing.module";
import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard";
import {CommonModule} from "@angular/common"; import {CommonModule} from "@angular/common";
import {RouterModule} from "@angular/router"; import {RouterModule} from "@angular/router";
import {InputModule} from "../../sharedComponents/input/input.module"; import {InputModule} from "../../sharedComponents/input/input.module";
@ -40,9 +39,7 @@ import {PagingModule} from "../../utils/paging.module";
SliderTabsModule, SliderTabsModule,
PagingModule PagingModule
], ],
providers: [ providers: [],
PreviousRouteRecorder,
],
exports: [ManageStakeholdersComponent] exports: [ManageStakeholdersComponent]
}) })
export class ManageStakeholdersModule { export class ManageStakeholdersModule {

View File

@ -271,6 +271,12 @@
[options]="indicatorUtils.formats" type="select"> [options]="indicatorUtils.formats" type="select">
</div> </div>
</div> </div>
<div class="uk-width-1-2@m" formArrayName="parameters">
<div *ngIf="getParameter(i, 'statsProfile', 'number') && statsProfiles" input [formInput]="getParameter(i, 'statsProfile', 'number').get('value')"
[type]="'select'"
[options]="statsProfiles"
placeholder="Stats Profile"></div>
</div>
</div> </div>
</div> </div>
<div formArrayName="jsonPath" class="uk-width-1-1"> <div formArrayName="jsonPath" class="uk-width-1-1">
@ -327,6 +333,20 @@
</a> </a>
</div> </div>
</div> </div>
<div *ngIf="hasDifference(i, 'number')"
class="uk-width-1-1 uk-height-1-1 refresh-indicator">
<div class="uk-position-relative uk-height-1-1">
<a class="uk-position-center uk-text-center uk-text-small uk-link-reset"
[class.uk-disabled]="numberIndicatorPaths.at(i).get('url').invalid"
(click)="refreshIndicator('number')">
<div>
<icon name="refresh"></icon>
</div>
<span>Calculate</span>
<span *ngIf="numberIndicatorPaths.at(i).get('result').errors?.validating">Calculating...</span>
</a>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -400,6 +420,8 @@
placeholder="Year (From)"></div> placeholder="Year (From)"></div>
<div *ngIf="getParameter(i, 'end_year')" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'end_year').get('value')" <div *ngIf="getParameter(i, 'end_year')" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'end_year').get('value')"
placeholder="Year (To)"></div> placeholder="Year (To)"></div>
<div *ngIf="getParameter(i, 'statsProfile') && statsProfiles" input class="uk-width-1-3@s" [formInput]="getParameter(i, 'statsProfile').get('value')"
[type]="'select'" [options]="statsProfiles" placeholder="Stats Profile"></div>
</div> </div>
</div> </div>
<div *ngIf="indicator && indicator.indicatorPaths[i] && indicator.indicatorPaths[i].safeResourceUrl" <div *ngIf="indicator && indicator.indicatorPaths[i] && indicator.indicatorPaths[i].safeResourceUrl"

View File

@ -44,6 +44,7 @@ import {NotificationService} from "../../notifications/notification.service";
import {NotificationHandler} from "../../utils/notification-handler"; import {NotificationHandler} from "../../utils/notification-handler";
import {IndicatorStakeholderBaseComponent} from "../utils/stakeholder-base.component"; import {IndicatorStakeholderBaseComponent} from "../utils/stakeholder-base.component";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {StatsProfilesService} from "../utils/services/stats-profiles.service";
declare var UIkit; declare var UIkit;
declare var copy; declare var copy;
@ -68,6 +69,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
@Input() @Input()
public user: User = null; public user: User = null;
public preview: string; public preview: string;
public statsProfiles = [];
public numberIndicatorFb: UntypedFormGroup; public numberIndicatorFb: UntypedFormGroup;
public chartIndicatorFb: UntypedFormGroup; public chartIndicatorFb: UntypedFormGroup;
public chartSections: UntypedFormArray; public chartSections: UntypedFormArray;
@ -119,6 +121,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
constructor(private layoutService: LayoutService, constructor(private layoutService: LayoutService,
private stakeholderService: StakeholderService, private stakeholderService: StakeholderService,
private statisticsService: StatisticsService, private statisticsService: StatisticsService,
private statsProfileService: StatsProfilesService,
private notificationService: NotificationService, private notificationService: NotificationService,
private fb: UntypedFormBuilder, private fb: UntypedFormBuilder,
protected _router: Router, protected _router: Router,
@ -137,7 +140,16 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
this.setCharts(); this.setCharts();
this.setNumbers(); this.setNumbers();
this.initReorder(); this.initReorder();
}) });
if (this.isCurator) {
this.subscriptions.push(this.statsProfileService.getStatsProfiles().subscribe(statsProfiles => {
this.statsProfiles = [null].concat(statsProfiles);
}, error => {
this.statsProfiles = [];
}));
} else {
this.statsProfiles = [];
}
} }
ngOnDestroy(): void { ngOnDestroy(): void {
@ -400,7 +412,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
this.getJsonPath(index).disable(); this.getJsonPath(index).disable();
} }
indicatorPath.get('result').setErrors({validating: true}); 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)); let result = JSON.parse(JSON.stringify(response));
this.getJsonPath(index).controls.forEach(jsonPath => { this.getJsonPath(index).controls.forEach(jsonPath => {
if (result) { if (result) {
@ -448,12 +460,16 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
return this.section.indicators[this.index].indicatorPaths[index].jsonPath; return this.section.indicators[this.index].indicatorPaths[index].jsonPath;
} }
public getParameters(index: number): UntypedFormArray { public getParameters(index: number, type: IndicatorType = 'chart'): UntypedFormArray {
return this.chartIndicatorPaths.at(index).get('parameters') as 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 { public getParameter(index: number, key: string, type: IndicatorType = 'chart'): UntypedFormControl {
return this.getParameters(index).controls.filter(control => control.value.key === key)[0] as UntypedFormControl; return this.getParameters(index, type).controls.filter(control => control.value.key === key)[0] as UntypedFormControl;
} }
private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) { private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) {
@ -474,6 +490,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
jsonPath: jsonPath, jsonPath: jsonPath,
result: this.fb.control(0, Validators.required), result: this.fb.control(0, Validators.required),
source: this.fb.control(source, Validators.required), source: this.fb.control(source, Validators.required),
parameters: parameters,
format: this.fb.control(format, Validators.required) format: this.fb.control(format, Validators.required)
} }
)); ));
@ -506,6 +523,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
if (indicatorPath.source) { if (indicatorPath.source) {
this.numberIndicatorPaths.at(index).get('source').setValue(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) { if (indicatorPath.jsonPath.length > 1 && this.getJsonPath(index).length == 1) {
let paths = indicatorPath.jsonPath; let paths = indicatorPath.jsonPath;
for (let i = 0; i < paths.length; i++) { 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.checkForSchemaEnhancements(this.chartIndicatorPaths.at(index).get('url').value);
(this.chartIndicatorPaths.at(index) as UntypedFormGroup).get('type').setValue(indicatorPath.type); (this.chartIndicatorPaths.at(index) as UntypedFormGroup).get('type').setValue(indicatorPath.type);
let parameters = this.getParametersAsFormArray(indicatorPath); (this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath));
(this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', parameters);
if (!this.indicator.indicatorPaths[index]) { if (!this.indicator.indicatorPaths[index]) {
this.indicator.indicatorPaths[index] = indicatorPath; this.indicator.indicatorPaths[index] = indicatorPath;
this.indicator.indicatorPaths[index].safeResourceUrl = this.getSecureUrlByStakeHolder(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) defaultId: this.fb.control(this.indicator.defaultId)
}); });
this.indicator.indicatorPaths.forEach(indicatorPath => { 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 { } else {
this.indicator = new Indicator('', '', '', 'number', 'small', 'small', "PUBLIC", []); this.indicator = new Indicator('', '', '', 'number', 'small', 'small', "PUBLIC", []);
@ -754,11 +771,11 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
this.editing = true; this.editing = true;
if (this.indicator.type === 'chart') { if (this.indicator.type === 'chart') {
this.chartIndicatorFb.get('description').enable(); 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); this.section = this.charts.find(section => section._id === this.section._id);
} else { } else {
this.numberIndicatorFb.get('description').enable(); 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); this.section = this.numbers.find(section => section._id === this.section._id);
} }
let path = [ 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; let hasDifference = false;
this.chartIndicatorPaths.at(index).value.parameters.forEach((parameter) => { if(type === 'chart') {
if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { this.chartIndicatorPaths.at(index).value.parameters.forEach(parameter => {
hasDifference = true; if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) {
return; hasDifference = true;
} return;
}); }
return hasDifference || this.indicator.indicatorPaths[index].safeResourceUrl.toString() !== });
this.getSecureUrlByStakeHolder(this.indicator.indicatorPaths[index]).toString(); 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 { public get isAdministrator(): boolean {
@ -937,11 +965,18 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
return this.isAdministrator || Session.isCurator(this.stakeholder.type, this.user); return this.isAdministrator || Session.isCurator(this.stakeholder.type, this.user);
} }
refreshIndicator() { refreshIndicator(type: IndicatorType = 'chart') {
this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart', true); if(type === 'chart') {
this.indicator.indicatorPaths.forEach(indicatorPath => { this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart');
indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); 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) { deleteIndicatorOpen(section: Section, indicatorId: string, type: string, childrenAction: string = null) {

View File

@ -1,9 +1,6 @@
import {NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common'; 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 {TopicComponent} from "./topic.component";
import {TopicRoutingModule} from "./topic-routing.module"; import {TopicRoutingModule} from "./topic-routing.module";
import {RouterModule} from "@angular/router"; 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 {TransitionGroupModule} from "../../utils/transition-group/transition-group.module";
import {NumberRoundModule} from "../../utils/pipes/number-round.module"; import {NumberRoundModule} from "../../utils/pipes/number-round.module";
import {SideBarModule} from "../../dashboard/sharedComponents/sidebar/sideBar.module"; import {SideBarModule} from "../../dashboard/sharedComponents/sidebar/sideBar.module";
import { import {SidebarMobileToggleModule} from "../../dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module";
SidebarMobileToggleModule
} from "../../dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module";
@NgModule({ @NgModule({
imports: [ imports: [
@ -34,10 +29,7 @@ import {
declarations: [ declarations: [
TopicComponent, IndicatorsComponent TopicComponent, IndicatorsComponent
], ],
providers: [ providers: [],
PreviousRouteRecorder,
PiwikService
],
exports: [ exports: [
TopicComponent TopicComponent
] ]

View File

@ -85,7 +85,7 @@ export class StakeholderUtils {
visibilityIcon: Map<Visibility, string> = new Map<Visibility, string>(this.visibilities.map(option => [option.value, option.icon])); visibilityIcon: Map<Visibility, string> = new Map<Visibility, string>(this.visibilities.map(option => [option.value, option.icon]));
defaultValue(options: Option[]) { defaultValue(options: Option[]) {
return options.length === 1?options[0].value:null; return options.length === 1 ? options[0].value : null;
} }
showField(options: Option[]) { showField(options: Option[]) {
@ -94,7 +94,7 @@ export class StakeholderUtils {
getLabel(options: Option[], value) { getLabel(options: Option[], value) {
let option = options.find(option => option.value === 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[] { 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 { public getFullUrl(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null): string {
let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url; 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 + 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) { if (indicatorPath.parameters) {
Object.keys(indicatorPath.parameters).forEach(key => { Object.keys(indicatorPath.parameters).forEach(key => {
let replacedValue = indicatorPath.parameters[key]; let replacedValue = indicatorPath.parameters[key];
@ -329,16 +334,6 @@ export class IndicatorUtils {
if (endYear && key == "end_year" && indicatorPath.filters["end_year"]) { if (endYear && key == "end_year" && indicatorPath.filters["end_year"]) {
replacedValue = (replacedValue > endYear) ? endYear : replacedValue; 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) 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); 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 = []; let filterSubtitleText = [];
indicatorPath.filtersApplied = 0; indicatorPath.filtersApplied = 0;
let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url; 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(stakeholder.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 (fundingL0) {
if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) {
let filterResults = this.addFilter(replacedUrl, 'fundingL0', fundingL0); let filterResults = this.addFilter(replacedUrl, 'fundingL0', fundingL0);
replacedUrl = filterResults.url; replacedUrl = filterResults.url;
indicatorPath.filtersApplied += filterResults.filtersApplied; indicatorPath.filtersApplied += filterResults.filtersApplied;
filterSubtitleText.push( "Funding level 0: " ) ; filterSubtitleText.push("Funding level 0: ");
} }
} }
if (startYear) { if (startYear) {
@ -421,7 +421,7 @@ export class IndicatorUtils {
indicatorPath.filtersApplied += filterResults.filtersApplied; indicatorPath.filtersApplied += filterResults.filtersApplied;
} }
} }
if(startYear || endYear) { if (startYear || endYear) {
filterSubtitleText.push(startYear && endYear ? (startYear + ' - ' + endYear) : (endYear ? ('until ' + endYear) : '')); filterSubtitleText.push(startYear && endYear ? (startYear + ' - ' + endYear) : (endYear ? ('until ' + endYear) : ''));
} }
if (coFunded) { if (coFunded) {
@ -429,33 +429,33 @@ export class IndicatorUtils {
let filterResults = this.addFilter(replacedUrl, 'co-funded', coFunded); let filterResults = this.addFilter(replacedUrl, 'co-funded', coFunded);
replacedUrl = filterResults.url; replacedUrl = filterResults.url;
indicatorPath.filtersApplied += filterResults.filtersApplied; 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) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) {
let filterResults = this.addFilter(replacedUrl, 'publicly-funded', publiclyFunded); let filterResults = this.addFilter(replacedUrl, 'publicly-funded', publiclyFunded);
replacedUrl = filterResults.url; replacedUrl = filterResults.url;
indicatorPath.filtersApplied += filterResults.filtersApplied; indicatorPath.filtersApplied += filterResults.filtersApplied;
filterSubtitleText.push( "Publicly funded: " + (publiclyFunded?'yes':'no') ) ; filterSubtitleText.push("Publicly funded: " + (publiclyFunded ? 'yes' : 'no'));
} }
} }
if (foslvl1) { if (foslvl1) {
if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) {
let filterResults = this.addFilter(replacedUrl, 'foslvl1', foslvl1); let filterResults = this.addFilter(replacedUrl, 'foslvl1', foslvl1);
replacedUrl = filterResults.url; replacedUrl = filterResults.url;
indicatorPath.filtersApplied +=filterResults.filtersApplied?foslvl1.length:0; indicatorPath.filtersApplied += filterResults.filtersApplied ? foslvl1.length : 0;
} }
} }
if (foslvl2) { if (foslvl2) {
if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) {
let filterResults = this.addFilter(replacedUrl, 'foslvl2', foslvl2); let filterResults = this.addFilter(replacedUrl, 'foslvl2', foslvl2);
replacedUrl = filterResults.url; replacedUrl = filterResults.url;
indicatorPath.filtersApplied += filterResults.filtersApplied?foslvl2.length:0; indicatorPath.filtersApplied += filterResults.filtersApplied ? foslvl2.length : 0;
} }
} }
if((foslvl1 && foslvl1.length > 0) || (foslvl2 && 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(", ") ) ; filterSubtitleText.push("Field of Science: " + foslvl1.join(', ') + (foslvl1.length > 0 && foslvl2.length > 0 ? ', ' : '') + foslvl2.join(", "));
} }
if (indicatorPath.parameters) { if (indicatorPath.parameters) {
Object.keys(indicatorPath.parameters).forEach(key => { 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 //if there is a parameter that is filtered and the value of the parameter changes, count the filter as applied
indicatorPath.filtersApplied++; 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) { 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) replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue)
}); });
@ -573,7 +564,7 @@ export class IndicatorUtils {
/*Chart with proper json object*/ /*Chart with proper json object*/
//apply the filter in any select fields //apply the filter in any select fields
for (let select of queries["query"]["select"]) { 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) { if (filterString) {
let filter = JSON.parse(filterString); let filter = JSON.parse(filterString);
//check if filter already exists //check if filter already exists
@ -635,21 +626,19 @@ export class IndicatorUtils {
return values.length > 1; 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, let indicator: Indicator = new Indicator(form.name, form.description, form.additionalDescription, type,
form.width, form.height, form.visibility, indicatorPaths, form.defaultId); form.width, form.height, form.visibility, indicatorPaths, form.defaultId);
indicator._id = form._id; indicator._id = form._id;
form.indicatorPaths.forEach((indicatorPath, index) => { form.indicatorPaths.forEach((indicatorPath, index) => {
indicator.indicatorPaths[index].type = indicatorPath.type; indicator.indicatorPaths[index].type = indicatorPath.type;
indicator.indicatorPaths[index].format = indicatorPath.format; indicator.indicatorPaths[index].format = indicatorPath.format;
if (addParameters) { indicatorPath.parameters.forEach(parameter => {
indicatorPath.parameters.forEach(parameter => { indicator.indicatorPaths[index].parameters[parameter.key] = parameter.value;
indicator.indicatorPaths[index].parameters[parameter.key] = parameter.value; if (parameter.key === 'type') {
if (parameter.key === 'type') { indicator.indicatorPaths[index].type = parameter.value;
indicator.indicatorPaths[index].type = parameter.value; }
} });
});
}
}); });
return indicator; return indicator;
} }
@ -663,6 +652,7 @@ export class IndicatorUtils {
let chart = JSON.parse(indicatorPath.chartObject); let chart = JSON.parse(indicatorPath.chartObject);
this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder); this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder);
this.extractStakeHolders(chart, indicatorPath, stakeholder); this.extractStakeHolders(chart, indicatorPath, stakeholder);
this.addProfile(indicatorPath);
indicatorPath.chartObject = JSON.stringify(chart); indicatorPath.chartObject = JSON.stringify(chart);
if (!jsonPath || jsonPath.length == 0 || (jsonPath.length == 1 && jsonPath[0] == "")) { if (!jsonPath || jsonPath.length == 0 || (jsonPath.length == 1 && jsonPath[0] == "")) {
indicatorPath.jsonPath = ["data", "0", "0", "0"]; indicatorPath.jsonPath = ["data", "0", "0", "0"];
@ -722,6 +712,7 @@ export class IndicatorUtils {
this.extractStakeHolders(chart, indicatorPath, stakeholder); this.extractStakeHolders(chart, indicatorPath, stakeholder);
this.extractStartYear(chart, indicatorPath); this.extractStartYear(chart, indicatorPath);
this.extractEndYear(chart, indicatorPath); this.extractEndYear(chart, indicatorPath);
this.addProfile(indicatorPath);
indicatorPath.chartObject = JSON.stringify(chart); indicatorPath.chartObject = JSON.stringify(chart);
} }
} else if (source === 'old') { } else if (source === 'old') {
@ -801,11 +792,11 @@ export class IndicatorUtils {
for (let filter of query["query"]["filters"]) { for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) { for (let gfilter of filter["groupFilters"]) {
//ignore field No Of Funders //ignore field No Of Funders
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if(replacedValue) { // don't proceed in replacement if no replaced value matches if (replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1 ) || if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1) ||
(gfilter["field"].indexOf(".funder") != -1) || (gfilter["field"].indexOf(".funder") != -1) ||
(gfilter["field"].indexOf(".funder.id") != -1)) { (gfilter["field"].indexOf(".funder.id") != -1)) {
gfilter["values"][0] = replacedValue; gfilter["values"][0] = replacedValue;
} }
} }
@ -827,10 +818,10 @@ export class IndicatorUtils {
} }
for (let filter of query["query"]["filters"]) { for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) { for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if(replacedValue) { // don't proceed in replacement if no replaced value matches if (replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(".context.name") != -1) if ((gfilter["field"].indexOf(".context.name") != -1)
|| (gfilter["field"].indexOf(".context.id") != -1)) { || (gfilter["field"].indexOf(".context.id") != -1)) {
gfilter["values"][0] = replacedValue; gfilter["values"][0] = replacedValue;
} }
} }
@ -854,10 +845,10 @@ export class IndicatorUtils {
} }
for (let filter of query["query"]["filters"]) { for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) { for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if(replacedValue) { // don't proceed in replacement if no replaced value matches if (replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(".organization.name") != -1)|| if ((gfilter["field"].indexOf(".organization.name") != -1) ||
(gfilter["field"].indexOf(".organization.id") != -1)) { (gfilter["field"].indexOf(".organization.id") != -1)) {
gfilter["values"][0] = replacedValue; gfilter["values"][0] = replacedValue;
} }
} }
@ -865,6 +856,7 @@ export class IndicatorUtils {
} }
} }
} }
private extractDatasource(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) { private extractDatasource(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
// works for .datasource.name and .HostedBy datasource // works for .datasource.name and .HostedBy datasource
// and .datasource.id // and .datasource.id
@ -880,10 +872,10 @@ export class IndicatorUtils {
} }
for (let filter of query["query"]["filters"]) { for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) { for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if(replacedValue) { // don't proceed in replacement if no replaced value matches 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)|| 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["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) {
gfilter["values"][0] = replacedValue; gfilter["values"][0] = replacedValue;
} }
} }
@ -891,6 +883,7 @@ export class IndicatorUtils {
} }
} }
} }
private extractResearcher(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) { private extractResearcher(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
// works for .orcid // works for .orcid
if (stakeholder.type != "researcher") { if (stakeholder.type != "researcher") {
@ -905,9 +898,9 @@ export class IndicatorUtils {
} }
for (let filter of query["query"]["filters"]) { for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) { for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if(replacedValue) { // don't proceed in replacement if no replaced value matches if (replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(".orcid") != -1 )) { if ((gfilter["field"].indexOf(".orcid") != -1)) {
gfilter["values"][0] = replacedValue; gfilter["values"][0] = replacedValue;
} }
} }
@ -915,19 +908,18 @@ export class IndicatorUtils {
} }
} }
} }
private replaceIndexValues(currentValue, stakeholder, parameters ){
if(currentValue == stakeholder.index_name){ private replaceIndexValues(currentValue, stakeholder) {
parameters["index_name"] = stakeholder.index_name; if (currentValue == stakeholder.index_name) {
return ChartHelper.prefix + "index_name" + ChartHelper.suffix; return ChartHelper.prefix + "index_name" + ChartHelper.suffix;
}else if(currentValue == stakeholder.index_id){ } else if (currentValue == stakeholder.index_id) {
parameters["index_id"] = stakeholder.index_id;
return ChartHelper.prefix + "index_id" + ChartHelper.suffix; return ChartHelper.prefix + "index_id" + ChartHelper.suffix;
}else if(currentValue == stakeholder.index_shortName) { } else if (currentValue == stakeholder.index_shortName) {
parameters["index_shortName"] = stakeholder.index_shortName;
return ChartHelper.prefix + "index_shortName" + ChartHelper.suffix; return ChartHelper.prefix + "index_shortName" + ChartHelper.suffix;
} }
} }
private extractStartYear(obj, indicatorPath: IndicatorPath) { private extractStartYear(obj, indicatorPath: IndicatorPath) {
let start_year; let start_year;
for (let query of obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)]) { 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) { private parameterizeDefaultQuery(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) {
let name = ""; let name = "";
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) { 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) { for (let i of index) {
if (name.split('.').length > 3 && name.split('.')[3] == "id") { if (name.split('.').length > 3 && name.split('.')[3] == "id") {
parameters[i] = ChartHelper.prefix + "index_id" + ChartHelper.suffix; 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") { } else if (name.split('.').length > 3 && name.split('.')[3] == "shortname") {
parameters[i] = ChartHelper.prefix + "index_shortName" + ChartHelper.suffix; 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") { } else if (name.split('.').length > 3 && name.split('.')[3] == "name") {
parameters[i] = ChartHelper.prefix + "index_name" + ChartHelper.suffix; parameters[i] = ChartHelper.prefix + "index_name" + ChartHelper.suffix;
indicatorPath.parameters["index_name"] = stakeholder.index_name;
} }
} }
} }

View File

@ -1,6 +1,6 @@
import {SafeResourceUrl} from "@angular/platform-browser"; import {SafeResourceUrl} from "@angular/platform-browser";
import {properties} from "../../../../environments/environment";
import {Session, User} from "../../login/utils/helper.class"; import {Session, User} from "../../login/utils/helper.class";
import {StringUtils} from "../../utils/string-utils.class";
export const ChartHelper = { export const ChartHelper = {
prefix: "((__", prefix: "((__",
@ -52,6 +52,17 @@ export class Stakeholder {
this.description = description; this.description = description;
this.topics = []; 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 { export class StakeholderInfo extends Stakeholder {

View File

@ -50,10 +50,10 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
selectedFromAndToValues: "" selectedFromAndToValues: ""
}; };
rangeFilter: RangeFilterComponent; rangeFilter: RangeFilterComponent;
minYear = Dates.currentYear - 20;
maxYear = Dates.currentYear;
public numberResults: Map<string, number> = new Map<string, number>(); public numberResults: Map<string, number> = new Map<string, number>();
public chartsActiveType: Map<string, IndicatorPath> = new Map<string, IndicatorPath>(); public chartsActiveType: Map<string, IndicatorPath> = new Map<string, IndicatorPath>();
public currentYear = new Date().getFullYear();
public clipboard; public clipboard;
/** Services */ /** Services */
@ -179,12 +179,12 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator
protected validateYearRange(navigateTo: boolean = false) { protected validateYearRange(navigateTo: boolean = false) {
let validYears = true; let validYears = true;
if (this.periodFilter.selectedToValue && (this.periodFilter.selectedToValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedToValue, Dates.currentYear - 20, Dates.currentYear))) { if (this.periodFilter.selectedToValue && (this.periodFilter.selectedToValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedToValue, this.minYear, this.maxYear))) {
this.periodFilter.selectedToValue = Dates.currentYear + ""; this.periodFilter.selectedToValue = this.maxYear + "";
validYears = false; validYears = false;
} }
if (this.periodFilter.selectedFromValue && (this.periodFilter.selectedFromValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedFromValue, Dates.currentYear - 20, Dates.currentYear))) { if (this.periodFilter.selectedFromValue && (this.periodFilter.selectedFromValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedFromValue, this.minYear, this.maxYear))) {
this.periodFilter.selectedFromValue = Dates.currentYear - 20 + ""; this.periodFilter.selectedFromValue = this.minYear + "";
validYears = false; 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)) { 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() { 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.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 : "")) : ""); (this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? " - " : "") + (this.periodFilter.selectedToValue ? this.periodFilter.selectedToValue : "")) : "");
//clear numbers when filters change //clear numbers when filters change

View File

@ -6,7 +6,6 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {map} from "rxjs/operators"; import {map} from "rxjs/operators";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {CustomOptions} from "../../services/servicesUtils/customOptions.class"; import {CustomOptions} from "../../services/servicesUtils/customOptions.class";
import {StringUtils} from "../../utils/string-utils.class";
export interface Reorder { export interface Reorder {
action: 'moved' | 'added' | 'removed', action: 'moved' | 'added' | 'removed',
@ -41,7 +40,7 @@ export class StakeholderService {
if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias || shouldUpdate) { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias || shouldUpdate) {
this.promise = new Promise<void>((resolve, reject) => { this.promise = new Promise<void>((resolve, reject) => {
this.sub = this.http.get<Stakeholder>(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => { this.sub = this.http.get<Stakeholder>(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => {
return this.formalize(this.checkIsUpload(stakeholder)); return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder));
})).subscribe(stakeholder => { })).subscribe(stakeholder => {
this.stakeholderSubject.next(stakeholder); this.stakeholderSubject.next(stakeholder);
resolve(); resolve();
@ -53,23 +52,24 @@ export class StakeholderService {
} }
return from(this.getStakeholderAsync()); return from(this.getStakeholderAsync());
} }
getResearcherStakeholder( orcid, name, results, shouldUpdate: boolean = false): Observable<Stakeholder> {
getResearcherStakeholder(orcid, name, results, shouldUpdate: boolean = false): Observable<Stakeholder> {
if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== orcid || shouldUpdate) { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== orcid || shouldUpdate) {
this.promise = new Promise<void>((resolve, reject) => { this.promise = new Promise<void>((resolve, reject) => {
this.sub = this.http.get<Stakeholder>(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent("researcher"), CustomOptions.registryOptions()).pipe(map(stakeholder => { this.sub = this.http.get<Stakeholder>(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent("researcher"), CustomOptions.registryOptions()).pipe(map(stakeholder => {
return this.formalize(this.checkIsUpload(stakeholder)); return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder));
})).subscribe(stakeholder => { })).subscribe(stakeholder => {
stakeholder.index_id = orcid; stakeholder.index_id = orcid;
stakeholder.index_name = name; stakeholder.index_name = name;
stakeholder.name = name; stakeholder.name = name;
stakeholder.alias = orcid; stakeholder.alias = orcid;
if(results <7 && stakeholder.topics[0]?.categories[0]?.subCategories[0]){ 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 stakeholder.topics[0].categories[0].subCategories[0].charts = []; // keep only numbers - charts wont show much anyway
} }
this.stakeholderSubject.next(stakeholder); this.stakeholderSubject.next(stakeholder);
resolve(); resolve();
}, error => { }, 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); this.stakeholderSubject.next(stakeholder);
resolve(); resolve();
}); });
@ -89,25 +89,25 @@ export class StakeholderService {
getAlias(url: string): Observable<string[]> { getAlias(url: string): Observable<string[]> {
return this.http.get<Stakeholder[]>(url + '/stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => { return this.http.get<Stakeholder[]>(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)[]> { getStakeholders(url: string, type: string = null, defaultId: string = null): Observable<(Stakeholder & StakeholderInfo)[]> {
return this.http.get<Stakeholder[]>(url + '/stakeholder' + ((type) ? ('?type=' + type) : '') + ((!type && defaultId) ? ('?defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { return this.http.get<Stakeholder[]>(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)[]> { getMyStakeholders(url: string, type: string = null): Observable<(Stakeholder & StakeholderInfo)[]> {
return this.http.get<Stakeholder[]>(url + '/my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { return this.http.get<Stakeholder[]>(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<Stakeholder[]> { getDefaultStakeholders(url: string, type: string = null): Observable<Stakeholder[]> {
return this.http.get<Stakeholder[]>(url + '/stakeholder/default' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { return this.http.get<Stakeholder[]>(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); stakeholder.alias = stakeholder.alias.slice(1);
} }
return this.http.post<Stakeholder>(url + '/build-stakeholder', stakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => { return this.http.post<Stakeholder>(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); path = HelperFunctions.encodeArray(path);
return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') + return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
'/save', element, CustomOptions.registryOptions()).pipe(map(element => { '/save', element, CustomOptions.registryOptions()).pipe(map(element => {
if (path.length === 0) { if (path.length === 0) {
return this.formalize(this.checkIsUpload(element)); return HelperFunctions.copy(Stakeholder.checkIsUpload(element));
} else { } else {
return this.formalize(element); return HelperFunctions.copy(element);
} }
})); }));
} }
@ -142,11 +142,11 @@ export class StakeholderService {
saveBulkElements(url: string, indicators, path: string[] = []): Observable<any> { saveBulkElements(url: string, indicators, path: string[] = []): Observable<any> {
path = HelperFunctions.encodeArray(path); path = HelperFunctions.encodeArray(path);
return this.http.post<any>(url + ((path.length > 0) ? '/' : '') + path.join('/') + return this.http.post<any>(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) { if (path.length === 0) {
return this.formalize(this.checkIsUpload(element)); return HelperFunctions.copy(Stakeholder.checkIsUpload(element));
} else { } 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<Section> { saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable<Section> {
path = HelperFunctions.encodeArray(path); path = HelperFunctions.encodeArray(path);
return this.http.post<Section>(url + ((path.length > 0) ? '/' : '') + path.join('/') + return this.http.post<Section>(url + ((path.length > 0) ? '/' : '') + path.join('/') +
'/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => { '/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => {
return this.formalize(element); return HelperFunctions.copy(element);
})); }));
} }
@ -176,7 +176,7 @@ export class StakeholderService {
reorderIndicators(url: string, path: string[], reorder: Reorder, type: string = 'chart'): Observable<Indicator[]> { reorderIndicators(url: string, path: string[], reorder: Reorder, type: string = 'chart'): Observable<Indicator[]> {
path = HelperFunctions.encodeArray(path); path = HelperFunctions.encodeArray(path);
return this.http.post<Indicator[]>(url + '/' + path.join('/') + '/' + type + '/reorder', reorder, CustomOptions.registryOptions()).pipe(map(indicators => { return this.http.post<Indicator[]>(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) { setStakeholder(stakeholder: Stakeholder) {
this.stakeholderSubject.next(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);
}
} }

View File

@ -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 { }

View File

@ -9,14 +9,15 @@ import {MyOrcidLinksComponent} from "./myOrcidLinks.component";
import {SearchResearchResultsServiceModule} from "../../services/searchResearchResultsService.module"; import {SearchResearchResultsServiceModule} from "../../services/searchResearchResultsService.module";
import {SearchMyOrcidResultsModule} from "./searchMyOrcidResults.module"; import {SearchMyOrcidResultsModule} from "./searchMyOrcidResults.module";
import {AlertModalModule} from "../../utils/modal/alertModal.module"; import {AlertModalModule} from "../../utils/modal/alertModal.module";
import {PiwikServiceModule} from "../../utils/piwik/piwikService.module"; import {MyOrcidLinksRoutingModule} from "./myOrcidLinks-routing.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, CommonModule, FormsModule,
MyOrcidLinksRoutingModule,
RouterModule, ErrorMessagesModule, RouterModule, ErrorMessagesModule,
ResultPreviewModule, SearchResearchResultsServiceModule, SearchMyOrcidResultsModule, ResultPreviewModule, SearchResearchResultsServiceModule, SearchMyOrcidResultsModule,
AlertModalModule, PiwikServiceModule AlertModalModule
], ],
declarations: [ declarations: [
MyOrcidLinksComponent MyOrcidLinksComponent

View File

@ -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 { }

View File

@ -5,8 +5,6 @@ import {RouterModule} from '@angular/router';
import {OrcidComponent} from './orcid.component'; import {OrcidComponent} from './orcid.component';
import {OrcidService} from './orcid.service'; 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 {OrcidWorkComponent} from './orcid-work.component';
import {AlertModalModule} from '../utils/modal/alertModal.module'; import {AlertModalModule} from '../utils/modal/alertModal.module';
import {ResultLandingService} from '../landingPages/result/resultLanding.service'; 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 {orcid_add, orcid_bin} from "../utils/icons/icons";
import {FullScreenModalModule} from "../utils/modal/full-screen-modal/full-screen-modal.module"; import {FullScreenModalModule} from "../utils/modal/full-screen-modal/full-screen-modal.module";
import {LogServiceModule} from "../utils/log/LogService.module"; import {LogServiceModule} from "../utils/log/LogService.module";
import {OrcidRoutingModule} from "./orcid-routing.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule, CommonModule, RouterModule, OrcidRoutingModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule,
IconsModule, FullScreenModalModule, LogServiceModule IconsModule, FullScreenModalModule, LogServiceModule
], ],
declarations: [ declarations: [
@ -28,7 +27,6 @@ import {LogServiceModule} from "../utils/log/LogService.module";
OrcidWorkComponent OrcidWorkComponent
], ],
providers:[ providers:[
FreeGuard, PreviousRouteRecorder,
OrcidService, ResultLandingService OrcidService, ResultLandingService
], ],
exports: [ exports: [

View File

@ -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 { }

View File

@ -8,22 +8,23 @@ import {SearchRecommendedResultsForOrcidComponent} from './searchRecommendedResu
import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module'; import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module';
import {SearchFormModule} from '../../searchPages/searchUtils/searchForm.module'; import {SearchFormModule} from '../../searchPages/searchUtils/searchForm.module';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
import {SearchResearchResultsModule} from "../../searchPages/searchResearchResults.module"; import {SearchResearchResultsModule} from "../../searchPages/searchResearchResults.module";
import {OrcidService} from "../orcid.service"; import {OrcidService} from "../orcid.service";
import {SearchRecommendedResultsForOrcidRoutingModule} from "./searchRecommendedResultsForOrcid-routing.module";
// import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; // import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, FormsModule, CommonModule, FormsModule,
RouterModule, RouterModule,
SearchRecommendedResultsForOrcidRoutingModule,
SearchFormModule, SearchResearchResultsModule, SearchFormModule, SearchResearchResultsModule,
// , BreadcrumbsModule // , BreadcrumbsModule
], ],
declarations: [ declarations: [
SearchRecommendedResultsForOrcidComponent SearchRecommendedResultsForOrcidComponent
], ],
providers:[ IsRouteEnabled, OrcidService], providers:[OrcidService],
exports: [ exports: [
SearchRecommendedResultsForOrcidComponent SearchRecommendedResultsForOrcidComponent
] ]

View File

@ -6,8 +6,6 @@ import { RouterModule } from '@angular/router';
import{ReloadRoutingModule } from './reload-routing.module'; import{ReloadRoutingModule } from './reload-routing.module';
import{ReloadComponent} from './reload.component'; import{ReloadComponent} from './reload.component';
import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard';
import {LoadingModule} from "../utils/loading/loading.module"; import {LoadingModule} from "../utils/loading/loading.module";
@NgModule({ @NgModule({
@ -19,9 +17,7 @@ import {LoadingModule} from "../utils/loading/loading.module";
declarations: [ declarations: [
ReloadComponent ReloadComponent
], ],
providers:[ providers:[],
PreviousRouteRecorder
],
exports: [ exports: [
ReloadComponent ReloadComponent
] ]

View File

@ -2,14 +2,11 @@ import {CommonModule} from "@angular/common";
import {NgModule} from "@angular/core"; import {NgModule} from "@angular/core";
import {FormsModule} from "@angular/forms"; import {FormsModule} from "@angular/forms";
import {RouterModule} from "@angular/router"; import {RouterModule} from "@angular/router";
import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard";
import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module";
import {RefineFieldResultsServiceModule} from "../services/refineFieldResultsService.module"; import {RefineFieldResultsServiceModule} from "../services/refineFieldResultsService.module";
import {LoadingModule} from "../utils/loading/loading.module"; import {LoadingModule} from "../utils/loading/loading.module";
import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module"; import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module"; import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module";
import {PiwikService} from "../utils/piwik/piwik.service";
import {SdgRoutingModule} from './sdg-routing.module'; import {SdgRoutingModule} from './sdg-routing.module';
import {SdgComponent} from './sdg.component'; import {SdgComponent} from './sdg.component';
@ -22,9 +19,7 @@ import {SdgComponent} from './sdg.component';
declarations: [ declarations: [
SdgComponent SdgComponent
], ],
providers: [ providers: [],
PreviousRouteRecorder, PiwikService
],
exports: [ exports: [
SdgComponent SdgComponent
] ]

View File

@ -23,7 +23,8 @@ import {EnvProperties} from '../../utils/properties/env-properties';
import {SEOService} from '../../sharedComponents/SEO/SEO.service'; import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {StringUtils} from '../../utils/string-utils.class'; import {StringUtils} from '../../utils/string-utils.class';
import {SearchCustomFilter} from "../searchUtils/searchUtils.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 {AdvancedField, Filter} from "../searchUtils/searchHelperClasses.class";
import {SearchResearchResultsComponent} from "../searchResearchResults.component"; import {SearchResearchResultsComponent} from "../searchResearchResults.component";
import {SearchProjectsComponent} from "../searchProjects.component"; import {SearchProjectsComponent} from "../searchProjects.component";
@ -219,9 +220,14 @@ export class SearchAllComponent {
loadAll() { loadAll() {
this.reloadTabs(); 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.parameters = Object.assign({}, queryParams);
this.keyword = (queryParams['keyword']) ? queryParams['keyword'] : (queryParams["q"] ? queryParams["q"] : (queryParams["f0"] && queryParams["f0"] == "q" && queryParams["fv0"]?queryParams["fv0"]:"")); 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); 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; active = ((["result","projects","organizations","datasources","services"]).indexOf(queryParams["active"])!= -1)?queryParams["active"]:null;
delete this.parameters['active']; delete this.parameters['active'];
} }
// if(this.activeEntity == null) {
if(this.activeEntity == null) { if (this.activeEntity == null && (!params["entity"] || params["entity"].length == 0) && (!active || this.activeEntity != active)) {
if (this.activeEntity == null && (!params["entity"] || params["entity"].length == 0)) {
if (active) { if (active) {
this.activeEntity = active; this.activeEntity = active;
if ((typeof document !== 'undefined')) { if ((typeof document !== 'undefined')) {
@ -261,7 +266,7 @@ export class SearchAllComponent {
} }
this.activeEntity = ((["result", "projects", "organizations", "datasources", "services"]).indexOf(entity) != -1) ? entity : this.getDefaultEntityToShow(); this.activeEntity = ((["result", "projects", "organizations", "datasources", "services"]).indexOf(entity) != -1) ? entity : this.getDefaultEntityToShow();
} }
} // }
if (this.activeEntity == "result") { if (this.activeEntity == "result") {
this.searchResults(); this.searchResults();
} else if (this.activeEntity == "projects") { } else if (this.activeEntity == "projects") {
@ -274,7 +279,7 @@ export class SearchAllComponent {
this.searchOrganizations(); this.searchOrganizations();
} }
this.count(); this.count();
})); // }));
})); }));
} }

View File

@ -12,7 +12,6 @@ import {SearchResearchResultsServiceModule} from '../../services/searchResearchR
import {OrganizationsServiceModule} from '../../services/organizationsService.module'; import {OrganizationsServiceModule} from '../../services/organizationsService.module';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import {PiwikServiceModule} from '../../utils/piwik/piwikService.module';
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import {SearchAllComponent} from "./searchAll.component"; import {SearchAllComponent} from "./searchAll.component";
import {AdvancedSearchFormModule} from "../searchUtils/advancedSearchForm.module"; import {AdvancedSearchFormModule} from "../searchUtils/advancedSearchForm.module";
@ -20,7 +19,6 @@ import {SearchResearchResultsModule} from "../searchResearchResults.module";
import {SearchProjectsModule} from "../searchProjects.module"; import {SearchProjectsModule} from "../searchProjects.module";
import {SearchOrganizationsModule} from "../searchOrganizations.module"; import {SearchOrganizationsModule} from "../searchOrganizations.module";
import {SearchDataProvidersModule} from "../searchDataProviders.module"; import {SearchDataProvidersModule} from "../searchDataProviders.module";
import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard";
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module"; import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
import {SliderTabsModule} from "../../sharedComponents/tabs/slider-tabs.module"; import {SliderTabsModule} from "../../sharedComponents/tabs/slider-tabs.module";
import {NumberRoundModule} from "../../utils/pipes/number-round.module"; import {NumberRoundModule} from "../../utils/pipes/number-round.module";
@ -31,15 +29,13 @@ import {GroupedRequestsServiceModule} from "../../services/groupedRequestsServic
CommonModule, FormsModule, RouterModule, CommonModule, FormsModule, RouterModule,
DataProvidersServiceModule, ProjectsServiceModule, DataProvidersServiceModule, ProjectsServiceModule,
SearchResearchResultsServiceModule, OrganizationsServiceModule, 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 GroupedRequestsServiceModule
], ],
declarations: [ declarations: [
SearchAllComponent SearchAllComponent
], ],
providers:[ providers:[],
PreviousRouteRecorder
],
exports: [ exports: [
SearchAllComponent SearchAllComponent
] ]

View File

@ -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._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( // this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, this.entityType, this.properties, this.refineQuery).subscribe(
res => { res => {
let filter: Filter = res[1][0]; let filter: Filter = res[2][0];
if(filter.values.length == 0) { if(filter.values.length == 0) {
filter = oldFilter; filter = oldFilter;
filter.countAllValues = 0; filter.countAllValues = 0;

View File

@ -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._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( // this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "organization", this.properties, this.refineQuery).subscribe(
res => { res => {
let filter: Filter = res[1][0]; let filter: Filter = res[2][0];
if(filter.values.length == 0) { if(filter.values.length == 0) {
filter = oldFilter; filter = oldFilter;
filter.countAllValues = 0; filter.countAllValues = 0;

View File

@ -1,7 +1,6 @@
import {NgModule} from '@angular/core'; import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common'; import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms'; import {FormsModule} from '@angular/forms';
import {IsRouteEnabled} from '../error/isRouteEnabled.guard';
import {NewSearchPageModule} from "./searchUtils/newSearchPage.module"; import {NewSearchPageModule} from "./searchUtils/newSearchPage.module";
import {OrganizationsServiceModule} from "../services/organizationsService.module"; import {OrganizationsServiceModule} from "../services/organizationsService.module";
import {SearchOrganizationsComponent} from "./searchOrganizations.component"; import {SearchOrganizationsComponent} from "./searchOrganizations.component";

View File

@ -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._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( // this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "project", this.properties, this.refineQuery).subscribe(
res => { res => {
let filter: Filter = res[1][0]; let filter: Filter = res[2][0];
if(filter.values.length == 0) { if(filter.values.length == 0) {
filter = oldFilter; filter = oldFilter;
filter.countAllValues = 0; filter.countAllValues = 0;

View File

@ -1,101 +1,103 @@
<ng-template #selected_filters_pills> <ng-template #selected_filters_pills>
<h1> <h1 class="uk-margin-remove">
<div class="uk-slider filters-slider" uk-slider="finite: true"> <div [class.uk-invisible]="list.children.length === 0">
<div [class.uk-invisible]="list.children.length === 0" class="uk-position-relative"> <ul #list class="uk-grid uk-grid-small uk-flex-wrap" uk-grid>
<div class="uk-slider-container"> <ng-container *ngFor="let customFilter of customFilters">
<ul #list class="uk-slider-items uk-grid uk-grid-small uk-margin-small-right uk-flex-nowrap" style="padding-bottom: 1px"> <ng-container *ngIf="customFilter.isHiddenFilter">
<ng-container *ngFor="let customFilter of customFilters"> <li class="uk-flex uk-flex-middle">
<ng-container *ngIf="customFilter.isHiddenFilter"> <span class="uk-label uk-label-small uk-label-secondary uk-text-truncate target1">
<li class="uk-flex uk-flex-middle"> {{customFilter.valueName}}
<span class="uk-label uk-label-secondary uk-text-truncate"> </span>
{{customFilter.valueName}} </li>
</ng-container>
</ng-container>
<ng-container *ngIf="resultTypes && resultTypes.countSelectedValues > 0">
<ng-container *ngFor="let type of resultTypes.values; let i = index;">
<ng-container *ngIf="type.selected">
<li class="">
<span class="uk-label uk-label-small uk-label-primary uk-flex uk-flex-middle target2">
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{type.name}}</span>
<button [class.uk-disabled]="disabled" (click)="removeResultType(type.id)" class="uk-close uk-icon" [disabled]="disabled">
<icon name="close" flex="true" ratio="0.7"></icon>
</button>
</span>
</li>
</ng-container>
</ng-container>
</ng-container>
<ng-container *ngIf="selectedRangeFilters > 0">
<ng-container *ngFor="let filter of rangeFilters ">
<ng-container *ngIf="filter.selectedFromAndToValues">
<li class="">
<span class="uk-label uk-label-small uk-label-primary uk-flex uk-flex-middle target3">
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{filter.selectedFromAndToValues}}</span>
<button [class.uk-disabled]="disabled" (click)="removeRangeFilter(filter)" class="uk-close uk-icon" [disabled]="disabled">
<icon name="close" flex="true" ratio="0.7"></icon>
</button>
</span>
</li>
</ng-container>
</ng-container>
</ng-container>
<ng-container *ngFor="let filter of staticFilters">
<ng-container *ngIf="filter.countSelectedValues > 0">
<ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; ">
<li *ngIf="!customFilter || (customFilter.isHiddenFilter && customFilter.valueId != value.id)"
class="">
<span class="uk-label uk-label-small uk-label-primary uk-flex uk-flex-middle target4">
<span
class="uk-margin-small-right uk-width-expand uk-text-truncate">
<ng-container *ngIf="filter.type && (filter.type == 'boolean' || filter.type == 'triplet') else noboolean">
<span>{{filter.title}}:
{{(value.name=='true'||value.name=='Yes')?'Yes':'No'}}
</span>
</ng-container>
<ng-template #noboolean>
<span [attr.title]="value.name" *ngIf="value.name.length > filterPillCharactersLimit">
{{value.name | slice:0:filterPillCharactersLimit}}...
</span>
<span *ngIf="value.name.length <= filterPillCharactersLimit">
{{value.name}}
</span>
</ng-template>
</span> </span>
</li> <button [class.uk-disabled]="disabled" (click)="removeFilter(value, filter)" class="uk-close uk-icon" [disabled]="disabled">
<icon name="close" flex="true" ratio="0.7"></icon>
</button>
</span>
</li>
</ng-container> </ng-container>
</ng-container> </ng-container>
<ng-container *ngIf="resultTypes && resultTypes.countSelectedValues > 0"> </ng-container>
<ng-container *ngFor="let type of resultTypes.values; let i = index;"> <ng-container *ngFor="let filter of filters ">
<ng-container *ngIf="type.selected"> <ng-container *ngIf="filter.countSelectedValues > 0">
<li class=""> <ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; ">
<span class="uk-label uk-label-primary uk-flex uk-flex-middle"> <li *ngIf="!customFilters || (customFilters[0].isHiddenFilter && customFilters[0].valueId != value.id)">
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{type.name}}</span> <span class="uk-label uk-label-small uk-label-primary uk-flex uk-flex-middle target5">
<button [class.uk-disabled]="disabled" (click)="removeResultType(type.id)" class="uk-close uk-icon" [disabled]="disabled"> <span class="uk-margin-small-right uk-width-expand uk-text-truncate">
<icon name="close" flex="true" ratio="0.7"></icon> <ng-container *ngIf="filter.type && (filter.type == 'boolean' || filter.type == 'triplet') else noboolean">
</button> <span>{{filter.title}}:
</span> {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}}
</li> </span>
</ng-container> </ng-container>
</ng-container> <ng-template #noboolean>
</ng-container> <span [attr.title]="value.name" *ngIf="value.name.length > filterPillCharactersLimit">
<ng-container *ngIf="selectedRangeFilters > 0"> {{value.name | slice:0:filterPillCharactersLimit}}...
<ng-container *ngFor="let filter of rangeFilters "> </span>
<ng-container *ngIf="filter.selectedFromAndToValues"> <span *ngIf="value.name.length <= filterPillCharactersLimit">
<li class="">
<span class="uk-label uk-label-primary uk-flex uk-flex-middle">
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{filter.selectedFromAndToValues}}</span>
<button [class.uk-disabled]="disabled" (click)="removeRangeFilter(filter)" class="uk-close uk-icon" [disabled]="disabled">
<icon name="close" flex="true" ratio="0.7"></icon>
</button>
</span>
</li>
</ng-container>
</ng-container>
</ng-container>
<ng-container *ngFor="let filter of staticFilters">
<ng-container *ngIf="filter.countSelectedValues > 0">
<ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; ">
<li *ngIf="!customFilter || (customFilter.isHiddenFilter && customFilter.valueId != value.id)"
class="">
<span class="uk-label uk-label-primary uk-flex uk-flex-middle">
<span
class="uk-margin-small-right uk-width-expand uk-text-truncate">
<ng-container *ngIf="filter.type && (filter.type == 'boolean' || filter.type == 'triplet') else noboolean">
<!-- *ngIf="filter.type == 'boolean'"-->
<span>{{filter.title}}:
{{(value.name=='true'||value.name=='Yes')?'Yes':'No'}}
</span>
<!-- <span *ngIf="filter.type == 'triplet'">{{value.name=='true'?'':'Not '}}{{filter.title}}</span>-->
</ng-container>
<ng-template #noboolean>
{{value.name}} {{value.name}}
</ng-template></span> </span>
<button [class.uk-disabled]="disabled" (click)="removeFilter(value, filter)" class="uk-close uk-icon" [disabled]="disabled"> </ng-template>
<icon name="close" flex="true" ratio="0.7"></icon> </span>
</button> <button [class.uk-disabled]="disabled" (click)="removeFilter(value, filter)" class="uk-close uk-icon" [disabled]="disabled">
</span> <icon name="close" flex="true" ratio="0.7"></icon>
</li> </button>
</ng-container> </span>
</ng-container> </li>
</ng-container> </ng-container>
<ng-container *ngFor="let filter of filters "> </ng-container>
<ng-container *ngIf="filter.countSelectedValues > 0"> </ng-container>
<ng-container *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; "> </ul>
<li *ngIf="!customFilters || (customFilters[0].isHiddenFilter && customFilters[0].valueId != value.id)"
class="">
<span class="uk-label uk-label-primary uk-flex uk-flex-middle">
<span
class="uk-margin-small-right uk-width-expand uk-text-truncate">
<ng-container *ngIf="filter.type && (filter.type == 'boolean' || filter.type == 'triplet') else noboolean">
<span>{{filter.title}}:
{{(value.name=='true'||value.name=='Yes')?'Yes':'No'}}
</span>
</ng-container>
<ng-template #noboolean>
{{value.name}}
</ng-template></span>
<button [class.uk-disabled]="disabled" (click)="removeFilter(value, filter)" class="uk-close uk-icon" [disabled]="disabled">
<icon name="close" flex="true" ratio="0.7"></icon>
</button>
</span>
</li>
</ng-container>
</ng-container>
</ng-container>
</ul>
</div>
<a class="uk-position-center-left uk-blur-background" uk-slider-item="previous"><span uk-icon="chevron-left"></span></a>
<a class="uk-position-center-right uk-blur-background" uk-slider-item="next"><span uk-icon="chevron-right"></span></a>
</div>
</div> </div>
</h1> </h1>
</ng-template> </ng-template>
@ -170,10 +172,6 @@
<ng-container *ngFor="let filter of filters "> <ng-container *ngFor="let filter of filters ">
<li *ngIf="filter.values && filter.values.length > 0 <li *ngIf="filter.values && filter.values.length > 0
&& filter.filterId != 'resultbestaccessright' && filter.filterId != 'instancetypename' && filter.filterId != 'projectoamandatepublications'"> && filter.filterId != 'resultbestaccessright' && filter.filterId != 'instancetypename' && filter.filterId != 'projectoamandatepublications'">
<!-- <search-filter [filterValuesNum]="filterValuesNum" [showMoreInline]="showMoreFilterValuesInline"-->
<!-- [isDisabled]="disabled"-->
<!-- [filter]="filter" [showResultCount]=showResultCount-->
<!-- (onFilterChange)="filterChanged($event)" [actionRoute]="true"></search-filter>-->
<ng-container *ngTemplateOutlet="search_filter; context: {filter: filter, showResultCount: showResultCount}"></ng-container> <ng-container *ngTemplateOutlet="search_filter; context: {filter: filter, showResultCount: showResultCount}"></ng-container>
</li> </li>
</ng-container> </ng-container>
@ -190,31 +188,7 @@
</ul> </ul>
</div> </div>
</ng-template> </ng-template>
<ng-template #sorting let-mobile="mobile">
<div *ngIf="searchUtils.totalResults > 10 || sort || searchUtils.totalResults > searchUtils.size ||
(!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING)"
class="uk-grid uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m" uk-grid>
<div>
<div class="uk-grid uk-flex-middle uk-grid-column-collapse" uk-grid>
<div *ngIf="searchUtils.totalResults > 10 && !mobile" class="uk-width-small uk-margin-right">
<div input type="select" placeholder="Results per page" inputClass="flat x-small"
[options]="pageOptions" [(value)]="searchUtils.size" [disabled]="disabled"
(valueChange)="sizeChanged($event)"></div>
</div>
<search-sorting *ngIf="sort && searchUtils.totalResults > 0"
[entityType]="entityType" [sortBy]="searchUtils.sortBy"
(sortByChange)="sortByChanged($event)"
[isDisabled]="disabled">
</search-sorting>
</div>
</div>
<search-paging *ngIf="!mobile" [type]="type" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults"
[searchUtils]="searchUtils" [results]="results" [baseUrl]="searchUtils.baseUrl"
[parameterNames]="parameterNames" [parameterValues]="parameterValues"
[isDisabled]="disabled">
</search-paging>
</div>
</ng-template>
<ng-template #main let-mobile="mobile"> <ng-template #main let-mobile="mobile">
<div *ngIf="mobile && showRefine && (searchUtils.refineStatus != errorCodes.LOADING || existingFiltersWithValues !== 0)" <div *ngIf="mobile && showRefine && (searchUtils.refineStatus != errorCodes.LOADING || existingFiltersWithValues !== 0)"
class="filters-toggle-button"> class="filters-toggle-button">
@ -294,9 +268,6 @@
<icon name="close" ratio="1.5" visuallyHidden="close filters"></icon> <icon name="close" ratio="1.5" visuallyHidden="close filters"></icon>
</a> </a>
<div *ngIf="showOffCanvas" class="uk-padding-small uk-padding-remove-vertical"> <div *ngIf="showOffCanvas" class="uk-padding-small uk-padding-remove-vertical">
<div class="uk-margin-medium-top">
<ng-container *ngTemplateOutlet="sorting; context: {mobile: mobile}"></ng-container>
</div>
<div class="uk-margin-medium-top"> <div class="uk-margin-medium-top">
<ng-container *ngTemplateOutlet="filters_column; context: {}"></ng-container> <ng-container *ngTemplateOutlet="filters_column; context: {}"></ng-container>
</div> </div>
@ -315,7 +286,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="uk-container" [class.uk-container-large]="!mobile" [class.uk-container-expand]="mobile" [class.uk-padding-remove-horizontal]="mobile"> <div class="uk-container uk-margin-top" [class.uk-container-large]="!mobile" [class.uk-container-expand]="mobile" [class.uk-padding-remove-horizontal]="mobile">
<div class="uk-grid uk-margin-large-bottom" [class.uk-margin-top]="!mobile" uk-grid> <div class="uk-grid uk-margin-large-bottom" [class.uk-margin-top]="!mobile" uk-grid>
<div *ngIf="!mobile && showRefine && (results.length > 0 || (searchUtils.refineStatus == errorCodes.LOADING && searchUtils.status != errorCodes.LOADING) || (!hideFilters && <div *ngIf="!mobile && showRefine && (results.length > 0 || (searchUtils.refineStatus == errorCodes.LOADING && searchUtils.status != errorCodes.LOADING) || (!hideFilters &&
(existingFiltersWithValues > 0 || (selectedRangeFilters + selectedFilters + selectedTypesNum) > 0))) " (existingFiltersWithValues > 0 || (selectedRangeFilters + selectedFilters + selectedTypesNum) > 0))) "
@ -337,31 +308,10 @@
[href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)" [href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)"
target="_blank"> OpenAIRE - Explore</a>. target="_blank"> OpenAIRE - Explore</a>.
</div> </div>
<div class="uk-flex uk-flex-middle uk-flex-wrap uk-child-width-1-1 uk-child-width-auto@m" [class.uk-flex-between]="!mobile" <ng-container *ngIf="mobile">
[class.uk-margin-top]="mobile">
<!-- Total results, number of pages -->
<div class="uk-width-expand@m uk-margin-remove-bottom uk-text-truncate" [class.uk-margin-medium-right]="!mobile" [class.uk-h6]="!mobile" [class.uk-text-center]="mobile">
<ng-container *ngIf="results && searchUtils.totalResults > 0">
<span>{{searchUtils.totalResults|number}}</span>
<span class="uk-text-meta uk-text-capitalize"> {{type}}</span>
<ng-container *ngIf="searchTerm && simpleView">
<span class="uk-text-meta"> for </span>
<span class="uk-text-bold">{{searchTerm}}</span>
</ng-container>
<ng-container *ngIf="!simpleView && advancedSearchTerms > 0">
<span class="uk-text-bold"> ({{advancedSearchTerms}} rule{{advancedSearchTerms == 1 ? '' : 's'}} applied)</span>
</ng-container>
</ng-container>
<ng-container *ngIf="!loadPaging && oldTotalResults > 0 && searchUtils.status == errorCodes.LOADING">
<span>{{oldTotalResults|number}}</span>
<span class="uk-text-meta uk-text-capitalize"> {{type}}, page </span>
<span>{{searchUtils.page | number}}</span>
<span class="uk-text-meta"> of {{(totalPages(oldTotalResults)|number)}}</span>
</ng-container>
</div>
<!-- Download results --> <!-- Download results -->
<div *ngIf="showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)" <div *ngIf="showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)"
class="uk-margin-small-bottom uk-flex uk-margin-small-top" [class.uk-flex-center]="mobile" [class.uk-margin-medium-top]="mobile"> class="uk-margin-small-bottom uk-flex uk-flex-center">
<search-download <search-download
*ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'" *ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'"
[isDisabled]="disabled" [isDisabled]="disabled"
@ -373,12 +323,41 @@
</a> </a>
</ng-container> </ng-container>
</div> </div>
</div> </ng-container>
<div *ngIf="(searchUtils.status !== errorCodes.LOADING || !loadPaging) && !mobile" class="uk-margin-top"> <div *ngIf="(searchUtils.status !== errorCodes.LOADING || !loadPaging) && !mobile" class="uk-flex uk-flex-top">
<ng-container *ngTemplateOutlet="selected_filters_pills;"></ng-container> <!-- filters pills -->
</div> <div class="uk-width-expand@m">
<div *ngIf="!mobile" class="uk-margin-medium-topuk-margin-medium-top"> <ng-container *ngTemplateOutlet="selected_filters_pills;"></ng-container>
<ng-container *ngTemplateOutlet="sorting; context: {mobile: mobile}"></ng-container> </div>
<div class="uk-width-auto@m uk-margin-medium-left uk-flex uk-flex-middle">
<div *ngIf="searchUtils.totalResults > 10 || sort || searchUtils.totalResults > searchUtils.size ||
(!loadPaging && oldTotalResults > searchUtils.size && searchUtils.status == errorCodes.LOADING)"
class="uk-grid uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m" uk-grid>
<div>
<div class="uk-grid uk-flex-middle uk-grid-column-collapse" uk-grid>
<search-sorting *ngIf="sort && searchUtils.totalResults > 0"
[entityType]="entityType" [sortBy]="searchUtils.sortBy"
(sortByChange)="sortByChanged($event)"
[isDisabled]="disabled">
</search-sorting>
</div>
</div>
</div>
<!-- Download results -->
<div *ngIf="showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)"
class="uk-margin-small-left uk-flex uk-flex-middle" [class.uk-flex-center]="mobile" [class.uk-margin-medium-top]="mobile">
<search-download
*ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'"
[isDisabled]="disabled"
[type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults">
</search-download>
<ng-container *ngIf="properties.zenodoDumpUrl && entityType == 'result'">
<a [href]="properties.zenodoDumpUrl" target="_blank" class=" uk-margin-left uk-button uk-button-link uk-flex uk-flex-middle">
<img src="assets/common-assets/common/zenodoDump.png" width="20"><span class="uk-margin-xsmall-left">Data dump</span>
</a>
</ng-container>
</div>
</div>
</div> </div>
<div [class]="searchUtils.page > pagingLimit ? 'search-results' : ''" <div [class]="searchUtils.page > pagingLimit ? 'search-results' : ''"
*ngIf="(searchUtils.page >= pagingLimit) && (searchUtils.totalResults > searchUtils.size*pagingLimit)"> *ngIf="(searchUtils.page >= pagingLimit) && (searchUtils.totalResults > searchUtils.size*pagingLimit)">

View File

@ -131,6 +131,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
public parameterNames: string[] = []; public parameterNames: string[] = [];
public parameterValues: string[] = []; public parameterValues: string[] = [];
filterPillCharactersLimit: number = 35;
public csvLimit: number = 0; public csvLimit: number = 0;
public pagingLimit: number = 0; public pagingLimit: number = 0;
public resultsPerPage: number = 0; public resultsPerPage: number = 0;

View File

@ -13,8 +13,6 @@ import {SearchPagingModule} from './searchPaging.module';
import {SearchSortingModule} from './searchSorting.module'; import {SearchSortingModule} from './searchSorting.module';
import {SearchDownloadModule} from './searchDownload.module'; import {SearchDownloadModule} from './searchDownload.module';
import {ModalModule} from '../../utils/modal/modal.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 {HelperModule} from '../../utils/helper/helper.module';
import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module'; import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
@ -39,7 +37,7 @@ import {graph} from "../../utils/icons/icons";
LoadingModalModule, ReportsServiceModule, LoadingModalModule, ReportsServiceModule,
SearchPagingModule, SearchSortingModule, SearchDownloadModule, ModalModule, SearchPagingModule, SearchSortingModule, SearchDownloadModule, ModalModule,
SearchFilterModule, RangeFilterModule, SearchFilterModule, RangeFilterModule,
PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule, HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule,
SearchResultsInDepositModule, SearchResultsForOrcidModule, SearchResultsInDepositModule, SearchResultsForOrcidModule,
AdvancedSearchFormModule, QuickSelectionsModule, BreadcrumbsModule, AlertModalModule, ClickModule, IconsModule, LoadingModule, AdvancedSearchFormModule, QuickSelectionsModule, BreadcrumbsModule, AlertModalModule, ClickModule, IconsModule, LoadingModule,
InputModule InputModule
@ -47,9 +45,7 @@ import {graph} from "../../utils/icons/icons";
declarations: [ declarations: [
NewSearchPageComponent NewSearchPageComponent
], ],
providers: [ providers: [],
PreviousRouteRecorder
],
exports: [ exports: [
NewSearchPageComponent NewSearchPageComponent
] ]

View File

@ -15,12 +15,11 @@ import {properties} from "../../../../environments/environment";
selector: 'search-download', selector: 'search-download',
template: ` template: `
<button [attr.uk-tooltip]="'title: Download' + ((totalResults > csvLimit)?' the first 2000 ':' ') + 'results.' + <button [attr.uk-tooltip]="'title: Download' + ((totalResults > csvLimit)?' the first 2000 ':' ') + 'results.' +
((totalResults > csvLimit && properties.zenodoDumpUrl)?' To get all results download the data dump. ':' ') " ((totalResults > csvLimit && properties.zenodoDumpUrl)?' To get all results download the data dump. ':' ') "
class="uk-button uk-button-link uk-flex uk-flex-middle" [class.uk-disabled]="isDisabled" class="uk-button uk-button-link uk-flex uk-flex-middle" [class.uk-disabled]="isDisabled"
[disabled]="isDisabled" [disabled]="isDisabled"
(click)="downloadfile(downloadURLAPI+'?format=csv'+csvParams,type+'-report-'+((totalResults > csvLimit)?'2000 ':totalResults))"> (click)="downloadfile(downloadURLAPI+'?format=csv'+csvParams,type+'-report-'+((totalResults > csvLimit)?'2000 ':totalResults))">
<icon name="download" [flex]="true"></icon> <icon name="download" [flex]="true"></icon>
<span class="uk-margin-xsmall-left">Download Results</span>
</button> </button>
<modal-loading></modal-loading> <modal-loading></modal-loading>
<modal-alert #AlertModalCsvError></modal-alert> <modal-alert #AlertModalCsvError></modal-alert>

View File

@ -7,7 +7,7 @@ import {properties} from "../../../../environments/environment";
template: ` template: `
<div *ngIf="options" class="uk-width-small"> <div *ngIf="options" class="uk-width-small">
<div input <div input
type="select" placeholder="Sort by" inputClass="flat x-small" type="select" placeholder="Sort by" inputClass="border-bottom"
[options]="options" [(value)]="sortBy" [disabled]="isDisabled" [options]="options" [(value)]="sortBy" [disabled]="isDisabled"
(valueChange)="sortByChanged()"></div> (valueChange)="sortByChanged()"></div>
</div> </div>

View File

@ -8,9 +8,11 @@ import {OrganizationInfo} from '../utils/entities/organizationInfo';
import{EnvProperties} from '../utils/properties/env-properties'; import{EnvProperties} from '../utils/properties/env-properties';
import {map} from "rxjs/operators"; import {map} from "rxjs/operators";
import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class"; import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class";
import {properties} from "../../../environments/environment";
@Injectable() @Injectable()
export class OrganizationService { export class OrganizationService {
public parsingFunctions: ParsingFunctions = new ParsingFunctions();
constructor(private http: HttpClient ) {} 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 //Comment Parsing Projects info

View File

@ -9,9 +9,11 @@ import{EnvProperties} from '../utils/properties/env-properties';
import {StringUtils} from '../utils/string-utils.class'; import {StringUtils} from '../utils/string-utils.class';
import {map} from "rxjs/operators"; import {map} from "rxjs/operators";
import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class"; import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class";
import {properties} from "../../../environments/environment";
@Injectable() @Injectable()
export class SearchOrganizationsService { export class SearchOrganizationsService {
public parsingFunctions: ParsingFunctions = new ParsingFunctions();
constructor(private http: HttpClient ) {} constructor(private http: HttpClient ) {}
@ -173,7 +175,11 @@ export class SearchOrganizationsService {
result.country = resData.country.classname; 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; return results;

View File

@ -1,5 +1,5 @@
<ng-template #grant> <ng-template #grant>
<div class="uk-margin-small-top"> <div>
<img style="max-width: 42px;" [src]="assetsPath + 'common/commission.jpg'" alt="flag black white low" width="50px" loading="lazy"> <img style="max-width: 42px;" [src]="assetsPath + 'common/commission.jpg'" alt="flag black white low" width="50px" loading="lazy">
</div> </div>
<div class="uk-margin-left"> <div class="uk-margin-left">
@ -64,7 +64,7 @@
height="50px" class="el-image" alt="OpenAIRE" loading="lazy"> height="50px" class="el-image" alt="OpenAIRE" loading="lazy">
</div> </div>
<div *ngIf="showCommision" class="uk-width-expand"> <div *ngIf="showCommision" class="uk-width-expand">
<div class="uk-flex uk-flex-top uk-flex-center"> <div class="uk-flex uk-flex-middle uk-flex-center uk-margin-small-top">
<ng-container *ngTemplateOutlet="grant"></ng-container> <ng-container *ngTemplateOutlet="grant"></ng-container>
</div> </div>
</div> </div>
@ -208,7 +208,7 @@
height="50px" class="el-image" alt="OpenAIRE" loading="lazy"> height="50px" class="el-image" alt="OpenAIRE" loading="lazy">
</div> </div>
<div *ngIf="showCommision" class="uk-width-expand"> <div *ngIf="showCommision" class="uk-width-expand">
<div class="uk-flex uk-flex-top uk-flex-center"> <div class="uk-flex uk-flex-middle uk-flex-center uk-margin-small-top">
<ng-container *ngTemplateOutlet="grant"></ng-container> <ng-container *ngTemplateOutlet="grant"></ng-container>
</div> </div>
</div> </div>

View File

@ -336,7 +336,12 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@Input() @Input()
set options(options: (Option | string | number) []) { set options(options: (Option | string | number) []) {
this.optionsArray = options.map(option => { 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 { return {
label: option.toString(), label: option.toString(),
value: option value: option

View File

@ -1,12 +1,12 @@
<div class="quick-contact"> <div class="quick-contact">
<button class="uk-button uk-box-shadow-default uk-box-shadow-default-hover uk-button-secondary uk-flex uk-flex-middle"> <button class="uk-button uk-box-shadow-default uk-box-shadow-default-hover uk-button-secondary uk-flex uk-flex-middle" (click)="quickContactClicked=true">
<icon *ngIf="!showDrop" name="mail" [flex]="true"></icon> <icon *ngIf="!showDrop" name="mail" [flex]="true"></icon>
<icon *ngIf="showDrop" name="close" [flex]="true"></icon> <icon *ngIf="showDrop" name="close" [flex]="true"></icon>
<span class="uk-margin-small-left">{{contact}}</span> <span class="uk-margin-small-left">{{contact}}</span>
</button> </button>
<div #drop id="quick-contact" class="uk-drop" <div #drop id="quick-contact" class="uk-drop"
uk-drop="mode: click; pos: top-right; animation: uk-animation-fade; offset: 20"> uk-drop="mode: click; pos: top-right; animation: uk-animation-fade; offset: 20">
<div class="uk-card uk-card-default uk-box-shadow-default uk-flex uk-flex-column uk-height-1-1"> <div *ngIf="quickContactClicked" class="uk-card uk-card-default uk-box-shadow-default uk-flex uk-flex-column uk-height-1-1">
<div class="uk-card-header uk-padding-small uk-text-center" [class.uk-light]="backgroundHeader.dark" [ngClass]="backgroundHeader.class"> <div class="uk-card-header uk-padding-small uk-text-center" [class.uk-light]="backgroundHeader.dark" [ngClass]="backgroundHeader.class">
<div class="uk-text-small"> <div class="uk-text-small">
Send a message Send a message

View File

@ -11,6 +11,7 @@ declare var UIkit;
styleUrls: ['quick-contact.component.less'] styleUrls: ['quick-contact.component.less']
}) })
export class QuickContactComponent implements OnInit, OnDestroy { export class QuickContactComponent implements OnInit, OnDestroy {
public quickContactClicked: boolean = false;
public showDrop: boolean = false; public showDrop: boolean = false;
@Input() @Input()
public contactForm: FormGroup; public contactForm: FormGroup;

View File

@ -13,7 +13,7 @@ export class TimeoutInterceptor implements HttpInterceptor {
private static TIMEOUT_WHITELIST = [ private static TIMEOUT_WHITELIST = [
properties.csvAPIURL, properties.registryUrl, properties.claimsAPIURL, properties.csvAPIURL, properties.registryUrl, properties.claimsAPIURL,
properties.searchCrossrefAPIURL, properties.searchDataciteAPIURL, 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) { constructor(@Inject(DEFAULT_TIMEOUT) protected defaultTimeout: number, @Inject(PLATFORM_ID) private platformId: any) {
} }

View File

@ -26,4 +26,5 @@ export class OrganizationInfo {
// organizations: {name: string; url: string}[]}[]; // organizations: {name: string; url: string}[]}[];
deletedByInferenceIds: string[]; deletedByInferenceIds: string[];
identifiers: Map<string, string[]>; //key is the classname
} }

View File

@ -14,8 +14,7 @@ import {EnvProperties} from "../properties/env-properties";
<div *ngIf="linking && isRouteAvailable('participate/direct-claim')"> <div *ngIf="linking && isRouteAvailable('participate/direct-claim')">
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'], [id,type,linkTo])" <a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'], [id,type,linkTo])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim" routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
[title]="'Link '+openaireEntities.RESULTS+' with a '+openaireEntities.PROJECT+', a '+openaireEntities.COMMUNITY+' or other '+openaireEntities.RESULTS+' and make the new information available in OpenAIRE information space.'" [attr.uk-tooltip]="showTooltip ? 'title: Link '+openaireEntities.RESULTS+' with a '+openaireEntities.PROJECT+', a '+openaireEntities.COMMUNITY+' or other '+openaireEntities.RESULTS+' and make the new information available in OpenAIRE information space.; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon [flex]="true" [ratio]="0.7" name="link_to" visuallyHidden="link"></icon> <icon [flex]="true" [ratio]="0.7" name="link_to" visuallyHidden="link"></icon>
<span class="uk-margin-xsmall-left">Link to</span> <span class="uk-margin-xsmall-left">Link to</span>
@ -23,8 +22,7 @@ import {EnvProperties} from "../properties/env-properties";
</div> </div>
<div *ngIf="share"> <div *ngIf="share">
<a (click)="openAddThisModal()" <a (click)="openAddThisModal()"
[title]="'Share this '+getTypeName() + ' in your social networks'" [attr.uk-tooltip]="showTooltip ? 'title: Share this '+getTypeName()+' in your social networks; pos: bottom; cls: uk-active uk-text-small uk-padding-small' : 'cls: uk-invisible'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'"
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon class="uk-text-bolder" [flex]="true" [ratio]="0.8" name="share" visuallyHidden="share"></icon> <icon class="uk-text-bolder" [flex]="true" [ratio]="0.8" name="share" visuallyHidden="share"></icon>
<span class="uk-margin-xsmall-left">Share</span> <span class="uk-margin-xsmall-left">Share</span>
@ -39,8 +37,7 @@ import {EnvProperties} from "../properties/env-properties";
</div> </div>
<div *ngIf="deposit && isRouteAvailable('participate/deposit/learn-how')"> <div *ngIf="deposit && isRouteAvailable('participate/deposit/learn-how')">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit/learn-how" <a routerLinkActive="router-link-active" routerLink="/participate/deposit/learn-how"
[title]="'Find a repository to deposit or publish your research in Open Access'" [attr.uk-tooltip]="showTooltip ? 'title: Find a repository to deposit or publish your research in Open Access; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon flex="true" ratio="0.7" name="upload" visuallyHidden="upload"></icon> <icon flex="true" ratio="0.7" name="upload" visuallyHidden="upload"></icon>
<span class="uk-margin-xsmall-left">Deposit</span> <span class="uk-margin-xsmall-left">Deposit</span>
@ -48,8 +45,7 @@ import {EnvProperties} from "../properties/env-properties";
</div> </div>
<div *ngIf="embed" > <div *ngIf="embed" >
<a (click)="openEmbedResultsModal()" <a (click)="openEmbedResultsModal()"
[title]="'Embed the related '+openaireEntities.RESULTS+' of this '+getTypeName()+' in your website'" [attr.uk-tooltip]="showTooltip ? 'title: Embed the related '+openaireEntities.RESULTS+' of this '+getTypeName()+' in your website; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'"
[attr.uk-tooltip]="'pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium'"
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon flex="true" ratio="0.8" name="code" visuallyHidden="code"></icon> <icon flex="true" ratio="0.8" name="code" visuallyHidden="code"></icon>
<span class="uk-margin-xsmall-left">Embed</span> <span class="uk-margin-xsmall-left">Embed</span>
@ -99,6 +95,7 @@ export class EntityActionsComponent implements OnInit {
@Input() embed: boolean = false; @Input() embed: boolean = false;
@Input() url: string; @Input() url: string;
@Input() isMobile: boolean = false; @Input() isMobile: boolean = false;
@Input() showTooltip: boolean = true;
public citeThisClicked: boolean; public citeThisClicked: boolean;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
@ViewChild('citeModal') citeModal; @ViewChild('citeModal') citeModal;

View File

@ -6,7 +6,7 @@ import {properties} from "../../../../environments/environment";
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) // do not forget to register this class as a provider })
export class PreviousRouteRecorder { export class PreviousRouteRecorder {
constructor(private router: Router) { constructor(private router: Router) {
} }

View File

@ -45,6 +45,10 @@ export interface EnvProperties {
openDoarURL?: string; openDoarURL?: string;
r3DataURL?: string; r3DataURL?: string;
swhURL?: string; swhURL?: string;
rorURL?: string;
isniURL?: string;
wikiDataURL?: string;
fundRefURL?: string;
fairSharingURL?: string, fairSharingURL?: string,
eoscMarketplaceURL?: string, eoscMarketplaceURL?: string,
sherpaURL?: string; sherpaURL?: string;

View File

@ -6,7 +6,7 @@ export let common: EnvProperties = {
useNewStatistisTool: true, useNewStatistisTool: true,
openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=", openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=",
searchCrossrefAPIURL: "https://api.crossref.org/works", 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/", searchOrcidURL: "https://pub.orcid.org/v2.1/",
orcidURL: "https://orcid.org/", orcidURL: "https://orcid.org/",
orcidAPIURL: "https://services.openaire.eu/uoa-orcid-service/", orcidAPIURL: "https://services.openaire.eu/uoa-orcid-service/",
@ -20,6 +20,10 @@ export let common: EnvProperties = {
openDoarURL: "http://v2.sherpa.ac.uk/id/repository/", openDoarURL: "http://v2.sherpa.ac.uk/id/repository/",
r3DataURL: "http://service.re3data.org/repository/", r3DataURL: "http://service.re3data.org/repository/",
swhURL: "https://archive.softwareheritage.org/", 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/", fairSharingURL: "https://fairsharing.org/",
eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/", eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/",
sherpaURL: "http://sherpa.ac.uk/romeo/issn/", sherpaURL: "http://sherpa.ac.uk/romeo/issn/",
@ -77,7 +81,7 @@ export let common: EnvProperties = {
b2noteAPIURL: 'https://b2note.eudat.eu/', b2noteAPIURL: 'https://b2note.eudat.eu/',
myOrcidLinksPage: "/my-orcid-links", 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 href='https://www.openaire.eu/projects' target='_blank'>a series of EU funded projects</a>.",
//connect //connect
enermapsURL: "https://lab.idiap.ch/enermaps", enermapsURL: "https://lab.idiap.ch/enermaps",
@ -86,6 +90,9 @@ export let common: EnvProperties = {
afterLoginRedirectLink: '/myCommunities', afterLoginRedirectLink: '/myCommunities',
searchLinkToCommunities: '/search/find/communities', searchLinkToCommunities: '/search/find/communities',
openOrgsUrl:"https://beta.orgs.openaire.eu", openOrgsUrl:"https://beta.orgs.openaire.eu",
// monitor
searchLinkToStakeholders: "/browse"
} }
export let commonDev: EnvProperties = { export let commonDev: EnvProperties = {

View File

@ -21,7 +21,7 @@ export class RangeFilterComponent {
@Input() yearMax: number = Dates.yearMax; @Input() yearMax: number = Dates.yearMax;
@Input() mandatoryRange:boolean = false; @Input() mandatoryRange:boolean = false;
public currentYear: number = Dates.currentYear; public currentYear: number = Dates.currentYear;
public yearValidators = [StringUtils.inValidYearValidator(this.yearMin, this.yearMax)]; public yearValidators;
public formValidators = [StringUtils.fromYearAfterToYearValidator]; public formValidators = [StringUtils.fromYearAfterToYearValidator];
public rangeForm: UntypedFormGroup; public rangeForm: UntypedFormGroup;
public yearRange: YearRange = { public yearRange: YearRange = {
@ -41,6 +41,11 @@ export class RangeFilterComponent {
constructor(private _router: Router, private route: ActivatedRoute, private _fb: UntypedFormBuilder) {} constructor(private _router: Router, private route: ActivatedRoute, private _fb: UntypedFormBuilder) {}
ngOnInit() { 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) { if(this.mandatoryRange) {
this.formValidators.push(StringUtils.rangeRequired(this.mandatoryRange)); this.formValidators.push(StringUtils.rangeRequired(this.mandatoryRange));
} }

View File

@ -187,7 +187,8 @@
[deposit]="deposit" [embed]="embed" [deposit]="deposit" [embed]="embed"
[type]="result.resultType" [type]="result.resultType"
[result]="result" [id]="result.objId?result.objId:result.id" [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">
<span *ngIf="orcid"> <span *ngIf="orcid">
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0" <orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0"
[resultId]="result.relcanId" [resultTitle]="result.title" [resultId]="result.relcanId" [resultTitle]="result.title"
@ -224,7 +225,7 @@
</span> </span>
<span class="uk-margin-xsmall-left">Access Routes</span> <span class="uk-margin-xsmall-left">Access Routes</span>
</a> </a>
<div uk-drop="pos: top-right" class="uk-drop"> <div uk-drop="pos: top-right; mode: click" class="uk-drop">
<div class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small"> <div class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small">
<table> <table>
<tr *ngIf="result.oaRoutes.green"> <tr *ngIf="result.oaRoutes.green">
@ -263,7 +264,7 @@
<span *ngIf="isNumber(result.measure.bip[0].value)" class="uk-margin-xsmall-left">{{formatNumber(result.measure.bip[0].value)}}</span> <span *ngIf="isNumber(result.measure.bip[0].value)" class="uk-margin-xsmall-left">{{formatNumber(result.measure.bip[0].value)}}</span>
<span *ngIf="!isNumber(result.measure.bip[0].value)" class="uk-margin-xsmall-left">{{result.measure.bip[0].value}}</span> <span *ngIf="!isNumber(result.measure.bip[0].value)" class="uk-margin-xsmall-left">{{result.measure.bip[0].value}}</span>
</a> </a>
<div uk-drop="pos: top-right" class="uk-drop"> <div uk-drop="pos: top-right; mode: click" class="uk-drop">
<div class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small"> <div class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small">
<table> <table>
<tr *ngFor="let metric of result.measure.bip"> <tr *ngFor="let metric of result.measure.bip">
@ -289,7 +290,7 @@
[name]="result.measure.counts[0].icon"></icon> [name]="result.measure.counts[0].icon"></icon>
<span class="uk-margin-xsmall-left">{{formatNumber(result.measure.counts[0].value)}}</span> <span class="uk-margin-xsmall-left">{{formatNumber(result.measure.counts[0].value)}}</span>
</a> </a>
<div uk-drop="pos: top-right" class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small"> <div uk-drop="pos: top-right; mode: click" class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small">
<table> <table>
<tr *ngFor="let metric of result.measure.counts"> <tr *ngFor="let metric of result.measure.counts">
<td class="text-usage-counts"> <td class="text-usage-counts">
@ -331,7 +332,8 @@
[type]="result.resultType" [type]="result.resultType"
[result]="result" [id]="result.objId?result.objId:result.id" [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"
[isMobile]="isMobile"> [isMobile]="isMobile"
[showTooltip]="false">
<span *ngIf="orcid"> <span *ngIf="orcid">
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0" <orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0"
[resultId]="result.relcanId" [resultTitle]="result.title" [resultId]="result.relcanId" [resultTitle]="result.title"