diff --git a/src/app/common/common.coffee b/src/app/common/common.coffee
index e5bbea48a..f330d8f6a 100644
--- a/src/app/common/common.coffee
+++ b/src/app/common/common.coffee
@@ -3,6 +3,5 @@ angular.module("doubtfire.common", [
'doubtfire.common.filters'
'doubtfire.common.modals'
'doubtfire.common.file-uploader'
- 'doubtfire.common.grade-icon'
'doubtfire.common.content-editable'
])
diff --git a/src/app/common/grade-icon/grade-icon.coffee b/src/app/common/grade-icon/grade-icon.coffee
deleted file mode 100644
index f35f7fbfa..000000000
--- a/src/app/common/grade-icon/grade-icon.coffee
+++ /dev/null
@@ -1,16 +0,0 @@
-angular.module('doubtfire.common.grade-icon', [])
-
-.directive 'gradeIcon', ->
- restrict: 'E'
- replace: true
- templateUrl: 'common/grade-icon/grade-icon.tpl.html'
- scope:
- inputGrade: '=?grade'
- colorful: '=?'
- controller: ($scope, gradeService) ->
- $scope.$watch 'inputGrade', (newGrade) ->
- $scope.grade = if _.isString($scope.inputGrade) then gradeService.stringToGrade($scope.inputGrade) else $scope.inputGrade
- $scope.gradeText = (grade) ->
- if grade? then gradeService.grades[grade] or "Grade"
- $scope.gradeLetter = (grade) ->
- gradeService.gradeAcronyms[grade] or 'G'
diff --git a/src/app/common/grade-icon/grade-icon.component.html b/src/app/common/grade-icon/grade-icon.component.html
new file mode 100644
index 000000000..7af15c0ba
--- /dev/null
+++ b/src/app/common/grade-icon/grade-icon.component.html
@@ -0,0 +1,16 @@
+
+
+ {{ gradeLetter }}
+
+
diff --git a/src/app/common/grade-icon/grade-icon.component.scss b/src/app/common/grade-icon/grade-icon.component.scss
new file mode 100644
index 000000000..7bcb77dea
--- /dev/null
+++ b/src/app/common/grade-icon/grade-icon.component.scss
@@ -0,0 +1,6 @@
+.text-left .grade-icon {
+ margin-left: 0;
+}
+.text-right .grade-icon {
+ margin-right: 0;
+}
diff --git a/src/app/common/grade-icon/grade-icon.component.ts b/src/app/common/grade-icon/grade-icon.component.ts
new file mode 100644
index 000000000..5f8f31c7b
--- /dev/null
+++ b/src/app/common/grade-icon/grade-icon.component.ts
@@ -0,0 +1,35 @@
+/* eslint-disable @typescript-eslint/no-unused-vars */
+import {Component, Input, OnChanges, OnInit, SimpleChanges} from '@angular/core';
+import {GradeService} from '../services/grade.service';
+
+@Component({
+ selector: 'f-grade-icon',
+ templateUrl: './grade-icon.component.html',
+ styleUrls: ['./grade-icon.component.scss'],
+})
+export class GradeIconComponent implements OnInit, OnChanges {
+ @Input() grade?: number | string;
+ @Input() colorful: boolean = false;
+
+ gradeText: string = 'Grade';
+ gradeLetter: string = 'G';
+
+ constructor(private gradeService: GradeService) {}
+
+ ngOnInit(): void {
+ this.updateGrade();
+ }
+
+ ngOnChanges(changes: SimpleChanges): void {
+ if (changes['grade']) {
+ this.updateGrade();
+ }
+ }
+
+ private updateGrade(): void {
+ const grade: number =
+ typeof this.grade === 'string' ? this.gradeService.stringToGrade(this.grade) : this.grade;
+ this.gradeText = this.gradeService.grades[grade] || 'Grade';
+ this.gradeLetter = this.gradeService.gradeAcronyms[grade] || 'G';
+ }
+}
diff --git a/src/app/common/grade-icon/grade-icon.scss b/src/app/common/grade-icon/grade-icon.scss
deleted file mode 100644
index 08db661a8..000000000
--- a/src/app/common/grade-icon/grade-icon.scss
+++ /dev/null
@@ -1,48 +0,0 @@
-.grade-icon.text-muted {
- background-color: $text-muted;
-}
-.grade-icon.text-primary {
- background-color: $brand-primary;
-}
-.grade-icon.text-success {
- background-color: $brand-success;
-}
-.grade-icon.text-danger {
- background-color: $brand-danger;
-}
-.grade-icon.text-info {
- background-color: $brand-info;
-}
-.grade-icon.text-warning {
- background-color: $brand-warning;
-}
-a .grade-icon:hover {
- background-color: $link-hover-color;
-}
-.grade-icon {
- color: #fff;
- font-size: 1em;
- background-color: $text-color;
- border-radius: 100%;
- width: 2.25em;
- height: 2.25em;
- font-weight: 100;
- font-size: 1em;
- @include no-select;
- margin: 0 auto;
- display: flex;
- align-items: center;
- justify-content: center;
-}
-.grade-icon.colorful {
- &.grade-0 { background-color: $grade-color-p; }
- &.grade-1 { background-color: $grade-color-c; }
- &.grade-2 { background-color: $grade-color-d; }
- &.grade-3 { background-color: $grade-color-hd; }
-}
-.text-left .grade-icon {
- margin-left: 0;
-}
-.text-right .grade-icon {
- margin-right: 0;
-}
diff --git a/src/app/common/grade-icon/grade-icon.tpl.html b/src/app/common/grade-icon/grade-icon.tpl.html
deleted file mode 100644
index 1939b2136..000000000
--- a/src/app/common/grade-icon/grade-icon.tpl.html
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
- {{gradeLetter(grade)}}
-
-
diff --git a/src/app/doubtfire-angular.module.ts b/src/app/doubtfire-angular.module.ts
index 991ac397b..4b06266dc 100644
--- a/src/app/doubtfire-angular.module.ts
+++ b/src/app/doubtfire-angular.module.ts
@@ -170,6 +170,7 @@ import {TaskAssessmentModalComponent} from './common/modals/task-assessment-moda
import {TaskSubmissionHistoryComponent} from './tasks/task-submission-history/task-submission-history.component';
import {HomeComponent} from './home/states/home/home.component';
import {IsActiveUnitRole} from './common/pipes/is-active-unit-role.pipe';
+import {GradeIconComponent} from './common/grade-icon/grade-icon.component';
import {HeaderComponent} from './common/header/header.component';
import {UnitDropdownComponent} from './common/header/unit-dropdown/unit-dropdown.component';
import {TaskDropdownComponent} from './common/header/task-dropdown/task-dropdown.component';
@@ -316,6 +317,7 @@ const MY_DATE_FORMAT = {
TaskAssessmentCommentComponent,
TaskAssessmentModalComponent,
TaskSubmissionHistoryComponent,
+ GradeIconComponent,
HeaderComponent,
UnitDropdownComponent,
TaskDropdownComponent,
diff --git a/src/app/doubtfire-angularjs.module.ts b/src/app/doubtfire-angularjs.module.ts
index e14fdbb54..d6b60ef34 100644
--- a/src/app/doubtfire-angularjs.module.ts
+++ b/src/app/doubtfire-angularjs.module.ts
@@ -122,7 +122,6 @@ import 'build/src/app/common/modals/confirmation-modal/confirmation-modal.js';
import 'build/src/app/common/modals/comments-modal/comments-modal.js';
import 'build/src/app/common/modals/csv-result-modal/csv-result-modal.js';
import 'build/src/app/common/modals/modals.js';
-import 'build/src/app/common/grade-icon/grade-icon.js';
import 'build/src/app/common/file-uploader/file-uploader.js';
import 'build/src/app/common/common.js';
import 'build/src/app/common/services/listener-service.js';
@@ -193,6 +192,7 @@ import {CheckForUpdateService} from './sessions/service-worker-updater/check-for
import {TaskSubmissionService} from './common/services/task-submission.service';
import {TaskAssessmentModalService} from './common/modals/task-assessment-modal/task-assessment-modal.service';
import {TaskSubmissionHistoryComponent} from './tasks/task-submission-history/task-submission-history.component';
+import {GradeIconComponent} from './common/grade-icon/grade-icon.component';
import {HeaderComponent} from './common/header/header.component';
import {SplashScreenComponent} from './home/splash-screen/splash-screen.component';
import {GlobalStateService} from './projects/states/index/global-state.service';
@@ -313,6 +313,7 @@ DoubtfireAngularJSModule.directive(
'objectSelect',
downgradeComponent({component: ObjectSelectComponent}),
);
+DoubtfireAngularJSModule.directive('fGradeIcon', downgradeComponent({component: GradeIconComponent}));
DoubtfireAngularJSModule.directive('appHeader', downgradeComponent({component: HeaderComponent}));
DoubtfireAngularJSModule.directive(
'splashScreen',
diff --git a/src/app/groups/group-member-contribution-assigner/group-member-contribution-assigner.tpl.html b/src/app/groups/group-member-contribution-assigner/group-member-contribution-assigner.tpl.html
index 4caab308f..92c4f2ef4 100644
--- a/src/app/groups/group-member-contribution-assigner/group-member-contribution-assigner.tpl.html
+++ b/src/app/groups/group-member-contribution-assigner/group-member-contribution-assigner.tpl.html
@@ -1,41 +1,41 @@
-
+
diff --git a/src/app/groups/group-member-list/group-member-list.tpl.html b/src/app/groups/group-member-list/group-member-list.tpl.html
index f483b4acb..fd28367eb 100644
--- a/src/app/groups/group-member-list/group-member-list.tpl.html
+++ b/src/app/groups/group-member-list/group-member-list.tpl.html
@@ -38,7 +38,7 @@ No members in group
{{member.student.username || "N/A"}} |
{{member.student.name}} |
-
+
|
|