Skip to content

Commit

Permalink
Merge pull request #372 from FaizanMohammed326/dev
Browse files Browse the repository at this point in the history
navaigation issue fixed
  • Loading branch information
htvenkatesh authored Sep 21, 2023
2 parents adc9fdd + 38635f2 commit cf4b50a
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export class AppComponent {
loadingDataImg: boolean = false;
constructor(private translate: TranslateService, private titleService: Title,
private router: Router, private activatedRoute: ActivatedRoute, public config: AppConfig, private http: HttpClient, private pageTrackerService: PageTrackerService) {
translate.setDefaultLang('en');
translate.use('en');
// translate.setDefaultLang('en');
// translate.use('en');
/** START : Code to Track Page View using gtag.js */

// this.http.get('assets/config/globalconfig.json').pipe(
Expand Down
8 changes: 7 additions & 1 deletion src/app/core/services/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ export class DataService {
let newValue = value?.substring(0, Number(yAxis?.limitCharacters)) + '...'
return newValue
}
else if (yAxis?.onlyIntegers) {
if (value % 1 === 0) {
return value;
}
else return null
}
else {
return value
}
Expand All @@ -175,7 +181,7 @@ export class DataService {
callback: function (value, index, values) {
console.log(value);
if (type !== 'horizontal' && typeof value == 'string') {
let newValue = value?.split('_').map((word: any) => word[0].toUpperCase() + word.substring(1)).join(' ')
let newValue = value?.split('_').map((word: any) => word[0]?.toUpperCase() + word?.substring(1)).join(' ')
if (screen.width <= 768) {
return newValue.substr(0, 8) + '...';
} else {
Expand Down
60 changes: 40 additions & 20 deletions src/app/views/telemetry/config/telemetry_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const config = {
"metricValueProp": "user_count",
"valueSuffix": "",
"yAxis": {
"onlyIntegers": true,
"title": "User Count"
},
"xAxis": {
Expand Down Expand Up @@ -117,6 +118,7 @@ export const config = {
"metricValueProp": "user_count",
"valueSuffix": "",
"yAxis": {
"onlyIntegers": true,
"title": "User Conunt"
},
"xAxis": {
Expand All @@ -133,31 +135,40 @@ export const config = {
"label": "% against Potential Base",
"defaultLevel": "state",
"filters": [
{
"name": "National",
"hierarchyLevel": "0",
"actions": {
"queries": {
"barChart": "select sum(sum) as pageeventcount, pagename from datasets.telemetry_pageeventcount_OAYGGB8XYHFocwRwb255 where pageevent = 'onLoad' and date between startDate and endDate group by pagename order by pageeventcount desc",
},
"level": "state"
}
},
{
"name": "State",
"labelProp": "state_name",
"valueProp": "state_id",
"hierarchyLevel": "1",
"actions": {
"queries": {
"barChart": "select t1.program_name, round(cast(avg(t1.sum) as numeric),2) as target_achieved, round(cast(avg(t1.sum) as numeric) + (cast(avg(t2.sum) as numeric)),2) as total_target from datasets.nishtha_perc_target_achieved_enrolment_programnishtha as t1 join datasets.nishtha_perc_target_remaining_enrolment_programnishtha as t2 on t1.program_name = t2.program_name group by t1.program_name",
"barChart": "select sum(sum) as pageeventcount, pagename from datasets.telemetry_pageeventcount_OAYGGB8XYHFocwRwb255 where pageevent = 'onLoad' and date between startDate and endDate group by pagename order by pageeventcount desc",
},
"level": "district"
}
}
],
"options": {
"barChart": {
"metricLabelProp": "% Target Achieved-Enrolment",
"metricValueProp": "target_achieved",
"valueSuffix": "%",
"metricLabelProp": "Page Visits",
"metricValueProp": "pageeventcount",
"valueSuffix": "",
"yAxis": {
"title": ""
"onlyIntegers": true,
"title": "Page Visits"
},
"xAxis": {
"title": " Programs",
"label": "program_name",
"value": "program_name",
"title": "Page Name",
"label": "pagename",
"value": "pagename",
}
},
}
Expand All @@ -166,31 +177,40 @@ export const config = {
"label": "% against Potential Base",
"defaultLevel": "state",
"filters": [
{
"name": "National",
"hierarchyLevel": "0",
"actions": {
"queries": {
"barChart": "select sum(avg) as timespent, pagename from datasets.telemetry_timespent_daily_pagenames where date between startDate and endDate group by pagename",
},
"level": "state"
}
},
{
"name": "State",
"labelProp": "state_name",
"valueProp": "state_id",
"hierarchyLevel": "1",
"actions": {
"queries": {
"barChart": "select t1.program_name, round(cast(avg(t1.sum) as numeric),2) as target_achieved, round(cast(avg(t1.sum) as numeric) + (cast(avg(t2.sum) as numeric)),2) as total_target from datasets.nishtha_perc_target_achieved_enrolment_programnishtha as t1 join datasets.nishtha_perc_target_remaining_enrolment_programnishtha as t2 on t1.program_name = t2.program_name group by t1.program_name",
"barChart": "select sum(avg) as timespent, pagename from datasets.telemetry_timespent_daily_pagenames where date between startDate and endDate group by pagename",
},
"level": "district"
}
}
],
"options": {
"barChart": {
"metricLabelProp": "% Target Achieved-Enrolment",
"metricValueProp": "target_achieved",
"valueSuffix": "%",
"metricLabelProp": "Time spent per page (in minutes)",
"metricValueProp": "timespent",
"valueSuffix": "",
"yAxis": {
"title": ""
"onlyIntegers": true,
"title": "Time spent per page (in minutes)"
},
"xAxis": {
"title": " Programs",
"label": "program_name",
"value": "program_name",
"title": "Pages",
"label": "pagename",
"value": "pagename",
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class BrowserTypeWiseBarChartComponent implements OnInit {
reportData: any = {
reportName: "Telemetry"
};
title: string = 'browserTypeWiseBarChart'
title: string = 'Browser Type Wise User Count'
selectedYear: any;
selectedMonth: any;
startDate: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class DeviceTypeWiseBarChartComponent implements OnInit {
reportData: any = {
reportName: "Telemetry"
};
title: string = 'deviceTypeWiseBarChart'
title: string = 'Device Type Wise User Count'
selectedYear: any;
selectedMonth: any;
startDate: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ng-container *ngIf="(reportData?.values && reportData?.values?.length > 0)">
<p class="text-center font-medium py-2 filename" >{{title}}</p><br>
<!-- <sb-dashlet type="bar" [data]="reportData" [config]="config"></sb-dashlet> -->
<app-sb-bar-chart type="horizontalBar" [data]="reportData" [config]="config" ></app-sb-bar-chart>
<app-sb-bar-chart [data]="reportData" [config]="config" ></app-sb-bar-chart>
</ng-container>
<div class="noData" *ngIf="!(reportData?.values && reportData?.values?.length > 0)">
No Data Found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class PopularLandingPagesBarChartComponent implements OnInit {
reportData: any = {
reportName: "Telemetry"
};
title: string = 'popularLandingPagesBarChart'
title: string = 'Popular Landing Pages'
selectedYear: any;
selectedMonth: any;
startDate: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ng-container *ngIf="(reportData?.values && reportData?.values?.length > 0)">
<p class="text-center font-medium py-2 filename" >{{title}}</p><br>
<!-- <sb-dashlet type="bar" [data]="reportData" [config]="config"></sb-dashlet> -->
<app-sb-bar-chart type="horizontalBar" [data]="reportData" [config]="config" ></app-sb-bar-chart>
<app-sb-bar-chart [data]="reportData" [config]="config" ></app-sb-bar-chart>
</ng-container>
<div class="noData" *ngIf="!(reportData?.values && reportData?.values?.length > 0)">
No Data Found
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class TimeSpentPerPageBarChartComponent implements OnInit {
reportData: any = {
reportName: "Telemetry"
};
title: string = 'Telemetry'
title: string = 'Time Spent Per Page'
selectedYear: any;
selectedMonth: any;
startDate: any;
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>cQube</title>
<base href="/dashboard/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="/assets/images/icon.ico">
<link rel="icon" type="image/x-icon" href="./assets/images/icon.ico">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
Expand Down

0 comments on commit cf4b50a

Please sign in to comment.