create get-started page
This commit is contained in:
parent
3293249aac
commit
5052e40d59
|
@ -17,6 +17,10 @@ const routes: Routes = [
|
|||
path: 'contact-us',
|
||||
loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule)
|
||||
},
|
||||
{
|
||||
path: 'get-started',
|
||||
loadChildren: () => import('./get-started/get-started.module').then(m => m.GetStartedModule)
|
||||
},
|
||||
{
|
||||
path: 'my-dashboards',
|
||||
loadChildren: () => import('./my-stakeholders/my-stakeholders.module').then(m => m.MyStakeholdersModule)},
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {RouterModule} from '@angular/router';
|
||||
import {GetStartedComponent} from './get-started.component';
|
||||
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: GetStartedComponent, canActivate: [], canDeactivate: [PreviousRouteRecorder]}
|
||||
])
|
||||
]
|
||||
})
|
||||
export class GetStartedRoutingModule { }
|
|
@ -0,0 +1,69 @@
|
|||
<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other" [description]="description"></schema2jsonld>
|
||||
<div class="uk-background-muted">
|
||||
<div class="uk-container uk-container-large uk-section uk-padding-remove-bottom">
|
||||
<div class="uk-padding-small">
|
||||
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-container uk-container-large uk-section uk-padding-remove-top">
|
||||
<div class="uk-padding-small uk-margin-small-top uk-text-center">
|
||||
<h1>Lorem ipsum dolor <br> sit amet, consetetur<span class="uk-text-primary">.</span></h1>
|
||||
<div class="uk-text-large">
|
||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, <br> sed diam nonumy eirmod tempor invidunt ut labore et <br> dolore magna aliquyam erat, sed diam voluptua.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mixed-bacgkround">
|
||||
<div class="uk-background-muted">
|
||||
<div class="uk-container uk-container-large uk-section">
|
||||
<div class="uk-padding-small uk-text-center uk-width-1-2 uk-margin-auto uk-grid uk-child-width-1-2" uk-grid>
|
||||
<div class="">
|
||||
provide
|
||||
</div>
|
||||
<div class="">
|
||||
contact
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="normal-background">
|
||||
<div class="uk-container uk-container-large uk-section uk-padding-remove-vertical">
|
||||
<div class="uk-padding-small uk-padding-remove-vertical uk-text-center uk-width-1-2 uk-margin-auto uk-grid uk-child-width-1-2 uk-position-relative" uk-grid>
|
||||
<div class="floating-number">
|
||||
1
|
||||
</div>
|
||||
<div class="floating-number">
|
||||
2
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="uk-padding-small uk-text-center">
|
||||
TODO: Numbers with transform translate to go up by 50%
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-container uk-container-large uk-section uk-padding-remove-top">
|
||||
<div class="uk-padding-small uk-text-center">
|
||||
<h2 class="uk-h1">Provide some information<span class="uk-text-primary">.</span></h2>
|
||||
<div>
|
||||
TODO: Contact form + SEND button
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-container uk-container-large uk-section">
|
||||
<div class="uk-grid uk-grid-medium uk-padding-small" uk-grid>
|
||||
<div class="uk-width-2-3@m uk-width-1-1@s">
|
||||
<h2 class="uk-h1">We need a title that <br> suggest to learn the full <br> process in the about<span class="uk-text-primary">.</span></h2>
|
||||
<a class="uk-display-inline-block uk-text-uppercase uk-button-text"
|
||||
routerLinkActive="router-link-active" routerLink="/about/learn-how">
|
||||
<span class="uk-flex uk-flex-middle">
|
||||
<span>Learn More</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-width-1-3@m uk-width-1-1@s uk-text-center">
|
||||
<img src="../../assets/common-assets/monitor-assets/how/steps.svg" loading="lazy">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,178 @@
|
|||
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 {AbstractControl, FormBuilder, FormGroup, ValidatorFn, Validators} from "@angular/forms";
|
||||
import {Subscriber} from "rxjs";
|
||||
import {properties} from "../../environments/environment";
|
||||
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
|
||||
|
||||
@Component({
|
||||
selector: 'get-started',
|
||||
templateUrl: './get-started.component.html',
|
||||
})
|
||||
export class GetStartedComponent implements OnInit {
|
||||
public url: string = null;
|
||||
public pageTitle: string = "OpenAIRE - Monitor | Get Started";
|
||||
public description: string = "OpenAIRE - Monitor . Any Questions? Contact us to learn more";
|
||||
public piwiksub: any;
|
||||
public showLoading = true;
|
||||
public errorMessage = '';
|
||||
public email: Email;
|
||||
public properties: EnvProperties = null;
|
||||
public pageContents = null;
|
||||
public divContents = null;
|
||||
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Get started'}];
|
||||
public organizationTypes: string[] = [
|
||||
'Funding agency', 'University / Research Center',
|
||||
'Research Infrastructure', 'Government',
|
||||
'Non-profit', 'Industry', 'Other'
|
||||
];
|
||||
public contactForm: FormGroup;
|
||||
@ViewChild('AlertModal') modal;
|
||||
|
||||
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) {
|
||||
}
|
||||
subscriptions = [];
|
||||
ngOnDestroy() {
|
||||
this.subscriptions.forEach(subscription => {
|
||||
if (subscription instanceof Subscriber) {
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
ngOnInit() {
|
||||
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.properties.baseLink + this._router.url;
|
||||
this.seoService.createLinkForCanonicalURL(this.url);
|
||||
this.updateUrl(this.url);
|
||||
this.updateTitle(this.pageTitle);
|
||||
this.updateDescription(this.description);
|
||||
this.reset();
|
||||
//this.getDivContents();
|
||||
// this.getPageContents();
|
||||
this.showLoading = false;
|
||||
|
||||
}
|
||||
|
||||
private getPageContents() {
|
||||
this.subscriptions.push(this.helper.getPageHelpContents(this.properties, 'monitor', this._router.url).subscribe(contents => {
|
||||
this.pageContents = contents;
|
||||
}));
|
||||
}
|
||||
|
||||
private getDivContents() {
|
||||
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, 'monitor', this._router.url).subscribe(contents => {
|
||||
this.divContents = contents;
|
||||
}));
|
||||
}
|
||||
|
||||
public send(event) {
|
||||
HelperFunctions.scroll();
|
||||
if(event.valid === true) {
|
||||
this.sendMail(this.properties.admins);
|
||||
} else {
|
||||
this.errorMessage = 'Please fill in all the required fields!';
|
||||
}
|
||||
}
|
||||
|
||||
private validatorType(options: string[]): ValidatorFn {
|
||||
return (control: AbstractControl): { [key: string]: boolean } | null => {
|
||||
if (options.filter(type => type === control.value).length === 0) {
|
||||
return {'type': false};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
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]),
|
||||
job: this.fb.control('', Validators.required),
|
||||
organization: this.fb.control('', Validators.required),
|
||||
organizationType: this.fb.control('', [Validators.required, this.validatorType(this.organizationTypes)]),
|
||||
message: this.fb.control('', Validators.required),
|
||||
recaptcha: this.fb.control('', Validators.required),
|
||||
});
|
||||
this.errorMessage = '';
|
||||
}
|
||||
|
||||
private sendMail(admins: any) {
|
||||
this.showLoading = true;
|
||||
this.subscriptions.push(this._emailService.contact(this.properties,
|
||||
Composer.composeEmailForMonitor(this.contactForm.value, admins),
|
||||
this.contactForm.value.recaptcha).subscribe(
|
||||
res => {
|
||||
this.showLoading = false;
|
||||
if (res) {
|
||||
this.reset();
|
||||
this.modalOpen();
|
||||
} else {
|
||||
this.errorMessage = 'Email sent failed! Please try again.';
|
||||
this.contactForm.get('recaptcha').setValue('');
|
||||
}
|
||||
},
|
||||
error => {
|
||||
this.handleError('Email sent failed! Please try again.', error);
|
||||
this.showLoading = false;
|
||||
this.contactForm.get('recaptcha').setValue('');
|
||||
}
|
||||
));
|
||||
}
|
||||
|
||||
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) {
|
||||
this.errorMessage = message;
|
||||
console.log('Server responded: ' + error);
|
||||
this.showLoading = false;
|
||||
}
|
||||
|
||||
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'");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
import {GetStartedComponent} from './get-started.component';
|
||||
import {GetStartedRoutingModule} from "./get-started-routing.module";
|
||||
import {EmailService} from "../openaireLibrary/utils/email/email.service";
|
||||
import {RecaptchaModule} from "ng-recaptcha";
|
||||
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: [
|
||||
GetStartedRoutingModule, CommonModule, RouterModule,
|
||||
AlertModalModule, RecaptchaModule, HelperModule,
|
||||
Schema2jsonldModule, SEOServiceModule, ContactUsModule, BreadcrumbsModule, LoadingModule
|
||||
],
|
||||
declarations: [
|
||||
GetStartedComponent
|
||||
],
|
||||
providers: [
|
||||
EmailService, PiwikService, IsRouteEnabled
|
||||
],
|
||||
exports: [
|
||||
GetStartedComponent
|
||||
]
|
||||
})
|
||||
|
||||
export class GetStartedModule { }
|
|
@ -13,7 +13,7 @@
|
|||
<div>research statistics and indicators.</div>
|
||||
</div>
|
||||
<div class="uk-margin-medium-top">
|
||||
<a class="uk-button uk-button-primary" routerLink="/">GET STARTED</a>
|
||||
<a class="uk-button uk-button-primary" routerLink="/get-started">GET STARTED</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -76,3 +76,7 @@ main {
|
|||
/*.monitorApp .uk-grid-divider>:not(.uk-first-column)::before {*/
|
||||
/* border-left: 1px solid #DEDEDE;*/
|
||||
/*}*/
|
||||
.floating-number {
|
||||
font-size: 200px;
|
||||
transform: translateY(-50%);
|
||||
}
|
Loading…
Reference in New Issue