diff --git a/src/app/authoring-tool/edit-component-prompt/edit-component-prompt.component.ts b/src/app/authoring-tool/edit-component-prompt/edit-component-prompt.component.ts index 510240641b7..e03cc7078af 100644 --- a/src/app/authoring-tool/edit-component-prompt/edit-component-prompt.component.ts +++ b/src/app/authoring-tool/edit-component-prompt/edit-component-prompt.component.ts @@ -1,8 +1,11 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { ComponentContent } from '../../../assets/wise5/common/ComponentContent'; +import { TranslatableTextareaComponent } from '../../../assets/wise5/authoringTool/components/translatable-textarea/translatable-textarea.component'; @Component({ + imports: [TranslatableTextareaComponent], selector: 'edit-component-prompt', + standalone: true, styles: ['.prompt {width: 100%; mat-form-field { width:100%} }'], templateUrl: 'edit-component-prompt.component.html' }) diff --git a/src/app/teacher/component-authoring.module.ts b/src/app/teacher/component-authoring.module.ts index c1a58457518..7d788808b9e 100644 --- a/src/app/teacher/component-authoring.module.ts +++ b/src/app/teacher/component-authoring.module.ts @@ -115,7 +115,6 @@ import { RequiredErrorLabelComponent } from '../../assets/wise5/authoringTool/no EditComponentMaxScoreComponent, EditComponentMaxSubmitComponent, EditComponentPeerGroupingTagComponent, - EditComponentPrompt, EditComponentRubricComponent, EditComponentSaveButtonComponent, EditComponentSubmitButtonComponent, @@ -176,6 +175,7 @@ import { RequiredErrorLabelComponent } from '../../assets/wise5/authoringTool/no ComponentAuthoringComponent, ComponentConstraintAuthoringComponent, EditComponentAdvancedButtonComponent, + EditComponentPrompt, EditComponentWidthComponent, PeerGroupingAuthoringModule, RequiredErrorLabelComponent, @@ -208,7 +208,6 @@ import { RequiredErrorLabelComponent } from '../../assets/wise5/authoringTool/no EditComponentMaxScoreComponent, EditComponentMaxSubmitComponent, EditComponentPeerGroupingTagComponent, - EditComponentPrompt, EditComponentRubricComponent, EditComponentSaveButtonComponent, EditComponentSubmitButtonComponent, diff --git a/src/assets/wise5/components/aiChat/ai-chat-authoring/ai-chat-authoring.component.spec.ts b/src/assets/wise5/components/aiChat/ai-chat-authoring/ai-chat-authoring.component.spec.ts index 501602358fa..95425c4941b 100644 --- a/src/assets/wise5/components/aiChat/ai-chat-authoring/ai-chat-authoring.component.spec.ts +++ b/src/assets/wise5/components/aiChat/ai-chat-authoring/ai-chat-authoring.component.spec.ts @@ -25,14 +25,11 @@ describe('AiChatAuthoringComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [ - AiChatAuthoringComponent, - EditComponentPrompt, - EditDialogGuidanceComputerAvatarComponent - ], + declarations: [AiChatAuthoringComponent, EditDialogGuidanceComputerAvatarComponent], imports: [ BrowserAnimationsModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatButtonToggleModule, MatCheckboxModule, diff --git a/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.spec.ts b/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.spec.ts index 5ee5eefb3b5..0aba0d891ee 100644 --- a/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.spec.ts +++ b/src/assets/wise5/components/animation/animation-authoring/animation-authoring.component.spec.ts @@ -26,11 +26,12 @@ let fixture: ComponentFixture; describe('AnimationAuthoring', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [AnimationAuthoring, EditComponentPrompt], + declarations: [AnimationAuthoring], imports: [ BrowserAnimationsModule, BrowserModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatFormFieldModule, MatIconModule, diff --git a/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.spec.ts b/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.spec.ts index 8eb82510c2c..90664534c8c 100644 --- a/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.spec.ts +++ b/src/assets/wise5/components/audioOscillator/audio-oscillator-authoring/audio-oscillator-authoring.component.spec.ts @@ -26,6 +26,7 @@ describe('AudioOscillatorAuthoring', () => { imports: [ BrowserAnimationsModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatCheckboxModule, MatDialogModule, @@ -33,7 +34,7 @@ describe('AudioOscillatorAuthoring', () => { ReactiveFormsModule, StudentTeacherCommonServicesModule ], - declarations: [EditComponentPrompt, AudioOscillatorAuthoring], + declarations: [AudioOscillatorAuthoring], providers: [ ProjectAssetService, TeacherNodeService, diff --git a/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.module.ts b/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.module.ts index 1b9adeb0f8c..274be2c8e47 100644 --- a/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.module.ts +++ b/src/assets/wise5/components/conceptMap/concept-map-authoring/concept-map-authoring.module.ts @@ -22,10 +22,11 @@ import { TeacherNodeService } from '../../../services/teacherNodeService'; import { ComponentAuthoringModule } from '../../component-authoring.module'; @NgModule({ - declarations: [ConceptMapAuthoring, EditComponentPrompt], + declarations: [ConceptMapAuthoring], imports: [ CommonModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatCheckboxModule, MatFormFieldModule, diff --git a/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.module.ts b/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.module.ts index 45319d74db6..4103f054dee 100644 --- a/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.module.ts +++ b/src/assets/wise5/components/dialogGuidance/dialog-guidance-authoring/dialog-guidance-authoring.module.ts @@ -28,7 +28,6 @@ import { ComponentAuthoringModule } from '../../component-authoring.module'; @NgModule({ declarations: [ DialogGuidanceAuthoringComponent, - EditComponentPrompt, EditComponentMaxSubmitComponent, EditFeedbackRulesComponent, FeedbackRuleHelpComponent @@ -36,6 +35,7 @@ import { ComponentAuthoringModule } from '../../component-authoring.module'; imports: [ CommonModule, ComponentAuthoringModule, + EditComponentPrompt, DragDropModule, FormsModule, MatCheckboxModule, diff --git a/src/assets/wise5/components/draw/draw-authoring/draw-authoring.module.ts b/src/assets/wise5/components/draw/draw-authoring/draw-authoring.module.ts index 95fd478c3a7..9556cce594b 100644 --- a/src/assets/wise5/components/draw/draw-authoring/draw-authoring.module.ts +++ b/src/assets/wise5/components/draw/draw-authoring/draw-authoring.module.ts @@ -22,10 +22,11 @@ import { TeacherNodeService } from '../../../services/teacherNodeService'; import { ComponentAuthoringModule } from '../../component-authoring.module'; @NgModule({ - declarations: [DrawAuthoring, EditComponentPrompt], + declarations: [DrawAuthoring], imports: [ CommonModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatCheckboxModule, MatDialogModule, diff --git a/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.module.ts b/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.module.ts index 58d75cb8253..68ba3674884 100644 --- a/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.module.ts +++ b/src/assets/wise5/components/embedded/embedded-authoring/embedded-authoring.module.ts @@ -24,10 +24,11 @@ import { EmbeddedAuthoring } from './embedded-authoring.component'; import { ComponentAuthoringModule } from '../../component-authoring.module'; @NgModule({ - declarations: [EmbeddedAuthoring, EditComponentPrompt, AuthorUrlParametersComponent], + declarations: [EmbeddedAuthoring, AuthorUrlParametersComponent], imports: [ CommonModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatCheckboxModule, MatDialogModule, diff --git a/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.spec.ts b/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.spec.ts index 894f761d8d3..ec6285e6818 100644 --- a/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.spec.ts +++ b/src/assets/wise5/components/graph/graph-authoring/graph-authoring.component.spec.ts @@ -28,11 +28,12 @@ let fixture: ComponentFixture; describe('GraphAuthoringComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [GraphAuthoring, EditComponentPrompt], + declarations: [GraphAuthoring], imports: [ BrowserAnimationsModule, BrowserModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatCheckboxModule, MatDialogModule, diff --git a/src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.spec.ts b/src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.spec.ts index 6381fb5fffb..1072e34d46d 100644 --- a/src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.spec.ts +++ b/src/assets/wise5/components/multipleChoice/multiple-choice-authoring/multiple-choice-authoring.spec.ts @@ -30,10 +30,11 @@ let teacherProjectService: TeacherProjectService; describe('MultipleChoiceAuthoringComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - declarations: [EditComponentPrompt, MultipleChoiceAuthoring], + declarations: [MultipleChoiceAuthoring], imports: [ BrowserAnimationsModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatDialogModule, MatCheckboxModule, diff --git a/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.spec.ts b/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.spec.ts index e40265832aa..617898603ab 100644 --- a/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.spec.ts +++ b/src/assets/wise5/components/peerChat/peer-chat-authoring/peer-chat-authoring.component.spec.ts @@ -20,6 +20,8 @@ import { StudentTeacherCommonServicesModule } from '../../../../../app/student-t import { NO_ERRORS_SCHEMA } from '@angular/core'; import { TeacherNodeService } from '../../../services/teacherNodeService'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { ComponentAuthoringModule } from '../../component-authoring.module'; +import { ProjectLocale } from '../../../../../app/domain/projectLocale'; const componentContent = { id: 'qn3savv52r', @@ -47,17 +49,21 @@ describe('PeerChatAuthoringComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [EditComponentPrompt, PeerChatAuthoringComponent], - schemas: [NO_ERRORS_SCHEMA], - imports: [BrowserAnimationsModule, + declarations: [PeerChatAuthoringComponent], + schemas: [NO_ERRORS_SCHEMA], + imports: [ + BrowserAnimationsModule, + ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatDialogModule, MatFormFieldModule, MatIconModule, MatInputModule, MatSelectModule, - StudentTeacherCommonServicesModule], - providers: [ + StudentTeacherCommonServicesModule + ], + providers: [ ConfigService, { provide: TeacherNodeService, useClass: MockNodeService }, ProjectAssetService, @@ -66,13 +72,17 @@ describe('PeerChatAuthoringComponent', () => { TeacherProjectService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting() - ] -}).compileComponents(); + ] + }).compileComponents(); }); beforeEach(() => { + spyOn(TestBed.inject(TeacherProjectService), 'getLocale').and.returnValue( + new ProjectLocale({ default: 'en-US' }) + ); fixture = TestBed.createComponent(PeerChatAuthoringComponent); component = fixture.componentInstance; + spyOn(TestBed.inject(TeacherProjectService), 'isDefaultLocale').and.returnValue(true); spyOn(TestBed.inject(TeacherProjectService), 'getFlattenedProjectAsNodeIds').and.returnValue([ 'node1', 'node2', diff --git a/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.spec.ts b/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.spec.ts index 9999004bb83..47a5755a6bd 100644 --- a/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.spec.ts +++ b/src/assets/wise5/components/showGroupWork/show-group-work-authoring/show-group-work-authoring.component.spec.ts @@ -16,6 +16,8 @@ import { StudentTeacherCommonServicesModule } from '../../../../../app/student-t import { NO_ERRORS_SCHEMA } from '@angular/core'; import { TeacherNodeService } from '../../../services/teacherNodeService'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { ComponentAuthoringModule } from '../../component-authoring.module'; +import { ProjectLocale } from '../../../../../app/domain/projectLocale'; describe('ShowGroupWorkAuthoringComponent', () => { let component: ShowGroupWorkAuthoringComponent; @@ -24,23 +26,37 @@ describe('ShowGroupWorkAuthoringComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [EditComponentPrompt, ShowGroupWorkAuthoringComponent], - schemas: [NO_ERRORS_SCHEMA], - imports: [BrowserAnimationsModule, + declarations: [ShowGroupWorkAuthoringComponent], + schemas: [NO_ERRORS_SCHEMA], + imports: [ + BrowserAnimationsModule, BrowserModule, + ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatCheckboxModule, MatDialogModule, MatFormFieldModule, MatInputModule, MatSelectModule, - StudentTeacherCommonServicesModule], - providers: [ProjectAssetService, TeacherNodeService, TeacherProjectService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()] -}).compileComponents(); + StudentTeacherCommonServicesModule + ], + providers: [ + ProjectAssetService, + TeacherNodeService, + TeacherProjectService, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting() + ] + }).compileComponents(); }); beforeEach(() => { + spyOn(TestBed.inject(TeacherProjectService), 'getLocale').and.returnValue( + new ProjectLocale({ default: 'en-US' }) + ); fixture = TestBed.createComponent(ShowGroupWorkAuthoringComponent); + spyOn(TestBed.inject(TeacherProjectService), 'isDefaultLocale').and.returnValue(true); spyOn(TestBed.inject(TeacherProjectService), 'getFlattenedProjectAsNodeIds').and.returnValue([ nodeId1 ]); diff --git a/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.spec.ts b/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.spec.ts index edee73343c3..08608d29b49 100644 --- a/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.spec.ts +++ b/src/assets/wise5/components/showMyWork/show-my-work-authoring/show-my-work-authoring.component.spec.ts @@ -35,11 +35,12 @@ describe('ShowMyWorkAuthoringComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [EditComponentPrompt, ShowMyWorkAuthoringComponent], + declarations: [ShowMyWorkAuthoringComponent], imports: [ BrowserAnimationsModule, BrowserModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatDialogModule, MatFormFieldModule, diff --git a/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.spec.ts b/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.spec.ts index 27cfbf004d1..fe9d45f3502 100644 --- a/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.spec.ts +++ b/src/assets/wise5/components/summary/summary-authoring/summary-authoring.component.spec.ts @@ -31,12 +31,13 @@ let getComponentSpy; describe('SummaryAuthoringComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [EditComponentPrompt, SummaryAuthoring], + declarations: [SummaryAuthoring], imports: [ BrowserAnimationsModule, BrowserModule, CommonModule, ComponentAuthoringModule, + EditComponentPrompt, FormsModule, MatCheckboxModule, MatFormFieldModule,