Skip to content

Commit

Permalink
refactor(StatusIconComponent): Convert to standalone (#1828)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima authored Jun 21, 2024
1 parent 273bb3b commit c7a408a
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 52 deletions.
10 changes: 2 additions & 8 deletions src/app/classroom-monitor/status-icon/status-icon.component.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<mat-icon
class="{{ iconClass }}"
tabindex="0"
[attr.aria-label]="iconLabel"
matTooltip="{{ iconTooltip }}"
matTooltipPosition="above"
>
{{ iconName }}
<mat-icon class="{{ class }}" tabindex="0" matTooltip="{{ tooltip }}" matTooltipPosition="above">
{{ name }}
</mat-icon>
20 changes: 7 additions & 13 deletions src/app/classroom-monitor/status-icon/status-icon.component.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import { Component, Input } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';

@Component({
imports: [MatIconModule, MatTooltipModule],
selector: 'status-icon',
standalone: true,
templateUrl: 'status-icon.component.html'
})
export class StatusIconComponent {
@Input()
iconClass: string;

@Input()
iconLabel: string;

@Input()
iconName: string;

@Input()
iconTooltip: string;

constructor() {}
@Input() class: string;
@Input() name: string;
@Input() tooltip: string;
}
20 changes: 9 additions & 11 deletions src/app/classroom-monitor/step-info/step-info.component.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<div fxLayout="row" fxLayoutAlign="start center">
<node-icon [nodeId]="nodeId" size="18" fxHide.xs></node-icon>
<node-icon [nodeId]="nodeId" size="18" fxHide.xs />
<span fxHide.xs>&nbsp;&nbsp;</span>
<span>{{ stepTitle }}</span>
<status-icon
*ngIf="hasAlert"
[iconClass]="alertIconClass"
[iconName]="alertIconName"
[iconLabel]="alertIconLabel"
[iconTooltip]="alertIconLabel"
></status-icon>
[class]="alertIconClass"
[name]="alertIconName"
[tooltip]="alertIconLabel"
/>
<status-icon
*ngIf="hasRubrics"
iconClass="info"
iconName="info"
[iconLabel]="rubricIconLabel"
[iconTooltip]="rubricIconLabel"
></status-icon>
class="info"
name="info"
[tooltip]="rubricIconLabel"
/>
<span *ngIf="hasNewWork" class="badge badge--info animate-fade" i18n>New</span>
</div>
9 changes: 6 additions & 3 deletions src/app/teacher/grading-common.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@ import { StudentTeacherCommonModule } from '../student-teacher-common.module';
import { ComponentGradingModule } from './component-grading.module';
import { StatusIconComponent } from '../classroom-monitor/status-icon/status-icon.component';
import { NavItemProgressComponent } from '../classroom-monitor/nav-item-progress/nav-item-progress.component';
import { SaveIndicatorComponent } from '../../assets/wise5/common/save-indicator/save-indicator.component';

@NgModule({
imports: [ComponentGradingModule, IntersectionObserverModule, StudentTeacherCommonModule],
imports: [
ComponentGradingModule,
IntersectionObserverModule,
StatusIconComponent,
StudentTeacherCommonModule
],
declarations: [
EditComponentAnnotationsComponent,
EditComponentCommentComponent,
EditComponentScoreComponent,
GradingEditComponentMaxScoreComponent,
NavItemProgressComponent,
StatusIconComponent,
WorkgroupComponentGradingComponent,
WorkgroupInfoComponent,
WorkgroupItemComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
</div>
<status-icon
*ngIf="hasAlert"
[iconLabel]="alertLabel"
[iconTooltip]="alertLabel"
[iconName]="alertIconName"
[iconClass]="alertIconClass"
></status-icon>
[tooltip]="alertLabel"
[name]="alertIconName"
[class]="alertIconClass"
/>
<span *ngIf="hasNewWork" class="badge badge--info animate-fade" i18n>New</span>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,16 @@
<span fxFlex fxHide.gt-xs></span>
<status-icon
*ngIf="newAlert"
[iconClass]="alertIconClass"
[iconName]="alertIconName"
[iconLabel]="alertIconLabel"
[iconTooltip]="alertIconLabel"
></status-icon>
[class]="alertIconClass"
[name]="alertIconName"
[tooltip]="alertIconLabel"
/>
<status-icon
*ngIf="hasRubrics"
[iconClass]="rubricIconClass"
[iconName]="rubricIconName"
[iconLabel]="rubricIconLabel"
[iconTooltip]="rubricIconLabel"
></status-icon>
[class]="rubricIconClass"
[name]="rubricIconName"
[tooltip]="rubricIconLabel"
/>
<span fxFlex hide-xs></span>
<nav-item-score
class="nav-item--list__info-item"
Expand Down
4 changes: 2 additions & 2 deletions src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1712,11 +1712,11 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/classroom-monitor/step-info/step-info.component.html</context>
<context context-type="linenumber">19</context>
<context context-type="linenumber">17</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/classroomMonitor/classroomMonitorComponents/nodeGrading/workgroupInfo/workgroup-info.component.html</context>
<context context-type="linenumber">14</context>
<context context-type="linenumber">13</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/directives/componentAnnotations/component-annotations.component.html</context>
Expand Down

0 comments on commit c7a408a

Please sign in to comment.