From 98effe34a0cfe0ec86263567e7d695131f521f39 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Mon, 10 Oct 2022 17:20:51 +0300 Subject: [PATCH 01/10] update FOS page, change to new uoa-admin-tools duffy port --- explore/src/app/fos/fos.component.html | 160 +++++++++++------------- explore/src/app/fos/fos.component.ts | 48 +++---- explore/src/app/openaireLibrary | 2 +- explore/src/environments/environment.ts | 2 +- 4 files changed, 92 insertions(+), 120 deletions(-) diff --git a/explore/src/app/fos/fos.component.html b/explore/src/app/fos/fos.component.html index b8e77672..024a7780 100644 --- a/explore/src/app/fos/fos.component.html +++ b/explore/src/app/fos/fos.component.html @@ -36,107 +36,93 @@ -
-
-
-
+
+
+
- -
-
Search results for:
- - - {{keyword}} - - - - - -
-
- +
-
+ - - -
- -
-

- - -

-
-
-

- - -

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

No results were found.

diff --git a/explore/src/app/fos/fos.component.ts b/explore/src/app/fos/fos.component.ts index dc588ea3..5bcd2765 100644 --- a/explore/src/app/fos/fos.component.ts +++ b/explore/src/app/fos/fos.component.ts @@ -12,6 +12,7 @@ import {Location} from "@angular/common"; import {StringUtils} from "../openaireLibrary/utils/string-utils.class"; import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; +import {debounceTime, distinctUntilChanged} from "rxjs/operators"; @Component({ selector: 'fos', @@ -25,10 +26,10 @@ export class FosComponent implements OnInit, OnDestroy { public fos: any[] = []; public fosOptions: string[] = []; - public index: number = 0; + public activeSection: string; public keywordControl: FormControl; - public keyword: string = null; + public keyword: string; public viewResults = []; @@ -60,17 +61,21 @@ export class FosComponent implements OnInit, OnDestroy { this.updateUrl(this.url); this.updateTitle(this.pageTitle); this.updateDescription(this.pageDescription); - this.keywordControl = this.fb.control(''); this.httpClient.get(properties.domain+'/assets/vocabulary/fos.json').subscribe(data => { this.fos = data['fos']; this.convertFosToOptions(); - this.subscriptions.push(this.route.queryParams.subscribe(params => { - if(params.keyword) { - this.keywordControl.setValue(params.keyword); - this.keyword = this.keywordControl.value; - this.findMatches(); + this.subscriptions.push(this.route.fragment.subscribe(fragment => { + if(fragment) { + this.activeSection = fragment; + } else { + this.activeSection = this.fos[0].id; } })); + this.keywordControl = this.fb.control(''); + this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => { + this.keyword = value; + this.findMatches(this.keyword); + })); }); } @@ -79,19 +84,6 @@ export class FosComponent implements OnInit, OnDestroy { sub.unsubscribe(); } } - - changeDisplayedFos(i) { - this.index = i; - } - - onSubmit() { - if(this.keywordControl.value) { - this.keyword = this.keywordControl.value; - // TODO: router.navigate(); - this.location.go(window.location.pathname + '?keyword=' + this.keyword); - this.findMatches(); - } - } convertFosToOptions() { this.fosOptions = []; @@ -110,14 +102,14 @@ export class FosComponent implements OnInit, OnDestroy { }); } - findMatches() { + findMatches(value: string) { this.viewResults = JSON.parse(JSON.stringify(this.fos)); let matchLevel1: boolean = false; let matchLevel2: boolean = false; // 1st level search if(this.viewResults.length) { this.viewResults = this.viewResults.filter(item => { - if(item.id.includes(this.keyword.toLowerCase())) { + if(item.id.includes(value?.toLowerCase())) { matchLevel1 = true; } else { matchLevel1 = false; @@ -125,14 +117,14 @@ export class FosComponent implements OnInit, OnDestroy { // // 2nd level search if(item.children?.length && !matchLevel1) { item.children = item.children.filter(subItem => { - if(subItem.id.includes(this.keyword.toLowerCase())) { + if(subItem.id.includes(value?.toLowerCase())) { matchLevel2 = true; } else { matchLevel2 = false; } // 3rd level search if(subItem.children?.length && !matchLevel2) { - subItem.children = subItem.children.filter(subSubItem => subSubItem.id.includes(this.keyword.toLowerCase())); + subItem.children = subItem.children.filter(subSubItem => subSubItem.id.includes(value?.toLowerCase())); } return subItem.children?.length > 0 || matchLevel2; }); @@ -150,12 +142,6 @@ export class FosComponent implements OnInit, OnDestroy { } } - clearKeyword() { - this.keyword = null; - this.keywordControl.setValue(''); - this.location.go(window.location.pathname); - } - public urlEncodeAndQuote(str: string): string { return StringUtils.quote(StringUtils.URIEncode(str)); } diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index 9ac7ed93..d6c54949 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 9ac7ed93d4420cf904609b1fbfbe341cc4ae8836 +Subproject commit d6c54949df4c0106ad0f290fcc1c245a9324015d diff --git a/explore/src/environments/environment.ts b/explore/src/environments/environment.ts index e4260d95..af794914 100644 --- a/explore/src/environments/environment.ts +++ b/explore/src/environments/environment.ts @@ -65,7 +65,7 @@ export let properties: EnvProperties = { cacheUrl: "http://dl170.madgik.di.uoa.gr:3000/get?url=", - adminToolsAPIURL: "http://duffy.di.uoa.gr:8080/uoa-admin-tools/", + adminToolsAPIURL: "http://duffy.di.uoa.gr:19280/uoa-admin-tools/", adminToolsCommunity: "openaire", datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/api/", From dc1f947d7abfea59a660d1dbb86a1577f45d666a Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 12 Oct 2022 12:25:47 +0300 Subject: [PATCH 02/10] Fos: Change search-modifier, make some page alignments and add observer to handle scroll --- explore/src/app/app-routing.module.ts | 5 ++- explore/src/app/fos/fos.component.html | 10 +++--- explore/src/app/fos/fos.component.ts | 49 +++++++++++++++++++------- explore/src/app/openaireLibrary | 2 +- explore/src/assets/openaire-theme | 2 +- 5 files changed, 46 insertions(+), 22 deletions(-) diff --git a/explore/src/app/app-routing.module.ts b/explore/src/app/app-routing.module.ts index 291b194f..10166089 100644 --- a/explore/src/app/app-routing.module.ts +++ b/explore/src/app/app-routing.module.ts @@ -1,16 +1,15 @@ import {NgModule} from '@angular/core'; -import {PreloadAllModules, RouterModule, Routes} from '@angular/router'; +import {RouterModule, Routes} from '@angular/router'; import {OpenaireErrorPageComponent} from './error/errorPage.component'; import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component"; const routes: Routes = [ // Other Pages {path: '', loadChildren: () => import('./home/home.module').then(m => m.HomeModule)}, - //{ path: 'home', loadChildren: './home/home.module#HomeModule'}, {path: 'home', redirectTo: '', pathMatch: 'full'}, {path: 'mail-preferences', loadChildren: () => import('./userEmailPreferences/mailPrefs.module').then(m => m.LibMailPrefsModule)}, {path: 'sdgs', loadChildren: () => import('./sdg/sdg.module').then(m => m.SdgModule)}, - {path: 'fields-of-science', loadChildren: () => import('./fos/fos.module').then(m => m.FosModule)}, + {path: 'fields-of-science', loadChildren: () => import('./fos/fos.module').then(m => m.FosModule), data: {extraOffset: 100}}, {path: 'contact-us', loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule)}, // ORCID Pages {path: 'orcid', loadChildren: () => import('./orcid/orcid.module').then(m => m.LibOrcidModule)}, diff --git a/explore/src/app/fos/fos.component.html b/explore/src/app/fos/fos.component.html index 024a7780..accf321d 100644 --- a/explore/src/app/fos/fos.component.html +++ b/explore/src/app/fos/fos.component.html @@ -39,15 +39,15 @@
-
+
-
+
  • @@ -73,9 +73,9 @@
-
+
-
+

diff --git a/explore/src/app/fos/fos.component.ts b/explore/src/app/fos/fos.component.ts index 5bcd2765..0545672a 100644 --- a/explore/src/app/fos/fos.component.ts +++ b/explore/src/app/fos/fos.component.ts @@ -13,6 +13,7 @@ import {StringUtils} from "../openaireLibrary/utils/string-utils.class"; import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; import {debounceTime, distinctUntilChanged} from "rxjs/operators"; +import Timeout = NodeJS.Timeout; @Component({ selector: 'fos', @@ -37,8 +38,10 @@ export class FosComponent implements OnInit, OnDestroy { properties: EnvProperties = properties; public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Fields of Science'}]; - - subscriptions: Subscription[] = []; + + private subscriptions: Subscription[] = []; + private observer: IntersectionObserver; + private timeout: Timeout; constructor( private httpClient: HttpClient, @@ -75,6 +78,9 @@ export class FosComponent implements OnInit, OnDestroy { this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => { this.keyword = value; this.findMatches(this.keyword); + setTimeout(() => { + this.setObserver(); + }); })); }); } @@ -83,8 +89,35 @@ export class FosComponent implements OnInit, OnDestroy { for (let sub of this.subscriptions) { sub.unsubscribe(); } + if(this.observer) { + this.observer.disconnect(); + } } + private setObserver() { + if(this.observer) { + this.observer.disconnect(); + } + this.observer = new IntersectionObserver((entries) => { + entries.forEach(entry => { + if(entry.isIntersecting) { + if(this.timeout) { + clearTimeout(this.timeout); + } + this.timeout = setTimeout(() => { + this._router.navigate(['./'], {fragment: entry.target.id, relativeTo: this.route, state: {disableScroll: true}}); + }, 200); + } + }); + }, {threshold: 0.25, rootMargin: '-100px'}); + this.fos.forEach(fos => { + let element = document.getElementById(fos.id); + if(element) { + this.observer.observe(element); + } + }); + } + convertFosToOptions() { this.fosOptions = []; this.fos.forEach(fos => { @@ -109,19 +142,11 @@ export class FosComponent implements OnInit, OnDestroy { // 1st level search if(this.viewResults.length) { this.viewResults = this.viewResults.filter(item => { - if(item.id.includes(value?.toLowerCase())) { - matchLevel1 = true; - } else { - matchLevel1 = false; - } + matchLevel1 = !!item.id.includes(value?.toLowerCase()); // // 2nd level search if(item.children?.length && !matchLevel1) { item.children = item.children.filter(subItem => { - if(subItem.id.includes(value?.toLowerCase())) { - matchLevel2 = true; - } else { - matchLevel2 = false; - } + matchLevel2 = !!subItem.id.includes(value?.toLowerCase()); // 3rd level search if(subItem.children?.length && !matchLevel2) { subItem.children = subItem.children.filter(subSubItem => subSubItem.id.includes(value?.toLowerCase())); diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index d6c54949..09706515 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit d6c54949df4c0106ad0f290fcc1c245a9324015d +Subproject commit 09706515ba1feb0d44c02485bee9782f63a5978f diff --git a/explore/src/assets/openaire-theme b/explore/src/assets/openaire-theme index 8bb758b3..f2d544d4 160000 --- a/explore/src/assets/openaire-theme +++ b/explore/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit 8bb758b340d05b50b65da48863ff7ed69fdc122b +Subproject commit f2d544d4f1ec152db80528be300f0936add71190 From 6380311b1eb2ab27cc9f813b9cf47f3bd4f41066 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Wed, 12 Oct 2022 15:31:34 +0300 Subject: [PATCH 03/10] add fixed contact/help button --- explore/src/app/app-routing.module.ts | 20 ++--- explore/src/app/app.component.ts | 94 ++++++++++++++++++++++-- explore/src/app/app.module.ts | 7 +- explore/src/app/fos/fos.component.html | 4 +- explore/src/app/home/home.component.html | 2 +- explore/src/app/home/home.component.ts | 30 ++++++-- explore/src/app/openaireLibrary | 2 +- explore/src/assets/explore-custom.less | 7 ++ 8 files changed, 142 insertions(+), 24 deletions(-) diff --git a/explore/src/app/app-routing.module.ts b/explore/src/app/app-routing.module.ts index 10166089..dcba415f 100644 --- a/explore/src/app/app-routing.module.ts +++ b/explore/src/app/app-routing.module.ts @@ -10,24 +10,26 @@ const routes: Routes = [ {path: 'mail-preferences', loadChildren: () => import('./userEmailPreferences/mailPrefs.module').then(m => m.LibMailPrefsModule)}, {path: 'sdgs', loadChildren: () => import('./sdg/sdg.module').then(m => m.SdgModule)}, {path: 'fields-of-science', loadChildren: () => import('./fos/fos.module').then(m => m.FosModule), data: {extraOffset: 100}}, - {path: 'contact-us', loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule)}, + {path: 'contact-us', loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule), data: {hasQuickContact: false}}, // ORCID Pages {path: 'orcid', loadChildren: () => import('./orcid/orcid.module').then(m => m.LibOrcidModule)}, {path: 'my-orcid-links', loadChildren: () => import('./orcid/my-orcid-links/myOrcidLinks.module').then(m => m.LibMyOrcidLinksModule)}, // Landing Pages - {path: 'search/result', loadChildren: () => import('./landingPages/result/libResult.module').then(m => m.LibResultModule)}, - {path: 'search/publication', loadChildren: () => import('./landingPages/publication/libPublication.module').then(m => m.LibPublicationModule)}, - {path: 'search/dataset', loadChildren: () => import('./landingPages/dataset/libDataset.module').then(m => m.LibDatasetModule)}, - {path: 'search/software', loadChildren: () => import('./landingPages/software/libSoftware.module').then(m => m.LibSoftwareModule)}, - {path: 'search/other', loadChildren: () => import('./landingPages/orp/libOrp.module').then(m => m.LibOrpModule)}, - {path: 'search/project', loadChildren: () => import('./landingPages/project/libProject.module').then(m => m.LibProjectModule)}, + {path: 'search/result', loadChildren: () => import('./landingPages/result/libResult.module').then(m => m.LibResultModule), data: {hasQuickContact: false}}, + {path: 'search/publication', loadChildren: () => import('./landingPages/publication/libPublication.module').then(m => m.LibPublicationModule), data: {hasQuickContact: false}}, + {path: 'search/dataset', loadChildren: () => import('./landingPages/dataset/libDataset.module').then(m => m.LibDatasetModule), data: {hasQuickContact: false}}, + {path: 'search/software', loadChildren: () => import('./landingPages/software/libSoftware.module').then(m => m.LibSoftwareModule), data: {hasQuickContact: false}}, + {path: 'search/other', loadChildren: () => import('./landingPages/orp/libOrp.module').then(m => m.LibOrpModule), data: {hasQuickContact: false}}, + {path: 'search/project', loadChildren: () => import('./landingPages/project/libProject.module').then(m => m.LibProjectModule), data: {hasQuickContact: false}}, { path: 'search/dataprovider', - loadChildren: () => import('././landingPages/dataProvider/libDataProvider.module').then(m => m.LibDataProviderModule) + loadChildren: () => import('././landingPages/dataProvider/libDataProvider.module').then(m => m.LibDataProviderModule), + data: {hasQuickContact: false} }, { path: 'search/organization', - loadChildren: () => import('./landingPages/organization/libOrganization.module').then(m => m.LibOrganizationModule) + loadChildren: () => import('./landingPages/organization/libOrganization.module').then(m => m.LibOrganizationModule), + data: {hasQuickContact: false} }, { path: 'project-report', diff --git a/explore/src/app/app.component.ts b/explore/src/app/app.component.ts index a3e2cad1..538570f3 100644 --- a/explore/src/app/app.component.ts +++ b/explore/src/app/app.component.ts @@ -1,10 +1,8 @@ -import {Component} from '@angular/core'; +import {ChangeDetectorRef, Component, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; - import {EnvProperties} from './openaireLibrary/utils/properties/env-properties'; import {MenuItem} from './openaireLibrary/sharedComponents/menu'; import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service'; - import {Session, User} from './openaireLibrary/login/utils/helper.class'; import {UserManagementService} from "./openaireLibrary/services/user-management.service"; import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service"; @@ -15,6 +13,14 @@ import {properties} from "../environments/environment"; import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll"; import {SEOService} from "./openaireLibrary/sharedComponents/SEO/SEO.service"; import {OpenaireEntities} from "./openaireLibrary/utils/properties/searchFields"; +import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {QuickContactComponent} from './openaireLibrary/sharedComponents/quick-contact/quick-contact.component'; +import {EmailService} from './openaireLibrary/utils/email/email.service'; +import {Composer} from "./openaireLibrary/utils/email/composer"; +import {AlertModal} from './openaireLibrary/utils/modal/alert'; +import {NotificationHandler} from "./openaireLibrary/utils/notification-handler"; +import {QuickContactService} from './openaireLibrary/sharedComponents/quick-contact/quick-contact.service'; +import {LayoutService} from './openaireLibrary/dashboard/sharedComponents/sidebar/layout.service'; @Component({ //changeDetection: ChangeDetectionStrategy.Default, @@ -46,6 +52,9 @@ import {OpenaireEntities} from "./openaireLibrary/utils/properties/searchFields" + + ` }) export class AppComponent { @@ -56,17 +65,29 @@ export class AppComponent { properties: EnvProperties = properties; user: User; header: Header; + public showQuickContact: boolean; + public contactForm: FormGroup; + public sending: boolean = false; + @ViewChild('quickContact') quickContact: QuickContactComponent; + @ViewChild('modal') modal: AlertModal; + subscriptions = []; constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService, private router: Router, private userManagementService: UserManagementService, private smoothScroll: SmoothScroll, - private configurationService: ConfigurationService, private _meta: Meta, private seoService: SEOService,) { + private configurationService: ConfigurationService, private _meta: Meta, private seoService: SEOService, + private emailService: EmailService, private fb: FormBuilder, private quickContactService: QuickContactService, + private layoutService: LayoutService, private cdr: ChangeDetectorRef) { } ngOnInit() { if (typeof document !== 'undefined') { this.isClient = true; } + this.subscriptions.push(this.layoutService.hasQuickContact.subscribe(hasQuickContact => { + this.showQuickContact = hasQuickContact; + this.cdr.detectChanges(); + })); this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity); this.feedbackmail = this.properties.feedbackmail; if (this.properties.environment == "production" || this.properties.environment == "development") { @@ -88,6 +109,10 @@ export class AppComponent { position: 'left', badge: true }; + this.reset(); + })); + this.subscriptions.push(this.quickContactService.isDisplayed.subscribe(display => { + this.showQuickContact = display; })); } @@ -138,7 +163,6 @@ export class AppComponent { new MenuItem("", "Registries", "", "/search/entity-registries", false, ["datasource"], ["/search/entity-registries"], {}), new MenuItem("", "Browse all", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], {})] ), - new MenuItem("contact", "Contact us", "", "/contact-us", false, [], ["/contact-us"], {}), ]; if (Session.isPortalAdministrator(this.user)) { this.userMenuItems.push(new MenuItem("", "Manage all links", "", "/claims", false, [], ["/claims"], {})); @@ -150,6 +174,66 @@ export class AppComponent { if (this.user) { this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {})); } + } + + public send(event) { + if (event.valid === true) { + this.sendMail(this.properties.admins); + } + } + + private sendMail(admins: string[]) { + this.sending = true; + this.subscriptions.push(this.emailService.contact(this.properties, + Composer.composeEmailForExplore(this.contactForm.value, admins), + this.contactForm.value.recaptcha).subscribe( + res => { + if (res) { + this.sending = false; + this.reset(); + this.modalOpen(); + } else { + this.handleError('Email sent failed! Please try again.'); + } + }, + error => { + this.handleError('Email sent failed! Please try again.', error); + } + )); + } + + public reset() { + if (this.quickContact) { + this.quickContact.close(); + } + this.contactForm = this.fb.group({ + name: this.fb.control('', Validators.required), + surname: this.fb.control('', Validators.required), + email: this.fb.control('', [Validators.required, Validators.email]), + affiliation: this.fb.control(''), + message: this.fb.control('', Validators.required), + recaptcha: this.fb.control('', Validators.required), + }); + } + + public modalOpen() { + this.modal.okButton = true; + this.modal.alertTitle = 'Your request has been successfully submitted'; + this.modal.message = 'Our team will respond to your submission soon.'; + this.modal.cancelButton = false; + this.modal.okButtonLeft = false; + this.modal.okButtonText = 'OK'; + this.modal.open(); + } + + handleError(message: string, error = null) { + if (error) { + console.error(error); + } + this.sending = false; + this.quickContact.close(); + NotificationHandler.rise(message, 'danger'); + this.contactForm.get('recaptcha').setValue(''); } } diff --git a/explore/src/app/app.module.ts b/explore/src/app/app.module.ts index 30fd904d..75a1a717 100755 --- a/explore/src/app/app.module.ts +++ b/explore/src/app/app.module.ts @@ -17,6 +17,8 @@ import {Schema2jsonldModule} from "./openaireLibrary/sharedComponents/schema2jso import {CacheInterceptorService} from "./openaireLibrary/cache-interceptor.service"; import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service"; import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service"; +import {QuickContactModule} from './openaireLibrary/sharedComponents/quick-contact/quick-contact.module'; +import {AlertModalModule} from './openaireLibrary/utils/modal/alertModal.module'; @NgModule({ imports: [ @@ -29,7 +31,10 @@ import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.servi BrowserModule.withServerTransition({ appId: 'explore' }), AppRoutingModule, BrowserTransferStateModule, - BrowserAnimationsModule, PageURLResolverModule, Schema2jsonldModule + BrowserAnimationsModule, PageURLResolverModule, + Schema2jsonldModule, + QuickContactModule, + AlertModalModule ], declarations: [AppComponent, OpenaireErrorPageComponent], exports: [AppComponent], diff --git a/explore/src/app/fos/fos.component.html b/explore/src/app/fos/fos.component.html index accf321d..92648243 100644 --- a/explore/src/app/fos/fos.component.html +++ b/explore/src/app/fos/fos.component.html @@ -46,7 +46,7 @@
-
+
-
+
diff --git a/explore/src/app/home/home.component.html b/explore/src/app/home/home.component.html index 45fb8e44..5395c755 100644 --- a/explore/src/app/home/home.component.html +++ b/explore/src/app/home/home.component.html @@ -324,7 +324,7 @@
-
+

Need more information? diff --git a/explore/src/app/home/home.component.ts b/explore/src/app/home/home.component.ts index d7093b5a..e7ea6bd8 100644 --- a/explore/src/app/home/home.component.ts +++ b/explore/src/app/home/home.component.ts @@ -19,7 +19,6 @@ import {SearchProjectsService} from '../openaireLibrary/services/searchProjects. import {SearchOrganizationsService} from '../openaireLibrary/services/searchOrganizations.service'; import {RefineFieldResultsService} from '../openaireLibrary/services/refineFieldResults.service'; import {OpenaireEntities, SearchFields} from '../openaireLibrary/utils/properties/searchFields'; - import {RouterHelper} from '../openaireLibrary/utils/routerHelper.class'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; @@ -32,6 +31,7 @@ import {properties} from "../../environments/environment"; import {Numbers, NumbersComponent} from "../openaireLibrary/sharedComponents/numbers/numbers.component"; import {StringUtils} from "../openaireLibrary/utils/string-utils.class"; import {NumberUtils} from '../openaireLibrary/utils/number-utils.class'; +import {QuickContactService} from '../openaireLibrary/sharedComponents/quick-contact/quick-contact.service'; @Component({ selector: 'home', @@ -138,7 +138,8 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit { properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; public readMore: boolean = false; - + public showQuickContact: boolean; + @ViewChild('contact') contact: ElementRef; subscriptions: any[] = []; @ViewChildren('scrolling_element') elements: QueryList; @@ -195,7 +196,8 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit { private location: Location, private _piwikService: PiwikService, private config: ConfigurationService, private _meta: Meta, private _title: Title, private seoService: SEOService, private helper: HelperService, - private cdr: ChangeDetectorRef + private cdr: ChangeDetectorRef, + private quickContactService: QuickContactService ) { let description = "OpenAIRE Explore: Over 100M of research deduplicated, 170K research software, 11M research data. One of the largest open scholarly records collection worldwide."; let title = "OpenAIRE | Find and Share research"; @@ -304,11 +306,28 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit { ngAfterViewInit() { if (typeof window !== "undefined") { - this.createObserver(); + this.createObservers(); } } - createObserver() { + createObservers() { + let options = { + root: null, + rootMargin: '200px', + threshold: 1.0 + }; + let intersectionObserver = new IntersectionObserver(entries => { + entries.forEach(entry => { + if (entry.isIntersecting && this.showQuickContact) { + this.showQuickContact = false; + this.quickContactService.setDisplay(this.showQuickContact); + } else if (!entry.isIntersecting && !this.showQuickContact) { + this.showQuickContact = true; + this.quickContactService.setDisplay(this.showQuickContact); + } + }); + }, options); + intersectionObserver.observe(this.contact.nativeElement); let mutationObserver = new MutationObserver(entries => { entries.forEach(entry => { if (entry.attributeName === 'style') { @@ -327,6 +346,7 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit { this.elements.forEach(element => { mutationObserver.observe(element.nativeElement, {attributes: true}); }); + this.subscriptions.push(intersectionObserver); this.subscriptions.push(mutationObserver); } diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index 09706515..427e9105 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 09706515ba1feb0d44c02485bee9782f63a5978f +Subproject commit 427e9105140fabb99f59693c94bc3b70db159901 diff --git a/explore/src/assets/explore-custom.less b/explore/src/assets/explore-custom.less index 60707c55..5b160e16 100644 --- a/explore/src/assets/explore-custom.less +++ b/explore/src/assets/explore-custom.less @@ -3,6 +3,13 @@ /* Button */ @button-primary-background: @explore-color; @inverse-button-primary-background: @explore-color; +@button-secondary-border: @explore-color; +@button-secondary-color: @explore-color; +@button-secondary-hover-background: @global-secondary-background; +@button-secondary-hover-background-gradient: none; +@button-secondary-active-background: @global-secondary-background; +@button-secondary-active-background-gradient: none; + /* Background */ @background-primary-background: @explore-color; From 285c65e3f28f7ce51a9e3a9075de60232457c80f Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 12 Oct 2022 16:36:33 +0300 Subject: [PATCH 04/10] [Explore]: orcid-work.component.ts: [Bug fix] Added [size]="'small'" input to | environment.ts: Updated port of orcidAPIURL (standalone service). --- explore/src/app/openaireLibrary | 2 +- explore/src/environments/environment.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index 427e9105..d720178d 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 427e9105140fabb99f59693c94bc3b70db159901 +Subproject commit d720178db3b563583bec05689dee9639af43117c diff --git a/explore/src/environments/environment.ts b/explore/src/environments/environment.ts index af794914..2379110b 100644 --- a/explore/src/environments/environment.ts +++ b/explore/src/environments/environment.ts @@ -28,7 +28,7 @@ export let properties: EnvProperties = { searchDataciteAPIURL: "https://api.datacite.org/works", searchOrcidURL: "https://pub.orcid.org/v2.1/", orcidURL: "https://orcid.org/", - orcidAPIURL: "http://duffy.di.uoa.gr:8080/uoa-orcid-service/", + orcidAPIURL: "http://duffy.di.uoa.gr:19480/uoa-orcid-service/", orcidTokenURL : "https://sandbox.orcid.org/oauth/authorize?", orcidClientId: "APP-A5M3KTX6NCN67L91", doiURL: "https://doi.org/", From 4db4795a04bb9200bc8fe9eaff489bbf38809346 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 12 Oct 2022 16:36:37 +0300 Subject: [PATCH 05/10] Change inverse text primary --- explore/src/assets/explore-custom.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/explore/src/assets/explore-custom.less b/explore/src/assets/explore-custom.less index 5b160e16..e5899a09 100644 --- a/explore/src/assets/explore-custom.less +++ b/explore/src/assets/explore-custom.less @@ -15,8 +15,10 @@ @background-primary-background: @explore-color; @background-primary-background-gradient: none; -/* Text */ +/** Text */ @text-primary-color: @explore-color; +@text-background-color: @explore-color; +@inverse-text-primary-color: @explore-color; /* Label */ @label-secondary-color: @explore-color; From 25a92c827c6c127ac82a040358adf66ec16045b8 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 18 Oct 2022 15:28:04 +0300 Subject: [PATCH 06/10] [Explore & Library]: home.component.html & advancedSearchForm.component.html & claimContextSearchForm.component.html & claimProjectSearchForm.component.html & claimResultSearchForm.component.html: Increased width of search forms and fixed width of each step of stepper input. --- explore/src/app/home/home.component.html | 6 +++--- explore/src/app/openaireLibrary | 2 +- explore/src/assets/openaire-theme | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/explore/src/app/home/home.component.html b/explore/src/app/home/home.component.html index 5395c755..62980d3e 100644 --- a/explore/src/app/home/home.component.html +++ b/explore/src/app/home/home.component.html @@ -26,12 +26,12 @@

All linked together through citations and semantics.
-
+
-
+ [onChangeNavigate]="false" class="uk-width-2-5"> +
diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index d720178d..087cd208 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit d720178db3b563583bec05689dee9639af43117c +Subproject commit 087cd208d5d4f2db661ddd467fb7b90b3a7d9480 diff --git a/explore/src/assets/openaire-theme b/explore/src/assets/openaire-theme index f2d544d4..f902074e 160000 --- a/explore/src/assets/openaire-theme +++ b/explore/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit f2d544d4f1ec152db80528be300f0936add71190 +Subproject commit f902074e00e01165f489e2fef12aad6551c03ccd From 55bd190ec8f21923addcfcbefd82669a29679ae7 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 18 Oct 2022 15:31:37 +0300 Subject: [PATCH 07/10] FOS page: add horizontal navigation tabs for mobile/tablet --- explore/src/app/fos/fos.component.html | 38 ++++++++++++++++++++---- explore/src/app/fos/fos.component.ts | 41 ++++++++++++++++++++++---- 2 files changed, 69 insertions(+), 10 deletions(-) diff --git a/explore/src/app/fos/fos.component.html b/explore/src/app/fos/fos.component.html index 92648243..cbdc1f98 100644 --- a/explore/src/app/fos/fos.component.html +++ b/explore/src/app/fos/fos.component.html @@ -37,16 +37,18 @@
-
-
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+ + +
+ + +
+
+
diff --git a/explore/src/app/fos/fos.component.ts b/explore/src/app/fos/fos.component.ts index 0545672a..422149e5 100644 --- a/explore/src/app/fos/fos.component.ts +++ b/explore/src/app/fos/fos.component.ts @@ -1,5 +1,5 @@ import {HttpClient} from "@angular/common/http"; -import {Component, OnDestroy, OnInit} from "@angular/core"; +import {ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewChild} from "@angular/core"; import {Subscription} from "rxjs"; import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component"; @@ -15,6 +15,8 @@ import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service"; import {debounceTime, distinctUntilChanged} from "rxjs/operators"; import Timeout = NodeJS.Timeout; +declare var UIkit; + @Component({ selector: 'fos', templateUrl: 'fos.component.html', @@ -42,6 +44,8 @@ export class FosComponent implements OnInit, OnDestroy { private subscriptions: Subscription[] = []; private observer: IntersectionObserver; private timeout: Timeout; + @ViewChild('tabs') tabs: ElementRef; + public sliderInit: boolean = false; constructor( private httpClient: HttpClient, @@ -52,7 +56,8 @@ export class FosComponent implements OnInit, OnDestroy { private _meta: Meta, private _title: Title, private seoService: SEOService, - private _piwikService: PiwikService + private _piwikService: PiwikService, + private cdr: ChangeDetectorRef ) {} ngOnInit() { @@ -67,9 +72,33 @@ export class FosComponent implements OnInit, OnDestroy { this.httpClient.get(properties.domain+'/assets/vocabulary/fos.json').subscribe(data => { this.fos = data['fos']; this.convertFosToOptions(); + if (typeof document !== 'undefined') { + setTimeout(()=> { + let slider = UIkit.slider(this.tabs.nativeElement); + slider.clsActive = 'uk-slider-active'; + slider.updateActiveClasses(); + this.sliderInit = true; + slider.slides.forEach(item => { + item.classList.remove('uk-active'); + }); + if (this.route.snapshot.fragment) { + this.activeSection = this.route.snapshot.fragment; + let i = this.fos.findIndex(item => item.id == this.route.snapshot.fragment); + slider.show(i); + } else { + this.activeSection = this.fos[0].id; + } + this.cdr.detectChanges(); + }); + } this.subscriptions.push(this.route.fragment.subscribe(fragment => { if(fragment) { this.activeSection = fragment; + if(this.tabs) { + let slider = UIkit.slider(this.tabs.nativeElement); + let i = this.fos.findIndex(item => item.id == fragment); + slider.show(i); + } } else { this.activeSection = this.fos[0].id; } @@ -78,9 +107,11 @@ export class FosComponent implements OnInit, OnDestroy { this.subscriptions.push(this.keywordControl.valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => { this.keyword = value; this.findMatches(this.keyword); - setTimeout(() => { - this.setObserver(); - }); + if (typeof document !== 'undefined') { + setTimeout(() => { + this.setObserver(); + }); + } })); }); } From 120774c414080c06b013efcf1c83eb9bcab4248b Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 18 Oct 2022 15:55:16 +0300 Subject: [PATCH 08/10] [Library]: claimResultSearchForm.component.html & claimProjectSearchForm.component.html & claimContextSearchForm.component.html: Set tooltip=true in search input form. --- explore/src/app/openaireLibrary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/explore/src/app/openaireLibrary b/explore/src/app/openaireLibrary index 087cd208..ec8fb39e 160000 --- a/explore/src/app/openaireLibrary +++ b/explore/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 087cd208d5d4f2db661ddd467fb7b90b3a7d9480 +Subproject commit ec8fb39eea0aba58a468aa88605714def913a375 From e6cfab5646cabcb28d14b41c8704ff8efaad3449 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 19 Oct 2022 18:57:36 +0300 Subject: [PATCH 09/10] [Explore]: fos.component.html: Updated doi link of SciNoBo. --- explore/src/app/fos/fos.component.html | 2 +- explore/src/app/openaireLibrary | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/explore/src/app/fos/fos.component.html b/explore/src/app/fos/fos.component.html index cbdc1f98..8092553e 100644 --- a/explore/src/app/fos/fos.component.html +++ b/explore/src/app/fos/fos.component.html @@ -18,7 +18,7 @@ We have integrated a Field-of-Science (FoS) taxonomy into our dataset to organize and discover research more effectively. Using the full capabilities of the OpenAIRE Research Graph (full-texts, citations, references, venues) we apply AI and bring forward any multidisciplinarity potential.
- Our work is based on the work from our partner Athena Research Center: SciNoBo : A Hierarchical Multi-Label Classifier of Scientific Publications - https://arxiv.org/abs/2204.00880 + Our work is based on the work from our partner Athena Research Center: SciNoBo : A Hierarchical Multi-Label Classifier of Scientific Publications - https://doi.org/10.1145/3487553.3524677