diff --git a/src/app/teacher/authoring-routing.module.ts b/src/app/teacher/authoring-routing.module.ts index ba1cd0e95f0..c681bc908e6 100644 --- a/src/app/teacher/authoring-routing.module.ts +++ b/src/app/teacher/authoring-routing.module.ts @@ -12,7 +12,7 @@ import { NodeAdvancedConstraintAuthoringComponent } from '../../assets/wise5/aut import { ChooseComponentLocationComponent } from '../../assets/wise5/authoringTool/node/chooseComponentLocation/choose-component-location.component'; import { AddLessonConfigureComponent } from '../../assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component'; import { ChooseNewNodeTemplateComponent } from '../../assets/wise5/authoringTool/addNode/choose-new-node-template/choose-new-node-template.component'; -import { AddYourOwnNode } from '../../assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component'; +import { AddYourOwnNodeComponent } from '../../assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component'; import { ChooseAutomatedAssessmentComponent } from '../../assets/wise5/authoringTool/addNode/choose-automated-assessment/choose-automated-assessment.component'; import { ConfigureAutomatedAssessmentComponent } from '../../assets/wise5/authoringTool/addNode/configure-automated-assessment/configure-automated-assessment.component'; import { ChooseSimulationComponent } from '../../assets/wise5/authoringTool/addNode/choose-simulation/choose-simulation.component'; @@ -81,7 +81,7 @@ const routes: Routes = [ children: [ { path: 'add-your-own', - component: AddYourOwnNode + component: AddYourOwnNodeComponent }, { path: 'automated-assessment', diff --git a/src/app/teacher/authoring-tool.module.ts b/src/app/teacher/authoring-tool.module.ts index 4ded82a993b..e5f914d1cb1 100644 --- a/src/app/teacher/authoring-tool.module.ts +++ b/src/app/teacher/authoring-tool.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { NgSelectModule } from '@ng-select/ng-select'; -import { AddYourOwnNode } from '../../assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component'; +import { AddYourOwnNodeComponent } from '../../assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component'; import { ChooseNewNodeTemplateComponent } from '../../assets/wise5/authoringTool/addNode/choose-new-node-template/choose-new-node-template.component'; import { AdvancedProjectAuthoringComponent } from '../../assets/wise5/authoringTool/advanced/advanced-project-authoring.component'; import { CardSelectorComponent } from '../../assets/wise5/authoringTool/components/card-selector/card-selector.component'; @@ -69,7 +69,6 @@ import { ComponentTypeButtonComponent } from '../../assets/wise5/authoringTool/c AddLessonChooseTemplateComponent, AddLessonConfigureComponent, AddProjectComponent, - AddYourOwnNode, AdvancedProjectAuthoringComponent, AuthoringToolComponent, AuthoringToolBarComponent, @@ -107,6 +106,7 @@ import { ComponentTypeButtonComponent } from '../../assets/wise5/authoringTool/c AddComponentButtonComponent, AddLessonButtonComponent, AddStepButtonComponent, + AddYourOwnNodeComponent, ChooseNewNodeTemplateComponent, StudentTeacherCommonModule, ChooseNewComponent, diff --git a/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html b/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html index 370e0503613..24d699392cc 100644 --- a/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html +++ b/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html @@ -2,50 +2,52 @@ Step Title - - Step Title is required - + @if (addNodeFormGroup.controls['title'].hasError('required')) { + Step Title is required + }
Select components to add to your new step (optional):
-
No components added
-
-
- reorder - {{ component.name }} - - + @if (initialComponents.length == 0) { +
No components added
+ } + @if (initialComponents.length > 0) { +
+ @for (component of initialComponents; track component.id) { +
+ reorder + {{ component.name }} + + +
+ }
-
+ }
-
- -
+ @for (componentType of componentTypes; track componentType.type) { +
+ +
+ }

*Note: You can always add or remove content later by editing the step. @@ -73,7 +75,9 @@

Select components to add to your new step (optional):
(click)="submit()" class="button--progress" > - + @if (submitting) { + + } Submit
diff --git a/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts b/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts index 15caeb376c0..fb2139ceee9 100644 --- a/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts +++ b/src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts @@ -1,16 +1,47 @@ import { Component } from '@angular/core'; -import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; -import { FormControl, FormGroup, Validators, FormBuilder } from '@angular/forms'; +import { CdkDragDrop, DragDropModule, moveItemInArray } from '@angular/cdk/drag-drop'; +import { + FormControl, + FormGroup, + Validators, + FormBuilder, + FormsModule, + ReactiveFormsModule +} from '@angular/forms'; import { ComponentTypeService } from '../../../services/componentTypeService'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import { TeacherProjectService } from '../../../services/teacherProjectService'; +import { CommonModule } from '@angular/common'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { FlexLayoutModule } from '@angular/flex-layout'; +import { MatIconModule } from '@angular/material/icon'; +import { ComponentTypeButtonComponent } from '../../components/component-type-button/component-type-button.component'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatButtonModule } from '@angular/material/button'; +import { MatProgressBarModule } from '@angular/material/progress-bar'; +import { MatInputModule } from '@angular/material/input'; @Component({ - selector: 'add-your-own-node', + imports: [ + CommonModule, + ComponentTypeButtonComponent, + DragDropModule, + FlexLayoutModule, + FormsModule, + MatButtonModule, + MatDividerModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatProgressBarModule, + ReactiveFormsModule, + RouterModule + ], + standalone: true, styleUrls: ['add-your-own-node.component.scss', '../../add-content.scss'], templateUrl: 'add-your-own-node.component.html' }) -export class AddYourOwnNode { +export class AddYourOwnNodeComponent { protected addNodeFormGroup: FormGroup = this.fb.group({ title: new FormControl($localize`New Step`, [Validators.required]) }); @@ -25,11 +56,12 @@ export class AddYourOwnNode { private projectService: TeacherProjectService, private route: ActivatedRoute, private router: Router - ) {} + ) { + this.componentTypes = this.componentTypeService.getComponentTypes(); + } - ngOnInit() { + ngOnInit(): void { this.targetId = history.state.targetId; - this.componentTypes = this.componentTypeService.getComponentTypes(); } protected addComponent(componentType: any): void { diff --git a/src/messages.xlf b/src/messages.xlf index 59982d2fe1d..f3e32347ca9 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -449,7 +449,7 @@ src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html - 68 + 70 src/assets/wise5/authoringTool/addNode/choose-new-node-template/choose-new-node-template.component.html @@ -1560,7 +1560,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html - 77 + 81 src/assets/wise5/authoringTool/addNode/choose-simulation/choose-simulation.component.html @@ -9585,7 +9585,7 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html - 64,66 + 66,68 @@ -9595,11 +9595,11 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.3 - + Step Title is required src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html - 5,7 + 6 @@ -9613,28 +9613,28 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.No components added src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html - 12 + 13 Delete component src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html - 34 + 32 *Note: You can always add or remove content later by editing the step. src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html - 50,52 + 52,54 New Step src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts - 15 + 46