Skip to content

Commit

Permalink
Merge pull request Sunbird-cQube#254 from atulmane01/development
Browse files Browse the repository at this point in the history
added map for udise and pgi
  • Loading branch information
tibil-it authored Jul 26, 2022
2 parents 29c19ba + ec4c70a commit b444bdb
Show file tree
Hide file tree
Showing 14 changed files with 239 additions and 2 deletions.
35 changes: 35 additions & 0 deletions development/ui/back-end/core/config/nvsk/pgi_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,41 @@ const dataSourceInfo = {
}
}
}
},
implementationStatus: {
map: {
pathToFile: "pgi_program-started.json",
locations: [
{
name: "Location",
property: "State",
level: "state",
isState: true,
tooltip: {
name: "State/UT name",
},
},
],
dimensions: [
{
name: "indicator",
property: "Started",
tooltip: {
name: "PGI Started",
},
},
{
name: "state_code",
property: "State Code",
},
],
filters: [],
options: {
legend: {
title: "Started PGI",
},
},
},
}
}

Expand Down
35 changes: 35 additions & 0 deletions development/ui/back-end/core/config/nvsk/udise_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,41 @@ const dataSourceInfo = {
}
]
}
},
implementationStatus: {
map: {
pathToFile: "udise_program-started.json",
locations: [
{
name: "Location",
property: "State",
level: "state",
isState: true,
tooltip: {
name: "State/UT name",
},
},
],
dimensions: [
{
name: "indicator",
property: "Started",
tooltip: {
name: "UDISE Started",
},
},
{
name: "state_code",
property: "State Code",
},
],
filters: [],
options: {
legend: {
title: "Started UDISE",
},
},
},
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<div class="grid grid-cols-12">
<div class="col-span-full" *ngIf="pgiStateData" appFullScreen>
<app-leaflet-map [mapData]="pgiStateData"></app-leaflet-map>
<ngx-spinner bdColor = "rgba(0, 0, 0, 0.8)" size = "medium" color = "#fff" type = "ball-scale-multiple" [fullScreen] = "true"><p style="color: white" > Loading... </p></ngx-spinner>
</div>
<div class="col" *ngIf="isMapReport1Loading">
<!-- <ngx-spinner bdColor = "rgba(0, 0, 0, 0.8)" size = "medium" color = "#fff" type = "ball-scale-multiple" [fullScreen] = "true"><p style="color: white" > Loading... </p></ngx-spinner> -->
<p class="mt-8 mb-8">Loading...</p>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ImplementationStatusComponent } from './implementation-status.component';

describe('ImplementationStatusComponent', () => {
let component: ImplementationStatusComponent;
let fixture: ComponentFixture<ImplementationStatusComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ImplementationStatusComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(ImplementationStatusComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Component, OnInit } from '@angular/core';
import { NgxSpinnerService } from 'ngx-spinner';
import { IReportDataPayload } from 'src/app/core/models/IReportDataPayload';
import { CommonService } from 'src/app/core/services/common/common.service';
import { ConfigService } from 'src/app/core/services/config/config.service';
import { environment } from 'src/environments/environment';

@Component({
selector: 'app-implementation-status',
templateUrl: './implementation-status.component.html',
styleUrls: ['./implementation-status.component.scss']
})
export class ImplementationStatusComponent implements OnInit {
isMapReport1Loading = true;
filters: any;
pgiStateData: any;

constructor(private readonly _commonService: CommonService, private readonly _spinner:NgxSpinnerService) {
this.getImplementationStatus(this.filters)
}

ngOnInit(): void {
}

getImplementationStatus(filters: any): void {
let data: IReportDataPayload = {
appName: environment.config.toLowerCase(),
dataSourceName: 'pgi',
reportName: 'implementationStatus',
reportType: 'map',
stateCode: environment.stateCode,
filters
};

this._commonService.getReportData(data).subscribe(res => {
this._spinner.hide()
this.isMapReport1Loading = false;
this.pgiStateData = res.result;
this.filters = res.result.filters;
}, err => {
this.isMapReport1Loading = false;
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
</div>
<div class="tab-group-wrapper">
<mat-tab-group mat-align-tabs="start" animationDuration="0ms" (focusChange)="onTabChanged($event);">
<mat-tab label="Implementation Status">
<app-implementation-status></app-implementation-status>
</mat-tab>
<mat-tab label="State Wise Performance">
<div class="grid grid-cols-1">
<div class="col-span-full">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import { SchoolEducationRoutingModule } from './school-education-routing.module'
import { MatTabsModule } from '@angular/material/tabs';
import { CqubeLibraryModule } from 'cqube-library';
import { SchoolEducationComponent } from './school-education.component';
import { ImplementationStatusComponent } from './pages/implementation-status/implementation-status.component';


@NgModule({
declarations: [
SchoolEducationComponent
SchoolEducationComponent,
ImplementationStatusComponent
],
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="grid grid-cols-12">
<div class="col-span-full" *ngIf="pgiStateData" appFullScreen>
<app-leaflet-map [mapData]="pgiStateData"></app-leaflet-map>
<ngx-spinner bdColor = "rgba(0, 0, 0, 0.8)" size = "medium" color = "#fff" type = "ball-scale-multiple" [fullScreen] = "true"><p style="color: white" > Loading... </p></ngx-spinner>
</div>
<div class="col" *ngIf="isMapReport1Loading">
<!-- <ngx-spinner bdColor = "rgba(0, 0, 0, 0.8)" size = "medium" color = "#fff" type = "ball-scale-multiple" [fullScreen] = "true"><p style="color: white" > Loading... </p></ngx-spinner> -->
<p class="mt-8 mb-8">Loading...</p>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ImplementationstatusComponent } from './implementationstatus.component';

describe('ImplementationstatusComponent', () => {
let component: ImplementationstatusComponent;
let fixture: ComponentFixture<ImplementationstatusComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ImplementationstatusComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(ImplementationstatusComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Component, OnInit } from '@angular/core';
import { NgxSpinnerService } from 'ngx-spinner';
import { IReportDataPayload } from 'src/app/core/models/IReportDataPayload';
import { CommonService } from 'src/app/core/services/common/common.service';
import { ConfigService } from 'src/app/core/services/config/config.service';
import { environment } from 'src/environments/environment';

@Component({
selector: 'app-implementationstatus',
templateUrl: './implementationstatus.component.html',
styleUrls: ['./implementationstatus.component.scss']
})
export class ImplementationstatusComponent implements OnInit {
isMapReport1Loading = true;
filters: any;
pgiStateData: any;

constructor(private readonly _commonService: CommonService, private readonly _spinner:NgxSpinnerService) {
this.getImplementationStatus(this.filters)
}

ngOnInit(): void {
}

getImplementationStatus(filters: any): void {
let data: IReportDataPayload = {
appName: environment.config.toLowerCase(),
dataSourceName: 'udise',
reportName: 'implementationStatus',
reportType: 'map',
stateCode: environment.stateCode,
filters
};

this._commonService.getReportData(data).subscribe(res => {
this._spinner.hide()
this.isMapReport1Loading = false;
this.pgiStateData = res.result;
this.filters = res.result.filters;
}, err => {
this.isMapReport1Loading = false;
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

<div class="tab-group-wrapper">
<mat-tab-group mat-align-tabs="start" animationDuration="0ms" (focusChange)="onTabChanged($event);">
<mat-tab label="Implementation Status">
<app-implementationstatus></app-implementationstatus>
</mat-tab>
<mat-tab label="State Wise Performance ">
<div class="grid grid-cols-1">
<div class="col">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { MatTabsModule } from '@angular/material/tabs';
import { SchoolRegistryComponent } from './school-registry.component';
import { SchoolRegistryRoutingModule } from './school-registry-routing.module';
import { SchoolFacilitiesComparisionComponent } from './pages/school-facilities-comparision/school-facilities-comparision.component';
import { ImplementationstatusComponent } from './pages/implementationstatus/implementationstatus.component';


@NgModule({
declarations: [
SchoolRegistryComponent,
SchoolFacilitiesComparisionComponent
SchoolFacilitiesComparisionComponent,
ImplementationstatusComponent
],
imports: [
CommonModule,
Expand Down

0 comments on commit b444bdb

Please sign in to comment.