Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(GradingEditComponentMaxScore): Convert to standalone #1957

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/teacher/grading-common.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { NavItemProgressComponent } from '../classroom-monitor/nav-item-progress
imports: [
ComponentGradingModule,
EditComponentScoreComponent,
GradingEditComponentMaxScoreComponent,
IntersectionObserverModule,
StatusIconComponent,
StudentTeacherCommonModule,
Expand All @@ -28,7 +29,6 @@ import { NavItemProgressComponent } from '../classroom-monitor/nav-item-progress
declarations: [
EditComponentAnnotationsComponent,
EditComponentCommentComponent,
GradingEditComponentMaxScoreComponent,
NavItemProgressComponent,
WorkgroupComponentGradingComponent,
WorkgroupInfoComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[componentId]="componentId"
[disabled]="isDisabled || !canAuthorProject"
[nodeId]="nodeId"
></grading-edit-component-max-score>
/>
</div>
<div *ngIf="edit || !showAutoComment()" class="annotations--grading__item">
<edit-component-comment
Expand Down Expand Up @@ -81,7 +81,7 @@
[componentId]="componentId"
[disabled]="true"
[nodeId]="nodeId"
></grading-edit-component-max-score>
/>
</div>
<div *ngIf="latestAnnotations.comment" class="annotations--grading__item">
<edit-component-comment
Expand Down Expand Up @@ -126,7 +126,7 @@
[nodeId]="nodeId"
[componentId]="componentId"
[disabled]="true"
></grading-edit-component-max-score>
/>
</div>
<div
class="annotations--grading__item annotations--grading__auto-comment"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { GradingEditComponentMaxScoreComponent } from './grading-edit-component-max-score.component';
import { TeacherProjectService } from '../../../services/teacherProjectService';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { CopyNodesService } from '../../../services/copyNodesService';
import { StudentTeacherCommonServicesModule } from '../../../../../app/student-teacher-common-services.module';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { Node } from '../../../common/Node';
Expand All @@ -17,15 +14,8 @@ let projectService: TeacherProjectService;
describe('GradingEditComponentMaxScoreComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [GradingEditComponentMaxScoreComponent],
schemas: [NO_ERRORS_SCHEMA],
imports: [StudentTeacherCommonServicesModule],
providers: [
CopyNodesService,
TeacherProjectService,
provideHttpClient(withInterceptorsFromDi()),
provideHttpClientTesting()
]
imports: [GradingEditComponentMaxScoreComponent, StudentTeacherCommonServicesModule],
providers: [TeacherProjectService, provideHttpClient(withInterceptorsFromDi())]
});
projectService = TestBed.inject(TeacherProjectService);
fixture = TestBed.createComponent(GradingEditComponentMaxScoreComponent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ import { Component, Input, ViewEncapsulation } from '@angular/core';
import { Subject, Subscription } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { TeacherProjectService } from '../../../services/teacherProjectService';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';

@Component({
imports: [CommonModule, FormsModule, MatFormFieldModule, MatInputModule],
selector: 'grading-edit-component-max-score',
standalone: true,
styles: [
`
/* TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
Expand All @@ -22,7 +28,7 @@ export class GradingEditComponentMaxScoreComponent {
maxScore: number;
maxScoreChanged: Subject<string> = new Subject<string>();
@Input() nodeId: string;
subscriptions: Subscription = new Subscription();
private subscriptions: Subscription = new Subscription();

constructor(private projectService: TeacherProjectService) {}

Expand Down
Loading