Skip to content

Commit 219a2eb

Browse files
Upgraded NavItemProgress to Angular component. #2842
1 parent d30c066 commit 219a2eb

8 files changed

Lines changed: 61 additions & 34 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<span fxLayout="row" fxLayoutAlign="start center">
2+
<span class="progress-wrapper" tabindex="0" [ngSwitch]="period.periodId">
3+
<mat-progress-bar *ngSwitchCase="-1"
4+
matTooltip="{{nodeCompletion}}% completed (All periods)"
5+
i18n-matTooltip
6+
matTooltipPosition="above"
7+
class="nav-item__progress"
8+
mode="determinate"
9+
value="{{nodeCompletion}}"></mat-progress-bar>
10+
<mat-progress-bar *ngSwitchDefault
11+
matTooltip="{{nodeCompletion}}% completed (Period: {{period.periodName}})"
12+
i18n-matTooltip
13+
matTooltipPosition="above"
14+
class="nav-item__progress"
15+
mode="determinate"
16+
value="{{nodeCompletion}}"></mat-progress-bar>
17+
</span>
18+
<span class="nav-item__progress-value md-body-2 text-secondary" hide-xs>{{nodeCompletion}}%</span>
19+
</span>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mat-progress-bar {
2+
height: 14px;
3+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, Input } from "@angular/core";
2+
3+
@Component({
4+
selector: 'nav-item-progress',
5+
styleUrls: ['nav-item-progress.component.scss'],
6+
templateUrl: 'nav-item-progress.component.html'
7+
})
8+
export class NavItemProgressComponent {
9+
10+
@Input()
11+
nodeCompletion: string;
12+
13+
@Input()
14+
period: any;
15+
}

src/main/webapp/site/src/app/teacher-hybrid-angular.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { EditComponentRubricComponent } from './authoring-tool/edit-component-ru
3434
import { EditComponentTagsComponent } from './authoring-tool/edit-component-tags/edit-component-tags.component';
3535
import { EditComponentWidthComponent } from './authoring-tool/edit-component-width/edit-component-width.component';
3636
import { RubricAuthoringComponent } from '../../../wise5/authoringTool/rubric/rubric-authoring.component';
37+
import { NavItemProgressComponent } from './classroom-monitor/nav-item-progress/nav-item-progress.component';
3738

3839
@NgModule({
3940
declarations: [
@@ -50,6 +51,7 @@ import { RubricAuthoringComponent } from '../../../wise5/authoringTool/rubric/ru
5051
EditComponentWidthComponent,
5152
ManageStudentsComponent,
5253
MilestoneReportDataComponent,
54+
NavItemProgressComponent,
5355
NodeAdvancedGeneralAuthoringComponent,
5456
NodeAdvancedJsonAuthoringComponent,
5557
RubricAuthoringComponent,

src/main/webapp/site/src/messages.xlf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6059,6 +6059,20 @@
60596059
<context context-type="linenumber">2</context>
60606060
</context-group>
60616061
</trans-unit>
6062+
<trans-unit datatype="html" id="6817513ddcee06a7cb2a7b2708e5616b861db81c">
6063+
<source><x equiv-text="{{nodeCompletion}}" id="INTERPOLATION"/>% completed (All periods)</source>
6064+
<context-group purpose="location">
6065+
<context context-type="sourcefile">app/classroom-monitor/nav-item-progress/nav-item-progress.component.html</context>
6066+
<context context-type="linenumber">4</context>
6067+
</context-group>
6068+
</trans-unit>
6069+
<trans-unit datatype="html" id="988ec0475312fa85da7fa2f0f2e06e56b1e7f429">
6070+
<source><x equiv-text="{{nodeCompletion}}" id="INTERPOLATION"/>% completed (Period: <x equiv-text="{{period.periodName}}" id="INTERPOLATION_1"/>)</source>
6071+
<context-group purpose="location">
6072+
<context context-type="sourcefile">app/classroom-monitor/nav-item-progress/nav-item-progress.component.html</context>
6073+
<context context-type="linenumber">11</context>
6074+
</context-group>
6075+
</trans-unit>
60626076
<trans-unit datatype="html" id="bfab7f41cfc32a926c55987d6a9c3349ae417131">
60636077
<source> Show Save Button </source>
60646078
<context-group purpose="location">

src/main/webapp/wise5/classroomMonitor/classroomMonitorComponents/nodeProgress/navItem/navItem.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
</md-list>
3030
</md-card-content>
3131
<md-card-footer class="nav-item__more md-body-1" layout="row" layout-align="start center" flex>
32-
<nav-item-progress node-completion="$ctrl.getNodeCompletion()"
33-
period-id="$ctrl.currentPeriod.periodId"
34-
period-name="$ctrl.currentPeriod.periodName"></nav-item-progress>
32+
<nav-item-progress [node-completion]="$ctrl.getNodeCompletion()"
33+
[period]="$ctrl.currentPeriod"></nav-item-progress>
3534
<span flex></span>
3635
<a href="#" ng-click="$ctrl.toggleLockNode()" aria-label="{{ $ctrl.getNodeLockedText() }}">
3736
<md-tooltip md-direction="top">{{ $ctrl.getNodeLockedText() }}</md-tooltip>
@@ -62,9 +61,8 @@
6261
<span flex hide-xs></span>
6362
<nav-item-score class="nav-item--list__info-item" [max-score]="$ctrl.maxScore"
6463
[average-score]="$ctrl.getNodeAverageScore()"></nav-item-score>
65-
<nav-item-progress node-completion="$ctrl.getNodeCompletion()"
66-
period-id="$ctrl.currentPeriod.periodId"
67-
period-name="$ctrl.currentPeriod.periodName"></nav-item-progress>
64+
<nav-item-progress [node-completion]="$ctrl.getNodeCompletion()"
65+
[period]="$ctrl.currentPeriod"></nav-item-progress>
6866
</p>
6967
</md-list-item>
7068
</ng-switch>

src/main/webapp/wise5/classroomMonitor/classroomMonitorComponents/nodeProgress/navItemProgress/navItemProgress.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/main/webapp/wise5/classroomMonitor/classroomMonitorComponents/nodeProgress/nodeProgress.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22

33
import NodeProgressView from './nodeProgressView/nodeProgressView';
44
import NavItem from './navItem/navItem';
5-
import NavItemProgress from './navItemProgress/navItemProgress';
65
import WorkgroupsOnNode from './workgroupsOnNode/workgroupsOnNode';
76
import WorkgroupProgress from './workgroupProgress/workgroupProgress';
87
import * as angular from 'angular';
98
import { downgradeComponent } from '@angular/upgrade/static';
109
import { NavItemScoreComponent } from './navItemScore/nav-item-score.component';
10+
import { NavItemProgressComponent } from '../../../../site/src/app/classroom-monitor/nav-item-progress/nav-item-progress.component';
1111

1212
const NodeProgress = angular
1313
.module('nodeProgress', [])
1414
.component('nodeProgressView', NodeProgressView)
1515
.component('navItem', NavItem)
16-
.component('navItemProgress', NavItemProgress)
16+
.directive('navItemProgress',
17+
downgradeComponent({ component: NavItemProgressComponent }) as angular.IDirectiveFactory)
1718
.directive('navItemScore',
18-
downgradeComponent({ component: NavItemScoreComponent}) as angular.IDirectiveFactory)
19+
downgradeComponent({ component: NavItemScoreComponent }) as angular.IDirectiveFactory)
1920
.component('workgroupsOnNode', WorkgroupsOnNode)
2021
.component('workgroupProgress', WorkgroupProgress);
2122

0 commit comments

Comments
 (0)