From 41c97cf4107b818733a661f3aae3dc938bd964b5 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Fri, 15 Sep 2017 11:51:38 +0000 Subject: [PATCH] Adding helpText in all pages, Set api url and enableText variables in Openaire properties git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@48973 d315682c-612b-4755-9ff5-7f18f6832af3 --- portal-2/src/app/app.component.ts | 3 +- portal-2/src/app/app.module.ts | 5 +- .../displayClaims.component.html | 180 ++++++++------- .../displayClaims/displayClaims.module.ts | 6 +- .../directLinking/directLinking.component.ts | 156 +++++++------ .../directLinking/directLinking.module.ts | 3 +- .../linking/linkingGeneric.component.ts | 211 ++++++++++-------- .../claims/linking/linkingGeneric.module.ts | 5 +- .../depositBySubjectResult.component.ts | 68 +++--- .../depositBySubjectResults.module.ts | 9 +- .../datasets/depositDatasets.component.ts | 3 +- .../datasets/depositDatasets.module.ts | 8 +- portal-2/src/app/deposit/deposit.component.ts | 89 +++++--- portal-2/src/app/deposit/deposit.module.ts | 11 +- .../app/deposit/depositResult.component.ts | 159 ++++++------- .../depositPublications.component.ts | 6 +- .../depositPublications.module.ts | 7 +- .../depositPublicationsResults.module.ts | 6 +- portal-2/src/app/home/home.component.ts | 1 + portal-2/src/app/home/home.module.ts | 4 +- .../advancedSearchPage.component.ts | 24 +- .../searchUtils/advancedSearchPage.module.ts | 3 +- .../searchUtils/searchPage.component.ts | 14 +- .../searchUtils/searchPage.module.ts | 3 +- .../searchPageTableView.component.ts | 6 +- .../searchUtils/searchPageTableView.module.ts | 4 +- .../src/app/utils/helper/helper.component.ts | 50 +++++ .../src/app/utils/helper/helper.module.ts | 25 +++ .../src/app/utils/helper/helper.service.ts | 32 +++ .../app/utils/helper/helperService.module.ts | 20 ++ .../utils/properties/openaireProperties.ts | 10 + portal-2/src/assets/discover-custom.css | 4 + 32 files changed, 685 insertions(+), 450 deletions(-) create mode 100644 portal-2/src/app/utils/helper/helper.component.ts create mode 100644 portal-2/src/app/utils/helper/helper.module.ts create mode 100644 portal-2/src/app/utils/helper/helper.service.ts create mode 100644 portal-2/src/app/utils/helper/helperService.module.ts diff --git a/portal-2/src/app/app.component.ts b/portal-2/src/app/app.component.ts index 70a22aa3..3b07b7a3 100644 --- a/portal-2/src/app/app.component.ts +++ b/portal-2/src/app/app.component.ts @@ -35,7 +35,8 @@ export class XLargeDirective {
-
+ +
+
+
+
+ You have selected {{selected.length}} claim(s) +
+
+
- -
- An Error occured. -
-
- You are not allowed to access this page. -
-
- User session is not valid. Please login again. -
- - - -
-
-
- You have selected {{selected.length}} claim(s) +
+
-
-
+
-
- + +
+
No entries found.
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
Research Result Link to Claimed by Claimed Date
{{claim.userMail}}{{claim.date}}
+
+
-
- - -
-
No entries found.
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
Research Result Link to Claimed by Claimed Date
{{claim.userMail}}{{claim.date}}
+ diff --git a/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.module.ts b/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.module.ts index 095ab6c7..4c8e0bb0 100644 --- a/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.module.ts +++ b/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.module.ts @@ -7,20 +7,18 @@ import {LoadingModalModule} from '../../../utils/modal/loadingModal.module'; import {AlertModalModule} from '../../../utils/modal/alertModal.module'; import {ClaimEntityFormatterModule} from '../entityFormatter/claimEntityFormatter.module'; import {PagingModule } from '../../../utils/paging.module'; -// import { Claim } from '../claim'; -//helpers +import {HelperModule} from '../../../utils/helper/helper.module'; @NgModule({ imports: [ CommonModule, FormsModule, ClaimServiceModule, LoadingModalModule, AlertModalModule, -ClaimEntityFormatterModule, PagingModule +ClaimEntityFormatterModule, PagingModule, HelperModule ], declarations: [ DisplayClaimsComponent ], - providers: [ ], exports: [ DisplayClaimsComponent ] diff --git a/portal-2/src/app/claims/directLinking/directLinking.component.ts b/portal-2/src/app/claims/directLinking/directLinking.component.ts index 936ee70e..b7f0de7f 100644 --- a/portal-2/src/app/claims/directLinking/directLinking.component.ts +++ b/portal-2/src/app/claims/directLinking/directLinking.component.ts @@ -15,89 +15,99 @@ import { Meta} from '../../../angular2-meta';
-
- Link -
- -
- - -
- Link {{(type=="project")?'Project':' Research result'}}: +
+ Link
-
- -
- -
-
-
- {{displayedResult.title}} - {{displayedResult.title}} -
- - +
+ +
+
+ +
+ +
+ + - -
- {{projects[0].funderName}} | {{projects[0].projectName}} {{(projects[0].projectAcronym)?'('+projects[0].projectAcronym+')':''}} +

Projects: Search & add projects using keyword search. Limit the search space by specifying project Funder.

+

Communities: Search & add communities/ concepts by selecting community, category and using keyword search for . Or browse through the categories and add communities.

+

Research Results: You can search for reasearch results (publication and/ or research data) to link, in openaire, crossref, Orcid, and/ or Datacite. Use search mode, to search and add results through keyword search. Use upload mode, to upload a list of DOIs of results.

+

Review Metadata of research results: The selected research results that came from 3rd party repositories (Datacite, Crossreff, Orcid), need review and change of metadata (such as access mode, and type) before they are included in openaire information space. + Please have in mind that ignoring this step, the research results will get the default values, that may be wrong. +

-
-
- -
+
+
+ Link {{(type=="project")?'Project':' Research result'}}: +
+
+ +
+ +
+
+
+ {{displayedResult.title}} + {{displayedResult.title}} +
+ -
- +
+ +
+ +
+ {{projects[0].funderName}} | {{projects[0].projectName}} {{(projects[0].projectAcronym)?'('+projects[0].projectAcronym+')':''}} + +
+
+ + + +
+ +
+ +
+
+ +
+ + + +
+
+
+ +
+
+
-
-
- - - -
-
-
- +
-
- -
-
+ +
diff --git a/portal-2/src/app/claims/directLinking/directLinking.module.ts b/portal-2/src/app/claims/directLinking/directLinking.module.ts index e869b667..25adc749 100644 --- a/portal-2/src/app/claims/directLinking/directLinking.module.ts +++ b/portal-2/src/app/claims/directLinking/directLinking.module.ts @@ -15,6 +15,7 @@ import {PublicationsServiceModule} from '../../services/publicationsService.modu import {DatasetsServiceModule} from '../../services/datasetsService.module'; import {LoginGuard} from'../../login/loginGuard.guard'; import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; +import {HelperModule} from '../../utils/helper/helper.module'; @@ -22,7 +23,7 @@ import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.gua imports: [ SharedModule, DirectLinkingRoutingModule,SelectedProjectsModule, SelectedContextsModule, SelectedPublicationsModule, InsertClaimsModule, - EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule + EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule, HelperModule ], diff --git a/portal-2/src/app/claims/linking/linkingGeneric.component.ts b/portal-2/src/app/claims/linking/linkingGeneric.component.ts index 42f798b8..3ebbda69 100644 --- a/portal-2/src/app/claims/linking/linkingGeneric.component.ts +++ b/portal-2/src/app/claims/linking/linkingGeneric.component.ts @@ -19,122 +19,137 @@ declare var UIkit:any;
Link
- - - - diff --git a/portal-2/src/app/claims/linking/linkingGeneric.module.ts b/portal-2/src/app/claims/linking/linkingGeneric.module.ts index 4fded1dd..331621a6 100644 --- a/portal-2/src/app/claims/linking/linkingGeneric.module.ts +++ b/portal-2/src/app/claims/linking/linkingGeneric.module.ts @@ -17,7 +17,7 @@ import {ClaimContextSearchFormModule} from '../claim-utils/claimContextSearchFor import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module'; import {BulkClaimModule} from './bulkClaim/bulkClaim.module'; import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module'; -// import {AlertModalModule} from '../../utils/modal/alertModal.module'; +import {HelperModule} from '../../utils/helper/helper.module'; @NgModule({ imports: [ @@ -25,8 +25,7 @@ import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm. SelectedPublicationsModule, InsertClaimsModule, EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, LinkingRoutingModule, StartOverModule, - ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule - // AlertModalModule + ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, HelperModule ], providers:[LoginGuard, PreviousRouteRecorder], declarations: [ diff --git a/portal-2/src/app/deposit/datasets/depositBySubjectResult.component.ts b/portal-2/src/app/deposit/datasets/depositBySubjectResult.component.ts index 0fd36f2a..6989b6a2 100644 --- a/portal-2/src/app/deposit/datasets/depositBySubjectResult.component.ts +++ b/portal-2/src/app/deposit/datasets/depositBySubjectResult.component.ts @@ -39,42 +39,52 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
- +
+ +
+
+ +
+ -
-

Please use the information/contacts shown below to deposit your {{requestFor}}.

- -
- -
-
- {{fetchDataproviders.searchUtils.totalResults}} content providers, page {{fetchDataproviders.searchUtils.page}} of {{(totalPages())}} -
+
+

Please use the information/contacts shown below to deposit your {{requestFor}}.

+ +
+ +
+
+ {{fetchDataproviders.searchUtils.totalResults}} content providers, page {{fetchDataproviders.searchUtils.page}} of {{(totalPages())}} +
- - -
+ + +
-
- No content providers found with classification "{{subject}}". -
-
- An error occured. -
+
+ No content providers found with classification "{{subject}}". +
+
+ An error occured. +
-
+
- You can still deposit your {{requestFor}} in - OpenAIRE's Zenodo catch-all repository () - hosted by CERN. -
+ You can still deposit your {{requestFor}} in + OpenAIRE's Zenodo catch-all repository () + hosted by CERN. +
+
+ +
+ - - +
+
-
+
+ +
+
+

+ + Are you a grant recipient from the following: H2020; FP7 with SC39; or ERC? + + Then you are required to publish in + open access (). + One way to do this is to deposit your {{requestFor}} into an + open access repository (). +

+

+ Click the following to find more information: + FP7 guidelines (), + H2020 guidelines (), + ERC guidelines () OR + ask a question () to OpenAIRE’s national representative. +

+
+

Locate repository via your institution

+ +
+
+ + +
+ + +
+
+ +
+
+

Or locate repository in map

+
+ +
+
+
+ +
+ +
` }) export class DepositComponent { @Input() compatibility: string = ''; + @Input() mapUrl: string = null; // optional in case i-frame is needed + @Input() searchBySubjects: boolean = false; // optional: in case search by subjects is needed + + + public status: number; // Type of entity: Publication or Research Data @Input() requestFor: string = "Publications"; diff --git a/portal-2/src/app/deposit/deposit.module.ts b/portal-2/src/app/deposit/deposit.module.ts index 5f1b7933..6fa8149c 100644 --- a/portal-2/src/app/deposit/deposit.module.ts +++ b/portal-2/src/app/deposit/deposit.module.ts @@ -12,6 +12,9 @@ import {DataProvidersServiceModule} from '../services/dataProvidersService.modul import {OrganizationServiceModule} from '../services/organizationService.module'; import {SearchResultsModule } from '../searchPages/searchUtils/searchResults.module'; import {PiwikServiceModule} from '../utils/piwik/piwikService.module'; +import {HelperModule} from '../utils/helper/helper.module'; +import { DepositBySubjectComponent } from './datasets/depositBySubject.component'; +import {IFrameModule} from '../utils/iframe.module'; @@ -23,12 +26,14 @@ import {PiwikServiceModule} from '../utils/piwik/piwikService.module'; DataProvidersServiceModule, OrganizationServiceModule, SearchResultsModule, - PiwikServiceModule + PiwikServiceModule, + HelperModule, + IFrameModule ], declarations: [ DepositComponent, - DepositResultComponent - + DepositResultComponent, + DepositBySubjectComponent ], exports: [ DepositComponent, diff --git a/portal-2/src/app/deposit/depositResult.component.ts b/portal-2/src/app/deposit/depositResult.component.ts index 4c859b3a..73841158 100644 --- a/portal-2/src/app/deposit/depositResult.component.ts +++ b/portal-2/src/app/deposit/depositResult.component.ts @@ -23,94 +23,99 @@ import {PiwikService} from '../utils/piwik/piwik.service';
Deposit {{requestFor}}
+ +
+ +
+ - +
+

Locate repository via your institution

+ +
+
+ + +
+ + +
+
-
-

Locate repository via your institution

- -
-
- - -
- - -
-
+
+

+ content providers for institution: + + {{organization['name']}} () + + {{organization['name']}} +

-
-

- content providers for institution: - - {{organization['name']}} () - - {{organization['name']}} -

+
+ +
+

Please use the information/contacts shown below to deposit your {{requestFor}}.

+ + + + +
-
- -
-

Please use the information/contacts shown below to deposit your {{requestFor}}.

- - - - -
- - -
-
- +
+
+ + An error occured. + + No content providers found for institution: + + {{organization['name']}} () + + {{organization['name']}} + . +
+
+ No organization with ID: {{organizationId}} found. +
+
An error occured. - - No content providers found for institution: - - {{organization['name']}} () - - {{organization['name']}} - . -
-
- No organization with ID: {{organizationId}} found. -
-
- An error occured. -
-
- No ID for organization. -
+
+
+ No ID for organization. +
- You can still deposit your {{requestFor}} in - OpenAIRE's Zenodo catch-all repository () - hosted by CERN. + You can still deposit your {{requestFor}} in + OpenAIRE's Zenodo catch-all repository () + hosted by CERN. +
+
+
- + diff --git a/portal-2/src/app/deposit/publications/depositPublications.component.ts b/portal-2/src/app/deposit/publications/depositPublications.component.ts index c0f248a2..77ff9a23 100644 --- a/portal-2/src/app/deposit/publications/depositPublications.component.ts +++ b/portal-2/src/app/deposit/publications/depositPublications.component.ts @@ -8,11 +8,7 @@ import {Component} from '@angular/core';
- -

Or locate repository in map

-
- -
+
diff --git a/portal-2/src/app/deposit/publications/depositPublications.module.ts b/portal-2/src/app/deposit/publications/depositPublications.module.ts index 4c927688..e23b3b7c 100644 --- a/portal-2/src/app/deposit/publications/depositPublications.module.ts +++ b/portal-2/src/app/deposit/publications/depositPublications.module.ts @@ -6,7 +6,6 @@ import { DepositPublicationsComponent } from './depositPublications.component'; import {DepositPublicationsRoutingModule} from './depositPublications-routing.module'; import {DepoditModule} from '../deposit.module'; -import {IFrameModule} from '../../utils/iframe.module'; import {FreeGuard} from'../../login/freeGuard.guard'; import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; @@ -14,12 +13,10 @@ import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.gua imports: [ CommonModule, FormsModule, DepoditModule, - DepositPublicationsRoutingModule,IFrameModule + DepositPublicationsRoutingModule ], declarations: [ - - DepositPublicationsComponent, - + DepositPublicationsComponent ], exports: [ DepositPublicationsComponent, diff --git a/portal-2/src/app/deposit/publications/depositPublicationsResults.module.ts b/portal-2/src/app/deposit/publications/depositPublicationsResults.module.ts index 71b25241..78e1d494 100644 --- a/portal-2/src/app/deposit/publications/depositPublicationsResults.module.ts +++ b/portal-2/src/app/deposit/publications/depositPublicationsResults.module.ts @@ -16,12 +16,10 @@ import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.gua DepositPublicationsResultRoutingModule ], declarations: [ - - DepositPublicationsResultComponent, - + DepositPublicationsResultComponent ], exports: [ - DepositPublicationsResultComponent, + DepositPublicationsResultComponent ], providers: [FreeGuard,PreviousRouteRecorder ] diff --git a/portal-2/src/app/home/home.component.ts b/portal-2/src/app/home/home.component.ts index ae8ec66b..bb827085 100644 --- a/portal-2/src/app/home/home.component.ts +++ b/portal-2/src/app/home/home.component.ts @@ -83,6 +83,7 @@ import {PiwikService} from '../utils/piwik/piwik.service';
+
` diff --git a/portal-2/src/app/home/home.module.ts b/portal-2/src/app/home/home.module.ts index e11bbb5c..61bbdc21 100644 --- a/portal-2/src/app/home/home.module.ts +++ b/portal-2/src/app/home/home.module.ts @@ -17,6 +17,7 @@ import {FreeGuard} from'../login/freeGuard.guard'; import {PiwikServiceModule} from '../utils/piwik/piwikService.module'; import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; import {RefineFieldResultsServiceModule} from '../services/refineFieldResultsService.module'; +import {HelperModule} from '../utils/helper/helper.module'; @NgModule({ imports: [ @@ -27,7 +28,8 @@ import {RefineFieldResultsServiceModule} from '../services/refineFieldResultsSer OrganizationsServiceModule, SearchFormModule, PiwikServiceModule, - HomeRoutingModule + HomeRoutingModule, + HelperModule ], declarations: [ diff --git a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts index 6b906e58..6cc08ebc 100644 --- a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts @@ -34,15 +34,27 @@ import {PiwikService} from '../../utils/piwik/piwik.service'; (queryChange)="queryChanged($event)" [isDisabled]="disableForms"> +
+ +
-
- - +
+ + + +
+ + +
+ +
+
+
diff --git a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.module.ts b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.module.ts index f4811758..df34b56c 100644 --- a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.module.ts +++ b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.module.ts @@ -13,10 +13,11 @@ import{SearchPagingModule} from './searchPaging.module'; import {AdvancedSearchFormModule} from '../searchUtils/advancedSearchForm.module'; import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; +import {HelperModule} from '../../utils/helper/helper.module'; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, AdvancedSearchFormModule, SearchDownloadModule, PiwikServiceModule + CommonModule, FormsModule, RouterModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, AdvancedSearchFormModule, SearchDownloadModule, PiwikServiceModule, HelperModule ], declarations: [ AdvancedSearchPageComponent, diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts index 3d41b364..7b09f7e8 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts @@ -63,6 +63,7 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
+
@@ -83,11 +84,12 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
+
-
+
+ - +
+
+
- - +
+ +
diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts index fde1b144..39fc78fd 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts @@ -17,13 +17,14 @@ import {SearchDownloadModule} from './searchDownload.module'; import {ModalModule} from '../../utils/modal/modal.module'; import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; +import {HelperModule} from '../../utils/helper/helper.module'; @NgModule({ imports: [ CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, - SearchPagingModule, SearchDownloadModule, ModalModule, SearchFilterModule, PiwikServiceModule + SearchPagingModule, SearchDownloadModule, ModalModule, SearchFilterModule, PiwikServiceModule, HelperModule ], declarations: [ SearchPageComponent diff --git a/portal-2/src/app/searchPages/searchUtils/searchPageTableView.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPageTableView.component.ts index dfb352c3..10969242 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPageTableView.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPageTableView.component.ts @@ -58,7 +58,9 @@ import {PiwikService} from '../../utils/piwik/piwik.service'; class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert">Loading
- +
+ +
@@ -73,6 +75,7 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
+
@@ -175,6 +178,7 @@ import {PiwikService} from '../../utils/piwik/piwik.service';
+ diff --git a/portal-2/src/app/searchPages/searchUtils/searchPageTableView.module.ts b/portal-2/src/app/searchPages/searchUtils/searchPageTableView.module.ts index 4c71a15a..86de5549 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPageTableView.module.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPageTableView.module.ts @@ -22,10 +22,12 @@ import {ContentProvidersDatatablePipe} from '../../utils/pipes/contentProvidersD import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; +import {HelperModule} from '../../utils/helper/helper.module'; + @NgModule({ imports: [ CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule, - ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule, DataTableModule, SearchFilterModule, PiwikServiceModule + ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule, DataTableModule, SearchFilterModule, PiwikServiceModule, HelperModule ], declarations: [ SearchPageTableViewComponent//, diff --git a/portal-2/src/app/utils/helper/helper.component.ts b/portal-2/src/app/utils/helper/helper.component.ts new file mode 100644 index 00000000..d2dee100 --- /dev/null +++ b/portal-2/src/app/utils/helper/helper.component.ts @@ -0,0 +1,50 @@ +import { Component, Input } from '@angular/core'; +import 'rxjs/Rx'; +import {HelperService} from './helper.service'; +import {OpenaireProperties} from '../properties/openaireProperties'; + +@Component({ + selector: 'helper', + template: ` + +
+
+
+
+ + +` +}) +export class HelperComponent { + texts=[]; + @Input() style:boolean = false; + @Input() position:string = 'right'; + @Input() styleName:string = ''; + sub:any; + + constructor ( + private _service: HelperService + ) { + } + + ngOnInit() { + if(OpenaireProperties.isHelperEnabled() && location){ + this.sub = this._service.getHelper(location.pathname).subscribe( + data => { + this.texts =(data && data.content && data.content[this.position] )? data.content[this.position]:[]; + }, + err => { + console.log(err); + + } + ); + } + } + ngOnDestroy() { + if(this.sub){ + this.sub.unsubscribe(); + } + } + + +} diff --git a/portal-2/src/app/utils/helper/helper.module.ts b/portal-2/src/app/utils/helper/helper.module.ts new file mode 100644 index 00000000..93752d19 --- /dev/null +++ b/portal-2/src/app/utils/helper/helper.module.ts @@ -0,0 +1,25 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +// import { RouterModule } from "@angular/router"; + +import {HelperComponent} from './helper.component'; +// import {HelperServiceModule} from './helperService.module'; +import {HelperService} from './helper.service'; + + +@NgModule({ + imports: [ + CommonModule, FormsModule, + // RouterModule//,HelperServiceModule + ], + declarations: [ + HelperComponent + ], + providers:[HelperService], + exports: [ + HelperComponent + ] +}) +export class HelperModule{ } diff --git a/portal-2/src/app/utils/helper/helper.service.ts b/portal-2/src/app/utils/helper/helper.service.ts new file mode 100644 index 00000000..8ebfd475 --- /dev/null +++ b/portal-2/src/app/utils/helper/helper.service.ts @@ -0,0 +1,32 @@ +import {Injectable} from '@angular/core'; +import {Http, Response} from '@angular/http'; +import {Observable} from 'rxjs/Observable'; +import 'rxjs/add/observable/of'; +import 'rxjs/add/operator/do'; +import 'rxjs/add/operator/share'; +import { CacheService } from '../../shared/cache.service'; +import { OpenaireProperties } from '../../utils/properties/openaireProperties'; + +@Injectable() +export class HelperService { + constructor(private http: Http, public _cache: CacheService) {} + + getHelper (router: string):any { + console.info("get router helpText for : "+router); + + let url = OpenaireProperties.getHelperPageUrl() + '?q=' + router; + let key = url; + if (this._cache.has(key)) { + return Observable.of(this._cache.get(key)).map(res => res); + } + return this.http.get(url) + .map(res => res.json()) + .do(res => { + this._cache.set(key, res); + }); + + } + + + +} diff --git a/portal-2/src/app/utils/helper/helperService.module.ts b/portal-2/src/app/utils/helper/helperService.module.ts new file mode 100644 index 00000000..475fd82d --- /dev/null +++ b/portal-2/src/app/utils/helper/helperService.module.ts @@ -0,0 +1,20 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import {HelperService} from './helper.service'; + + +@NgModule({ + imports: [ + CommonModule, FormsModule + ], + declarations: [ + ], + providers:[ + HelperService +], + exports: [ + ] +}) +export class HelperServiceModule { } diff --git a/portal-2/src/app/utils/properties/openaireProperties.ts b/portal-2/src/app/utils/properties/openaireProperties.ts index 62bd8709..34d54dd1 100644 --- a/portal-2/src/app/utils/properties/openaireProperties.ts +++ b/portal-2/src/app/utils/properties/openaireProperties.ts @@ -104,6 +104,9 @@ export class OpenaireProperties { private static feedbackmail ="openaire.test@gmail.com"; + private static helperPageUrl ="http://scoobydoo.di.uoa.gr:16000/api/page/route"; + private static enableHelper:boolean = false; + public static getBaseLink():string{ return this.baseLink; } @@ -356,6 +359,13 @@ export class OpenaireProperties { public static getFeedbackMail():string{ return this.feedbackmail; } + public static getHelperPageUrl():string{ + return this.helperPageUrl; + } + public static isHelperEnabled():boolean{ + return this.enableHelper; + } + } export class ErrorCodes { public LOADING = 0; diff --git a/portal-2/src/assets/discover-custom.css b/portal-2/src/assets/discover-custom.css index 7d96f012..3ddd9463 100644 --- a/portal-2/src/assets/discover-custom.css +++ b/portal-2/src/assets/discover-custom.css @@ -482,3 +482,7 @@ h2, .uk-h2{ } .tm-toolbar .uk-subnav-line li:hover {display: block;} // remove the others + +.helper-grid > * { + padding-left: 0px !important; +}