-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from Sunbird-cQube/dev
merge dev to staging for nishtha changes
- Loading branch information
Showing
13 changed files
with
389 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...pp/views/nishtha/pages/medium-of-instruction-tab/medium-of-instruction-tab.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<div class="col-span-full tab-wrapper"> | ||
<div class="filter-row grid grid-cols-4"> | ||
<div class="col-span-2"> | ||
<app-filter-panel [filters]="filters" (filtersUpdated)="filtersUpdated($event)" | ||
colSize="col-span-6" *ngIf="NVSK"></app-filter-panel> | ||
</div> | ||
<div class="col-start-4 col-end-5 download-button"> | ||
<!-- <app-popup-options [data]="reportsData" [reportName]="'nishtha_courses&medium_status'" ></app-popup-options> --> | ||
<app-download-button [data]="reportsData"></app-download-button> | ||
</div> | ||
</div> | ||
<div class="reports-row" > | ||
<div class="row-wrapper grid grid-cols-2 gap-4"> | ||
|
||
<div class="col-span-2 xmd:col-span-2 div-shadow" *ngIf="checkReport('medium_of_instruction', 'table')" | ||
id="table"> | ||
<app-medium-of-instruction #mediumOfInstruction></app-medium-of-instruction> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Empty file.
23 changes: 23 additions & 0 deletions
23
...views/nishtha/pages/medium-of-instruction-tab/medium-of-instruction-tab.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MediumOfInstructionTabComponent } from './medium-of-instruction-tab.component'; | ||
|
||
describe('MediumOfInstructionTabComponent', () => { | ||
let component: MediumOfInstructionTabComponent; | ||
let fixture: ComponentFixture<MediumOfInstructionTabComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ MediumOfInstructionTabComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(MediumOfInstructionTabComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
94 changes: 94 additions & 0 deletions
94
src/app/views/nishtha/pages/medium-of-instruction-tab/medium-of-instruction-tab.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'; | ||
import { RbacService } from 'src/app/core/services/rbac-service.service'; | ||
import { WrapperService } from 'src/app/core/services/wrapper.service'; | ||
import { config } from '../../config/nishtha_config'; | ||
import { environment } from 'src/environments/environment'; | ||
import { MediumOfInstructionComponent } from './reports/medium-of-instruction/medium-of-instruction.component'; | ||
|
||
@Component({ | ||
selector: 'app-medium-of-instruction-tab', | ||
templateUrl: './medium-of-instruction-tab.component.html', | ||
styleUrls: ['./medium-of-instruction-tab.component.scss'] | ||
}) | ||
export class MediumOfInstructionTabComponent implements OnInit, AfterViewInit { | ||
|
||
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; | ||
hasTimeSeriesFilters: boolean = false; | ||
hasCommonFilters: boolean = true; | ||
matLavel = 'Medium of instruction' | ||
NVSK: boolean = true; | ||
@ViewChild('mediumOfInstruction') mediumOfInstruction: MediumOfInstructionComponent; | ||
|
||
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<void> { | ||
// this.renderReports(); | ||
} | ||
|
||
async ngAfterViewInit(): Promise<void> { | ||
if (this.hasCommonFilters && this.NVSK) { | ||
this.filters = await this._wrapperService.constructCommonFilters(config.filters, this.matLavel); | ||
this.mediumOfInstruction?.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); | ||
this.mediumOfInstruction?.getReportData({ timeSeriesValues: { startDate: startDate?.toISOString().split('T')[0], endDate: endDate?.toISOString().split('T')[0] } }); | ||
} | ||
} | ||
|
||
checkReport(key: string, reportType: string, alterReportType?: 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) || Object.keys(filter?.actions?.queries).includes(alterReportType))) { | ||
flag = true | ||
} | ||
}) | ||
return flag | ||
} | ||
|
||
csvDownload(csvData: any) { | ||
if (csvData) { | ||
this.reportsData.push(csvData) | ||
} | ||
} | ||
|
||
filtersUpdated(filters: any) { | ||
this.reportsData = []; | ||
this.mediumOfInstruction?.getReportData({ filterValues: filters.map((filter) => { return { ...filter, columnName: filter.valueProp, filterType: filter.id } }) }); | ||
} | ||
|
||
timeSeriesUpdated(event: any): void { | ||
this.startDate = event?.startDate?.toDate().toISOString().split('T')[0] | ||
this.endDate = event?.endDate?.toDate().toISOString().split('T')[0] | ||
if (event?.startDate !== null && event?.endDate !== null) { | ||
this.reportsData = []; | ||
this.mediumOfInstruction?.getReportData({ timeSeriesValues: { startDate: this.startDate, endDate: this.endDate } }); | ||
} | ||
} | ||
} | ||
|
8 changes: 8 additions & 0 deletions
8
...ium-of-instruction-tab/reports/medium-of-instruction/medium-of-instruction.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="grid grid-cols-12" *ngIf="reportData?.data?.length > 0"> | ||
<div class="xs:col-span-full"> | ||
<app-material-heat-chart-table [tableData]="reportData" [title]="title"></app-material-heat-chart-table> | ||
</div> | ||
</div> | ||
<div class="noData" *ngIf="reportData?.data?.length <= 0"> | ||
No Data Found | ||
</div> |
Empty file.
Oops, something went wrong.