2019-01-18 18:35:57 +03:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Akveo. All Rights Reserved.
|
|
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-05 21:03:35 +03:00
|
|
|
import { AfterViewInit, Component, ElementRef, Inject, OnDestroy } from '@angular/core';
|
2019-02-05 18:53:21 +03:00
|
|
|
import { Descriptions, DescriptionsService } from '../../../@core/data/service/descriptions.service';
|
2019-02-05 21:03:35 +03:00
|
|
|
import { delay, filter, take, takeWhile } from 'rxjs/operators';
|
|
|
|
|
import { ActivatedRoute } from '@angular/router';
|
|
|
|
|
import { NB_WINDOW } from '@nebular/theme';
|
2019-01-18 18:35:57 +03:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'ngx-backend-bundles-section',
|
|
|
|
|
templateUrl: 'backend-bundles-section.component.html',
|
|
|
|
|
styleUrls: ['./backend-bundles-section.component.scss'],
|
|
|
|
|
})
|
|
|
|
|
|
2019-02-05 21:03:35 +03:00
|
|
|
export class BackendBundlesSectionComponent implements OnDestroy, AfterViewInit {
|
2019-02-05 18:53:21 +03:00
|
|
|
|
|
|
|
|
private alive = true;
|
|
|
|
|
descriptions: Descriptions[];
|
|
|
|
|
|
2019-01-24 16:37:12 +03:00
|
|
|
selectedLicenseType = 'Personal';
|
|
|
|
|
personalLicense = 'Personal';
|
|
|
|
|
commercialLicense = 'Commercial';
|
2019-01-18 18:35:57 +03:00
|
|
|
|
2019-02-05 18:53:21 +03:00
|
|
|
ecomName = 'E-Commerce:';
|
|
|
|
|
iotName = 'IoT:';
|
|
|
|
|
|
2019-02-05 21:03:35 +03:00
|
|
|
netName = '.NET + ngx-admin';
|
|
|
|
|
netCoreName = '.NET Core + ngx-admin';
|
2019-01-18 18:35:57 +03:00
|
|
|
|
2019-01-23 15:40:42 +03:00
|
|
|
get firstBundleMail(): string {
|
|
|
|
|
return this.getMailToText('.NET E-commerce');
|
|
|
|
|
}
|
2019-01-18 18:35:57 +03:00
|
|
|
|
2019-01-23 15:40:42 +03:00
|
|
|
get secondBundleMail(): string {
|
|
|
|
|
return this.getMailToText('.NET IoT');
|
|
|
|
|
}
|
2019-01-18 18:35:57 +03:00
|
|
|
|
2019-01-23 15:40:42 +03:00
|
|
|
get thirdBundleMail(): string {
|
|
|
|
|
return this.getMailToText('.NET Core E-commerce');
|
|
|
|
|
}
|
2019-01-18 18:35:57 +03:00
|
|
|
|
2019-01-23 15:40:42 +03:00
|
|
|
get fourthBundleMail(): string {
|
|
|
|
|
return this.getMailToText('.NET Core IoT');
|
|
|
|
|
}
|
2019-01-18 18:35:57 +03:00
|
|
|
|
|
|
|
|
firstCardFlipped: boolean = false;
|
|
|
|
|
secondCardFlipped: boolean = false;
|
|
|
|
|
thirdCardFlipped: boolean = false;
|
|
|
|
|
fourthCardFlipped: boolean = false;
|
|
|
|
|
|
2019-02-05 21:03:35 +03:00
|
|
|
constructor(private descriptionsService: DescriptionsService,
|
|
|
|
|
private activatedRoute: ActivatedRoute,
|
|
|
|
|
private el: ElementRef<HTMLElement>,
|
|
|
|
|
@Inject(NB_WINDOW) private window) {
|
|
|
|
|
this.descriptionsService.getBundleDescriptions()
|
|
|
|
|
.pipe(takeWhile(() => this.alive))
|
|
|
|
|
.subscribe((descriptions) => this.descriptions = descriptions);
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-18 18:35:57 +03:00
|
|
|
stopPropagation(e) {
|
2019-02-05 21:03:35 +03:00
|
|
|
// e.stopPropagation();
|
2019-01-18 18:35:57 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
isCommercial() {
|
2019-01-24 16:37:12 +03:00
|
|
|
return this.selectedLicenseType === 'Commercial';
|
2019-01-23 15:40:42 +03:00
|
|
|
}
|
|
|
|
|
|
2019-02-05 21:03:35 +03:00
|
|
|
ngAfterViewInit() {
|
|
|
|
|
this.activatedRoute.fragment
|
|
|
|
|
.pipe(
|
|
|
|
|
filter(fragment => fragment === 'backend-bundles'),
|
|
|
|
|
delay(500),
|
|
|
|
|
take(1),
|
|
|
|
|
)
|
|
|
|
|
.subscribe((fragment: string) => {
|
|
|
|
|
this.window.scrollTo(0, this.el.nativeElement.offsetTop);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnDestroy() {
|
|
|
|
|
this.alive = false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-23 15:40:42 +03:00
|
|
|
private getMailToText(bundleName: string) {
|
|
|
|
|
return 'mailto:support@akveo.com' +
|
2019-01-24 16:37:12 +03:00
|
|
|
`?subject=${this.selectedLicenseType} ${bundleName} Bundle` +
|
2019-01-23 15:40:42 +03:00
|
|
|
'&body=Dear Akveo, %0D%0A%0D%0A' +
|
2019-01-24 16:37:12 +03:00
|
|
|
`I would like to purchase ${this.selectedLicenseType} ${bundleName} Bundle. ` +
|
2019-01-23 15:40:42 +03:00
|
|
|
'Please give me details how I can proceed with that. %0D%0A%0D%0A' +
|
|
|
|
|
'Thanks and regards';
|
2019-01-18 18:35:57 +03:00
|
|
|
}
|
|
|
|
|
}
|