From ec9d7ff0c3365afccfa3f4afec15660596eeb4ba Mon Sep 17 00:00:00 2001 From: FaizanMohammed326 Date: Wed, 12 Jul 2023 14:47:15 +0530 Subject: [PATCH] bug fixes in NVSK reports --- src/app/core/services/map/map.service.ts | 2 +- .../leaflet-map/leaflet-map.component.scss | 27 +++++++++++++----- .../views/ncert-quiz/config/quiz_config.ts | 3 +- src/app/views/ncf/config/ncf_config.ts | 2 +- src/app/views/pgi/config/pgi_config.ts | 6 ++-- .../state-wise-performance.component.ts | 28 +++++++++---------- src/app/views/udise/config/udise_config.ts | 10 +++---- .../state-wise-performance.component.ts | 27 +++++++++--------- 8 files changed, 58 insertions(+), 47 deletions(-) diff --git a/src/app/core/services/map/map.service.ts b/src/app/core/services/map/map.service.ts index 975cbfdf..034575a8 100644 --- a/src/app/core/services/map/map.service.ts +++ b/src/app/core/services/map/map.service.ts @@ -29,7 +29,7 @@ export class MapService { } async getStateGeoJSON(drillDownDetails?: any): Promise { - if (!this.stateGeoJSON) { + if (!this.stateGeoJSON || environment.config === 'NVSK') { var response; if (environment.config === 'NVSK' && drillDownDetails?.state) { let stateCode = StateCodes[Number(drillDownDetails?.state)] diff --git a/src/app/shared/components/maps/leaflet-map/leaflet-map.component.scss b/src/app/shared/components/maps/leaflet-map/leaflet-map.component.scss index 5a2de15f..96067908 100644 --- a/src/app/shared/components/maps/leaflet-map/leaflet-map.component.scss +++ b/src/app/shared/components/maps/leaflet-map/leaflet-map.component.scss @@ -1,6 +1,7 @@ #map { height: 90vh; } + // ::ng-deep{ // .leaflet-pane { // z-index: 1002 !important; @@ -10,8 +11,13 @@ // min-width: fit-content !important; // } // } -::ng-deep{ - .leaflet-notification{ +::ng-deep { + .leaflet-popup { + word-break: break-all; + // min-width: fit-content !important; + } + + .leaflet-notification { background-color: white; padding: 10px; margin-right: 0px; @@ -19,12 +25,15 @@ font-size: 11px; font-weight: 700; } + .leaflet-top { pointer-events: auto !important; } - .clickable-range{ + + .clickable-range { cursor: pointer; } + .legend-range { margin-top: 10px; padding: 5px; @@ -35,10 +44,13 @@ font-weight: bold; width: 100%; } - .leaflet-interactive:focus, .leaflet-interactive:active{ - outline:none; + + .leaflet-interactive:focus, + .leaflet-interactive:active { + outline: none; } - .legend-checkbox{ + + .legend-checkbox { display: inline-block; // margin-bottom: 0.5rem; margin-top: 3px; @@ -46,7 +58,8 @@ margin-left: 10px; display: flex !important; } - .button-content{ + + .button-content { display: column; // justify-content: space-evenly; } diff --git a/src/app/views/ncert-quiz/config/quiz_config.ts b/src/app/views/ncert-quiz/config/quiz_config.ts index bcfc7938..c249ed89 100644 --- a/src/app/views/ncert-quiz/config/quiz_config.ts +++ b/src/app/views/ncert-quiz/config/quiz_config.ts @@ -192,7 +192,8 @@ export const config = { "options": { "bigNumber": { "title": ['Total Quizzes', 'Total Medium', 'Total States/UTs Participating', 'Total Enrolment', 'Total Certification'], - "property": ['total_quizzes', 'total_medium', 'total_states', 'total_enrolment', 'total_certification'] + "property": ['total_quizzes', 'total_medium', 'total_states', 'total_enrolment', 'total_certification'], + "valueSuffix": ['', '', '', '', ''] } } } diff --git a/src/app/views/ncf/config/ncf_config.ts b/src/app/views/ncf/config/ncf_config.ts index acd73091..d4ce0553 100644 --- a/src/app/views/ncf/config/ncf_config.ts +++ b/src/app/views/ncf/config/ncf_config.ts @@ -156,7 +156,7 @@ export const config = { ], "options": { "bigNumber": { - "title": ['Total District Consultation Report (DCR) Completed/Uploaded', 'Total Mobile Survey', 'Total National District Groups (NDGs) created', 'Total Digital Survey for National Curriculum (DiSaNC) Survey',], + "title": ['Total District Consultation Report (DCR) Completed/Uploaded', 'Total Mobile Survey', 'Total National District Groups (NDGs) created', 'Total Digital Survey for National Curriculum (DiSaNC) Survey'], "valueSuffix": ['','','',''], "property": ['total_dcr', 'total_mobile_survey', 'total_ndg', 'participants'] } diff --git a/src/app/views/pgi/config/pgi_config.ts b/src/app/views/pgi/config/pgi_config.ts index 602a884a..0f8c60a4 100644 --- a/src/app/views/pgi/config/pgi_config.ts +++ b/src/app/views/pgi/config/pgi_config.ts @@ -122,9 +122,9 @@ export const config = { "hierarchyLevel": "0", "actions": { "queries": { - "bigNumber1": "select sum(sum) as outcome from datasets.pgi_category_ermmbwaaaaaaaaaalxqd as t where category_name = 'outcome'", - "bigNumber2": "select sum(sum) as infra_score from datasets.pgi_category_ermmbwaaaaaaaaaalxqd as t where category_name = 'infrastructure_facilities_studententitlements'", - "bigNumber3": "select sum(sum) as governance_processes from datasets.pgi_category_ermmbwaaaaaaaaaalxqd as t where category_name = 'governance_processes'", + "bigNumber1": "select sum(sum) as outcome from datasets.pgi_category_state0categorypgi as t where category_name = 'outcome'", + "bigNumber2": "select sum(sum) as infra_score from datasets.pgi_category_state0categorypgi as t where category_name = 'infrastructure_facilities_studententitlements'", + "bigNumber3": "select sum(sum) as governance_processes from datasets.pgi_category_state0categorypgi as t where category_name = 'governance_processes'", "bigNumber4": "", "bigNumber5": "" }, diff --git a/src/app/views/pgi/pages/state-wise-performance-tab/reports/state-wise-performance/state-wise-performance.component.ts b/src/app/views/pgi/pages/state-wise-performance-tab/reports/state-wise-performance/state-wise-performance.component.ts index 78532702..12c3ad05 100644 --- a/src/app/views/pgi/pages/state-wise-performance-tab/reports/state-wise-performance/state-wise-performance.component.ts +++ b/src/app/views/pgi/pages/state-wise-performance-tab/reports/state-wise-performance/state-wise-performance.component.ts @@ -56,15 +56,25 @@ export class StateWisePerformanceComponent implements OnInit, OnDestroy { } async getReportData(values: any): Promise { + let { filterValues, timeSeriesValues } = values ?? {}; + this.startDate = timeSeriesValues?.startDate; + this.endDate = timeSeriesValues?.endDate; + let metricFilter = [...filterValues].filter((filter: any) => { + return filter.filterType === 'metric' + }) + this.metricFilter = metricFilter + + filterValues = [...filterValues].filter((filter: any) => { + return filter.filterType !== 'metric' + }) + + this.commonFilter = filterValues if (this.drillDownDetails !== undefined) { let result: any = await this._drillDownService.drilldown({ hierarchyLevel: this.drillDownLevel }, this.rbacDetails, config[this.reportName], this.startDate, this.endDate, this.drillDownDetails, this.metricFilter, this.commonFilter) this.drillDownDetails = result?.drillDownDetails this.reportData = result?.reportData } else { - let { filterValues, timeSeriesValues } = values ?? {}; - this.startDate = timeSeriesValues?.startDate; - this.endDate = timeSeriesValues?.endDate; let reportConfig = config let { timeSeriesQueries, queries, levels, defaultLevel, filters, options } = reportConfig[this.reportName]; @@ -102,18 +112,6 @@ export class StateWisePerformanceComponent implements OnInit, OnDestroy { } let query = buildQuery(onLoadQuery, defaultLevel, this.levels, this.filters, this.startDate, this.endDate, key, this.compareDateRange); - let metricFilter = [...filterValues].filter((filter: any) => { - return filter.filterType === 'metric' - }) - this.metricFilter = metricFilter - - filterValues = [...filterValues].filter((filter: any) => { - return filter.filterType !== 'metric' - }) - - this.commonFilter = filterValues - - filterValues.forEach((filterParams: any) => { query = parseFilterToQuery(query, filterParams) }); diff --git a/src/app/views/udise/config/udise_config.ts b/src/app/views/udise/config/udise_config.ts index 3836aa37..1765c7ab 100644 --- a/src/app/views/udise/config/udise_config.ts +++ b/src/app/views/udise/config/udise_config.ts @@ -203,10 +203,10 @@ export const config = { "actions": { "queries": { "bigNumber1": "select sum(sum) as total_students from datasets.udise_no_of_students_state", - "bigNumber2": "select round(cast (avg(sum) as numeric),2) as ptr from datasets.udise_category_ynl7ygbvaaaaaaaaaaaq where category_name = 'ptr'", - "bigNumber3": "select round(cast (avg(sum) as numeric),2) as schs_with_toilet from datasets.udise_category_ynl7ygbvaaaaaaaaaaaq where category_name = '%_schools_having_toilet'", - "bigNumber4": "select round(cast (avg(sum) as numeric),2) as schs_having_electricity from datasets.udise_category_ynl7ygbvaaaaaaaaaaaq where category_name = '%_schools_having_electricity'", - "bigNumber5": "select round(cast (avg(sum) as numeric),2) as schs_having_water from datasets.udise_category_ynl7ygbvaaaaaaaaaaaq where category_name = '%_schools_having_drinking_water'", + "bigNumber2": "select round(cast (avg(sum) as numeric),2) as ptr from datasets.udise_category_state0categoryudise where category_name = 'ptr'", + "bigNumber3": "select round(cast (avg(sum) as numeric),2) as schs_with_toilet from datasets.udise_category_state0categoryudise where category_name = '%_schools_having_toilet'", + "bigNumber4": "select round(cast (avg(sum) as numeric),2) as schs_having_electricity from datasets.udise_category_state0categoryudise where category_name = '%_schools_having_electricity'", + "bigNumber5": "select round(cast (avg(sum) as numeric),2) as schs_having_water from datasets.udise_category_state0categoryudise where category_name = '%_schools_having_drinking_water'", }, "level": "state" } @@ -260,7 +260,7 @@ export const config = { { "queries": { - "map": "select t2.district_name, t1.district_id, t1.district_id as level , t1.category_name,latitude, longitude,round(cast(sum(t1.sum) as numeric ),2) as percentage from datasets.udise_category_district0categoryudise as t1 join dimensions.district as t2 on t2.district_id = t1.district_id group by t1.district_id, t2.district_name,t1.category_name, latitude, longitude" + "map": "select t2.district_name, t1.district_id, t1.district_id as level , t1.category_name,latitude, longitude,round(cast(sum(t1.sum) as numeric ),2) as percentage from datasets.udise_category_district0categoryudise as t1 join dimensions.district as t2 on t2.district_id = t1.district_id where t2.state_id = {state_id} group by t1.district_id, t2.district_name,t1.category_name, latitude, longitude" }, "level": "district", "nextLevel": "block" diff --git a/src/app/views/udise/pages/state-wise-performance-tab/reports/state-wise-performance/state-wise-performance.component.ts b/src/app/views/udise/pages/state-wise-performance-tab/reports/state-wise-performance/state-wise-performance.component.ts index 86eebae2..9a602fa5 100644 --- a/src/app/views/udise/pages/state-wise-performance-tab/reports/state-wise-performance/state-wise-performance.component.ts +++ b/src/app/views/udise/pages/state-wise-performance-tab/reports/state-wise-performance/state-wise-performance.component.ts @@ -60,15 +60,25 @@ export class StateWisePerformanceComponent implements OnInit, OnDestroy { } async getReportData(values: any): Promise { + let { filterValues, timeSeriesValues } = values ?? {}; + this.startDate = timeSeriesValues?.startDate; + this.endDate = timeSeriesValues?.endDate; + let metricFilter = [...filterValues].filter((filter: any) => { + return filter.filterType === 'metric' + }) + this.metricFilter = metricFilter + + filterValues = [...filterValues].filter((filter: any) => { + return filter.filterType !== 'metric' + }) + + this.commonFilter = filterValues if (this.drillDownDetails !== undefined) { let result: any = await this._drillDownService.drilldown({ hierarchyLevel: this.drillDownLevel }, this.rbacDetails, config[this.reportName], this.startDate, this.endDate, this.drillDownDetails, this.metricFilter, this.commonFilter) this.drillDownDetails = result?.drillDownDetails this.reportData = result?.reportData } else { - let { filterValues, timeSeriesValues } = values ?? {}; - this.startDate = timeSeriesValues?.startDate; - this.endDate = timeSeriesValues?.endDate; let reportConfig = config let { timeSeriesQueries, queries, levels, defaultLevel, filters, options } = reportConfig[this.reportName]; @@ -106,17 +116,6 @@ export class StateWisePerformanceComponent implements OnInit, OnDestroy { } let query = buildQuery(onLoadQuery, defaultLevel, this.levels, this.filters, this.startDate, this.endDate, key, this.compareDateRange); - let metricFilter = [...filterValues].filter((filter: any) => { - return filter.filterType === 'metric' - }) - this.metricFilter = metricFilter - - filterValues = [...filterValues].filter((filter: any) => { - return filter.filterType !== 'metric' - }) - - this.commonFilter = filterValues - filterValues.forEach((filterParams: any) => { query = parseFilterToQuery(query, filterParams) });