|
@ -13,10 +13,14 @@ import { Subject } from 'rxjs'; |
|
|
templateUrl: './landing-page.html' |
|
|
templateUrl: './landing-page.html' |
|
|
}) |
|
|
}) |
|
|
export class LandingPageComponent implements OnDestroy, OnInit { |
|
|
export class LandingPageComponent implements OnDestroy, OnInit { |
|
|
|
|
|
public countriesOfSubscribersMap: { |
|
|
|
|
|
[code: string]: { value: number }; |
|
|
|
|
|
} = {}; |
|
|
public currentYear = format(new Date(), 'yyyy'); |
|
|
public currentYear = format(new Date(), 'yyyy'); |
|
|
public demoAuthToken: string; |
|
|
public demoAuthToken: string; |
|
|
public deviceType: string; |
|
|
public deviceType: string; |
|
|
public hasPermissionForStatistics: boolean; |
|
|
public hasPermissionForStatistics: boolean; |
|
|
|
|
|
public hasPermissionForSubscription: boolean; |
|
|
public hasPermissionToCreateUser: boolean; |
|
|
public hasPermissionToCreateUser: boolean; |
|
|
public statistics: Statistics; |
|
|
public statistics: Statistics; |
|
|
public testimonials = [ |
|
|
public testimonials = [ |
|
@ -48,13 +52,25 @@ export class LandingPageComponent implements OnDestroy, OnInit { |
|
|
private dataService: DataService, |
|
|
private dataService: DataService, |
|
|
private deviceService: DeviceDetectorService |
|
|
private deviceService: DeviceDetectorService |
|
|
) { |
|
|
) { |
|
|
const { globalPermissions, statistics } = this.dataService.fetchInfo(); |
|
|
const { countriesOfSubscribers, globalPermissions, statistics } = |
|
|
|
|
|
this.dataService.fetchInfo(); |
|
|
|
|
|
|
|
|
|
|
|
for (const country of countriesOfSubscribers) { |
|
|
|
|
|
this.countriesOfSubscribersMap[country] = { |
|
|
|
|
|
value: 1 |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.hasPermissionForStatistics = hasPermission( |
|
|
this.hasPermissionForStatistics = hasPermission( |
|
|
globalPermissions, |
|
|
globalPermissions, |
|
|
permissions.enableStatistics |
|
|
permissions.enableStatistics |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
this.hasPermissionForSubscription = hasPermission( |
|
|
|
|
|
globalPermissions, |
|
|
|
|
|
permissions.enableSubscription |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
this.hasPermissionToCreateUser = hasPermission( |
|
|
this.hasPermissionToCreateUser = hasPermission( |
|
|
globalPermissions, |
|
|
globalPermissions, |
|
|
permissions.createUserAccount |
|
|
permissions.createUserAccount |
|
|