diff --git a/src/app/views/telemetry/pages/telemetry-tab/telemetry-tab.component.ts b/src/app/views/telemetry/pages/telemetry-tab/telemetry-tab.component.ts
index 14a1cbf3..00c42509 100644
--- a/src/app/views/telemetry/pages/telemetry-tab/telemetry-tab.component.ts
+++ b/src/app/views/telemetry/pages/telemetry-tab/telemetry-tab.component.ts
@@ -9,123 +9,139 @@ import { DeviceTypeWiseBarChartComponent } from './reports/device-type-wise-bar-
import { PopularLandingPagesBarChartComponent } from './reports/popular-landing-pages-bar-chart/popular-landing-pages-bar-chart.component';
import { TimeSpentPerPageBarChartComponent } from './reports/time-spent-per-page-bar-chart/time-spent-per-page-bar-chart.component';
import moment from 'moment';
+import { TelemetryActiveUsersTrendlineComponent } from './reports/telemetry-active-users-trendline/telemetry-active-users-trendline.component';
+import { TelemetryActiveUsersBigNumberComponent } from './reports/telemetry-active-users-big-number/telemetry-active-users-big-number.component';
@Component({
- selector: 'app-telemetry-tab',
- templateUrl: './telemetry-tab.component.html',
- styleUrls: ['./telemetry-tab.component.scss']
+ selector: 'app-telemetry-tab',
+ templateUrl: './telemetry-tab.component.html',
+ styleUrls: ['./telemetry-tab.component.scss']
})
export class TelemetryTabComponent implements OnInit {
- bigNumberReports: any = {};
- minYear: any;
- maxYear: any;
- minMonth: any;
- maxMonth: any;
- academicYear: any = [];
- months: any = [];
- filters: any;
- reportsToBeShown: any = [];
- rbacDetails: any;
- reportsData: any = [];
- startDate: any;
- endDate: any;
- defaultSelectedDays: any = 7;
- hasTimeSeriesFilters: boolean = true;
- hasCommonFilters: boolean = false;
- tabLabel: any = "telemetry";
- NVSK: boolean = true;
- matLabel = 'Telemtery';
-
- @ViewChild('telemetryBigNumber') telemetryBigNumber: TelemetryBigNumberComponent;
- @ViewChild('browserTypeWiseBarChartComponent') browserTypeWiseBarChartComponent: BrowserTypeWiseBarChartComponent;
- @ViewChild('deviceTypeWiseBarChartComponent') deviceTypeWiseBarChartComponent: DeviceTypeWiseBarChartComponent;
- @ViewChild('popularLandingPagesBarChartComponent') popularLandingPagesBarChartComponent: PopularLandingPagesBarChartComponent;
- @ViewChild('timeSpentPerPageBarChartComponent') timeSpentPerPageBarChartComponent: TimeSpentPerPageBarChartComponent;
-
- @Input() bigNumberMetrics: any = [];
-
- constructor(private _wrapperService: WrapperService, private _rbacService: RbacService) {
- this._rbacService.getRbacDetails().subscribe((rbacDetails: any) => {
- this.rbacDetails = rbacDetails;
- })
- if(environment.config === 'VSK') {
- this.NVSK = false
- }
- }
-
- async ngOnInit(): Promise
{
- // this.renderReports();
- }
-
- async ngAfterViewInit(): Promise {
- if (this.hasCommonFilters) {
- this.filters = await this._wrapperService.constructCommonFilters(config.filters, this.tabLabel);
- this.telemetryBigNumber?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
- this.browserTypeWiseBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
- this.deviceTypeWiseBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
- this.popularLandingPagesBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
- this.timeSpentPerPageBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
-
- }
-
- if (this.startDate != undefined && this.endDate != undefined && this.hasTimeSeriesFilters) {
- // let endDate = new Date();
- // let days = endDate.getDate() - this.defaultSelectedDays;
- // let startDate = new Date();
- // startDate.setDate(days);
- let startDate = moment(this.startDate).format('YYYY-MM-DD');
- let endDate = moment(this.endDate).format('YYYY-MM-DD');
- this.browserTypeWiseBarChartComponent?.getReportData({ timeSeriesValues: { startDate: startDate, endDate: endDate } });
- this.deviceTypeWiseBarChartComponent?.getReportData({ timeSeriesValues: { startDate: startDate, endDate: endDate } });
- this.popularLandingPagesBarChartComponent?.getReportData({ timeSeriesValues: { startDate:startDate, endDate:endDate } });
- this.timeSpentPerPageBarChartComponent?.getReportData({ timeSeriesValues: { startDate: startDate, endDate: endDate } });
- }
- }
-
- checkReport(key: string, reportType: string): Boolean {
- let reportConfig = config;
- let flag = false;
- reportConfig[key]?.filters?.forEach((filter: any) => {
- if (Number(filter.hierarchyLevel) === Number(this.rbacDetails?.role) && Object.keys(filter?.actions?.queries).includes(reportType)) {
- flag = true
- }
- })
- return flag
- }
-
- csvDownload(csvData: any) {
- if (csvData) {
- this.reportsData.push(csvData)
- }
- }
-
- filtersUpdated(filters: any) {
- this.reportsData = [];
- this.telemetryBigNumber?.getReportData({ filterValues: filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
- this.browserTypeWiseBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
- this.deviceTypeWiseBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
- this.popularLandingPagesBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
- this.timeSpentPerPageBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
-
- }
-
- timeSeriesUpdated(event: any): void {
- this.startDate = moment(event.startDate).format('YYYY-MM-DD');
- this.endDate = moment(event.endDate).format('YYYY-MM-DD');
- if (event?.startDate !== null && event?.endDate !== null) {
- console.log(event);
- this.reportsData = [];
- // this.telemetryBigNumber?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
- this.browserTypeWiseBarChartComponent?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
- this.deviceTypeWiseBarChartComponent?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
- this.popularLandingPagesBarChartComponent?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
- this.timeSpentPerPageBarChartComponent?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
- }
- }
-
- importBigNumberMetrics(bigNumberMetric: any) {
- this.bigNumberMetrics[bigNumberMetric.ind] = bigNumberMetric.data
- }
+ bigNumberReports: any = {};
+ minYear: any;
+ maxYear: any;
+ minMonth: any;
+ maxMonth: any;
+ academicYear: any = [];
+ months: any = [];
+ filters: any;
+ reportsToBeShown: any = [];
+ rbacDetails: any;
+ reportsData: any = [];
+ startDate: any;
+ endDate: any;
+ defaultSelectedDays: any = 7;
+ hasTimeSeriesFilters: boolean = true;
+ hasCommonFilters: boolean = false;
+ tabLabel: any = "telemetry";
+ NVSK: boolean = true;
+ matLabel = 'Telemtery';
+ trendLineConfig = {
+ options: {
+ tooltips: { displayColors: false },
+ legend: { display: false }
+ }
+ };
+
+ @ViewChild('telemetryBigNumber') telemetryBigNumber: TelemetryBigNumberComponent;
+ @ViewChild('browserTypeWiseBarChartComponent') browserTypeWiseBarChartComponent: BrowserTypeWiseBarChartComponent;
+ @ViewChild('deviceTypeWiseBarChartComponent') deviceTypeWiseBarChartComponent: DeviceTypeWiseBarChartComponent;
+ @ViewChild('popularLandingPagesBarChartComponent') popularLandingPagesBarChartComponent: PopularLandingPagesBarChartComponent;
+ @ViewChild('timeSpentPerPageBarChartComponent') timeSpentPerPageBarChartComponent: TimeSpentPerPageBarChartComponent;
+ @ViewChild('activeUsersTrendline') activeUsersTrendline: TelemetryActiveUsersTrendlineComponent;
+ @ViewChild('activeUsersBignumber') activeUsersBignumber: TelemetryActiveUsersBigNumberComponent;
+
+ @Input() bigNumberMetrics: any = [];
+
+ constructor(private _wrapperService: WrapperService, private _rbacService: RbacService) {
+ this._rbacService.getRbacDetails().subscribe((rbacDetails: any) => {
+ this.rbacDetails = rbacDetails;
+ })
+ if (environment.config === 'VSK') {
+ this.NVSK = false
+ }
+ }
+
+ async ngOnInit(): Promise {
+ // this.renderReports();
+ }
+
+ async ngAfterViewInit(): Promise {
+ if (this.hasCommonFilters) {
+ this.filters = await this._wrapperService.constructCommonFilters(config.filters, this.tabLabel);
+ this.telemetryBigNumber?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.browserTypeWiseBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.deviceTypeWiseBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.popularLandingPagesBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.timeSpentPerPageBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.activeUsersTrendline?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.activeUsersBignumber?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ }
+
+ if (this.startDate != undefined && this.endDate != undefined && this.hasTimeSeriesFilters) {
+ // let endDate = new Date();
+ // let days = endDate.getDate() - this.defaultSelectedDays;
+ // let startDate = new Date();
+ // startDate.setDate(days);
+ let startDate = moment(this.startDate).format('YYYY-MM-DD');
+ let endDate = moment(this.endDate).format('YYYY-MM-DD');
+ this.browserTypeWiseBarChartComponent?.getReportData({ timeSeriesValues: { startDate: startDate, endDate: endDate } });
+ this.deviceTypeWiseBarChartComponent?.getReportData({ timeSeriesValues: { startDate: startDate, endDate: endDate } });
+ this.popularLandingPagesBarChartComponent?.getReportData({ timeSeriesValues: { startDate: startDate, endDate: endDate } });
+ this.timeSpentPerPageBarChartComponent?.getReportData({ timeSeriesValues: { startDate: startDate, endDate: endDate } });
+ this.activeUsersTrendline?.getReportData({ timeSeriesValues: { startDate: startDate, endDate: endDate } });
+ this.activeUsersBignumber?.getReportData({ timeSeriesValues: { startDate: startDate, endDate: endDate } });
+ }
+ }
+
+ checkReport(key: string, reportType: string): Boolean {
+ let reportConfig = config;
+ let flag = false;
+ reportConfig[key]?.filters?.forEach((filter: any) => {
+ if (Number(filter.hierarchyLevel) === Number(this.rbacDetails?.role) && Object.keys(filter?.actions?.queries).includes(reportType)) {
+ flag = true
+ }
+ })
+ return flag
+ }
+
+ csvDownload(csvData: any) {
+ if (csvData) {
+ this.reportsData.push(csvData)
+ }
+ }
+
+ filtersUpdated(filters: any) {
+ this.reportsData = [];
+ this.telemetryBigNumber?.getReportData({ filterValues: filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.browserTypeWiseBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.deviceTypeWiseBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.popularLandingPagesBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.timeSpentPerPageBarChartComponent?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.activeUsersTrendline?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ this.activeUsersBignumber?.getReportData({ filterValues: this.filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) });
+ }
+
+ timeSeriesUpdated(event: any): void {
+ this.startDate = moment(event.startDate).format('YYYY-MM-DD');
+ this.endDate = moment(event.endDate).format('YYYY-MM-DD');
+ if (event?.startDate !== null && event?.endDate !== null) {
+ console.log(event);
+ this.reportsData = [];
+ // this.telemetryBigNumber?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
+ this.browserTypeWiseBarChartComponent?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
+ this.deviceTypeWiseBarChartComponent?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
+ this.popularLandingPagesBarChartComponent?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
+ this.timeSpentPerPageBarChartComponent?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
+ this.activeUsersTrendline?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
+ this.activeUsersBignumber?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } });
+ }
+ }
+
+ importBigNumberMetrics(bigNumberMetric: any) {
+ this.bigNumberMetrics[bigNumberMetric.ind] = bigNumberMetric.data
+ }
}
diff --git a/src/app/views/telemetry/telemetry.module.ts b/src/app/views/telemetry/telemetry.module.ts
index 8d9b1228..c86f98f7 100644
--- a/src/app/views/telemetry/telemetry.module.ts
+++ b/src/app/views/telemetry/telemetry.module.ts
@@ -11,6 +11,8 @@ import { BrowserTypeWiseBarChartComponent } from './pages/telemetry-tab/reports/
import { DeviceTypeWiseBarChartComponent } from './pages/telemetry-tab/reports/device-type-wise-bar-chart/device-type-wise-bar-chart.component';
import { PopularLandingPagesBarChartComponent } from './pages/telemetry-tab/reports/popular-landing-pages-bar-chart/popular-landing-pages-bar-chart.component';
import { TimeSpentPerPageBarChartComponent } from './pages/telemetry-tab/reports/time-spent-per-page-bar-chart/time-spent-per-page-bar-chart.component';
+import { TelemetryActiveUsersTrendlineComponent } from './pages/telemetry-tab/reports/telemetry-active-users-trendline/telemetry-active-users-trendline.component';
+import { TelemetryActiveUsersBigNumberComponent } from './pages/telemetry-tab/reports/telemetry-active-users-big-number/telemetry-active-users-big-number.component';
@NgModule({
declarations: [
@@ -20,7 +22,9 @@ import { TimeSpentPerPageBarChartComponent } from './pages/telemetry-tab/reports
BrowserTypeWiseBarChartComponent,
DeviceTypeWiseBarChartComponent,
PopularLandingPagesBarChartComponent,
- TimeSpentPerPageBarChartComponent
+ TimeSpentPerPageBarChartComponent,
+ TelemetryActiveUsersTrendlineComponent,
+ TelemetryActiveUsersBigNumberComponent
],
imports: [
DashletModule.forRoot({