From 16d1ac65302d42694dd1433d7ab2137c4243d7a1 Mon Sep 17 00:00:00 2001 From: Geoffrey Kwan Date: Thu, 13 Jun 2024 14:45:03 -0700 Subject: [PATCH] fix(Authoring): Add lesson double click submit adds multiple lessons (#1833) --- .../add-lesson-configure.component.html | 7 +++-- .../add-lesson-configure.component.ts | 2 ++ .../configure-structure.component.ts | 2 ++ .../structure/jigsaw/jigsaw.component.html | 11 ++++++- .../ki-cycle-using-oer.component.html | 11 ++++++- .../peer-review-and-revision.component.html | 11 ++++++- ...self-directed-investigation.component.html | 11 ++++++- src/messages.xlf | 30 +++++++++---------- 8 files changed, 63 insertions(+), 22 deletions(-) diff --git a/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.html b/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.html index 3cb1befcf4e..b5c657d4f98 100644 --- a/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.html +++ b/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.html @@ -33,10 +33,11 @@
Enter a title for the new lesson
mat-button class="mat-raised-button mat-primary" (click)="submit()" - [disabled]="!addLessonFormGroup.valid" - i18n + [disabled]="!addLessonFormGroup.valid || submitting" + class="button--progress" > - Submit + + Submit diff --git a/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.ts b/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.ts index b93ebd2a2c0..7de3dc6664e 100644 --- a/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.ts +++ b/src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.ts @@ -13,6 +13,7 @@ export class AddLessonConfigureComponent { protected addLessonFormGroup: FormGroup = this.fb.group({ title: new FormControl('', [Validators.required]) }); + protected submitting: boolean; protected target: string; @ViewChild('titleField') titleField: ElementRef; @@ -32,6 +33,7 @@ export class AddLessonConfigureComponent { } protected submit(): void { + this.submitting = true; const newLesson = this.projectService.createGroup( this.addLessonFormGroup.controls['title'].value ); diff --git a/src/assets/wise5/authoringTool/structure/configure-structure.component.ts b/src/assets/wise5/authoringTool/structure/configure-structure.component.ts index ed5805fe87f..67cf555ae88 100644 --- a/src/assets/wise5/authoringTool/structure/configure-structure.component.ts +++ b/src/assets/wise5/authoringTool/structure/configure-structure.component.ts @@ -12,6 +12,7 @@ export abstract class ConfigureStructureComponent { protected target: string; private structure: any = {}; private structureDir: string = 'assets/wise5/authoringTool/structure'; + protected submitting: boolean; constructor( private http: HttpClient, @@ -58,6 +59,7 @@ export abstract class ConfigureStructureComponent { } protected submit(): void { + this.submitting = true; this.structure = this.injectUniqueIds(this.structure); this.addNodesToProject(this.structure.nodes); const target = history.state.target; diff --git a/src/assets/wise5/authoringTool/structure/jigsaw/jigsaw.component.html b/src/assets/wise5/authoringTool/structure/jigsaw/jigsaw.component.html index 3031b99ad6c..c8e40929b69 100644 --- a/src/assets/wise5/authoringTool/structure/jigsaw/jigsaw.component.html +++ b/src/assets/wise5/authoringTool/structure/jigsaw/jigsaw.component.html @@ -23,6 +23,15 @@
Jigsaw
- + diff --git a/src/assets/wise5/authoringTool/structure/ki-cycle-using-oer/ki-cycle-using-oer.component.html b/src/assets/wise5/authoringTool/structure/ki-cycle-using-oer/ki-cycle-using-oer.component.html index 84885e6ab2a..1e7c7c03706 100644 --- a/src/assets/wise5/authoringTool/structure/ki-cycle-using-oer/ki-cycle-using-oer.component.html +++ b/src/assets/wise5/authoringTool/structure/ki-cycle-using-oer/ki-cycle-using-oer.component.html @@ -14,6 +14,15 @@
KI Lesson with OER
- + diff --git a/src/assets/wise5/authoringTool/structure/peer-review-and-revision/peer-review-and-revision.component.html b/src/assets/wise5/authoringTool/structure/peer-review-and-revision/peer-review-and-revision.component.html index 06ee00ca888..5a3325599ff 100644 --- a/src/assets/wise5/authoringTool/structure/peer-review-and-revision/peer-review-and-revision.component.html +++ b/src/assets/wise5/authoringTool/structure/peer-review-and-revision/peer-review-and-revision.component.html @@ -12,6 +12,15 @@
Peer Review & Revision
- + diff --git a/src/assets/wise5/authoringTool/structure/self-directed-investigation/self-directed-investigation.component.html b/src/assets/wise5/authoringTool/structure/self-directed-investigation/self-directed-investigation.component.html index 4419a66eab6..d85da7bd87e 100644 --- a/src/assets/wise5/authoringTool/structure/self-directed-investigation/self-directed-investigation.component.html +++ b/src/assets/wise5/authoringTool/structure/self-directed-investigation/self-directed-investigation.component.html @@ -13,6 +13,15 @@
Self-Directed Investigation
- + diff --git a/src/messages.xlf b/src/messages.xlf index 5dcde7ee056..8ad4ecf0432 100644 --- a/src/messages.xlf +++ b/src/messages.xlf @@ -1542,6 +1542,10 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.src/app/modules/shared/unlink-google-account-password/unlink-google-account-password.component.html 20 + + src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.html + 40 + src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html 77 @@ -1556,19 +1560,19 @@ Click "Cancel" to keep the invalid JSON open so you can fix it. src/assets/wise5/authoringTool/structure/jigsaw/jigsaw.component.html - 26 + 34 src/assets/wise5/authoringTool/structure/ki-cycle-using-oer/ki-cycle-using-oer.component.html - 17 + 25 src/assets/wise5/authoringTool/structure/peer-review-and-revision/peer-review-and-revision.component.html - 15 + 23 src/assets/wise5/authoringTool/structure/self-directed-investigation/self-directed-investigation.component.html - 16 + 24 src/assets/wise5/components/draw/edit-draw-connected-components/edit-draw-connected-components.component.html @@ -9271,17 +9275,6 @@ Click "Cancel" to keep the invalid JSON open so you can fix it.64,66 - - Submit - - src/assets/wise5/authoringTool/addLesson/add-lesson-configure/add-lesson-configure.component.html - 38,40 - - - src/assets/wise5/vle/node/node.component.html - 59,61 - - Step Title @@ -22089,6 +22082,13 @@ If this problem continues, let your teacher know and move on to the next activit 88 + + Submit + + src/assets/wise5/vle/node/node.component.html + 59,61 + + Dismiss all alerts