create contact page and menu item entry, add correct admin emails for all environments, update submodules

This commit is contained in:
Alex Martzios 2022-10-03 13:47:06 +03:00
parent 82afd05444
commit caae320794
13 changed files with 238 additions and 4 deletions

View File

@ -11,6 +11,7 @@ const routes: Routes = [
{path: 'mail-preferences', loadChildren: () => import('./userEmailPreferences/mailPrefs.module').then(m => m.LibMailPrefsModule)}, {path: 'mail-preferences', loadChildren: () => import('./userEmailPreferences/mailPrefs.module').then(m => m.LibMailPrefsModule)},
{path: 'sdgs', loadChildren: () => import('./sdg/sdg.module').then(m => m.SdgModule)}, {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)},
{path: 'contact-us', loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule)},
// ORCID Pages // ORCID Pages
{path: 'orcid', loadChildren: () => import('./orcid/orcid.module').then(m => m.LibOrcidModule)}, {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)}, {path: 'my-orcid-links', loadChildren: () => import('./orcid/my-orcid-links/myOrcidLinks.module').then(m => m.LibMyOrcidLinksModule)},

View File

@ -137,7 +137,8 @@ export class AppComponent {
new MenuItem("", "Journals", "", "/search/journals", false, ["datasource"], ["/search/journals"], {}), new MenuItem("", "Journals", "", "/search/journals", false, ["datasource"], ["/search/journals"], {}),
new MenuItem("", "Registries", "", "/search/entity-registries", false, ["datasource"], ["/search/entity-registries"], {}), 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("", "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)) { if (Session.isPortalAdministrator(this.user)) {
this.userMenuItems.push(new MenuItem("", "Manage all links", "", "/claims", false, [], ["/claims"], {})); this.userMenuItems.push(new MenuItem("", "Manage all links", "", "/claims", false, [], ["/claims"], {}));

View File

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import {RouterModule} from '@angular/router';
import {ContactComponent} from './contact.component';
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: ContactComponent, canActivate: [IsRouteEnabled], canDeactivate: [PreviousRouteRecorder]}
])
]
})
export class ContactRoutingModule { }

View File

@ -0,0 +1,22 @@
<div>
<div class="uk-container uk-container-large uk-section uk-section-small uk-padding-remove-bottom">
<div class="uk-padding-small uk-padding-remove-horizontal">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
</div>
<div class="uk-section uk-padding-remove-top uk-container uk-container-large uk-flex uk-flex-center"
uk-scrollspy="target: [uk-scrollspy-class]; cls: uk-animation-slide-bottom-medium; delay: 200">
<div class="uk-padding-small uk-width-1-2@l uk-width-2-3@m uk-width-1-1">
<contact-us [sending]="sending" [scrollspy]="true"
[contactForm]="contactForm" (sendEmitter)="send($event)">
<h1 page-title class="uk-margin-auto uk-text-center" uk-scrollspy-class>
Contact us to <br> learn more<span class="uk-text-primary">.</span>
</h1>
</contact-us>
</div>
</div>
</div>
<modal-alert #modal (alertOutput)="goToHome()">
Our team will respond to your submission soon.<br>
Press OK to redirect to OpenAIRE Explore home page.
</modal-alert>

View File

@ -0,0 +1,156 @@
import {Component, OnInit, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {EmailService} from "../openaireLibrary/utils/email/email.service";
import {Email} from "../openaireLibrary/utils/email/email";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {Composer} from "../openaireLibrary/utils/email/composer";
import {Meta, Title} from "@angular/platform-browser";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {FormBuilder, FormGroup, Validators} from "@angular/forms";
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
import {Subscriber} from "rxjs";
import {properties} from "../../environments/environment";
import {NotificationHandler} from "../openaireLibrary/utils/notification-handler";
@Component({
selector: 'contact',
templateUrl: './contact.component.html',
})
export class ContactComponent implements OnInit {
public url: string = null;
public pageTitle: string = "OpenAIRE - Explore | Contact Us";
public description: string = "Contact us to learn more about OpenAIRE Explore";
public sending = true;
public email: Email;
public properties: EnvProperties = properties;
public pageContents = null;
public divContents = null;
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Contact us'}];
public contactForm: FormGroup;
@ViewChild('modal') modal;
private subscriptions = [];
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
constructor(private route: ActivatedRoute,
private _router: Router,
private _emailService: EmailService,
private _meta: Meta,
private _title: Title,
private seoService: SEOService,
private _piwikService: PiwikService,
private fb: FormBuilder,
private helper: HelperService) {
}
ngOnInit() {
this._title.setTitle('OpenAIRE - Explore | Contact Us');
this.properties = properties;
this.email = {body: '', subject: '', recipients: []};
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
this.subscriptions.push( this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
}
this.url = this.properties.domain + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url);
this.updateUrl(this.url);
this.updateTitle(this.pageTitle);
this.updateDescription(this.description);
this.reset();
this.getPageContents();
this.sending = false;
}
private getPageContents() {
this.subscriptions.push(this.helper.getPageHelpContents(this.properties, 'explore', this._router.url).subscribe(contents => {
this.pageContents = contents;
}));
}
public send(event) {
HelperFunctions.scroll();
if(event.valid === true) {
this.sendMail(this.properties.admins);
}
}
public reset() {
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),
});
}
private sendMail(admins: any) {
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 <b>sent failed!</b> Please try again.');
}
},
error => {
this.handleError('Email sent failed! Please try again.', error);
}
));
}
public modalOpen() {
this.modal.okButton = true;
this.modal.alertTitle = 'Your request has been successfully submitted';
this.modal.alertMessage = false;
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);
}
NotificationHandler.rise(message, 'danger');
this.sending = false;
this.contactForm.get('recaptcha').setValue('');
}
public goToHome() {
this._router.navigate(['/']);
}
private updateDescription(description: string) {
this._meta.updateTag({content: description}, "name='description'");
this._meta.updateTag({content: description}, "property='og:description'");
}
private updateTitle(title: string) {
var _title = ((title.length > 50) ? title.substring(0, 50) : title);
this._title.setTitle(_title);
this._meta.updateTag({content: _title}, "property='og:title'");
}
private updateUrl(url: string) {
this._meta.updateTag({content: url}, "property='og:url'");
}
}

View File

@ -0,0 +1,36 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {RouterModule} from '@angular/router';
import {ContactComponent} from './contact.component';
import {ContactRoutingModule} from "./contact-routing.module";
import {EmailService} from "../openaireLibrary/utils/email/email.service";
import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
import {Schema2jsonldModule} from "../openaireLibrary/sharedComponents/schema2jsonld/schema2jsonld.module";
import {SEOServiceModule} from "../openaireLibrary/sharedComponents/SEO/SEOService.module";
import {ContactUsModule} from "../openaireLibrary/contact-us/contact-us.module";
import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module";
import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
@NgModule({
imports: [
ContactRoutingModule, CommonModule, RouterModule,
AlertModalModule, HelperModule,
Schema2jsonldModule, SEOServiceModule, ContactUsModule, BreadcrumbsModule, LoadingModule
],
declarations: [
ContactComponent
],
providers: [
EmailService, PiwikService, IsRouteEnabled
],
exports: [
ContactComponent
]
})
export class ContactModule { }

View File

@ -329,7 +329,7 @@
Get in touch and let us help you<span class="uk-text-primary">.</span> Get in touch and let us help you<span class="uk-text-primary">.</span>
</h4> </h4>
<a class="uk-button uk-button-primary uk-text-uppercase uk-margin-top uk-margin-medium-bottom" <a class="uk-button uk-button-primary uk-text-uppercase uk-margin-top uk-margin-medium-bottom"
href="https://www.openaire.eu/contact-us" target="_blank">Contact us</a> routerLink="/contact-us">Contact us</a>
</div> </div>
</div> </div>
</div> </div>

@ -1 +1 @@
Subproject commit a72f962b3d9c25f4bdeed026b12146090d1d2850 Subproject commit 7da81d02b59a387d36c9bc1ee478591214edff9a

@ -1 +1 @@
Subproject commit bc0edde68dccfc17c1abc5d5aa3721f720aee852 Subproject commit cb006f41395304e085d4ac012c7a031e46458f59

View File

@ -115,6 +115,7 @@ export let properties: EnvProperties = {
depositSearchPage: "/participate/deposit/search", depositSearchPage: "/participate/deposit/search",
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/", altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",
reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P", reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
admins: ['feedback@openaire.eu'],
b2noteAPIURL: 'https://b2note.eudat.eu/', b2noteAPIURL: 'https://b2note.eudat.eu/',
adminPortalURL: "https://beta.admin.connect.openaire.eu", adminPortalURL: "https://beta.admin.connect.openaire.eu",

View File

@ -120,6 +120,7 @@ export let properties: EnvProperties = {
depositSearchPage: "/participate/deposit/search", depositSearchPage: "/participate/deposit/search",
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/", altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",
reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P", reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
admins: ['feedback@openaire.eu'],
b2noteAPIURL: 'https://b2note.eudat.eu/', b2noteAPIURL: 'https://b2note.eudat.eu/',
adminPortalURL: "https://admin.explore.openaire.eu", adminPortalURL: "https://admin.explore.openaire.eu",

View File

@ -119,6 +119,7 @@ export let properties: EnvProperties = {
depositSearchPage: "/participate/deposit/search", depositSearchPage: "/participate/deposit/search",
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/", altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",
reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P", reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P",
admins: ['feedback@openaire.eu'],
b2noteAPIURL: 'https://b2note.eudat.eu/', b2noteAPIURL: 'https://b2note.eudat.eu/',
adminPortalURL: "https://beta.admin.connect.openaire.eu", adminPortalURL: "https://beta.admin.connect.openaire.eu",

View File

@ -120,6 +120,7 @@ export let properties: EnvProperties = {
depositSearchPage: "/participate/deposit/search", depositSearchPage: "/participate/deposit/search",
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/", altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",
reCaptchaSiteKey: "6LcVtFIUAAAAAB2ac6xYivHxYXKoUvYRPi-6_rLu", reCaptchaSiteKey: "6LcVtFIUAAAAAB2ac6xYivHxYXKoUvYRPi-6_rLu",
admins: ['kostis30fylloy@gmail.com', 'alexandros.martzios@athenarc.gr', 'kgalouni@di.uoa.gr'],
b2noteAPIURL: 'https://b2note.eudat.eu/', b2noteAPIURL: 'https://b2note.eudat.eu/',
impactFactorsAPIURL: "https://bip-api.imsi.athenarc.gr/paper/scores/batch/", impactFactorsAPIURL: "https://bip-api.imsi.athenarc.gr/paper/scores/batch/",
adminPortalURL: "https://beta.admin.connect.openaire.eu", adminPortalURL: "https://beta.admin.connect.openaire.eu",