From 1c3d90ade3fd5c6ca05cce53dc9dcb64da9101b3 Mon Sep 17 00:00:00 2001 From: Neo Wei Qing Date: Mon, 13 Mar 2023 13:23:11 +0800 Subject: [PATCH 01/11] Shift submenu to bottom --- .../feedback-path-panel.component.html | 18 +++++----- .../feedback-path-panel.component.ts | 35 +++++++++++++++++++ 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html index 3d839cb71d4..5ea6e618d4f 100644 --- a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html +++ b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html @@ -3,26 +3,26 @@ Feedback Path (Who is giving feedback about whom?)
- -
+ diff --git a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.scss b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.scss index 6f729827c61..b89030c7b4d 100644 --- a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.scss +++ b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.scss @@ -17,3 +17,11 @@ .dropdown-item { cursor: pointer; } + +.dropdown-button { + border: none; + background: none; + cursor: inherit; + width: 100%; + text-align: left; +} diff --git a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.ts b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.ts index 1abfde7f74a..74688db776f 100644 --- a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.ts +++ b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.ts @@ -69,9 +69,6 @@ export class FeedbackPathPanelComponent { @Input() allowedFeedbackPaths: Map = new Map(); - @Input() - subMenuStatuses: Map = new Map(); - @Output() customFeedbackPath: EventEmitter = new EventEmitter(); @@ -86,6 +83,8 @@ export class FeedbackPathPanelComponent { triggerModelChangeBatch: EventEmitter> = new EventEmitter>(); + subMenuStatuses: Map = new Map(); + triggerCustomNumberOfEntities(data: number): void { this.customNumberOfEntitiesToGiveFeedbackTo.emit(data); } From 5350f20a7cb271b61b4197b0cd918d52c9fdf154 Mon Sep 17 00:00:00 2001 From: Neo Wei Qing Date: Wed, 15 Mar 2023 10:10:37 +0800 Subject: [PATCH 04/11] Fix screenreader focus --- .../feedback-path-panel.component.html | 30 +++++++++++-------- .../feedback-path-panel.component.scss | 1 - 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html index edbd233c5e1..baeb9a699ae 100644 --- a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html +++ b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html @@ -12,20 +12,26 @@
    -
  • - -
  • -
- +
  • + +
      + +
  • - +
    diff --git a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.scss b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.scss index b89030c7b4d..79aabc7d057 100644 --- a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.scss +++ b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.scss @@ -21,7 +21,6 @@ .dropdown-button { border: none; background: none; - cursor: inherit; width: 100%; text-align: left; } From 5a2e95ce1b935c63a26ee33d8187252c1098eb73 Mon Sep 17 00:00:00 2001 From: Neo Wei Qing Date: Wed, 15 Mar 2023 10:16:26 +0800 Subject: [PATCH 05/11] Lint and test --- .../feedback-path-panel.component.ts | 2 +- .../question-edit-form.component.spec.ts.snap | 10 +- ...r-session-edit-page.component.spec.ts.snap | 419 +++++------------- 3 files changed, 113 insertions(+), 318 deletions(-) diff --git a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.ts b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.ts index 74688db776f..b2ca26c5183 100644 --- a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.ts +++ b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.ts @@ -84,7 +84,7 @@ export class FeedbackPathPanelComponent { new EventEmitter>(); subMenuStatuses: Map = new Map(); - + triggerCustomNumberOfEntities(data: number): void { this.customNumberOfEntitiesToGiveFeedbackTo.emit(data); } diff --git a/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap b/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap index 46031718719..8faef19178d 100644 --- a/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap +++ b/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap @@ -239,12 +239,14 @@ exports[`QuestionEditFormComponent should snap with default view 1`] = ` >
    diff --git a/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap index d13d0869f1e..6964dacbab6 100644 --- a/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap @@ -1447,11 +1447,13 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu > @@ -2186,11 +2116,13 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu > @@ -4009,6 +3869,7 @@ exports[`InstructorSessionEditPageComponent should snap with new question added > From f91921916f58dd9a31207adf20e894201cb054d4 Mon Sep 17 00:00:00 2001 From: Neo Wei Qing Date: Wed, 15 Mar 2023 10:26:54 +0800 Subject: [PATCH 06/11] Fix mobile overflow --- .../feedback-path-panel.component.html | 2 +- ...or-session-edit-page.component.spec.ts.snap | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html index baeb9a699ae..9fa74b2a0ca 100644 --- a/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html +++ b/src/web/app/components/feedback-path-panel/feedback-path-panel.component.html @@ -13,7 +13,7 @@
    • -
    From f75e55ac258a5ae7f8faba4e39a0e522e3c09562 Mon Sep 17 00:00:00 2001 From: Neo Wei Qing Date: Wed, 15 Mar 2023 23:10:45 +0800 Subject: [PATCH 10/11] Update tests --- .../e2e/pageobjects/InstructorFeedbackEditPage.java | 5 +++-- .../__snapshots__/question-edit-form.component.spec.ts.snap | 2 +- .../instructor-session-edit-page.component.spec.ts.snap | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java index 53d00fec6d4..0e78ac9cadd 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java @@ -1081,8 +1081,9 @@ private void selectFeedbackPathDropdownOption(int questionNum, String text) { WebElement dropdown = feedbackPathPanel.findElement(By.id("feedback-path-dropdown")); List options = dropdown.findElements(By.className("dropdown-item")); for (WebElement option : options) { - if (option.findElement(By.className("dropdown-button")).getText().equals(text)) { - click(option); + WebElement dropdownButton = option.findElement(By.className("dropdown-button")); + if (dropdownButton.getText().equals(text)) { + click(dropdownButton); return; } } diff --git a/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap b/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap index dd802b41df3..ad29ba49d16 100644 --- a/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap +++ b/src/web/app/components/question-edit-form/__snapshots__/question-edit-form.component.spec.ts.snap @@ -274,7 +274,7 @@ exports[`QuestionEditFormComponent should snap with default view 1`] = ` diff --git a/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap b/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap index 5d492f15c56..f654d00bc32 100644 --- a/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap +++ b/src/web/app/pages-instructor/instructor-session-edit-page/__snapshots__/instructor-session-edit-page.component.spec.ts.snap @@ -1532,7 +1532,7 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu @@ -2200,7 +2200,7 @@ exports[`InstructorSessionEditPageComponent should snap with feedback session qu @@ -3947,7 +3947,7 @@ exports[`InstructorSessionEditPageComponent should snap with new question added From a783ac8305e0a97edd4b53ad6a63b170cbbdd58a Mon Sep 17 00:00:00 2001 From: Neo Wei Qing Date: Wed, 15 Mar 2023 23:26:56 +0800 Subject: [PATCH 11/11] Refine E2E change --- .../e2e/pageobjects/InstructorFeedbackEditPage.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java index 0e78ac9cadd..71e81e869c6 100644 --- a/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java +++ b/src/e2e/java/teammates/e2e/pageobjects/InstructorFeedbackEditPage.java @@ -1079,11 +1079,10 @@ private void selectFeedbackPathDropdownOption(int questionNum, String text) { WebElement feedbackPathPanel = questionForm.findElement(By.tagName("tm-feedback-path-panel")); click(feedbackPathPanel.findElement(By.id("btn-feedback-path"))); WebElement dropdown = feedbackPathPanel.findElement(By.id("feedback-path-dropdown")); - List options = dropdown.findElements(By.className("dropdown-item")); + List options = dropdown.findElements(By.className("dropdown-button")); for (WebElement option : options) { - WebElement dropdownButton = option.findElement(By.className("dropdown-button")); - if (dropdownButton.getText().equals(text)) { - click(dropdownButton); + if (option.getText().equals(text)) { + click(option); return; } }