Skip to content

Commit 0472f1f

Browse files
Upgraded RubricAuthoring to Angular component
1 parent a039d13 commit 0472f1f

6 files changed

Lines changed: 35 additions & 29 deletions

File tree

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
@@ -28,6 +28,7 @@ import { NodeAdvancedJsonAuthoringComponent } from '../../../wise5/authoringTool
2828
import { WorkgroupInfoComponent } from '../../../wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroupInfo/workgroup-info.component';
2929
import { NodeAdvancedGeneralAuthoringComponent } from '../../../wise5/authoringTool/node/advanced/general/node-advanced-general-authoring.component';
3030
import { WiseAuthoringTinymceEditorComponent } from '../../../wise5/directives/wise-tinymce-editor/wise-authoring-tinymce-editor.component';
31+
import { RubricAuthoringComponent } from '../../../wise5/authoringTool/rubric/rubric-authoring.component';
3132

3233
@NgModule({
3334
declarations: [
@@ -41,6 +42,7 @@ import { WiseAuthoringTinymceEditorComponent } from '../../../wise5/directives/w
4142
MilestoneReportDataComponent,
4243
NodeAdvancedGeneralAuthoringComponent,
4344
NodeAdvancedJsonAuthoringComponent,
45+
RubricAuthoringComponent,
4446
StatusIconComponent,
4547
WorkgroupInfoComponent,
4648
WorkgroupNodeScoreComponent,

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5782,6 +5782,10 @@
57825782
<context context-type="sourcefile">../../wise5/authoringTool/advanced/advanced-project-authoring.component.html</context>
57835783
<context context-type="linenumber">4</context>
57845784
</context-group>
5785+
<context-group purpose="location">
5786+
<context context-type="sourcefile">../../wise5/authoringTool/rubric/rubric-authoring.component.html</context>
5787+
<context context-type="linenumber">2</context>
5788+
</context-group>
57855789
</trans-unit>
57865790
<trans-unit datatype="html" id="077fb7924ecebe2ae768d860909315c29ee61fbe">
57875791
<source>Show JSON</source>
@@ -5981,6 +5985,13 @@
59815985
<context context-type="linenumber">2</context>
59825986
</context-group>
59835987
</trans-unit>
5988+
<trans-unit datatype="html" id="92328333ea9c72926ca7c631e9e1c0f081cbf565">
5989+
<source>Edit Unit Rubric</source>
5990+
<context-group purpose="location">
5991+
<context context-type="sourcefile">../../wise5/authoringTool/rubric/rubric-authoring.component.html</context>
5992+
<context context-type="linenumber">6</context>
5993+
</context-group>
5994+
</trans-unit>
59845995
<trans-unit datatype="html" id="f9c52903219e583ddefb23cd102d2057504ac980">
59855996
<source>(Team <x equiv-text="{{workgroupId}}" id="INTERPOLATION"/>)</source>
59865997
<context-group purpose="location">
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<button mat-button class='topButton mat-raised-button mat-primary' (click)='goBack()'
2+
matTooltip="Back to Unit Plan" i18n-matTooltip matToolTipPosition="above">
3+
<mat-icon>arrow_back</mat-icon>
4+
</button>
5+
<br/>
6+
<h5 i18n>Edit Unit Rubric</h5>
7+
<wise-authoring-tinymce-editor [(model)]='rubric' (modelChange)='rubricChanged()'>
8+
</wise-authoring-tinymce-editor>

src/main/webapp/wise5/authoringTool/rubric/rubricAuthoringComponent.ts renamed to src/main/webapp/wise5/authoringTool/rubric/rubric-authoring.component.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
import { ConfigService } from '../../services/configService';
22
import { UtilService } from '../../services/utilService';
33
import { TeacherProjectService } from '../../services/teacherProjectService';
4+
import { UpgradeModule } from '@angular/upgrade/static';
5+
import { Component } from '@angular/core';
6+
7+
@Component({
8+
templateUrl: 'rubric-authoring.component.html',
9+
})
10+
export class RubricAuthoringComponent {
411

5-
class RubricAuthoringController {
612
rubric: string = '';
7-
static $inject = [ '$state', 'ConfigService', 'ProjectService', 'UtilService' ];
813

9-
constructor(private $state: any, private ConfigService: ConfigService,
14+
constructor(private upgrade: UpgradeModule, private ConfigService: ConfigService,
1015
private ProjectService: TeacherProjectService, private UtilService: UtilService) {
1116
}
1217

13-
$onInit(): void {
18+
ngOnInit(): void {
1419
this.rubric = this.ProjectService.replaceAssetPaths(this.ProjectService.getProjectRubric());
1520
}
1621

1722
rubricChanged(): void {
1823
const html = this.UtilService.insertWISELinks(
19-
this.ConfigService.removeAbsoluteAssetPaths(this.rubric)
20-
);
24+
this.ConfigService.removeAbsoluteAssetPaths(this.rubric));
2125
this.ProjectService.setProjectRubric(html);
2226
this.ProjectService.saveProject();
2327
}
2428

2529
goBack(): void {
26-
this.$state.go('root.at.project');
30+
this.upgrade.$injector.get('$state').go('root.at.project');
2731
}
2832
}
29-
30-
export const RubricAuthoringComponent = {
31-
templateUrl: '/wise5/authoringTool/rubric/rubricAuthoring.html',
32-
controller: RubricAuthoringController
33-
};

src/main/webapp/wise5/authoringTool/rubric/rubricAuthoring.html

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

src/main/webapp/wise5/teacher/teacher-angular-js-module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import NotebookGradingController from '../classroomMonitor/notebook/notebookGrad
3030
import ProjectAssetController from '../authoringTool/asset/projectAssetController';
3131
import ProjectController from '../authoringTool/project/projectController';
3232
import ProjectInfoController from '../authoringTool/info/projectInfoController';
33-
import { RubricAuthoringComponent } from '../authoringTool/rubric/rubricAuthoringComponent';
33+
import { RubricAuthoringComponent } from '../authoringTool/rubric/rubric-authoring.component';
3434
import StudentGradingController from '../classroomMonitor/studentGrading/studentGradingController';
3535
import StudentProgressController from '../classroomMonitor/studentProgress/studentProgressController';
3636
import WISELinkAuthoringController from '../authoringTool/wiseLink/wiseLinkAuthoringController';
@@ -121,7 +121,8 @@ import '../components/table/tableAuthoringComponentModule';
121121
.controller('ProjectAssetController', ProjectAssetController)
122122
.controller('ProjectController', ProjectController)
123123
.controller('ProjectInfoController', ProjectInfoController)
124-
.component('rubricAuthoringComponent', RubricAuthoringComponent)
124+
.directive('rubricAuthoringComponent', downgradeComponent(
125+
{ component: RubricAuthoringComponent }) as angular.IDirectiveFactory)
125126
.controller('StudentGradingController', StudentGradingController)
126127
.controller('StudentProgressController', StudentProgressController)
127128
.controller('WISELinkAuthoringController', WISELinkAuthoringController)

0 commit comments

Comments
 (0)