Add enrolments by School Type to Enrol Dashboard

Issue #423 closed
Brian Lewis repo owner created an issue

Clone enrol by district chart, modify the crosstab group construction.

Add the new component to the dashboard

Comments (3)

  1. Brian Lewis reporter

    feat(Enrolments Dashboards): Add Enrolments by SchoolType to Enrol Dashboard

    Hidden amongst all the copy paste programming are these modifications to the EnrolmentLevelByDistrict 'blueprint':

    C:\fsm (issue423 -> origin)
    λ diff Pineapples\Views\default\Dashboard\Component\EnrolmentLevelBySchooltype.cshtml Pineapples\Views\default\Dashboard\Component\EnrolmentLevelByDistrict.cshtml
    3c3
    <   Enrolment by {{'School Type'|vocab}}
    ---
    >   {{'District'|vocab}} Enrolment
    7c7
    <   {{vm.dashboard.options.selectedAuthorityGovt|lookup:'authorityGovt'}} {{vm.dashboard.options.selectedYear}}
    ---
    > {{vm.dashboard.options.selectedAuthorityGovt|lookup:'authorityGovt'}} {{vm.dashboard.options.selectedYear}}
    13c13
    <         <th>{{'School Type'|vocab}}</th>
    ---
    >         <th>State</th>
    17,20c17,20
    <     <tr class="animated" ng-repeat="r in vm.grpSchoolType.all()"
    <         ng-click="vm.dashboard.options.toggleSelectedSchoolType(r.key)"
    <         ng-class="{'selected':vm.dashboard.options.isSelectedSchoolType(r.key)}">
    <       <td class="rowlabel">{{r.key| lookup:'schoolTypes'}}</td>
    ---
    >     <tr class="animated" ng-repeat="r in vm.grpDistrictCode.all()"
    >         ng-click="vm.dashboard.options.toggleSelectedDistrict(r.key)"
    >         ng-class="{'selected':vm.dashboard.options.isSelectedDistrict(r.key)}">
    >       <td class="rowlabel">{{r.key| lookup:'districts'}}</td>
    
    λ diff Pineapples.Client\src\app\ts\features\Dashboard\Component\Enrolment.LevelBySchooltype.Component.ts Pineapples.Client\src\app\ts\features\Dashboard\Component\Enrolment.LevelByDistrict.Component.ts
    31c31
    <     public grpSchoolType: CrossFilter.Group<IxfData, string, number>;
    ---
    >     public grpDistrictCode: CrossFilter.Group<IxfData, string, number>;
    47c47
    <       this.grpSchoolType = this.dashboard.dimSchoolTypeCode.group().reduceSum(d => d.EnrolM + d.EnrolF);
    ---
    >       this.grpDistrictCode = this.dashboard.dimDistrictCode.group().reduceSum(d => d.EnrolM + d.EnrolF);
    65c65
    <     .component("enrolmentLevelBySchooltype", new EnrolComponent(Controller, "EnrolmentLevelBySchooltype"));
    ---
    >     .component("enrolmentLevelByDistrict", new EnrolComponent(Controller, "EnrolmentLevelByDistrict"));
    

    closes #423

    → <<cset a62ef3a18096>>

  2. Log in to comment