-
-
We need a title that
suggest to learn the full
process in the about.
+
\ No newline at end of file
+
+
+
+ Our team will respond to your submission soon.
+ Press OK to redirect to OpenAIRE Monitor home page.
+
+
diff --git a/src/app/get-started/get-started.component.ts b/src/app/get-started/get-started.component.ts
index 51b46a7..ec56632 100644
--- a/src/app/get-started/get-started.component.ts
+++ b/src/app/get-started/get-started.component.ts
@@ -13,166 +13,152 @@ import {AbstractControl, FormBuilder, FormGroup, ValidatorFn, Validators} from "
import {Subscriber} from "rxjs";
import {properties} from "../../environments/environment";
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
+import {NotificationHandler} from "../openaireLibrary/utils/notification-handler";
+import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
@Component({
- selector: 'get-started',
- templateUrl: './get-started.component.html',
+ 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) {
+ 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 sending = false;
+ public properties: EnvProperties = properties;
+ 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('modal') modal;
+ private subscriptions = [];
+
+ 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) {
+ }
+
+ ngOnDestroy() {
+ this.subscriptions.forEach(subscription => {
+ if (subscription instanceof Subscriber) {
+ subscription.unsubscribe();
+ }
+ });
+ }
+
+ ngOnInit() {
+ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
+ this.subscriptions.push(this._piwikService.trackView(this.properties, this.pageTitle, this.properties.piwikSiteId).subscribe());
}
- subscriptions = [];
- ngOnDestroy() {
- this.subscriptions.forEach(subscription => {
- if (subscription instanceof Subscriber) {
- subscription.unsubscribe();
- }
- });
+ 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();
+ }
+
+ 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) {
+ if (event.valid === true) {
+ this.sendMail(this.properties.admins);
}
- 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);
+ }
+
+ 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, StringUtils.validatorType(this.organizationTypes)]),
+ 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.composeEmailForMonitor(this.contactForm.value, admins),
+ this.contactForm.value.recaptcha).subscribe(
+ res => {
+ if (res) {
+ this.sending = false;
+ this.reset();
+ this.modalOpen();
} else {
- this.errorMessage = 'Please fill in all the required fields!';
+ this.handleError('Email
sent failed! 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);
}
-
- 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'");
- }
+ 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'");
+ }
}
diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html
index 04c8626..bfb59e2 100644
--- a/src/app/home/home.component.html
+++ b/src/app/home/home.component.html
@@ -2,15 +2,17 @@
-
- A new era of
monitoring
research.
-
-
-
Work together with us to view, understand and visualize
-
research statistics and indicators.
-
-
-
Get Started
+
+
+ A new era of monitoring research.
+
+
+
Work together with us to view, understand and visualize
+
research statistics and indicators.
+
+
diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary
index ada419f..d590732 160000
--- a/src/app/openaireLibrary
+++ b/src/app/openaireLibrary
@@ -1 +1 @@
-Subproject commit ada419f8e82836c19633544aeddcc7ca31a5699b
+Subproject commit d590732aba2a632036b006fb3de683cdb5df8ade