From 40029fae3efbfa551cc78a9014ece9e2b4a2a5cd Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 28 Sep 2017 12:14:23 +0000 Subject: [PATCH] Direct Linking use the same look and feel with linking | add seperate template files for linking generic and direct linking components | login components redirects in case user is logged in git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@49153 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../displayClaims.component.html | 2 +- .../directLinking.component.html | 118 ++++++++++++++ .../directLinking/directLinking.component.ts | 112 +------------ .../directLinking/directLinking.module.ts | 7 +- .../linking/linkingGeneric.component.html | 144 +++++++++++++++++ .../linking/linkingGeneric.component.ts | 147 +----------------- .../selected/selectedResults.component.ts | 2 +- .../depositBySubjectResult.component.html | 4 +- .../app/deposit/depositResult.component.ts | 6 +- portal-2/src/app/login/user.component.ts | 5 +- portal-2/src/app/login/utils/helper.class.ts | 5 +- .../searchUtils/searchPage.component.ts | 13 +- .../utils/properties/openaireProperties.ts | 3 +- 13 files changed, 289 insertions(+), 279 deletions(-) create mode 100644 portal-2/src/app/claims/directLinking/directLinking.component.html create mode 100644 portal-2/src/app/claims/linking/linkingGeneric.component.html diff --git a/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.component.html b/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.component.html index dfd05e76..7a64cc39 100644 --- a/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.component.html +++ b/portal-2/src/app/claims/claim-utils/displayClaims/displayClaims.component.html @@ -11,7 +11,7 @@
Filter By:
-
+
diff --git a/portal-2/src/app/claims/directLinking/directLinking.component.html b/portal-2/src/app/claims/directLinking/directLinking.component.html new file mode 100644 index 00000000..ddef7ea6 --- /dev/null +++ b/portal-2/src/app/claims/directLinking/directLinking.component.html @@ -0,0 +1,118 @@ +
+
+
+ +
+
+ Link +
+
+ +
+
+ +
+ +
+ +
+ + +
+
+ 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.component.ts b/portal-2/src/app/claims/directLinking/directLinking.component.ts index b7f0de7f..567909a3 100644 --- a/portal-2/src/app/claims/directLinking/directLinking.component.ts +++ b/portal-2/src/app/claims/directLinking/directLinking.component.ts @@ -9,110 +9,7 @@ import { Meta} from '../../../angular2-meta'; @Component({ selector: 'directLinking', - template: ` -
-
-
- -
-
- Link -
-
- -
-
- -
- -
- - -
- Link {{(type=="project")?'Project':' Research result'}}: -
-
- -
- -
-
-
- {{displayedResult.title}} - {{displayedResult.title}} -
- - -
- -
- -
- {{projects[0].funderName}} | {{projects[0].projectName}} {{(projects[0].projectAcronym)?'('+projects[0].projectAcronym+')':''}} - -
-
- - - -
- -
- -
-
- -
- - - -
-
-
- -
-
- -
-
- -
- -
-
-
-
-` - + templateUrl: 'directLinking.component.html' }) export class DirectLinkingComponent { contexts=[]; @@ -284,13 +181,6 @@ export class DirectLinkingComponent { - resultsChange($event) { - this.results=$event.value; - } - - projectsChange($event) { - this.projects=$event.value; - } diff --git a/portal-2/src/app/claims/directLinking/directLinking.module.ts b/portal-2/src/app/claims/directLinking/directLinking.module.ts index 25adc749..6163a75d 100644 --- a/portal-2/src/app/claims/directLinking/directLinking.module.ts +++ b/portal-2/src/app/claims/directLinking/directLinking.module.ts @@ -16,14 +16,17 @@ 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'; - +import {ClaimContextSearchFormModule} from '../claim-utils/claimContextSearchForm.module'; +import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module'; +import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module'; @NgModule({ imports: [ SharedModule, DirectLinkingRoutingModule,SelectedProjectsModule, SelectedContextsModule, SelectedPublicationsModule, InsertClaimsModule, - EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule, HelperModule + EntitySearchServiceModule, PublicationsServiceModule, DatasetsServiceModule, StartOverModule, HelperModule, + ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, ClaimResultSearchFormModule ], diff --git a/portal-2/src/app/claims/linking/linkingGeneric.component.html b/portal-2/src/app/claims/linking/linkingGeneric.component.html new file mode 100644 index 00000000..218b2a68 --- /dev/null +++ b/portal-2/src/app/claims/linking/linkingGeneric.component.html @@ -0,0 +1,144 @@ +
+
+
+ +
+
+ Link +
+ +
+ +
+
+ +
+ + + + + + + + + + + + +
+ +
    +
  • + + +
  • +
  • + + +
  • + + +
+
+ + + + + +
+
+
+ + + + + + + + + + + + +
+ + +
+
+
+ + +
+ + + + +
+ +
+ + + + +
+ +
+
+
diff --git a/portal-2/src/app/claims/linking/linkingGeneric.component.ts b/portal-2/src/app/claims/linking/linkingGeneric.component.ts index 3ebbda69..379b8677 100644 --- a/portal-2/src/app/claims/linking/linkingGeneric.component.ts +++ b/portal-2/src/app/claims/linking/linkingGeneric.component.ts @@ -10,152 +10,7 @@ declare var UIkit:any; @Component({ selector: 'linking-generic', - template: ` -
-
-
- -
-
- Link -
- -
- -
-
- -
- - - - - - - - - - - - -
- -
    -
  • - - -
  • -
  • - - -
  • - - -
-
- - - - - -
-
-
- - - - - - - - - - - - -
- - -
-
-
- - -
- - - - -
- -
- - - - -
- -
-
-
-` + templateUrl: 'linkingGeneric.component.html' }) export class LinkingGenericComponent { diff --git a/portal-2/src/app/claims/linking/selected/selectedResults.component.ts b/portal-2/src/app/claims/linking/selected/selectedResults.component.ts index b4d55ffa..4899f3d8 100644 --- a/portal-2/src/app/claims/linking/selected/selectedResults.component.ts +++ b/portal-2/src/app/claims/linking/selected/selectedResults.component.ts @@ -90,7 +90,7 @@ import {Dates} from '../../../utils/string-utils.class'; - Currently you cannot change metadata from openaire + Currently you cannot change metadata from OpenAIRE diff --git a/portal-2/src/app/deposit/datasets/depositBySubjectResult.component.html b/portal-2/src/app/deposit/datasets/depositBySubjectResult.component.html index e4ac6ef8..940b4b58 100644 --- a/portal-2/src/app/deposit/datasets/depositBySubjectResult.component.html +++ b/portal-2/src/app/deposit/datasets/depositBySubjectResult.component.html @@ -68,11 +68,11 @@
- - + diff --git a/portal-2/src/app/deposit/depositResult.component.ts b/portal-2/src/app/deposit/depositResult.component.ts index 73841158..ac77adff 100644 --- a/portal-2/src/app/deposit/depositResult.component.ts +++ b/portal-2/src/app/deposit/depositResult.component.ts @@ -115,10 +115,10 @@ import {PiwikService} from '../utils/piwik/piwik.service'; - - + @@ -211,7 +211,7 @@ export class DepositResultComponent { this._organizationService.getOrganizationInfo(this.organizationId).subscribe( data => { - this.organization = data.title; + this.organization = (data && data.title)?data.title:""; this.status = this.errorCodes.DONE; this.searchDataproviders(); }, diff --git a/portal-2/src/app/login/user.component.ts b/portal-2/src/app/login/user.component.ts index 1560182b..2babc40e 100644 --- a/portal-2/src/app/login/user.component.ts +++ b/portal-2/src/app/login/user.component.ts @@ -44,6 +44,9 @@ export class UserComponent { this.loggedIn = Session.isLoggedIn(); this.user = Session.getUser(); this.errorMessage = ""; + if(this.loggedIn){ + this.redirect(); + } }); } ngOnDestroy(){ @@ -85,7 +88,7 @@ export class UserComponent { this.router.navigate([baseUrl]); } }else{ - this.router.navigate(['/search/find']); + this.router.navigate(['/']); } } // login() { diff --git a/portal-2/src/app/login/utils/helper.class.ts b/portal-2/src/app/login/utils/helper.class.ts index a7089978..bbba6cf6 100644 --- a/portal-2/src/app/login/utils/helper.class.ts +++ b/portal-2/src/app/login/utils/helper.class.ts @@ -50,7 +50,7 @@ export class Session{ loggedIn = false; } }else{ - if(cookie != null && this.getUserFromCookie()!= null){ + if(cookie != null && this.getUserFromCookie()!= null){ loggedIn = true }else{ loggedIn = false; @@ -129,7 +129,7 @@ export class Session{ var isAdmin = false; if(Session.isLoggedIn()){ var claimRoles = ["urn:mace:openminted.eu:aai.openminted.eu:group:OpenAIRE+Curator+-+Claim","urn:mace:openminted.eu:aai.openminted.eu:group:OpenAIRE+Portal+Administrator"] - + console.log(Session.getUser().role); for (var i = 0; i < claimRoles.length; i++) { if ((Session.getUser().role).indexOf(claimRoles[i]) > -1) { isAdmin = true; @@ -147,6 +147,7 @@ export class Session{ if(Session.isLoggedIn()){ var claimRoles = ["urn:mace:openminted.eu:aai.openminted.eu:group:Registered+User"]; for (var i = 0; i < claimRoles.length; i++) { + console.log(Session.getUser().role); if ((Session.getUser().role).indexOf(claimRoles[i]) > -1) { isRegisteredUser = true; break; diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts index f87025f2..293b2afe 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts @@ -20,7 +20,7 @@ import {PiwikService} from '../../utils/piwik/piwik.service'; @Component({ selector: 'search-page', templateUrl: 'searchPage.component.html' - + }) export class SearchPageComponent { @Input() pageTitle = ""; @@ -118,14 +118,11 @@ export class SearchPageComponent { public getQueryParametersFromUrl(params){ // var parameters = ""; var allFqs = ""; - + this.queryParameters = new Map(); for(var i=0; i< this.refineFields.length ; i++){ var filterId = this.refineFields[i]; if(params[filterId] != undefined) { - if(this.queryParameters == undefined){ - this.queryParameters = new Map(); - } this.queryParameters[filterId]=StringUtils.URIDecode(params[filterId]); let values = (StringUtils.URIDecode(this.queryParameters[filterId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1); var countvalues = 0; @@ -175,9 +172,6 @@ export class SearchPageComponent { var filterId = this.refineFields[i]; var fq = ""; if(params[filterId] != undefined) { - if(this.queryParameters == undefined){ - this.queryParameters = new Map(); - } this.queryParameters[filterId]=decodeURIComponent(params[filterId]); let values = (decodeURIComponent(this.queryParameters[filterId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1); var countvalues = 0 @@ -251,11 +245,13 @@ export class SearchPageComponent { this.baseURLWithParameters = this.baseUrl + this.createUrlParameters(filters,false); } + /* * */ private createUrlParameters(filters:Filter[], includePage:boolean){ var allLimits="";//location.search.slice(1); + this.queryParameters = new Map(); this.parameterNames.splice(0,this.parameterNames.length); this.parameterValues.splice(0,this.parameterValues.length); @@ -413,7 +409,6 @@ export class SearchPageComponent { goTo(page:number = 1){ this.searchUtils.page = page; console.info("searchUtils.page goto = "+this.searchUtils.page); - this.queryParameters = new Map(); var urlParameters = this.createUrlParameters(this.filters,true); console.info("urlParams : "+urlParameters); this.updateBaseUrlWithParameters(this.filters); diff --git a/portal-2/src/app/utils/properties/openaireProperties.ts b/portal-2/src/app/utils/properties/openaireProperties.ts index 34d54dd1..3df9808e 100644 --- a/portal-2/src/app/utils/properties/openaireProperties.ts +++ b/portal-2/src/app/utils/properties/openaireProperties.ts @@ -37,7 +37,8 @@ export class OpenaireProperties { private static metricsAPIURL = "https://beta.services.openaire.eu/usagestats/"; private static framesAPIURL = "https://beta.openaire.eu/stats3/"; - private static loginAPIURL = "http://scoobydoo.di.uoa.gr:8080/uoa-user-management-1.0.0-SNAPSHOT/api/users/authenticates"; + private static loginAPIURL = "http://rudie.di.uoa.gr:8080/dnet%2Dopenaire%2Dusers%2D1.0.0%2DSNAPSHOT/api/users/authenticates" + //"http://scoobydoo.di.uoa.gr:8080/uoa-user-management-1.0.0-SNAPSHOT/api/users/authenticates"; private static loginAPIURL_pm = "https://beta.services.openaire.eu/uoa-user-management/api/users/authenticates"; private static claimsAPIURL = "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/";