diff --git a/claims/claim-utils/service/contexts.service.ts b/claims/claim-utils/service/contexts.service.ts index 5491cd2d..45f40de1 100644 --- a/claims/claim-utils/service/contexts.service.ts +++ b/claims/claim-utils/service/contexts.service.ts @@ -7,7 +7,7 @@ import {properties} from "../../../../../environments/environment"; @Injectable({ providedIn: 'root' }) export class ContextsService { private communitiesSubject: BehaviorSubject = new BehaviorSubject(null); - private promise: Promise; + private promise: Promise; private sub: Subscription = null; constructor(private http: HttpClient=null ) { @@ -34,7 +34,7 @@ export class ContextsService { public initCommunities() { let url = properties.contextsAPI + 's/'; - this.promise = new Promise((resolve => { + this.promise = new Promise((resolve => { this.sub = this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => this.parseCommunities(res, true) )) .subscribe( diff --git a/claims/claim-utils/service/searchCrossref.service.ts b/claims/claim-utils/service/searchCrossref.service.ts index 16372b61..9448013c 100644 --- a/claims/claim-utils/service/searchCrossref.service.ts +++ b/claims/claim-utils/service/searchCrossref.service.ts @@ -2,8 +2,10 @@ import {throwError as observableThrowError} from 'rxjs'; import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {ClaimEntity, ClaimResult} from '../claimHelper.class'; -import {map} from "rxjs/operators"; +import {map, timeout} from "rxjs/operators"; import {EnvProperties} from "../../../utils/properties/env-properties"; +import {properties} from "../../../../../environments/environment"; +import {StringUtils} from "../../../utils/string-utils.class"; @Injectable() export class SearchCrossrefService { @@ -20,7 +22,9 @@ export class SearchCrossrefService { } - searchCrossrefByDOIs(DOIs: string[], properties: EnvProperties, parse: boolean = false): any { + searchCrossrefByDOIs(DOIs: string[], properties: EnvProperties, parse: boolean = false, file: boolean = false): any { + let timeoutTime: number = properties.environment == "production" ? 6000 : 12000; + // let timeoutTimeForFile: number = 60000; var doisParams = ""; for (var i = 0; i < DOIs.length; i++) { @@ -28,11 +32,21 @@ export class SearchCrossrefService { } let url = properties.searchCrossrefAPIURL + '?filter=' + doisParams; return this.http.get(url) - //.map(request => request.json().message) - .pipe(map(request => request['message'])) - .pipe(map(request => [request["total-results"], parse ? this.parse(request['items']) : request])) - //.catch(this.handleError); + // .pipe(timeout(file ? timeoutTimeForFile : (timeoutTime))) + .pipe(timeout(timeoutTime)) + .pipe(map(request => request['message'])) + .pipe(map(request => [request["total-results"], parse ? this.parse(request['items']) : request])) } + + searchCrossrefByDOI(DOI: string): any { + let timeoutTimeForFile: number = 20000; + + let url = properties.searchCrossrefAPIURL + '/' + StringUtils.URIEncode(DOI); + return this.http.get(url) + .pipe(timeout(timeoutTimeForFile)) + .pipe(map(request => request['message'])) + .pipe(map(request => this.parse(request))) + } searchCrossrefByMultipleDOIs(dois: string[], properties: EnvProperties, parse: boolean = false): any { let url = properties.searchCrossrefAPIURL + '?filter=doi:'; for (var i = 0; i < dois.length; i++) { @@ -56,8 +70,11 @@ export class SearchCrossrefService { parse(response): ClaimEntity[] { const results: ClaimEntity[] = []; - for (let i = 0; i < response.length; i++) { - const item = response[i]; + let length = Array.isArray(response) ? response.length : 1; + + for (let i = 0; i < length; i++) { + const item = Array.isArray(response) ? response[i] : response; + const entity: ClaimEntity = new ClaimEntity(); entity.result = new ClaimResult(); entity.result.publisher = null; diff --git a/claims/claim-utils/service/searchDatacite.service.ts b/claims/claim-utils/service/searchDatacite.service.ts index fa8dfbae..52854ed5 100644 --- a/claims/claim-utils/service/searchDatacite.service.ts +++ b/claims/claim-utils/service/searchDatacite.service.ts @@ -3,7 +3,7 @@ import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {EnvProperties} from '../../../utils/properties/env-properties'; import {ClaimEntity, ClaimResult} from '../claimHelper.class'; -import {catchError, map} from 'rxjs/operators'; +import {catchError, map, timeout} from 'rxjs/operators'; import {properties} from "../../../../../environments/environment"; @@ -21,10 +21,14 @@ export class SearchDataciteService { //.catch(this.handleError); } - getDataciteResultByDOI(doi: string, properties: EnvProperties, parse: boolean = false): any { + getDataciteResultByDOI(doi: string, properties: EnvProperties, parse: boolean = false, file: boolean = false): any { + let timeoutTime: number = properties.environment == "production" ? 6000 : 12000; + let timeoutTimeForFile: number = 20000; + let url = properties.searchDataciteAPIURL + '/' + doi; let key = url; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) + .pipe(timeout(file ? timeoutTimeForFile : (timeoutTime))) .pipe(map(request => (parse ? SearchDataciteService.parse([request["data"]])[0] : request)), catchError(err => of(null))); } diff --git a/claims/linking/bulkClaim/bulkClaim.component.ts b/claims/linking/bulkClaim/bulkClaim.component.ts index fdce3997..fac882b3 100644 --- a/claims/linking/bulkClaim/bulkClaim.component.ts +++ b/claims/linking/bulkClaim/bulkClaim.component.ts @@ -21,14 +21,16 @@ declare var UIkit: any;
-
- - Upload a DOI's CSV file +
+ + + Upload a DOI's CSV file + -   +  
@@ -107,17 +109,16 @@ export class BulkClaimComponent { exceedsLimit = false; @Input() basketLimit ; tooltip = ` -
-
-
CSV format:
"DOI","ACCESS_MODE","DATE"
-
-
-
- DOI is required
-
- Access mode:
OPEN, CLOSED, EMBARGO
-
- Embargo end date:
YYYY-MM-DD
-
-
-
`; +
+
Up to 100 DOIs
+
CSV format:
"DOI","ACCESS_MODE","DATE"
+
+
+
- DOI is required
+
- Access mode:
OPEN, CLOSED, EMBARGO
+
- Embargo end date:
YYYY-MM-DD
+
+
`; constructor(private _searchCrossrefService: SearchCrossrefService, private _searchDataciteService: SearchDataciteService) { this.filesToUpload = []; } @@ -226,7 +227,7 @@ export class BulkClaimComponent { } makeFileRequest(url: string, params: Array, files: Array) { - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { const formData: any = new FormData(); const xhr = new XMLHttpRequest(); for (let i = 0; i < files.length; i++) { @@ -247,11 +248,12 @@ export class BulkClaimComponent { } fetchResult(id: string, accessMode: string, date: string, row: number) { - this.subscriptions.push(this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties, true).subscribe( + // this.subscriptions.push(this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties, true, true).subscribe( + this.subscriptions.push(this._searchCrossrefService.searchCrossrefByDOI(id).subscribe( data => { - const result:ClaimEntity = data[1][0]; - if (data[1].length > 0) { + if (data.length > 0) { + const result:ClaimEntity = data[0]; this.foundIds.push(id); result.result.accessRights = accessMode; result.result.embargoEndDate = date; diff --git a/connect/community/community.service.ts b/connect/community/community.service.ts index af4caa0f..7bbc5fd5 100644 --- a/connect/community/community.service.ts +++ b/connect/community/community.service.ts @@ -11,7 +11,7 @@ export class CommunityService { public community: BehaviorSubject = new BehaviorSubject(null); public communityId: string = null; - private promise: Promise = null; + private promise: Promise = null; private subs = []; constructor(private http: HttpClient) {} @@ -40,7 +40,7 @@ export class CommunityService { getCommunity(communityId: string, refresh = false) { if (this.communityId !== communityId || !this.community.value || refresh) { this.communityId = communityId; - this.promise = new Promise((resolve, reject) => { + this.promise = new Promise((resolve, reject) => { this.subs.push(this.getCommunityInfo(communityId).subscribe(community => { this.community.next(community); resolve(); diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index 252e25c0..1fbbc59a 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -8,7 +8,7 @@ export class ConnectHelper { if(properties.environment == "development" && (properties.adminToolsPortalType == "connect" || properties.adminToolsPortalType == "community" || properties.adminToolsPortalType == "aggregator" || properties.adminToolsPortalType == "eosc")) { - domain = "canada.explore.openaire.eu"; //for testing + domain = "test.openaire.eu"; //for testing } domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix if (domain.indexOf('eosc-portal.eu') != -1) { diff --git a/dashboard/divId/divIds.component.html b/dashboard/divId/divIds.component.html index dce2a5e7..6631331e 100644 --- a/dashboard/divId/divIds.component.html +++ b/dashboard/divId/divIds.component.html @@ -1,9 +1,8 @@
-
-
Admin Dashboard - Manage Classes
+
Manage Classes

Super Admin

diff --git a/dashboard/divId/divIds.component.ts b/dashboard/divId/divIds.component.ts index 62b1383c..28908c8b 100644 --- a/dashboard/divId/divIds.component.ts +++ b/dashboard/divId/divIds.component.ts @@ -1,7 +1,7 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from "@angular/router"; import {HelpContentService} from "../../services/help-content.service"; -import {FormArray, FormBuilder, FormGroup, Validators} from "@angular/forms"; +import {UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators} from "@angular/forms"; import {CheckDivId, DivId} from "../../utils/entities/adminTool/divId"; import {Page} from "../../utils/entities/adminTool/page"; import {EnvProperties} from '../../utils/properties/env-properties'; @@ -25,15 +25,15 @@ export class DivIdsComponent implements OnInit { private selectedDivIds: string[] = []; public checkboxes: CheckDivId[] = []; public divIds: DivId[] = []; - public classForm: FormGroup; - public pagesCtrl: FormArray; + public classForm: UntypedFormGroup; + public pagesCtrl: UntypedFormArray; private searchText: RegExp = new RegExp(''); public keyword: string = ""; public properties: EnvProperties = properties; public formPages: Page[] = []; public showLoading: boolean = true; - public filterForm: FormGroup; + public filterForm: UntypedFormGroup; private subscriptions: any[] = []; public allPages: Option[] = []; selectedCommunityPid = null; @@ -42,7 +42,7 @@ export class DivIdsComponent implements OnInit { constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router, private title: Title, - private _helpContentService: HelpContentService, private _fb: FormBuilder, + private _helpContentService: HelpContentService, private _fb: UntypedFormBuilder, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/divhelpcontent/class-help-content-form.component.html b/dashboard/divhelpcontent/class-help-content-form.component.html index fb27f3a9..a23dbaf8 100644 --- a/dashboard/divhelpcontent/class-help-content-form.component.html +++ b/dashboard/divhelpcontent/class-help-content-form.component.html @@ -49,7 +49,11 @@
OpenAIRE style guide is based on UIKit. - You can find some usage examples here + You can find some usage examples + here + here in order to style your content.
diff --git a/dashboard/divhelpcontent/class-help-content-form.component.ts b/dashboard/divhelpcontent/class-help-content-form.component.ts index d598ee09..906040bf 100644 --- a/dashboard/divhelpcontent/class-help-content-form.component.ts +++ b/dashboard/divhelpcontent/class-help-content-form.component.ts @@ -1,6 +1,6 @@ import {Component, OnInit} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms'; import {Page} from '../../utils/entities/adminTool/page'; import {HelpContentService} from '../../services/help-content.service'; import {EnvProperties} from '../../utils/properties/env-properties'; @@ -16,7 +16,7 @@ import {ClearCacheService} from "../../services/clear-cache.service"; }) export class ClassContentFormComponent implements OnInit { - myForm: FormGroup; + myForm: UntypedFormGroup; portal: string; parentClass: string; pageId: string; @@ -28,7 +28,7 @@ export class ClassContentFormComponent implements OnInit { private subs: Subscription[] = []; public pageHelpContent: DivHelpContent; - constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, + constructor(private route: ActivatedRoute, private _router: Router, private _fb: UntypedFormBuilder, private _helpContentService: HelpContentService, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/divhelpcontent/class-help-contents.component.ts b/dashboard/divhelpcontent/class-help-contents.component.ts index 49df2efa..d59cd7d9 100644 --- a/dashboard/divhelpcontent/class-help-contents.component.ts +++ b/dashboard/divhelpcontent/class-help-contents.component.ts @@ -1,5 +1,5 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; -import {FormBuilder, FormControl, FormGroup} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormControl, UntypedFormGroup} from '@angular/forms'; import {ActivatedRoute, Router} from '@angular/router'; import {HelpContentService} from '../../services/help-content.service'; import {PageHelpContentFilterOptions} from '../../utils/entities/adminTool/page-help-content'; @@ -26,7 +26,7 @@ export class ClassHelpContentsComponent implements OnInit { private selectedPageContents: string[] = []; public checkboxes: CheckDivHelpContent[] = []; public divHelpContents: DivHelpContent[] = []; - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; public pages: Page[]; public checkboxAll: boolean = false; public filters: PageHelpContentFilterOptions = {id: '', active: null, text: new RegExp('')}; @@ -39,11 +39,11 @@ export class ClassHelpContentsComponent implements OnInit { public page: Page; public properties: EnvProperties = properties; public showLoading: boolean = true; - public filterForm: FormControl; + public filterForm: UntypedFormControl; private subscriptions: any[] = []; constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, - private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer, + private _helpService: HelpContentService, private _fb: UntypedFormBuilder, private sanitizer: DomSanitizer, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/entity/entities.component.html b/dashboard/entity/entities.component.html index 5679f8b2..e21a4b7b 100644 --- a/dashboard/entity/entities.component.html +++ b/dashboard/entity/entities.component.html @@ -1,11 +1,8 @@
- - -
-
Admin Dashboard - Manage Entities
+
Manage Entities

{{name?name:'Super Admin'}}

diff --git a/dashboard/entity/entities.component.ts b/dashboard/entity/entities.component.ts index 89a184e8..38fa4c6d 100644 --- a/dashboard/entity/entities.component.ts +++ b/dashboard/entity/entities.component.ts @@ -1,7 +1,7 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {HelpContentService} from '../../services/help-content.service'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms'; import {CheckEntity, Entity} from '../../utils/entities/adminTool/entity'; import {Portal} from '../../utils/entities/adminTool/portal'; import {EnvProperties} from '../../utils/properties/env-properties'; @@ -34,7 +34,7 @@ export class EntitiesComponent implements OnInit { public entities: Entity[] = []; - public entityForm: FormGroup; + public entityForm: UntypedFormGroup; private searchText: RegExp = new RegExp(''); public keyword = ''; @@ -52,14 +52,14 @@ export class EntitiesComponent implements OnInit { public showLoading = true; public isPortalAdministrator = null; - public filterForm: FormGroup; + public filterForm: UntypedFormGroup; private subscriptions: any[] = []; private index: number; constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router, private title: Title, private _helpContentService: HelpContentService, - private userManagementService: UserManagementService, private _fb: FormBuilder, + private userManagementService: UserManagementService, private _fb: UntypedFormBuilder, private communityService: CommunityService, private stakeholderService: StakeholderService, private _clearCacheService: ClearCacheService) { diff --git a/dashboard/helpTexts/page-help-content-form.component.html b/dashboard/helpTexts/page-help-content-form.component.html index b7de8282..78f3e93d 100644 --- a/dashboard/helpTexts/page-help-content-form.component.html +++ b/dashboard/helpTexts/page-help-content-form.component.html @@ -53,7 +53,11 @@
OpenAIRE style guide is based on UIKit. - You can find some usage examples here + You can find some usage examples + here + here in order to style your content.
diff --git a/dashboard/helpTexts/page-help-content-form.component.ts b/dashboard/helpTexts/page-help-content-form.component.ts index b66b4b94..2fa17105 100644 --- a/dashboard/helpTexts/page-help-content-form.component.ts +++ b/dashboard/helpTexts/page-help-content-form.component.ts @@ -1,6 +1,6 @@ import {Component, OnInit} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms'; import {Page} from '../../utils/entities/adminTool/page'; import {HelpContentService} from '../../services/help-content.service'; import {EnvProperties} from '../../utils/properties/env-properties'; @@ -17,7 +17,7 @@ import {NotificationHandler} from "../../utils/notification-handler"; }) export class PageContentFormComponent implements OnInit { - myForm: FormGroup; + myForm: UntypedFormGroup; portal: string; parentClass: string; pageId: string; @@ -30,7 +30,7 @@ export class PageContentFormComponent implements OnInit { private subs: Subscription[] = []; public pageHelpContent: PageHelpContent; - constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, + constructor(private route: ActivatedRoute, private _router: Router, private _fb: UntypedFormBuilder, private _helpContentService: HelpContentService, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/helpTexts/page-help-contents.component.ts b/dashboard/helpTexts/page-help-contents.component.ts index 832087a9..deba6ebd 100644 --- a/dashboard/helpTexts/page-help-contents.component.ts +++ b/dashboard/helpTexts/page-help-contents.component.ts @@ -1,5 +1,5 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; -import {FormBuilder, FormControl, FormGroup} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormControl, UntypedFormGroup} from '@angular/forms'; import {ActivatedRoute, Router} from '@angular/router'; import {HelpContentService} from '../../services/help-content.service'; import { @@ -27,7 +27,7 @@ export class PageHelpContentsComponent implements OnInit { private selectedPageContents: string[] = []; public checkboxes: CheckPageHelpContent[] = []; public pageHelpContents: PageHelpContent[] = []; - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; public pages: Page[]; public checkboxAll: boolean = false; public filters: PageHelpContentFilterOptions = {id: '', active: null, text: new RegExp('')}; @@ -40,13 +40,13 @@ export class PageHelpContentsComponent implements OnInit { public page: Page; public properties: EnvProperties = properties; public showLoading: boolean = true; - public filterForm: FormControl; + public filterForm: UntypedFormControl; private subscriptions: any[] = []; public selectedKeyword: string; @ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent; constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, - private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer, + private _helpService: HelpContentService, private _fb: UntypedFormBuilder, private sanitizer: DomSanitizer, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/menu/menu.component.html b/dashboard/menu/menu.component.html index 98d45a0d..7b966ee4 100644 --- a/dashboard/menu/menu.component.html +++ b/dashboard/menu/menu.component.html @@ -159,19 +159,41 @@
-
Menu settings
+
Menu visibility
+ +
Menu alignment
+
+
+ +
+
+ +
+
+ +
+
The item is not used because the required page is disabled
+ + + + + + + + + + + + + + + + + + +
-
  • @@ -149,7 +149,7 @@
  • -
    @@ -446,32 +446,23 @@
    - -
    0 && properties.adminToolsPortalType == 'eosc' && (!viewAll || viewAll=='egiNotebook')"> - +
    + Compatible EOSC Services +
    + +
    - - +
    diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 401261b1..58c227a1 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -37,11 +37,11 @@ export class ResultLandingComponent { @Input() piwikSiteId = properties.piwikSiteId; @Input() communityId = null; enermapsId; - @ViewChild('linkModal') linkModal; + // @ViewChild('linkModal') linkModal; @ViewChild('citeModal') citeModal; @ViewChild('addThisModal') addThisModal; @ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference; - @ViewChild('relationModal') relationModal; + // @ViewChild('relationModal') relationModal; public deleteByInferenceOpened: boolean = false; @Input() public resultFromInput: boolean = false; @Input() public resultLandingInfo: ResultLandingInfo; @@ -118,7 +118,7 @@ export class ResultLandingComponent { public isLoggedIn: boolean = false; public pid: string; - @ViewChild("annotation") annotation: AnnotationComponent; + // @ViewChild("annotation") annotation: AnnotationComponent; public contextsWithLink: any; public relatedClassFilters: Option[]=[{"label": "All relations", "value": ""}]; @@ -743,12 +743,12 @@ export class ResultLandingComponent { } } - public openLinkModal() { - this.linkModal.cancelButton = false; - this.linkModal.okButton = false; - this.linkModal.alertTitle = "Link this " + this.getTypeName() + " to"; - this.linkModal.open(); - } + // public openLinkModal() { + // this.linkModal.cancelButton = false; + // this.linkModal.okButton = false; + // this.linkModal.alertTitle = "Link this " + this.getTypeName() + " to"; + // this.linkModal.open(); + // } public openCiteModal() { this.citeThisClicked = true; @@ -800,11 +800,14 @@ export class ResultLandingComponent { ); // console.log("rich content " + allow) //spam words to exclude - need to be in lower case - let title_authors_words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty", "mobile hack", "tubydi", "电影","電影","download ebook","download [ebook]","düşük hapı", "düşük hapi"]; + + let title_authors_words = ["movie","hd","film","kimetsu", "1080p","4k","call of duty", "mobile hack", "tubydi", "电影","電影","download ebook","download [ebook]","düşük hapı", "düşük hapi", + "protocolo raikov", "top gun maverick streaming vf", "expensive candy full movie", "sigma game download", "阿凡達2線上看", "lack adam torrent magnet", + "원피스 필름 레드 다시보기", "원피스 필름 레드 자막 다시보기", "gtatogel", "gta to gel"]; let abstract_words = ["operacao-feliz-natal.blogspot.com", "moviedouban.site", "hack-expert-solution.link"]; allow = allow && !( (this.hasKeyword(resultLandingInfo.title,title_authors_words) || (resultLandingInfo.authors && this.hasKeyword(resultLandingInfo.authors.map(o => o.fullName).join(" "),title_authors_words)) - || (resultLandingInfo.description && resultLandingInfo.description[0] && this.hasKeyword(resultLandingInfo.description[0],abstract_words)) + || (resultLandingInfo.description && this.hasKeyword(resultLandingInfo.description,abstract_words)) ) && ((resultLandingInfo.publisher && resultLandingInfo.publisher.toLowerCase() == "zenodo") || (resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.filter(value => { @@ -816,7 +819,7 @@ export class ResultLandingComponent { let common_abstract = ["international audience","n/a","peer reviewed","national audience","info:eu-repo/semantics/published","-",".","graphical abstract","met lit. opg","international audience; no abstract",'.',"politics","info:eu-repo/semantics/publishedversion","copia digital. madrid : ministerio de educación, cultura y deporte, 2016",'',"peer-reviewed","copia digital. madrid : ministerio de educación, cultura y deporte. subdirección general de coordinación bibliotecaria, 2015","-","imperial users only","yüksek lisans"]; let common_authors = ["[s.n.]","null &na;","nn","(:unap)","(:null)","null anonymous","anonymous"]; allow = allow && !( - this.isKeyword(resultLandingInfo.title,common_titles) || (resultLandingInfo.description && resultLandingInfo.description[0] && this.isKeyword(resultLandingInfo.description[0],common_abstract)) || + this.isKeyword(resultLandingInfo.title,common_titles) || (resultLandingInfo.description && this.isKeyword(resultLandingInfo.description,common_abstract)) || (resultLandingInfo.authors && this.hasKeyword("_"+resultLandingInfo.authors.map(o => o.fullName).join("_")+"_",common_authors, "_")) ); // console.log("common content " + allow) diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index c40c9993..f240ebeb 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -153,10 +153,10 @@ export class ResultLandingService { for(let i=0; i
    -
    -
    User Information
    @@ -19,13 +17,13 @@
    Roles {{getTheRolesFormatted(user.role)}}
    - @@ -33,25 +31,6 @@
    -
    The requested page requires authentication. Please sign in to continue. @@ -68,10 +47,7 @@
    There is no research community selected.
    -
    {{errorMessage}}
    - -
    diff --git a/login/user.component.ts b/login/user.component.ts index 1f6ee1d8..1fcdc867 100644 --- a/login/user.component.ts +++ b/login/user.component.ts @@ -99,8 +99,12 @@ export class UserComponent { } return formattedRoles.join(", "); } + + get isCurator() { + return Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user); + } - isUserManager() { + get isUserManager() { return Session.isUserManager(this.user); } diff --git a/login/userMini.component.ts b/login/userMini.component.ts index 9360a881..f5b8b021 100644 --- a/login/userMini.component.ts +++ b/login/userMini.component.ts @@ -9,10 +9,10 @@ import {UserManagementService} from "../services/user-management.service"; @Component({ selector: 'user-mini', template: ` -
    ` diff --git a/login/userMiniModule.module.ts b/login/userMiniModule.module.ts index b53783ad..b48df909 100644 --- a/login/userMiniModule.module.ts +++ b/login/userMiniModule.module.ts @@ -4,10 +4,13 @@ import { FormsModule } from '@angular/forms'; import { RouterModule } from "@angular/router"; import {UserMiniComponent} from "./userMini.component"; +import {IconsModule} from "../utils/icons/icons.module"; +import {IconsService} from "../utils/icons/icons.service"; +import {login} from "../utils/icons/icons"; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule + CommonModule, FormsModule, RouterModule, IconsModule ], declarations: [ UserMiniComponent @@ -18,4 +21,7 @@ import {UserMiniComponent} from "./userMini.component"; ] }) export class UserMiniModule { + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([login]) + } } diff --git a/monitor/how/how.component.less b/monitor/how/how.component.less index d662a569..04459c51 100644 --- a/monitor/how/how.component.less +++ b/monitor/how/how.component.less @@ -1,4 +1,6 @@ -@media only screen and (min-width: 640px) { +@import "~src/assets/openaire-theme/less/_import-variables"; + +@media only screen and (min-width: @breakpoint-small) { .how .first > div:first-child { position: relative; } @@ -157,7 +159,7 @@ } } -@media only screen and (max-width: 639px) { +@media only screen and (max-width: @breakpoint-xsmall-max) { .how .first { position: relative; padding-bottom: 30%; diff --git a/monitor/indicators/indicator-themes.component.ts b/monitor/indicators/indicator-themes.component.ts index b34daf47..4f48b5e2 100644 --- a/monitor/indicators/indicator-themes.component.ts +++ b/monitor/indicators/indicator-themes.component.ts @@ -9,31 +9,55 @@ import {Subscriber} from "rxjs"; @Component({ selector: 'indicator-themes-page', template: ` -
    -
    - -
    -
    -
    -

    Indicator Themes.

    -
    -
    -
    - -
    -
    -
    -
    Indicator themes that we are covering in the Monitor dashboards.
    -

    - This is the current set of indicator themes we cover. We’ll keep enriching it as new requests and data are coming into the OpenAIRE Research Graph. We are at your disposal, should you have any recommendations! -

    -

    - Check out the indicator pages (for funders, - research institutions and - research initiatives) - for the specific indicators for each type of dashboard, and the methodology and terminology page on how we produce the metrics. -

    +
    +
    +
    + +
    +
    +
    +

    Indicator Themes.

    +
    +
    +
    +
    +
    +
    +
    Indicator themes that we are covering in the Monitor dashboards.
    +

    + This is the current set of indicator themes we cover. We’ll keep enriching it as new requests and data are coming into the OpenAIRE Research Graph. We are at your disposal, should you have any recommendations! +

    +

    + Check out the indicator pages (for funders, + research institutions and + research initiatives) + for the specific indicators for each type of dashboard, and the methodology and terminology page on how we produce the metrics. +

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Indicator Themes.

    +
    +
    + +
    +
    +
    Indicator themes that we are covering in the Monitor dashboards.
    +

    + This is the current set of indicator themes we cover. We’ll keep enriching it as new requests and data are coming into the OpenAIRE Research Graph. We are at your disposal, should you have any recommendations! +

    +

    + Check out the indicator pages (for funders, + research institutions and + research initiatives) + for the specific indicators for each type of dashboard, and the methodology and terminology page on how we produce the metrics. +

    diff --git a/monitor/indicators/indicators.component.ts b/monitor/indicators/indicators.component.ts index 40c32e42..7e54ee29 100644 --- a/monitor/indicators/indicators.component.ts +++ b/monitor/indicators/indicators.component.ts @@ -11,7 +11,7 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; @Component({ selector: 'indicators-page', template: ` -
    +
    diff --git a/monitor/methodology/methodological-approach.component.ts b/monitor/methodology/methodological-approach.component.ts index 6aa95421..e4e9bffe 100644 --- a/monitor/methodology/methodological-approach.component.ts +++ b/monitor/methodology/methodological-approach.component.ts @@ -11,35 +11,109 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; @Component({ selector: 'methodological-approach', template: ` -
    -
    - -
    -
    -
    -
    -

    - Inclusion, transparency,
    quality, state of the art
    technology. -

    -
    -
    -

    Our methodological approach is based on the following operational quality - criteria:

    +
    +
    +
    + +
    +
    +
    +
    +

    + Inclusion, transparency,
    quality, state of the art
    technology. +

    +
    +
    +

    Our methodological approach is based on the following operational quality + criteria:

    +
      +
    • Openness and transparency: Methodological assumptions are openly and + clearly presented. +
    • +
    • Coverage and accuracy: As detailed in graph.openaire.eu + multiple data sources are ingested in the OpenAIRE research graph for coverage to the fullest extent + possible, in order to provide meaningful indicators. +
    • +
    • Clarity and replicability: We describe our construction methodology in + detail, so that + it can be verified and used by the scholarly communication community to create ongoing updates to our + proposed statistics and indicators. +
    • +
    • Readiness and timeliness: The methodology is built around + well-established open databases + and already tested knowledge extraction technologies - natural language processing (NLP)/machine-learning + (ML) - using operational + workflows in OpenAIRE to warrant timely results. +
    • +
    • Trust and robustness: Our methodology also strives to be reliable, + robust, and aligned + to other assessment methods so that it can be operationalized, used and reused, in conjunction with other + assessment methods. +
    • +
    +
    The text above is modified from this report (DOI: 10.2777/268348). +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + Completeness, inclusion, transparency and replicability +

    How? It’s about open data and collaboration.

    +
      +
    • + Built on the OpenAire Research Graph + Linked scholarly information from open initiatives around the world. Beyond publications. +
    • +
    • + Based on Open Science principles + Open data sources, Open APIs, well documented metrics and indicators. +
    • +
    • + Relevance for the Community + Indicators development and visualizations to meet community requirements. +
    • +
    +
    +
    +
    + OpenAIRE Research Graph +
    +
    +
    +
    +
    +
    +
    +
    +

    + Inclusion, transparency,
    quality, state of the art
    technology. +

    +
    +

    Our methodological approach is based on the following operational quality + criteria:

      -
    • Openness and transparency: Methodological assumptions are openly and +
    • Openness and transparency: Methodological assumptions are openly and clearly presented.
    • -
    • Coverage and accuracy: As detailed in Coverage and accuracy: As detailed in graph.openaire.eu multiple data sources are ingested in the OpenAIRE research graph for coverage to the fullest extent possible, in order to provide meaningful indicators.
    • -
    • Clarity and replicability: We describe our construction methodology in +
    • Clarity and replicability: We describe our construction methodology in detail, so that it can be verified and used by the scholarly communication community to create ongoing updates to our proposed statistics and indicators.
    • -
    • Readiness and timeliness: The methodology is built around +
    • Readiness and timeliness: The methodology is built around well-established open databases and already tested knowledge extraction technologies - natural language processing (NLP)/machine-learning (ML) - using operational @@ -51,39 +125,32 @@ import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; assessment methods.
    -
    The text above is modified from The text above is modified from this report (DOI: 10.2777/268348).
    -
    -
    -
    -
    -
    -
    -
    -
    - Completeness, inclusion, transparency and replicability -

    How? It’s about open data and collaboration.

    -
      -
    • - Built on the OpenAire Research Graph - Linked scholarly information from open initiatives around the world. Beyond publications. -
    • -
    • - Based on Open Science principles - Open data sources, Open APIs, well documented metrics and indicators. -
    • -
    • - Relevance for the Community - Indicators development and visualizations to meet community requirements. -
    • -
    -
    +
    + OpenAIRE Research Graph
    -
    - OpenAIRE Research Graph +
    + Completeness, inclusion, transparency and replicability +

    How?

    +

    It’s about open data and collaboration.

    +
      +
    • + Built on the OpenAire Research Graph + Linked scholarly information from open initiatives around the world. Beyond publications. +
    • +
    • + Based on Open Science principles + Open data sources, Open APIs, well documented metrics and indicators. +
    • +
    • + Relevance for the Community + Indicators development and visualizations to meet community requirements. +
    • +
    diff --git a/monitor/methodology/methodology.module.ts b/monitor/methodology/methodology.module.ts index d9af4bfd..25a8ad77 100644 --- a/monitor/methodology/methodology.module.ts +++ b/monitor/methodology/methodology.module.ts @@ -19,6 +19,7 @@ import {HelperModule} from "../../utils/helper/helper.module"; { path: '', redirectTo: 'terminology', + pathMatch: 'full', canDeactivate: [PreviousRouteRecorder] }, { diff --git a/monitor/methodology/terminology.component.ts b/monitor/methodology/terminology.component.ts index c0cd77ef..a68d770b 100644 --- a/monitor/methodology/terminology.component.ts +++ b/monitor/methodology/terminology.component.ts @@ -3,8 +3,10 @@ import { AfterViewInit, ChangeDetectorRef, Component, + Inject, OnDestroy, OnInit, + PLATFORM_ID, ViewChild } from "@angular/core"; import {Subscription} from "rxjs"; @@ -15,6 +17,8 @@ import {SEOService} from "../../sharedComponents/SEO/SEO.service"; import {properties} from "../../../../environments/environment"; import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component"; import {HelperService} from "../../utils/helper/helper.service"; +import {LayoutService} from "../../dashboard/sharedComponents/sidebar/layout.service"; +import {isPlatformServer} from "@angular/common"; declare var ResizeObserver; @@ -22,214 +26,96 @@ declare var ResizeObserver; @Component({ selector: 'terminology', template: ` -
    -
    - - More information for - OpenAIRE Research Graph - . -
    -
    -
    -
    -
    - -
    -
    -

    Terminology and
    construction.

    +
    +
    +
    +
    + +
    +
    +

    Terminology and
    construction.

    +
    -
    -
    -
    -
    -
    -
    - - - - - -
    +
    +
    +
    + + More information for + OpenAIRE Research Graph + .
    -
    -
    - - - - - +
    +
    +
    +
    +
    + + + + + +
    -
    -
    -
    - -
    -
    - - -
    -
    - -
    -

    3. Constructed Attributes

    -
    - All attributes in this tab are constructed by us, with the methodology presented below. -
    -
    -
    -
    Attribute
    -
    Definition
    -
    How we build it
    -
    -
    -
    - Journal Business Models -
    -
    -
    -
    Fully Open Access (OA)
    -
    -

    A journal that publishes only in open access.

    -
    -
    -

    We follow Unpaywall’s approach on defining fully Open Access journals and publishers and we construct the lists of the latter using Unpaywall data.

    -

    In brief, a journal is fully Open Access if one or more of the following occur:

    -
      -
    1. It is in the Directory of Open Access Journals (DOAJ)
    2. -
    3. It has a known fully OA Publisher (curated list).
    4. -
    5. It only publishes OA articles.
    6. -
    -
    -
    -
    -
    -
    Subscription
    -
    -

    A journal that charges for access to its articles.

    -
    -
    -

    Journals without any open access articles.

    -
    -
    -
    -
    -
    Hybrid
    -
    -

    A subscription journal where some of its articles are open access.

    -
    -
    -

    Journals with open access articles that are not fully OA journals.

    -
    -
    -
    -
    -
    Transformative
    -
    -

    "A Transformative Journal is a subscription/hybrid journal that is actively committed to - transitioning to a fully Open Access journal.

    -

    In addition, a Transformative Journal must:

    -
      -
    • gradually increase the share of Open Access content; and
    • -
    • offset subscription income from payments for publishing services (to avoid double payments)." -
    • -
    -

    Source: Plan S initiative

    -
    -
    -

    - We identify Transformative Journals by ISSN matching with the publicly available Transformative Journals data from Plan S initiative. -

    -
    -
    -
    -
    - Journal APC Business Models -
    -
    -
    -
    Diamond OA
    -
    -

    A fully OA journal that does not charge article processing charges (APCs).

    -

    In other words, fully OA journals are either diamond, or charge APCs.

    -
    -
    -

    - We obtain APC data from DOAJ using DOAJ’s Public Data Dump (an exportable version of the journal metadata). We used it to determine whether a particular fully OA journal charges APCs. -

    -
    -
    -
    -
    - Routes to Open Access (OA) -
    -
    -
    -
    Green OA
    -
    -

    An open access scientific publication deposited in a repository

    -
    -
    -

    As in definition

    -
    -
    -
    -
    -
    Gold OA
    -
    -

    A scientific publication published in a fully OA journal.

    -
    -
    -

    We define fully OA journals above.

    -
    -
    -
    -
    -
    Hybrid OA
    -
    -

    An open access scientific publication published in a hybrid journal with an open license.

    -
    -
    -

    We define hybrid journals above.

    -

    At this point we consider only CC licenses “open”. We are currently working on cleaning non-CC - licenses as well to identify other open ones.

    -

    In principle, this means that we may be underestimating the number of hybrid OA articles and - overestimating the number of bronze.

    -
    -
    -
    -
    -
    Bronze OA
    -
    -

    An open access scientific publication published in a hybrid journal without an open license.

    -
    -
    - -
    -
    -
    -
    - Miscellaneous -
    -
    -
    -
    Downloads
    -
    -

    The number of downloads of a publication’s full text in a specific time frame, from a given set of - data sources.

    -
    -
    -

    We utilize the usage data for the downloads from OpenAIRE’s Usage Counts service that harvests it from a set of - datasources. The time range of available downloads varies for each datasource.

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

    Terminology and
    construction.

    +
    +
    +
    +
    +
    +
    + + More information for + OpenAIRE Research Graph + . +
    +
    +
    +
    + + + + + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    ` }) export class TerminologyComponent implements OnInit, OnDestroy, AfterViewInit, AfterContentChecked { @@ -244,6 +130,8 @@ export class TerminologyComponent implements OnInit, OnDestroy, AfterViewInit, A public activeSection: string; public properties = properties; public divContents: any; + isMobile: boolean = false; + isServer: boolean; constructor(private seoService: SEOService, private meta: Meta, @@ -251,7 +139,10 @@ export class TerminologyComponent implements OnInit, OnDestroy, AfterViewInit, A private route: ActivatedRoute, private title: Title, private cdr: ChangeDetectorRef, - private helper: HelperService) { + private helper: HelperService, + private layoutService: LayoutService, + @Inject(PLATFORM_ID) private platform: any) { + this.isServer = isPlatformServer(this.platform); } ngOnInit() { @@ -269,6 +160,10 @@ export class TerminologyComponent implements OnInit, OnDestroy, AfterViewInit, A this.activeSection = 'entities'; } })); + this.layoutService.isMobile.subscribe(isMobile => { + this.isMobile = isMobile; + this.cdr.detectChanges(); + }); this.getDivContents(); } @@ -295,7 +190,7 @@ export class TerminologyComponent implements OnInit, OnDestroy, AfterViewInit, A } private getDivContents() { - this.subscriptions.push(this.helper.getDivHelpContents(this.properties, 'monitor', this.router.url).subscribe(contents => { + this.subscriptions.push(this.helper.getDivHelpContents(this.properties, 'monitor', '/methodology/terminology').subscribe(contents => { this.divContents = contents; })); } diff --git a/monitor/services/resources.service.ts b/monitor/services/resources.service.ts index 8352bd0e..875f34d6 100644 --- a/monitor/services/resources.service.ts +++ b/monitor/services/resources.service.ts @@ -40,7 +40,7 @@ export class ResourcesService { "", "", false, [], null, {})); items.push(ResourcesService.setLink(new MenuItem("indicator-themes", "Indicator Themes", "", "", false, [], null, {}, null, null, null, null, '_self'), prefix + "/indicators/themes", portal)); - let promise = new Promise(resolve => { + let promise = new Promise(resolve => { this.isPagesEnabled().subscribe(status => { ResourcesService.types.forEach((type, index) => { if (status[index]) { diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index 27cfdfe5..8b546afd 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -23,7 +23,7 @@ export interface Reorder { export class StakeholderService { private stakeholderSubject: BehaviorSubject = null; - private promise: Promise; + private promise: Promise; private sub; constructor(private http: HttpClient, private route: ActivatedRoute) { @@ -46,7 +46,7 @@ export class StakeholderService { getStakeholder(alias: string): Observable { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias) { - this.promise = new Promise((resolve, reject) => { + this.promise = new Promise((resolve, reject) => { this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => { return this.formalize(this.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { diff --git a/notifications/notify-form/notify-form.component.ts b/notifications/notify-form/notify-form.component.ts index 469d7ca7..0072855c 100644 --- a/notifications/notify-form/notify-form.component.ts +++ b/notifications/notify-form/notify-form.component.ts @@ -1,5 +1,5 @@ import {ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation} from "@angular/core"; -import {FormArray, FormBuilder, FormGroup} from "@angular/forms"; +import {UntypedFormArray, UntypedFormBuilder, UntypedFormGroup} from "@angular/forms"; import {Role, User} from "../../login/utils/helper.class"; import {UserManagementService} from "../../services/user-management.service"; import {Subscription} from "rxjs"; @@ -47,7 +47,7 @@ import {NotificationHandler} from "../../utils/notification-handler"; export class NotifyFormComponent implements OnInit, OnDestroy { @Input() public label: string = 'Notify Managers'; - public form: FormGroup; + public form: UntypedFormGroup; @Input() public availableGroups: Option[] = null; public groups: Option[] = []; @@ -60,7 +60,7 @@ export class NotifyFormComponent implements OnInit, OnDestroy { private subscriptions: any[] = []; public sending: boolean = false; - constructor(private fb: FormBuilder, + constructor(private fb: UntypedFormBuilder, private cdr: ChangeDetectorRef, private userManagementService: UserManagementService, private notificationService: NotificationService) { @@ -157,8 +157,8 @@ export class NotifyFormComponent implements OnInit, OnDestroy { return groups; } - get groupsAsFromArray(): FormArray { - return this.form.get('groups')?(this.form.get('groups')):null; + get groupsAsFromArray(): UntypedFormArray { + return this.form.get('groups')?(this.form.get('groups')):null; } get message(): string { diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index b05596c2..3f0ccc69 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -302,9 +302,9 @@ export class OrcidWorkComponent { public subscriptions: Subscription[] = []; @ViewChild('workModal') workModal; - @ViewChild('saveWorkModal') saveWorkModal; + // @ViewChild('saveWorkModal') saveWorkModal; @ViewChild('grantModal') grantModal; - @ViewChild('messageModal') messageModal; + // @ViewChild('messageModal') messageModal; @ViewChild('propagationModal') propagationModal; public requestGrant: boolean = false; @@ -723,16 +723,16 @@ export class OrcidWorkComponent { this.workModal.cancel(); } - openMessageModal(title: string) { - this.messageModal.cancelButton = false; - this.messageModal.okButton = false; - this.messageModal.alertTitle = title; - this.messageModal.open(); - } - - closeMessageModal() { - this.messageModal.cancel(); - } + // openMessageModal(title: string) { + // this.messageModal.cancelButton = false; + // this.messageModal.okButton = false; + // this.messageModal.alertTitle = title; + // this.messageModal.open(); + // } + // + // closeMessageModal() { + // this.messageModal.cancel(); + // } openPropagationModal(title: string) { this.propagationModal.cancelButton = true; diff --git a/orcid/orcid.component.ts b/orcid/orcid.component.ts index c5bc05fb..2ae4a8cd 100644 --- a/orcid/orcid.component.ts +++ b/orcid/orcid.component.ts @@ -91,7 +91,7 @@ export class OrcidComponent { this.message = "
    Thank you for connecting your ORCID iD with OpenAIRE!
    " + "
    This window will automatically close and you will be ready to link OpenAIRE research results with your ORCID iD.
    "; if(window && window.opener) { - window.opener.postMessage("success"); + window.opener.postMessage("success", "*"); window.close(); } setTimeout(() => { diff --git a/orcid/orcidWork.ts b/orcid/orcidWork.ts index 9bceefae..054384a0 100644 --- a/orcid/orcidWork.ts +++ b/orcid/orcidWork.ts @@ -1,5 +1,6 @@ import {ResultLandingInfo} from "../utils/entities/resultLandingInfo"; import {ResultPreview} from "../utils/result-preview/result-preview"; +import {StringUtils} from "../utils/string-utils.class"; export class WorkV3_0 { // automatically filled by orcid? @@ -107,7 +108,8 @@ export class WorkV3_0 { } if(resultLandingInfo.description && resultLandingInfo.description.length < description_limit) { - work['short-description'] = resultLandingInfo.description.length > 0 ? resultLandingInfo.description[0] : ""; + resultLandingInfo.description = StringUtils.HTMLToString(resultLandingInfo.description); + work['short-description'] = resultLandingInfo.description.substring(0, description_limit-1); } // citation (Citation, optional), diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index c45184f8..326b0d23 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -4,8 +4,8 @@ import {ActivatedRoute, Router} from "@angular/router"; import {UserManagementService} from "../services/user-management.service"; import {UserRegistryService} from "../services/user-registry.service"; import {LoginErrorCodes} from "../login/utils/guardHelper.class"; -import {Subscriber} from "rxjs"; -import {FormBuilder, FormControl, Validators} from "@angular/forms"; +import {Subscriber, Subscription} from "rxjs"; +import {UntypedFormBuilder, UntypedFormControl, Validators} from "@angular/forms"; import {AlertModal} from "../utils/modal/alert"; import {properties} from "../../../environments/environment"; import {EmailService} from "../utils/email/email.service"; @@ -62,13 +62,18 @@ import {Composer} from "../utils/email/composer";
    - We are unable to process the request because the link is invalid, or it has expired. + We are unable to process the request. What happened? +
      +
    • You are logged in with a different email, than the one you have received the invitation. + Check here the email of your account.
    • +
    • The invitation has been canceled.
    • +
    • The URL is invalid.
    • +
    ` }) export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewInit { - @Input() public id: string; @Input() @@ -77,10 +82,13 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn public name: string; @Input() public service: "connect" | "monitor" = "monitor"; + @Input() + public userInfoLinkPrefix = ''; public user: User; public verification: any; - public code: FormControl; - private subs: any[] = []; + public code: UntypedFormControl; + private subscriptions: any[] = []; + private paramsSubscription: Subscription; @ViewChild('managerModal') managerModal: AlertModal; @ViewChild('memberModal') memberModal: AlertModal; @ViewChild('errorModal') errorModal: AlertModal; @@ -90,7 +98,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn constructor(private route: ActivatedRoute, private router: Router, - private fb: FormBuilder, + private fb: UntypedFormBuilder, private emailService: EmailService, private userManagementService: UserManagementService, private userRegistryService: UserRegistryService) { @@ -101,12 +109,15 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn } ngAfterViewInit() { - this.subs.push(this.route.queryParams.subscribe(params => { - if (params && params['verify']) { - this.subs.push(this.userManagementService.getUserInfo().subscribe(user => { - this.user = user; + this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { + this.user = user; + if (this.paramsSubscription instanceof Subscription) { + this.paramsSubscription.unsubscribe(); + } + this.paramsSubscription = this.route.queryParams.subscribe(params => { + if (params && params['verify']) { if (this.user) { - this.subs.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => { + this.subscriptions.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => { this.verification = verification; if (this.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) { if (this.verification.verificationType === 'manager') { @@ -123,22 +134,26 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn this.openErrorModal(); })); } else { - this.router.navigate(['/user-info'], { + this.router.navigate(['user-info'], { queryParams: { 'errorCode': LoginErrorCodes.NOT_LOGIN, 'redirectUrl': this.router.url - } + }, + relativeTo: this.route }); } - })); - } + } + }); })); } ngOnDestroy() { - this.subs.forEach(value => { - if (value instanceof Subscriber) { - value.unsubscribe(); + if (this.paramsSubscription instanceof Subscription) { + this.paramsSubscription.unsubscribe(); + } + this.subscriptions.forEach(subscription => { + if (subscription instanceof Subscriber) { + subscription.unsubscribe(); } }); } @@ -168,13 +183,13 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn this.error = null; this.errorModal.cancelButton = false; this.errorModal.okButtonText = 'Ok'; - this.errorModal.alertTitle = 'Invalid request'; + this.errorModal.alertTitle = 'Invalid URL'; this.errorModal.open(); } public verifyManager() { this.loading = true; - this.subs.push(this.userRegistryService.verify(this.verification.id, this.code.value).subscribe(() => { + this.subscriptions.push(this.userRegistryService.verify(this.verification.id, this.code.value).subscribe(() => { this.managerModal.cancel(); this.error = null; this.userManagementService.updateUserInfo(() => { @@ -182,9 +197,9 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn this.loading = false; this.router.navigate(['/admin/' + this.verification.entity]); } else { - this.subs.push(this.emailService.notifyManagers(this.id, 'manager', + this.subscriptions.push(this.emailService.notifyManagers(this.id, 'manager', Composer.composeEmailToInformOldManagersForTheNewOnes(this.name, this.id)).subscribe(() => { - this.subs.push(this.emailService.notifyNewManager(Composer.composeEmailForNewManager(this.id, this.name)).subscribe( + this.subscriptions.push(this.emailService.notifyNewManager(Composer.composeEmailForNewManager(this.id, this.name)).subscribe( () => { this.loading = false; window.location.href = properties.adminPortalURL + '/' + this.verification.entity; @@ -211,7 +226,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn public verifyMember() { this.loading = true; if (!this.isMember) { - this.subs.push(this.userRegistryService.verify(this.verification.id, this.code.value, "member").subscribe(() => { + this.subscriptions.push(this.userRegistryService.verify(this.verification.id, this.code.value, "member").subscribe(() => { this.loading = false; this.error = null; this.userManagementService.updateUserInfo(() => { diff --git a/role-verification/role-verification.module.ts b/role-verification/role-verification.module.ts index ffc66714..0a39dfdb 100644 --- a/role-verification/role-verification.module.ts +++ b/role-verification/role-verification.module.ts @@ -6,9 +6,10 @@ import {ReactiveFormsModule} from "@angular/forms"; import {LoadingModule} from "../utils/loading/loading.module"; import {InputModule} from "../sharedComponents/input/input.module"; import {EmailService} from "../utils/email/email.service"; +import {RouterModule} from "@angular/router"; @NgModule({ - imports: [CommonModule, AlertModalModule, ReactiveFormsModule, LoadingModule, InputModule], + imports: [CommonModule, AlertModalModule, ReactiveFormsModule, LoadingModule, InputModule, RouterModule], declarations: [RoleVerificationComponent], exports: [RoleVerificationComponent], providers: [EmailService] diff --git a/sdg/sdg.component.html b/sdg/sdg.component.html index 2bad4bed..1acb5d08 100644 --- a/sdg/sdg.component.html +++ b/sdg/sdg.component.html @@ -18,6 +18,10 @@
    We have developed a classification scheme for UN Sustainable Development Goals, to view contributions of research towards complex challenges for humanity such as climate change, biodiversity loss, pollution and poverty reduction. + +
    diff --git a/searchPages/find/searchAll.component.html b/searchPages/find/searchAll.component.html index 0f378b3b..51873f56 100644 --- a/searchPages/find/searchAll.component.html +++ b/searchPages/find/searchAll.component.html @@ -1,4 +1,4 @@ -
    +
    @@ -9,7 +9,7 @@
    - = null; + private promise: Promise = null; private publicCommunities = null; @Input() usedBy: string = "search"; @@ -194,7 +194,7 @@ export class SearchResearchResultsComponent { } public getPublicCommunities() { - this.promise = new Promise(resolve => { + this.promise = new Promise(resolve => { this._contextService.getPublicCommunitiesByState().subscribe( data => { if(this.publicCommunities == null) { @@ -210,7 +210,7 @@ export class SearchResearchResultsComponent { } racePromiseWithTimeout() { - const timeoutPromise = new Promise((_, reject) => { + const timeoutPromise = new Promise((_, reject) => { this.timeoutId = setTimeout(() => { this.publicCommunities = []; reject(new Error('Request timed out')); diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index 2f922846..570cd7db 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -19,14 +19,14 @@
    -
    +
    - +
    Searching Fields Terms
    - -
    -
    + @@ -173,10 +171,18 @@ [(value)]="selectedFields[0].value" tooltip="true">
    + [placeholder]="formPlaceholderText" (searchEmitter)="simpleKeywordChanged()" [iconPosition]="isMobile?'left':'right'"> + + + +
    + [placeholder]="formPlaceholderText" (searchEmitter)="simpleKeywordChanged()" [iconPosition]="isMobile?'left':'right'"> + + + +
    diff --git a/searchPages/searchUtils/advancedSearchForm.component.ts b/searchPages/searchUtils/advancedSearchForm.component.ts index 9ee3d16f..1b1fc5ce 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.ts +++ b/searchPages/searchUtils/advancedSearchForm.component.ts @@ -7,7 +7,7 @@ import { OnDestroy, OnInit, Output, - SimpleChanges + SimpleChanges, ViewChild } from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; @@ -25,6 +25,7 @@ import {Option} from "../../sharedComponents/input/input.component"; templateUrl: 'advancedSearchForm.component.html' }) export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges { + @ViewChild("container") container; @Input() entityType; @Input() fieldIds: string[]; @Input() fieldIdsMap; @@ -40,6 +41,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges @Output() queryChange = new EventEmitter(); @Input() resultTypes; @Input() quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string }; + @Input() isMobile: boolean = false; public disableSelect: boolean = false; validDateFrom: boolean = true; validDateTo: boolean = true; @@ -59,6 +61,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges selectedEntityAdvancedUrl; @Input() entitiesSelection: boolean; @Input() showSwitchSearchLink: boolean = true; + @Output() filtersClicked: EventEmitter = new EventEmitter(); sub; constructor(private route: ActivatedRoute, private router: Router, private cdr: ChangeDetectorRef) {} @@ -157,7 +160,9 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges } else { this.selectedFields.push(new AdvancedField(this.newFieldId, this.fieldIdsMap[this.newFieldId].param, this.fieldIdsMap[this.newFieldId].name, type, "", "and")); } - + + this.cdr.detectChanges(); + this.container.nativeElement.scrollTo({top: this.container.nativeElement.scrollHeight, behavior: 'smooth'}); } removeField(index: number) { diff --git a/searchPages/searchUtils/advancedSearchForm.module.ts b/searchPages/searchUtils/advancedSearchForm.module.ts index 0b6a5dd6..d9cf2b9b 100644 --- a/searchPages/searchUtils/advancedSearchForm.module.ts +++ b/searchPages/searchUtils/advancedSearchForm.module.ts @@ -10,26 +10,30 @@ import {DateFilterModule} from './dateFilter.module'; import {SearchFormModule} from './searchForm.module'; import {QuickSelectionsModule} from "./quick-selections.module"; import {EntitiesSelectionModule} from "./entitiesSelection.module"; -import { MatSelectModule } from "@angular/material/select"; +import {MatSelectModule} from "@angular/material/select"; import {IconsModule} from "../../utils/icons/icons.module"; import {SearchInputModule} from "../../sharedComponents/search-input/search-input.module"; import {AdvancedSearchInputModule} from "../../sharedComponents/advanced-search-input/advanced-search-input.module"; import {InputModule} from "../../sharedComponents/input/input.module"; +import {IconsService} from "../../utils/icons/icons.service"; +import {filters} from "../../utils/icons/icons"; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, EntitiesAutocompleteModule, StaticAutocompleteModule, DateFilterModule, SearchFormModule, QuickSelectionsModule, EntitiesSelectionModule, MatSelectModule, IconsModule, SearchInputModule, AdvancedSearchInputModule, InputModule + CommonModule, FormsModule, RouterModule, EntitiesAutocompleteModule, StaticAutocompleteModule, DateFilterModule, + SearchFormModule, QuickSelectionsModule, EntitiesSelectionModule, MatSelectModule, IconsModule, SearchInputModule, AdvancedSearchInputModule, InputModule ], declarations: [ AdvancedSearchFormComponent, -], - - providers:[ ], exports: [ AdvancedSearchFormComponent - - ] + + ] }) -export class AdvancedSearchFormModule { } +export class AdvancedSearchFormModule { + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([filters]); + } +} diff --git a/searchPages/searchUtils/dateFilter.component.ts b/searchPages/searchUtils/dateFilter.component.ts index 7dec2a2c..30499e86 100644 --- a/searchPages/searchUtils/dateFilter.component.ts +++ b/searchPages/searchUtils/dateFilter.component.ts @@ -1,7 +1,7 @@ import {Component, Input} from '@angular/core'; import {DateValue} from './searchHelperClasses.class'; -import {FormControl} from "@angular/forms"; +import {UntypedFormControl} from "@angular/forms"; import { MatDatepickerInputEvent } from "@angular/material/datepicker"; @Component({ @@ -61,8 +61,8 @@ ngOnInit() { this.updateDefaultRangeDates(this.dateValue.from,this.dateValue.to); } updateDefaultRangeDates(df:Date,dt:Date){ - this.fromDate = new FormControl(df); - this.toDate = new FormControl(dt); + this.fromDate = new UntypedFormControl(df); + this.toDate = new UntypedFormControl(dt); } typeChanged(type:string){ diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 6e3c1081..b2e4ed18 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -3,7 +3,7 @@
    -
      +
        @@ -113,56 +113,82 @@
    - -
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + + + +
    -
    -
    -
    -
    - +
    +
    +
    +
    + +
    -
    -
    -
    -
    -
    - - +
    +
    +
    +
    + + +
    -
    - -
    - - - - -
    -
    + +
    + + + + +
    +
    @@ -171,34 +197,19 @@
    -
    - - - - - - - - - - - - - - - Filters - ({{(selectedRangeFilters + selectedFilters)}}) - - -
    -
    +
    +
    +
    -
    - +
    +
    + +
    +
    + +
    @@ -206,33 +217,33 @@
    -
    -
    - -
    -
    +
    +
    +
    +
    +
    + +
    +
    +
    + class="uk-alert uk-animation-slide-top-small"> Do you want to see results only for {{customFilter.valueName}}? Click here.
    + class="uk-alert uk-margin-small-top "> The following results are related to {{customFilter.valueName}}. Are you interested to view more results? Visit @@ -241,7 +252,7 @@ [href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)" target="_blank"> OpenAIRE - Explore.
    -
    +
    @@ -267,72 +278,52 @@
    -
    +
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    -
    - - - - - - - - +
    +

    For more results please try a new, more specific query

    +
    +
    + + + + + + + + +
    +
    + [searchUtils]="searchUtils" [results]="results" [baseUrl]="searchUtils.baseUrl" + [parameterNames]="parameterNames" [parameterValues]="parameterValues" + [isDisabled]="disabled" [isMobile]="mobile">
    @@ -340,24 +331,31 @@
    - Powered by - OpenAIRE Research Graph - + Powered by + OpenAIRE Research Graph +
    - - Last update - Last update - of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} - + + Last update + Last update + of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} +
    -
    +
    - + +
    + +
    + +
    +
    +
    diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 69163faa..6f6e5c10 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -1,15 +1,15 @@ import { ChangeDetectorRef, Component, - ElementRef, + ElementRef, Inject, Input, OnChanges, OnDestroy, - OnInit, + OnInit, PLATFORM_ID, SimpleChanges, ViewChild } from '@angular/core'; -import {Location} from '@angular/common'; +import {isPlatformServer, Location} from '@angular/common'; import {ActivatedRoute, Router} from '@angular/router'; import {Meta, Title} from '@angular/platform-browser'; @@ -35,6 +35,8 @@ import {AlertModal} from "../../utils/modal/alert"; import {Subscriber} from "rxjs"; import {IndexInfoService} from "../../utils/indexInfo.service"; import {Background} from "../../utils/background-utils"; +import {LayoutService} from "../../dashboard/sharedComponents/sidebar/layout.service"; +import {Platform} from "@angular/cdk/platform"; export interface SearchForm extends Background {} @@ -147,13 +149,8 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { currentFilterToRemove; public indexUpdateDate: Date; showOffCanvas:boolean = false; - // public resultsPerPageOptions = [ - // {label: '5', value: '5'}, - // {label: '10', value: '10'}, - // {label: '20', value: '20'}, - // {label: '50', value: '50'}, - // ]; - + isMobile: boolean = false; + isServer: boolean; constructor(private route: ActivatedRoute, private location: Location, @@ -163,7 +160,10 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { private router: Router, private seoService: SEOService, private helper: HelperService, + private layoutService: LayoutService, + @Inject(PLATFORM_ID) private platform: any, private cdr: ChangeDetectorRef, private indexInfoService: IndexInfoService) { + this.isServer = isPlatformServer(this.platform); } ngOnInit() { @@ -178,6 +178,10 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { if (typeof document !== 'undefined' && this.isPiwikEnabled && !this.includeOnlyResultsAndFilter && this.piwikSiteId) { this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.piwikSiteId).subscribe()); } + this.layoutService.isMobile.subscribe(isMobile => { + this.isMobile = isMobile; + this.cdr.detectChanges(); + }); this.route.queryParams.subscribe(params => { if (params['page'] && params['page'] != 1) { HelperFunctions.scrollToId("searchForm"); diff --git a/searchPages/searchUtils/portal-search-result.component.html b/searchPages/searchUtils/portal-search-result.component.html index 3a3b6c91..542dd13b 100644 --- a/searchPages/searchUtils/portal-search-result.component.html +++ b/searchPages/searchUtils/portal-search-result.component.html @@ -1,71 +1,40 @@ -
    • -
      -
      - Member -
      -
      - - restricted -
      -
      - - private -
      -
      - - {{result.visibility.toLowerCase()}} +
      + Member +
      +
      +
      + + restricted
      + + + private + + + + {{result.visibility.toLowerCase()}} +
      - - - - - - -
      - -
      - - +
      + + +
      Creation Date: @@ -78,10 +47,21 @@ {{mapType(result.type)}}
      -
      +

      +
      + + + + + + +
      + +
      +
      diff --git a/searchPages/searchUtils/portal-search-result.component.less b/searchPages/searchUtils/portal-search-result.component.less index 0381bcbf..e43a61fd 100644 --- a/searchPages/searchUtils/portal-search-result.component.less +++ b/searchPages/searchUtils/portal-search-result.component.less @@ -1,23 +1,42 @@ @import (reference) "~src/assets/openaire-theme/less/color.less"; +@import (reference) "~src/assets/openaire-theme/less/_import-variables.less"; -.setType(@color) { - border-left: 4px solid fade(@color, 30%); +.setType(@color, @position: left) { + border-@{position}: 4px solid fade(@color, 30%); & .type { color: @color; } } -.uk-card { - &.funder { - .setType(@funder-color); - } +@media(min-width: @breakpoint-medium) { + .uk-card { + &.funder { + .setType(@funder-color); + } - &.ri { - .setType(@ri-color); - } + &.ri { + .setType(@ri-color); + } - &.organization { - .setType(@organization-color); + &.organization { + .setType(@organization-color); + } } -} \ No newline at end of file +} + +@media(max-width: @breakpoint-small-max) { + .uk-card { + &.funder { + .setType(@funder-color, bottom); + } + + &.ri { + .setType(@ri-color, bottom); + } + + &.organization { + .setType(@organization-color, bottom); + } + } +} diff --git a/searchPages/searchUtils/portal-search-result.component.ts b/searchPages/searchUtils/portal-search-result.component.ts index dfc77c92..cbf85974 100644 --- a/searchPages/searchUtils/portal-search-result.component.ts +++ b/searchPages/searchUtils/portal-search-result.component.ts @@ -22,6 +22,7 @@ export class PortalSearchResultComponent implements OnInit{ @Input() showLoading: boolean = false; @Input() custom_class: string = "search-results"; @Input() properties: EnvProperties; + @Input() isMobile: boolean = false; @ViewChild('AlertModal') modal; visibilityIcon: Map = new Map ([ ["PRIVATE", 'incognito'], diff --git a/searchPages/searchUtils/quick-selections.component.ts b/searchPages/searchUtils/quick-selections.component.ts index dbe91093..ad1cfb97 100644 --- a/searchPages/searchUtils/quick-selections.component.ts +++ b/searchPages/searchUtils/quick-selections.component.ts @@ -1,5 +1,5 @@ import {ChangeDetectorRef, Component, EventEmitter, Input, Output} from '@angular/core'; -import {FormBuilder} from "@angular/forms"; +import {UntypedFormBuilder} from "@angular/forms"; import {Filter} from "./searchHelperClasses.class"; import {EnvProperties} from "../../utils/properties/env-properties"; import {ConfigurationService} from "../../utils/configuration/configuration.service"; @@ -48,7 +48,7 @@ export class QuickSelectionsComponent { subs: Subscription[] = []; - constructor(private _fb: FormBuilder, private config: ConfigurationService, private _router: Router, private route: ActivatedRoute, private cdr:ChangeDetectorRef) { + constructor(private _fb: UntypedFormBuilder, private config: ConfigurationService, private _router: Router, private route: ActivatedRoute, private cdr:ChangeDetectorRef) { } changed() { diff --git a/searchPages/searchUtils/searchPaging.component.ts b/searchPages/searchUtils/searchPaging.component.ts index 3b4ea350..3eef9913 100644 --- a/searchPages/searchUtils/searchPaging.component.ts +++ b/searchPages/searchUtils/searchPaging.component.ts @@ -4,13 +4,13 @@ import {ErrorCodes} from '../../utils/properties/errorCodes'; @Component({ selector: 'search-paging', template: ` - @@ -26,6 +26,7 @@ export class SearchPagingComponent { @Input() parameterValues: string[]; @Input() loadPaging: boolean = true; @Input() oldTotalResults: number = 0; + @Input() isMobile: boolean = false; public totalResults: number = 0; public errorCodes: ErrorCodes = new ErrorCodes(); diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts index 24cb1c04..79402ff3 100644 --- a/searchPages/searchUtils/searchResult.component.ts +++ b/searchPages/searchUtils/searchResult.component.ts @@ -40,7 +40,7 @@ export class SearchResultComponent implements OnInit, OnChanges { this.previewResults.push(this.getResultPreview(result)); } - if((properties.adminToolsPortalType == "explore" || properties.adminToolsPortalType == "community") + if((properties.adminToolsPortalType == "explore" || properties.adminToolsPortalType == "community" || properties.adminToolsPortalType == "aggregator") && Session.isLoggedIn() && this.results && this.results.length > 0 && (this.type == "result" || this.type == "publication" || this.type == "dataset" || this.type == "software" || this.type == "other") ) { diff --git a/services/customization.service.ts b/services/customization.service.ts index d868137e..e4dd4933 100644 --- a/services/customization.service.ts +++ b/services/customization.service.ts @@ -14,7 +14,7 @@ export class CustomizationService { const isArray = obj instanceof Array; for (let k in obj) { if (obj[k] === null || obj[k] === '') { - isArray ? obj.splice(k, 1) : delete obj[k]; + isArray ? obj.splice(Number.parseInt(k), 1) : delete obj[k]; } else if (typeof obj[k] === 'object') { CustomizationService.removeNulls(obj[k]); } diff --git a/services/help-content.service.ts b/services/help-content.service.ts index b952a9ec..27865e6d 100644 --- a/services/help-content.service.ts +++ b/services/help-content.service.ts @@ -349,6 +349,11 @@ export class HelpContentService { return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + portalPid + "/menu/toggle?status=" + status + "&featured=" + isFeatured, {}, CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } + + alignMenu(alignment: string, portalPid: string) { + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + portalPid + "/menu/align?alignment=" + alignment, {}, CustomOptions.getAuthOptionsWithBody()) + .pipe(catchError(this.handleError)); + } // unused diff --git a/services/refineFieldResults.service.ts b/services/refineFieldResults.service.ts index eca09c9d..d40819ab 100644 --- a/services/refineFieldResults.service.ts +++ b/services/refineFieldResults.service.ts @@ -77,7 +77,7 @@ export class RefineFieldResultsService { }else if(entityType == "person"){ suffix="people/"; }else if(entityType == "result"){ - suffix="publications/"; + suffix="results/"; } return suffix; } diff --git a/services/reports.service.ts b/services/reports.service.ts index 4fbf20da..84b19088 100644 --- a/services/reports.service.ts +++ b/services/reports.service.ts @@ -13,19 +13,11 @@ export class ReportsService { //On the service: downloadCSVFile(url: string){ - //var headers = new Headers(); - //headers.append('responseType', 'arraybuffer'); - return this.http.get(url, {responseType: 'text'}) - .pipe( - timeout(10000), - map(res => new Blob([res], { type: 'text/csv' }))); + return this.http.get(url, {responseType: 'text'}).pipe(map(res => new Blob([res], { type: 'text/csv' }))); } + getCSVResponse(url: string){ - //var headers = new Headers(); - //headers.append('responseType', 'arraybuffer'); return this.http.get(url, {responseType: 'text'}) - .pipe(timeout(10000)); - //.pipe(map(res => res)); } /** diff --git a/services/searchDataproviders.service.ts b/services/searchDataproviders.service.ts index d452003a..3160d7ee 100644 --- a/services/searchDataproviders.service.ts +++ b/services/searchDataproviders.service.ts @@ -106,8 +106,14 @@ export class SearchDataprovidersService { result['title'] = {"name": '', "accessMode": ''}; - result['title'].name = resData.officialname; - result['englishname'] = resData.englishname; + if(resData.officialname) { + result['title'].name = StringUtils.HTMLToString(String(resData.officialname)); + } + if(resData.englishname) { + result['englishname'] = StringUtils.HTMLToString(String(resData.englishname)); + } else { + result['englishname'] = ""; + } //result['title'].url = OpenaireProperties.getsearchLinkToDataProvider(); //result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier']; @@ -125,9 +131,9 @@ export class SearchDataprovidersService { let abstracts = this.parsingFunctions.parseDescription(resData.description, true); result.description = abstracts; - if (result.description && result.description.length > this.sizeOfDescription) { - result.description = result.description.substring(0, this.sizeOfDescription) + "..."; - } + // if (result.description && result.description.length > this.sizeOfDescription) { + // result.description = result.description.substring(0, this.sizeOfDescription) + "..."; + // } let typeid: string = resData['datasourcetype'].classid; if(typeid != "entityregistry" && typeid != "entityregistry::projects" && typeid != "entityregistry::repositories") { diff --git a/services/searchOrganizations.service.ts b/services/searchOrganizations.service.ts index a41a4084..d35f9f97 100644 --- a/services/searchOrganizations.service.ts +++ b/services/searchOrganizations.service.ts @@ -94,9 +94,11 @@ export class SearchOrganizationsService { result['title'] = {"name": '', "accessMode": ''}; - result['title'].name = resData.legalshortname; + if(resData.legalshortname) { + result['title'].name = StringUtils.HTMLToString(String(resData.legalshortname)); + } if(!result['title'].name || result['title'].name == '') { - result['title'].name = resData.legalname; + result['title'].name = StringUtils.HTMLToString(String(resData.legalname)); } //result['title'].url = OpenaireProperties.getsearchLinkToOrganization(); diff --git a/services/searchProjects.service.ts b/services/searchProjects.service.ts index b9e60214..e898dcda 100644 --- a/services/searchProjects.service.ts +++ b/services/searchProjects.service.ts @@ -135,11 +135,15 @@ export class SearchProjectsService { // if(resData['acronym'] != undefined && resData['acronym'] != "") { // result['title'].name = resData['acronym'] + " - "; // } - if(Array.isArray(resData['title'])) { - result['title'].name += resData['title'][0]; + if(resData['title']) { + if (Array.isArray(resData['title'])) { + result['title'].name += StringUtils.HTMLToString(String(resData['title'][0])); } else { - result['title'].name += resData['title']; + result['title'].name += StringUtils.HTMLToString(String(resData['title'])); } + } else { + result['title'].name = ""; + } // if(result['title'].name != '') { // result['title'].name += " ("+resData['code']+")" @@ -160,9 +164,9 @@ export class SearchProjectsService { let abstracts = this.parsingFunctions.parseDescription(resData.summary, true); result.description = abstracts; - if (result.description && result.description.length > this.sizeOfDescription) { - result.description = result.description.substring(0, this.sizeOfDescription) + "..."; - } + // if (result.description && result.description.length > this.sizeOfDescription) { + // result.description = result.description.substring(0, this.sizeOfDescription) + "..."; + // } if(resData['rels'].hasOwnProperty("rel")) { let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1; diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index 4609e22c..e026e951 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -205,7 +205,17 @@ export class SearchResearchResultsService { for (let i = 0; i < resData['measure'].length; i++) { if (resData['measure'][i].id == 'influence') { result.measure[1] = resData['measure'][i].class; - if (resData['measure'][i].class == 'A') { + if (resData['measure'][i].class == 'C1') { + result.measure[3] = 'Top 0.01% in'; + } else if (resData['measure'][i].class == 'C2') { + result.measure[3] = 'Top 0.1% in'; + } else if (resData['measure'][i].class == 'C3') { + result.measure[3] = 'Top 1% in'; + } else if (resData['measure'][i].class == 'C4') { + result.measure[3] = 'Top 10% in'; + } else if (resData['measure'][i].class == 'C5') { + result.measure[3] = 'Average/low'; + } else if (resData['measure'][i].class == 'A') { result.measure[3] = 'Exceptional'; } else if (resData['measure'][i].class == 'B') { result.measure[3] = 'Substantial'; @@ -215,7 +225,17 @@ export class SearchResearchResultsService { } if (resData['measure'][i].id == 'popularity') { result.measure[0] = resData['measure'][i].class; - if (resData['measure'][i].class == 'A') { + if (resData['measure'][i].class == 'C1') { + result.measure[2] = 'Top 0.01% in'; + } else if (resData['measure'][i].class == 'C2') { + result.measure[2] = 'Top 0.1% in'; + } else if (resData['measure'][i].class == 'C3') { + result.measure[2] = 'Top 1% in'; + } else if (resData['measure'][i].class == 'C4') { + result.measure[2] = 'Top 10% in'; + } else if (resData['measure'][i].class == 'C5') { + result.measure[2] = 'Average/low'; + } else if (resData['measure'][i].class == 'A') { result.measure[2] = 'Exceptional'; } else if (resData['measure'][i].class == 'B') { result.measure[2] = 'Substantial'; @@ -299,7 +319,7 @@ export class SearchResearchResultsService { for (let i = 0; i < resData['title'].length; i++) { if (resData['title'][i] && resData['title'][i].content) { if (!result.title.name || resData['title'][i].classid == "main title") { - result['title'].name = String(resData['title'][i].content); + result['title'].name = StringUtils.HTMLToString(String(resData['title'][i].content)); } if (resData['title'][i].classid == "main title") { break; @@ -311,7 +331,7 @@ export class SearchResearchResultsService { } // result['title'].name = (resData['title'][0] && resData['title'][0].content) ? String(resData['title'][0].content) : ""; } else { - result['title'].name = (resData['title'] && resData['title'].content) ? String(resData['title'].content) : ""; + result['title'].name = (resData['title'] && resData['title'].content) ? StringUtils.HTMLToString(String(resData['title'].content)) : ""; } result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier']; @@ -373,9 +393,9 @@ export class SearchResearchResultsService { let abstracts = this.parsingFunctions.parseDescription(resData.description, true); result.description = abstracts; - if (result.description && result.description.length > this.sizeOfDescription) { - result.description = result.description.substring(0, this.sizeOfDescription) + "..."; - } + // if (result.description && result.description.length > this.sizeOfDescription) { + // result.description = result.description.substring(0, this.sizeOfDescription) + "..."; + // } if (resData.embargoenddate && resData.embargoenddate != '') { result.embargoEndDate = Dates.getDate(resData.embargoenddate); diff --git a/services/user-management.service.ts b/services/user-management.service.ts index d7b640eb..6282ddb6 100644 --- a/services/user-management.service.ts +++ b/services/user-management.service.ts @@ -1,9 +1,8 @@ import {Injectable} from '@angular/core'; import {HttpClient} from '@angular/common/http'; -import {BehaviorSubject, from, Observable} from "rxjs"; -import {COOKIE, Session, User} from "../login/utils/helper.class"; +import {Observable} from "rxjs"; +import {Session, User} from "../login/utils/helper.class"; import {map} from "rxjs/operators"; -import {NavigationEnd, Router} from "@angular/router"; import {properties} from "../../../environments/environment"; import {StringUtils} from "../utils/string-utils.class"; import {CustomOptions} from "./servicesUtils/customOptions.class"; diff --git a/sharedComponents/bottom.component.html b/sharedComponents/bottom.component.html index b6e0500f..0b6c6c19 100644 --- a/sharedComponents/bottom.component.html +++ b/sharedComponents/bottom.component.html @@ -1,318 +1,278 @@ + +
      + flag black white low +
      +
      + +
      + +
      +
      +
      -
      +
      - flag black white low + alt="flag black white low" width="50px" loading="lazy"> +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      +
      -
      - -
      -
      - -
      -
      -
      -
      - -
      -
      -
      - OpenAIRE
      -
      -
      - -
      -
      - -
      - - OpenAIRE -
      -
      - - - - - - - - - - - -
      -
      - flag black white low -
      -
      - -
      - -
      +
      +
      +
      +
      +
      +
      +
      + OpenAIRE +
      +
      +
      +
      -
      - - -
      -
      -
      -
      - - - +
      +
      +
      + +
      +
      + +
      +
      +
      Dashboards
      + +
      +
      +
      +
      +
      Support
      + +
      +
      +
      +
      +
      Updates
      + +
      +
      +
      -
      -
      -
      -
      Dashboards
      - -
      -
      -
      -
      -
      Support
      - -
      -
      -
      -
      -
      Updates
      - +
      +
      +
      +
      + +
      +
      + +
      +
      + + + +
      +
      + + + +
      +
      + + + +
      +
      + +
      -
      - +
      +
      +
      + + + + + Unless otherwise indicated, all materials created by OpenAIRE are licenced under + CC ATTRIBUTION 4.0 INTERNATIONALLICENSE
      - +
      + + + +
      - -
      -
      -
      -
      -
      -
      -
      -
      - - - - - - - - - -   - - - {{' '}} - - - - - - - - - - - - - - - - - - license - -  Unless otherwise indicated, all materials created by OpenAIRE are licenced under CC ATTRIBUTION 4.0 INTERNATIONAL - LICENSE. +
      +
      +
      +
      +
      +
      +
      + OpenAIRE +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      + +
      +
      + +
      +
      + + + +
      +
      + + + +
      +
      + + + +
      +
      + +
      +
      -
      - +
      +
      +
      + + + + Unless otherwise indicated, all materials created by OpenAIRE are licenced under
      + +
      +
      diff --git a/sharedComponents/bottom.component.ts b/sharedComponents/bottom.component.ts index d810b9e6..e8158bfa 100644 --- a/sharedComponents/bottom.component.ts +++ b/sharedComponents/bottom.component.ts @@ -1,8 +1,8 @@ -import { Component, Input } from '@angular/core'; +import {Component, Input} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; import 'rxjs'; -import{MenuItem} from './menu'; -import { ConfigurationService } from '../utils/configuration/configuration.service'; +import {MenuItem} from './menu'; +import {ConfigurationService} from '../utils/configuration/configuration.service'; import {EnvProperties} from "../utils/properties/env-properties"; import {Subscription} from "rxjs"; import {properties} from '../../../environments/environment'; @@ -13,81 +13,71 @@ import {HelperService} from "../utils/helper/helper.service"; templateUrl: 'bottom.component.html' }) export class BottomComponent { - -@Input() showSocialButtons:boolean = true; -@Input() showOpenaire:boolean = true; -@Input() showMenuItems:boolean = false; -@Input() showCommision:boolean = true; -@Input() assetsPath:string ='assets/common-assets/'; -@Input() menuItems:MenuItem []; - -@Input() communityId; -// @Input() environment:string = "beta"; -showPage ={}; -@Input() grantAdvance:boolean = true; -// grantAdvanceText = "OpenAIRE-Advance receives funding from the European Union's Horizon 2020 Research and Innovation programme under Grant Agreement No. 777541."; -// grantConenctText = "OpenAIRE-Connect receives funding from the European Union's Horizon 2020 Research and Innovation programme under grant agreement No. 731011 and No. 777541."; -@Input() properties:EnvProperties = properties; -@Input() darkBackground:boolean=true; -@Input() centered:boolean=false; -@Input() shortView: boolean = false; -sectionClass= "uk-tile-default"; - -subs: Subscription[] = []; -public divContents = null; - -constructor(private config: ConfigurationService, private route: ActivatedRoute, - private helper: HelperService) { -} - + @Input() showSocialButtons: boolean = true; + @Input() showOpenaire: boolean = true; + @Input() showMenuItems: boolean = false; + @Input() showCommision: boolean = true; + @Input() assetsPath: string = 'assets/common-assets/'; + @Input() menuItems: MenuItem []; + @Input() communityId; + showPage = {}; + @Input() grantAdvance: boolean = true; + @Input() properties: EnvProperties = properties; + @Input() centered: boolean = false; + @Input() shortView: boolean = false; + @Input() background: string = "uk-tile-default"; + subs: Subscription[] = []; + public divContents = null; + + constructor(private config: ConfigurationService, private route: ActivatedRoute, + private helper: HelperService) { + } + ngOnInit() { - if(!properties.footerGrantText) { - this.getDivContents(); - } - if(!this.darkBackground){ - this.sectionClass= " footer-light-background"; - } - this.subs.push(this.route.queryParams.subscribe(params => { - if(this.showMenuItems){ - if( this.properties.adminToolsAPIURL && this.communityId ){ - //this.subs.push(this.config.getCommunityInformation(this.properties, this.communityId ).subscribe(data => { - this.subs.push(this.config.communityInformationState.subscribe(data => { - if(data) { - for (var i = 0; i < data['pages'].length; i++) { - this.showPage[data['pages'][i]["route"]] = data['pages'][i]["isEnabled"]; - - } - // console.log(this.showPage) - } - })); - } + if (!properties.footerGrantText) { + this.getDivContents(); } - })); + this.subs.push(this.route.queryParams.subscribe(params => { + if (this.showMenuItems) { + if (this.properties.adminToolsAPIURL && this.communityId) { + //this.subs.push(this.config.getCommunityInformation(this.properties, this.communityId ).subscribe(data => { + this.subs.push(this.config.communityInformationState.subscribe(data => { + if (data) { + for (var i = 0; i < data['pages'].length; i++) { + this.showPage[data['pages'][i]["route"]] = data['pages'][i]["isEnabled"]; + + } + // console.log(this.showPage) + } + })); + } + } + })); } - + public ngOnDestroy() { for (let sub of this.subs) { sub.unsubscribe(); } } - - isEnabled(required, enabled){ - - if(!required ){ + + isEnabled(required, enabled) { + + if (!required) { return true; } - for(let requiredEntity of required){ + for (let requiredEntity of required) { // console.log("R "+requiredEntity +" E " + enabled[requiredEntity]) - if(typeof enabled[requiredEntity] === "undefined" || enabled[requiredEntity] == false){ - return false; - } + if (typeof enabled[requiredEntity] === "undefined" || enabled[requiredEntity] == false) { + return false; + } } return true; } - + private getDivContents() { - let communityId = this.communityId; - if(!communityId) { + let communityId = this.communityId; + if (!communityId) { communityId = properties.adminToolsCommunity; } this.subs.push(this.helper.getDivHelpContents(this.properties, communityId, "/").subscribe(contents => { diff --git a/sharedComponents/bottom.module.ts b/sharedComponents/bottom.module.ts index 23dacc1e..c8464867 100644 --- a/sharedComponents/bottom.module.ts +++ b/sharedComponents/bottom.module.ts @@ -1,22 +1,25 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { RouterModule } from "@angular/router"; +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {FormsModule} from '@angular/forms'; +import {RouterModule} from "@angular/router"; import {BottomComponent} from './bottom.component'; import {HelperModule} from "../utils/helper/helper.module"; +import {IconsModule} from "../utils/icons/icons.module"; +import {IconsService} from "../utils/icons/icons.service"; +import {by, cc, facebook, linkedin, newsletter, slideshare, twitter, youtube} from "../utils/icons/icons"; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, HelperModule - + CommonModule, FormsModule, RouterModule, HelperModule, IconsModule ], declarations: [ BottomComponent ], - - exports: [ - BottomComponent - ] + exports: [BottomComponent] }) -export class BottomModule{ } +export class BottomModule{ + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([by, cc, twitter, facebook, linkedin, slideshare, youtube, newsletter]); + } +} diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index b5dd99ae..f124b02a 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -13,7 +13,7 @@ import { SimpleChanges, ViewChild } from "@angular/core"; -import {AbstractControl, FormArray, FormControl, ValidatorFn} from "@angular/forms"; +import {AbstractControl, UntypedFormArray, UntypedFormControl, ValidatorFn} from "@angular/forms"; import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {Subscription} from "rxjs"; import {EnvProperties} from "../../utils/properties/env-properties"; @@ -60,7 +60,7 @@ declare var UIkit;
      + [attr.uk-tooltip]="(tooltip && !focused && type !== 'chips' && type !== 'textarea' && (formControl.value || hint || placeholderInfo?.label))?('title: ' + (formControl.value ?getTooltip(formControl.value):(hint?hint:placeholderInfo?.label)) + '; delay: 500; pos: bottom-left'):null"> @@ -217,7 +217,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() noValueSelected: string = 'No option selected'; /** Chips && Autocomplete*/ public filteredOptions: Option[] = []; - public searchControl: FormControl; + public searchControl: UntypedFormControl; /** Use modifier's class(es) to change view of your Input */ @Input() inputClass: string = 'inner'; /** Icon on the input */ @@ -332,12 +332,12 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang this.id = 'input-' + InputComponent.INPUT_COUNTER; if (!this.formControl) { if (Array.isArray(this.value)) { - this.formControl = new FormArray([]); + this.formControl = new UntypedFormArray([]); this.value.forEach(value => { - this.formAsArray.push(new FormControl(value, this.validators)); + this.formAsArray.push(new UntypedFormControl(value, this.validators)); }); } else { - this.formControl = new FormControl(this.value); + this.formControl = new UntypedFormControl(this.value); this.formControl.setValidators(this.validators); } if (this.disabled) { @@ -372,16 +372,16 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang this.unsubscribe(); } - get formAsControl(): FormControl { - if (this.formControl instanceof FormControl) { + get formAsControl(): UntypedFormControl { + if (this.formControl instanceof UntypedFormControl) { return this.formControl; } else { return null; } } - get formAsArray(): FormArray { - if (this.formControl instanceof FormArray) { + get formAsArray(): UntypedFormArray { + if (this.formControl instanceof UntypedFormArray) { return this.formControl; } else { return null; @@ -401,7 +401,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } if (this.type === 'chips' || this.type === 'autocomplete') { if (!this.searchControl) { - this.searchControl = new FormControl('', this.validators); + this.searchControl = new UntypedFormControl('', this.validators); } this.subscriptions.push(this.searchControl.valueChanges.subscribe(value => { this.filteredOptions = this.filter(value); @@ -488,7 +488,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang if (event && event.stopPropagation) { event.stopPropagation(); } - this.formAsArray.push(new FormControl(this.searchControl.value, this.validators)); + this.formAsArray.push(new UntypedFormControl(this.searchControl.value, this.validators)); this.formAsArray.markAsDirty(); } this.searchControl.setValue(''); @@ -573,7 +573,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang if (this.formAsControl) { this.formAsControl.setValue(option.value); } else if (this.formAsArray) { - this.formAsArray.push(new FormControl(option.value)); + this.formAsArray.push(new UntypedFormControl(option.value)); this.formAsArray.markAsDirty(); event.stopPropagation(); this.focus(true); diff --git a/sharedComponents/menu.ts b/sharedComponents/menu.ts index 000f05a5..fc186356 100644 --- a/sharedComponents/menu.ts +++ b/sharedComponents/menu.ts @@ -76,6 +76,7 @@ export class Menu { portalPid: string; isFeaturedMenuEnabled: boolean; isMenuEnabled: boolean; + featuredAlignment: MenuAlignment; featuredMenuItems: MenuItemExtended[] = []; menuItems: MenuItemExtended[] = []; } @@ -83,3 +84,5 @@ export class Menu { export class SideMenuItem extends MenuItem { ukIcon: string = ''; } + +export enum MenuAlignment {LEFT="LEFT", CENTER="CENTER", RIGHT="RIGHT"} \ No newline at end of file diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html index adab204f..bb24504d 100644 --- a/sharedComponents/navigationBar.component.html +++ b/sharedComponents/navigationBar.component.html @@ -1,5 +1,5 @@
      -
      +
    -

    Usage

    diff --git a/utils/icons/icons-preview/icons-preview.module.ts b/utils/icons/icons-preview/icons-preview.module.ts index 5ce06c31..31f3916b 100644 --- a/utils/icons/icons-preview/icons-preview.module.ts +++ b/utils/icons/icons-preview/icons-preview.module.ts @@ -15,7 +15,9 @@ import { orcid_add, orcid_bin, quotes, - restricted + restricted, + by, + cc, twitter, facebook, linkedin, slideshare, youtube, newsletter } from "../icons"; @NgModule({ @@ -27,6 +29,6 @@ import { }) export class IconsPreviewModule { constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([book, database, cog, earth, incognito, restricted, graph, filters, orcid_add, orcid_bin, link, quotes, mining]) + this.iconsService.registerIcons([book, database, cog, earth, incognito, restricted, graph, filters, orcid_add, orcid_bin, link, quotes, mining, by, cc, twitter, facebook, linkedin, slideshare, youtube, newsletter]) } } diff --git a/utils/icons/icons.component.ts b/utils/icons/icons.component.ts index e44a1468..6ed6b574 100644 --- a/utils/icons/icons.component.ts +++ b/utils/icons/icons.component.ts @@ -46,7 +46,7 @@ export interface StopRule { @Component({ selector: 'icon', template: ` - + {{iconName}} @@ -125,6 +125,8 @@ export class IconsComponent implements AfterViewInit, OnChanges { public stopRules: StopRule[]= [{class: 'start', offset: 0}, {class: 'end', offset: 100}]; @ViewChild("icon") public icon: ElementRef; + @Input() + public preserveColor: boolean = false; constructor(private iconsService: IconsService, private cdr: ChangeDetectorRef) {} diff --git a/utils/icons/icons.ts b/utils/icons/icons.ts index 1a6447dd..fb4fab03 100644 --- a/utils/icons/icons.ts +++ b/utils/icons/icons.ts @@ -3,30 +3,6 @@ export interface Icon { data: string } -/** @deprecated */ -export const arrow_left: Icon = { - name: 'arrow_left', - data: '' -} - -/** @deprecated */ -export const arrow_right: Icon = { - name: 'arrow_right', - data: '' -}; - -/** @deprecated */ -export const arrow_up: Icon = { - name: 'arrow_up', - data: '' -} - -/** @deprecated */ -export const arrow_down: Icon = { - name: 'arrow_down', - data: '' -} - export const book: Icon = { name: 'book', data: '' @@ -47,137 +23,6 @@ export const earth: Icon = { data: '' } -/** @deprecated */ -export const edit: Icon = { - name: 'edit', - data: '' -} - -/** @deprecated - * - * Use delete - * */ -export const remove: Icon = { - name: 'remove', - data: '' -} - -/** @deprecated - * Use visibility - * */ -export const preview: Icon = { - name: 'preview', - data: '' -} - -/** @deprecated */ -export const bullet: Icon = { - name: 'bullet', - data: '' -} - -/** @deprecated */ -export const remove_circle = { - name: 'remove_circle', - data: '' -} - -/** @deprecated */ -export const remove_circle_outline = { - name: 'remove_circle_outline', - data: '' -} - -/** @deprecated */ -export const person_add = { - name: 'person_add', - data: '' -} - -/** @deprecated */ -export const cloud_upload = { - name: 'cloud_upload', - data: '' -} - -/** @deprecated */ -export const add = { - name: 'add', - data: '' -} - -/** @deprecated */ -export const group = { - name: 'group', - data: '' -} - -/** @deprecated */ -export const lock = { - name: 'lock', - data: '' -} - -/** @deprecated */ -export const search = { - name: 'search', - data: '' -} - -/** @deprecated */ -export const refresh = { - name: 'refresh', - data: '' -} - -/** @deprecated */ -export const close = { - name: 'close', - data: '' -} - -/** @deprecated */ -export const done = { - name: 'done', - data: '' -} - -/** @deprecated */ -export const mail = { - name: 'mail', - data: '' -} - -/** @deprecated */ -export const photo = { - name: 'photo', - data: '' -} - -/** @deprecated */ -export const check_circle_outlined = { - name: 'check_circle_outlined', - data: '' -} - -/** @deprecated */ -export const reset = { - name: 'reset', - data: '' -} - -/** @deprecated */ -export const send = { - name: 'send', - data: '' -} - -/** @deprecated */ -export const print = { - name: 'print', - data: '' -} - export const incognito = { name: 'incognito', data: '' @@ -223,4 +68,48 @@ export const mining = { data: '' } +export const by = { + name: 'by', + data: '' +} + +export const cc = { + name: 'cc', + data: '' +} + +export const twitter = { + name: 'twitter', + data: '' +} + +export const facebook = { + name: 'facebook', + data: '' +} + +export const linkedin = { + name: 'linkedin', + data: '' +} + +export const slideshare = { + name: 'slideshare', + data: '' +} + +export const youtube = { + name: 'youtube', + data: '' +} + +export const newsletter = { + name: 'newsletter', + data: '' +} + +export const login = { + name: 'login', + data: '' +} /** Add new icon under this line to be sure that it will be added on preview */ diff --git a/utils/modal/loading.component.ts b/utils/modal/loading.component.ts index 81c84c23..7dcd3ed9 100644 --- a/utils/modal/loading.component.ts +++ b/utils/modal/loading.component.ts @@ -1,10 +1,21 @@ -import {Component, ViewEncapsulation, ComponentRef, ElementRef, Input, EventEmitter, Output} from '@angular/core'; +import { + Component, + ViewEncapsulation, + ComponentRef, + ElementRef, + Input, + EventEmitter, + Output, + ViewChild +} from '@angular/core'; +declare var UIkit: any; @Component({ selector: 'modal-loading', template: ` - -
    + + +
    @@ -23,6 +34,23 @@ import {Component, ViewEncapsulation, ComponentRef, ElementRef, Input, EventEmit
    + + + + + + + + + + + + + + + + +
    -

    - {{result.description}} -

    +

    @@ -307,7 +305,7 @@
    @@ -393,7 +391,7 @@ - 0 && isResultType" class="uk-margin-auto-left"> 0 ? result.description[0] : ""; + resultPreview.description = result.description;//.length > 0 ? result.description[0] : ""; if(result.dateofacceptance) { resultPreview.year = new Date(result.dateofacceptance).getFullYear().toString(); } diff --git a/utils/smooth-scroll.ts b/utils/smooth-scroll.ts index 5663d6ca..c828b450 100644 --- a/utils/smooth-scroll.ts +++ b/utils/smooth-scroll.ts @@ -1,6 +1,7 @@ import {ActivationStart, NavigationEnd, Router} from '@angular/router'; import {Injectable, Type} from '@angular/core'; import {Subscription} from 'rxjs'; +import {LayoutService} from "../dashboard/sharedComponents/sidebar/layout.service"; @Injectable({ providedIn: 'root' @@ -12,7 +13,7 @@ export class SmoothScroll { private currentComponent: string; private extraOffset: number = 0; - constructor(private router: Router) { + constructor(private router: Router, private layoutService: LayoutService) { if (typeof window !== "undefined") { this.sub = router.events.subscribe(event => { if (event instanceof ActivationStart) { @@ -21,7 +22,7 @@ export class SmoothScroll { this.currentComponent = event.snapshot.component.name; } } else if (event instanceof NavigationEnd) { - let headerOffset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--header-height')) + 35; + let headerOffset = (this.layoutService.isMobileValue?0:Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--header-height'))) + 35; if(!this.router.getCurrentNavigation().extras?.state?.disableScroll) { if (this.interval) { clearInterval(this.interval); @@ -46,7 +47,7 @@ export class SmoothScroll { position = element.getBoundingClientRect().top; } else { clearInterval(interval); - const y = element.getBoundingClientRect().top + window.pageYOffset + yOffset; + const y = element.getBoundingClientRect().top + window.scrollY + yOffset; window.scrollTo({top: y, behavior: 'smooth'}); } }, 50); diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts index 5823091f..8df594e5 100644 --- a/utils/staticAutoComplete/ISVocabularies.service.ts +++ b/utils/staticAutoComplete/ISVocabularies.service.ts @@ -13,7 +13,7 @@ export class ISVocabulariesService { private subjectsVocabulary: BehaviorSubject = new BehaviorSubject(null); private relationsVocabulary: BehaviorSubject = new BehaviorSubject(null); private subscriptions = []; - private vocabulariesPromises: Map> = new Map>(); + private vocabulariesPromises: Map> = new Map>(); constructor(private http: HttpClient) {} ngOnDestroy() { @@ -72,7 +72,7 @@ export class ISVocabulariesService { this.vocabularies.set(vocabularyName, new BehaviorSubject(null)); if(!this.vocabulariesPromises.has(vocabularyName)) { this.vocabulariesPromises.set(vocabularyName, - new Promise(resolve => { + new Promise(resolve => { this.subscriptions.push(this.getVocabularyFromService(vocabularyName, properties).subscribe( vocabularyRes => { this.vocabularies.get(vocabularyName).next(vocabularyRes); @@ -183,7 +183,7 @@ export class ISVocabulariesService { async getProvenanceActionVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> { if(!this.provenanceActionVocabulary || !this.provenanceActionVocabulary.getValue()) { - await new Promise(resolve => { + await new Promise(resolve => { this.subscriptions.push(this.getProvenanceActionVocabularyFromService(vocabularyName, properties).subscribe( vocabularyRes => { this.provenanceActionVocabulary.next(vocabularyRes); @@ -223,7 +223,7 @@ export class ISVocabulariesService { async getSubjectsVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> { if(!this.subjectsVocabulary || !this.subjectsVocabulary.getValue()) { - await new Promise(resolve => { + await new Promise(resolve => { this.subscriptions.push(this.getSubjectsVocabularyFromService(vocabularyName, properties).subscribe( vocabularyRes => { // console.log(vocabularyRes); @@ -267,7 +267,7 @@ export class ISVocabulariesService { async getRelationsVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> { if(!this.relationsVocabulary || !this.relationsVocabulary.getValue()) { - await new Promise(resolve => { + await new Promise(resolve => { this.subscriptions.push(this.getRelationsVocabularyFromService(vocabularyName, properties).subscribe( vocabularyRes => { this.relationsVocabulary.next(vocabularyRes); diff --git a/utils/string-utils.class.ts b/utils/string-utils.class.ts index 75046e4a..ced29bc7 100644 --- a/utils/string-utils.class.ts +++ b/utils/string-utils.class.ts @@ -1,5 +1,5 @@ import {UrlSegment} from '@angular/router'; -import {AbstractControl, FormGroup, ValidationErrors, ValidatorFn, Validators} from "@angular/forms"; +import {AbstractControl, UntypedFormGroup, ValidationErrors, ValidatorFn, Validators} from "@angular/forms"; import {Stakeholder, StakeholderEntities} from "../monitor/entities/stakeholder"; import {CommunityInfo} from "../connect/community/communityInfo"; import {properties} from "../../../environments/environment"; @@ -435,7 +435,7 @@ export class StringUtils { }; } - public static fromYearAfterToYearValidator: ValidatorFn = (control: FormGroup): ValidationErrors | null => { + public static fromYearAfterToYearValidator: ValidatorFn = (control: UntypedFormGroup): ValidationErrors | null => { const yearFrom = control.get('yearFrom'); const yearTo = control.get('yearTo'); return ((yearFrom && yearTo && (parseInt(yearFrom.value, 10) > parseInt(yearTo.value, 10))) ? { 'fromYearAfterToYear': true } : null); diff --git a/utils/transition-group/transition-group.component.ts b/utils/transition-group/transition-group.component.ts index 5a3ae537..53530868 100644 --- a/utils/transition-group/transition-group.component.ts +++ b/utils/transition-group/transition-group.component.ts @@ -1,5 +1,13 @@ import {TransitionGroupItemDirective} from "./transition-group-item.directive"; -import {AfterViewInit, Component, ContentChildren, OnDestroy, QueryList, ViewEncapsulation} from "@angular/core"; +import { + AfterViewInit, + Component, + ContentChildren, + ElementRef, Input, + OnDestroy, + QueryList, + ViewEncapsulation +} from "@angular/core"; import {Subscription} from "rxjs"; import {THREE} from "@angular/cdk/keycodes"; @@ -19,9 +27,13 @@ import {THREE} from "@angular/cdk/keycodes"; }) export class TransitionGroupComponent implements AfterViewInit, OnDestroy { @ContentChildren(TransitionGroupItemDirective) items: QueryList; + @Input() + public id: string; private disabled: boolean = false; private subscription: Subscription; + constructor(public element: ElementRef) {} + ngAfterViewInit() { this.init(); this.subscription = this.items.changes.subscribe(items => {