Merge remote-tracking branch 'origin/develop'

This commit is contained in:
Konstantinos Triantafyllou 2023-07-12 13:08:47 +03:00
commit ec66503544
11 changed files with 161 additions and 77 deletions

View File

@ -11,7 +11,7 @@ import {properties} from "../../environments/environment";
import {StakeholderEntities} from "../openaireLibrary/monitor/entities/stakeholder";
@Component({
selector: 'how-it-works',
selector: 'about',
template: `
<div class="uk-visible@m">
<div class="uk-position-relative">
@ -589,15 +589,13 @@ import {StakeholderEntities} from "../openaireLibrary/monitor/entities/stakehold
}
`]
})
export class HowItWorksComponent {
export class AboutComponent {
public url: string = null;
public pageTitle: string = "OpenAIRE - Monitor | How it works";
public description: string = "OpenAIRE - Monitor | How it works";
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'About - How it works'}];
public pageTitle: string = "OpenAIRE - Monitor | About";
public description: string = "OpenAIRE - Monitor | About - How it works";
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'About'}];
public properties: EnvProperties = properties;
public sections: string[] = [StakeholderEntities.FUNDERS, StakeholderEntities.RIS, StakeholderEntities.ORGANIZATIONS];
public activeSection: string = StakeholderEntities.FUNDERS;
public offset: number;
public stakeholderEntities = StakeholderEntities;
public shouldSticky: boolean = true;

View File

@ -2,8 +2,7 @@ import {CommonModule} from "@angular/common";
import {NgModule} from "@angular/core";
import {RouterModule} from "@angular/router";
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {HowItWorksComponent} from "./how-it-works.component";
import {FaqsComponent} from "./faqs.component";
import {AboutComponent} from "./about.component";
import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {SliderTabsModule} from "../openaireLibrary/sharedComponents/tabs/slider-tabs.module";
@ -11,25 +10,23 @@ import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {YouWeComponent} from "./you-we.component";
@NgModule({
declarations: [HowItWorksComponent, FaqsComponent, YouWeComponent],
declarations: [AboutComponent, YouWeComponent],
imports: [CommonModule, RouterModule.forChild([
{
path: '',
redirectTo: 'how-it-works',
canDeactivate: [PreviousRouteRecorder],
pathMatch: 'full'
},
{
path: 'how-it-works',
component: HowItWorksComponent,
component: AboutComponent,
data: {extraOffset: 50}
},
{
path: 'faqs',
component: FaqsComponent
path: 'how-it-works',
redirectTo: '/about'
},
{
path: 'faqs',
redirectTo: '/support'
}
]), BreadcrumbsModule, SliderTabsModule, HelperModule],
exports: [HowItWorksComponent, FaqsComponent],
exports: [AboutComponent],
providers: [PreviousRouteRecorder, PiwikService]
})
export class AboutModule {}

View File

@ -1,25 +0,0 @@
<div class="uk-visible@m">
<div class="uk-background-muted">
<div class="uk-container uk-container-large uk-section uk-section-small">
<div class="uk-padding-small uk-padding-remove-horizontal">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
<div class="uk-text-center" uk-scrollspy-class>
<h1 class="uk-margin-medium-top uk-margin-medium-bottom">Frequently Asked <br> Questions<span
class="uk-text-primary">.</span></h1>
</div>
</div>
</div>
<helper *ngIf="pageContents" [texts]="pageContents.top"></helper>
</div>
<div class="uk-hidden@m">
<div class="uk-background-muted">
<div class="uk-container uk-container-large">
<div class="uk-text-center" uk-scrollspy-class>
<h1 class="uk-margin-medium-top uk-margin-medium-bottom">Frequently Asked <br> Questions<span
class="uk-text-primary">.</span></h1>
</div>
</div>
</div>
<helper *ngIf="pageContents" [texts]="pageContents.top"></helper>
</div>

View File

@ -9,6 +9,10 @@ const routes: Routes = [
path: 'about',
loadChildren: () => import('./about/about.module').then(m => m.AboutModule)
},
{
path: 'support',
loadChildren: () => import('./support/support.module').then(m => m.SupportModule)
},
{
path: 'methodology',
loadChildren: () => import('./openaireLibrary/monitor/methodology/methodology.module').then(m => m.MethodologyModule)
@ -23,7 +27,8 @@ const routes: Routes = [
},
{
path: 'contact-us',
loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule)
loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule),
data: {hasQuickContact: false}
},
{
path: 'get-started',

View File

@ -1,4 +1,4 @@
import {Component, ElementRef, ViewChild} from '@angular/core';
import {ChangeDetectorRef, Component, ElementRef, ViewChild} from '@angular/core';
import {ActivatedRoute, NavigationEnd, Router} from '@angular/router';
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
@ -21,6 +21,7 @@ import {QuickContactComponent} from "./openaireLibrary/sharedComponents/quick-co
import {AlertModal} from "./openaireLibrary/utils/modal/alert";
import {StakeholderEntities} from './openaireLibrary/monitor/entities/stakeholder';
import {ResourcesService} from "./openaireLibrary/monitor/services/resources.service";
import {LayoutService} from "./openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
@Component({
selector: 'app-root',
@ -60,7 +61,7 @@ import {ResourcesService} from "./openaireLibrary/monitor/services/resources.ser
</cookie-law>
<bottom #bottom *ngIf="properties && showMenu" id="bottom" [grantAdvance]="false"
[properties]="properties"></bottom>
<quick-contact #quickContact *ngIf="bottomNotIntersecting && displayQuickContact && contactForm"
<quick-contact #quickContact *ngIf="bottomNotIntersecting && displayQuickContact && showQuickContact && contactForm"
(sendEmitter)="send($event)"
[contactForm]="contactForm" [sending]="sending" [images]="images" [contact]="'Help'"
[organizationTypes]="organizationTypes"
@ -80,6 +81,7 @@ export class AppComponent {
header: Header;
logoPath: string = 'assets/common-assets/logo-services/monitor/';
/* Contact */
public showQuickContact: boolean;
public bottomNotIntersecting: boolean;
public displayQuickContact: boolean; // intersecting with specific section in home page
public showGetStarted: boolean = true;
@ -102,16 +104,13 @@ export class AppComponent {
private router: Router, private stakeholderService: StakeholderService, private smoothScroll: SmoothScroll,
private userManagementService: UserManagementService,
private quickContactService: QuickContactService,
private layoutService: LayoutService,
private fb: UntypedFormBuilder,
private emailService: EmailService,
private resourcesService: ResourcesService) {
private resourcesService: ResourcesService,
private cdr: ChangeDetectorRef) {
this.subscriptions.push(router.events.forEach((event) => {
if (event instanceof NavigationEnd) {
if (event.url === '/contact-us') {
this.quickContactService.setDisplay(false);
} else if (event.url !== '/contact-us' && (!this.bottomNotIntersecting || !this.displayQuickContact)) {
this.quickContactService.setDisplay(true);
}
this.showGetStarted = event.url !== '/get-started';
}
@ -136,8 +135,17 @@ export class AppComponent {
this.buildMenu();
this.reset();
}));
this.subscriptions.push(this.layoutService.hasQuickContact.subscribe(hasQuickContact => {
if(this.showQuickContact !== hasQuickContact) {
this.showQuickContact = hasQuickContact;
this.cdr.detectChanges();
}
}));
this.subscriptions.push(this.quickContactService.isDisplayed.subscribe(display => {
this.displayQuickContact = display;
if(this.displayQuickContact !== display) {
this.displayQuickContact = display;
this.cdr.detectChanges();
}
}));
}
@ -151,7 +159,10 @@ export class AppComponent {
let intersectionObserver = new IntersectionObserver(entries => {
entries.forEach(entry => {
// if (entry.isIntersecting && this.showQuickContact) {
this.bottomNotIntersecting = !entry.isIntersecting;
if(this.bottomNotIntersecting !== (!entry.isIntersecting)) {
this.bottomNotIntersecting = !entry.isIntersecting;
this.cdr.detectChanges();
}
});
}, options);
intersectionObserver.observe(this.bottom.nativeElement);
@ -180,12 +191,8 @@ export class AppComponent {
new MenuItem("stakeholders", "Browse " + this.stakeholderEntities.STAKEHOLDERS, "", "/browse", false, [], null, {})
);
this.resourcesService.setResources(this.menuItems);
let about = new MenuItem("about", "About", "", "", false, [], null, {});
about.items = [
new MenuItem("how-it-works", "How it works", "", "/about/how-it-works", false, [], null, {}),
new MenuItem("faqs", "FAQs", "", "/about/faqs", false, [], null, {})
]
this.menuItems.push(about);
this.menuItems.push(new MenuItem("support", "Support", "", "/support", false, [], null, {}));
this.menuItems.push(new MenuItem("about", "About", "", "/about", false, [], null, {}));
this.bottomMenuItems = [
new MenuItem("", "About", "https://beta.openaire.eu/project-factsheets", "", false, [], [], {}),
new MenuItem("", "News - Events", "https://beta.openaire.eu/news-events", "", false, [], [], {}),

View File

@ -66,8 +66,6 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit, IDeactiv
public softwareSize: any = null;
public otherSize: any = null;
public fundersSize: any = null;
public showQuickContact: boolean = true;
@ViewChild('AlertModal') modal;
private errorMessages: ErrorMessagesComponent;
private subscriptions = [];
private mutationObserver: MutationObserver;
@ -102,6 +100,7 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit, IDeactiv
this.errorMessages = new ErrorMessagesComponent();
this.status = this.errorCodes.LOADING;
this.isServer = isPlatformServer(this.platform);
this.quickContactService.setDisplay(false);
}
public ngOnInit() {
@ -131,6 +130,7 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit, IDeactiv
}
ngOnDestroy() {
this.quickContactService.setDisplay(true);
this.clear();
}
@ -161,13 +161,7 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit, IDeactiv
};
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);
}
this.quickContactService.setDisplay(!entry.isIntersecting);
});
}, options);
if(this.contact) {

View File

@ -0,0 +1,41 @@
<div class="uk-visible@m">
<div class="uk-background-muted">
<div class="uk-container uk-container-large uk-section uk-section-small">
<div class="uk-padding-small uk-padding-remove-horizontal">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
<div class="uk-flex uk-flex-middle" uk-scrollspy-class>
<div class="uk-width-1-2 uk-margin-medium-bottom">
<h1 class="uk-margin-medium-top">How can we help you?</h1>
<div class="uk-margin-medium-bottom">Monitor expert support team is ready and excited to help.</div>
<a routerLink="/contact-us" class="uk-button uk-button-primary">Contact Us</a>
</div>
<div class="uk-position-relative uk-width-1-2 uk-visible@l contact-us">
<img class="uk-box-shadow-large one" src="../../assets/monitor-assets/curators/1.jpg">
<img class="uk-box-shadow-large two" src="../../assets/monitor-assets/curators/2.jpg">
<img class="uk-box-shadow-large three" src="../../assets/monitor-assets/curators/3.jpg">
<img class="uk-box-shadow-large four" src="../../assets/monitor-assets/curators/4.jpg">
</div>
</div>
</div>
</div>
<div class="uk-margin-large-top">
<h3 class="uk-text-center">Frequently Asked Questions</h3>
</div>
<helper *ngIf="pageContents" [texts]="pageContents.top"></helper>
</div>
<div class="uk-hidden@m">
<div class="uk-background-muted">
<div class="uk-section-small uk-container uk-container-large">
<div class="uk-text-center" uk-scrollspy-class>
<h1 class="uk-margin-top">How can we help you?</h1>
<div class="uk-margin-medium-bottom">Monitor expert support team is ready and excited to help.</div>
<a routerLink="/contact-us" class="uk-button uk-button-small uk-button-primary">Contact Us</a>
</div>
</div>
</div>
<div class="uk-margin-medium-top">
<h3 class="uk-text-center">Frequently Asked Questions</h3>
</div>
<helper *ngIf="pageContents" [texts]="pageContents.top"></helper>
</div>

View File

@ -0,0 +1,44 @@
@import (reference) "~../../assets/openaire-theme/less/_import-variables";
@faqs-curator-image-size: 136px;
@faqs-contact-us-height: 450px;
.contact-us {
height: @faqs-contact-us-height;
img {
position: absolute;
width: @faqs-curator-image-size;
height: @faqs-curator-image-size;
object-fit: cover;
border-radius: 18px;
&.one {
top: @global-medium-gutter;
right: @global-medium-gutter + (@faqs-curator-image-size/2);
transform: rotate(10deg);
}
&.two {
bottom: @global-medium-gutter;
right: @global-medium-gutter + (@faqs-curator-image-size);
transform: rotate(-10deg);
object-position: top;
}
&.three {
top: 0;
left: @global-medium-gutter + (@faqs-curator-image-size);
transform: rotate(-10deg);
object-position: -60px;
}
&.four {
bottom: 2*@global-medium-gutter;
left: 2*@global-medium-gutter;
transform: rotate(-10deg);
object-position: 0;
}
}
}

View File

@ -10,17 +10,18 @@ import {Subscriber} from "rxjs";
import {Breadcrumb} from '../openaireLibrary/utils/breadcrumbs/breadcrumbs.component';
@Component({
selector: 'faqs',
templateUrl: 'faqs.component.html'
selector: 'support',
templateUrl: 'support.component.html',
styleUrls: ['support.component.less']
})
export class FaqsComponent {
export class SupportComponent {
public pageContents = null;
public divContents = null;
public url: string = null;
public pageTitle: string = "OpenAIRE - Monitor | FAQs";
public description: string = "OpenAIRE - Monitor | FAQs";
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'FAQs'}];
public pageTitle: string = "OpenAIRE - Monitor | Support";
public description: string = "OpenAIRE - Monitor | Support";
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Support'}];
public properties: EnvProperties = properties;
subscriptions = [];

View File

@ -0,0 +1,22 @@
import {CommonModule} from "@angular/common";
import {NgModule} from "@angular/core";
import {RouterModule} from "@angular/router";
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {SupportComponent} from "./support.component";
import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
@NgModule({
declarations: [SupportComponent],
imports: [CommonModule, RouterModule.forChild([
{
path: '',
component: SupportComponent,
data: {extraOffset: 50}
}
]), BreadcrumbsModule, HelperModule],
exports: [SupportComponent],
providers: [PreviousRouteRecorder, PiwikService]
})
export class SupportModule {}