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

[#12658] Instructor Home Page: Dropdown buttons on mobile #12662

Merged
merged 13 commits into from
Dec 24, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ public void deleteSession(int courseTabIndex, int sessionIndex) {
public void archiveCourse(int courseTabIndex) {
WebElement courseTab = getCourseTab(courseTabIndex);
click(courseTab.findElement(By.className("btn-course")));
clickAndConfirm(courseTab.findElement(By.className("btn-archive-course")));
clickAndConfirm(browser.driver.findElement(By.cssSelector("body > div > div > .btn-archive-course")));
waitUntilAnimationFinish();
}

public void deleteCourse(int courseTabIndex) {
WebElement courseTab = getCourseTab(courseTabIndex);
click(courseTab.findElement(By.className("btn-course")));
clickAndConfirm(courseTab.findElement(By.className("btn-delete-course")));
clickAndConfirm(browser.driver.findElement(By.cssSelector("body > div > div > .btn-delete-course")));
waitUntilAnimationFinish();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba
>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand Down Expand Up @@ -451,6 +452,7 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -476,6 +478,7 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -501,6 +504,7 @@ exports[`InstructorHomePageComponent should snap with one course with one feedba
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand Down Expand Up @@ -1017,6 +1021,7 @@ exports[`InstructorHomePageComponent should snap with one course with two feedba
>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -1042,6 +1047,7 @@ exports[`InstructorHomePageComponent should snap with one course with two feedba
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -1067,6 +1073,7 @@ exports[`InstructorHomePageComponent should snap with one course with two feedba
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -1092,6 +1099,7 @@ exports[`InstructorHomePageComponent should snap with one course with two feedba
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand Down Expand Up @@ -1772,6 +1780,7 @@ exports[`InstructorHomePageComponent should snap with one course with unexpanded
>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand Down Expand Up @@ -1804,6 +1813,7 @@ exports[`InstructorHomePageComponent should snap with one course with unexpanded
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -1829,6 +1839,7 @@ exports[`InstructorHomePageComponent should snap with one course with unexpanded
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -1854,6 +1865,7 @@ exports[`InstructorHomePageComponent should snap with one course with unexpanded
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand Down Expand Up @@ -2041,6 +2053,7 @@ exports[`InstructorHomePageComponent should snap with one course with unpopulate
>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand Down Expand Up @@ -2073,6 +2086,7 @@ exports[`InstructorHomePageComponent should snap with one course with unpopulate
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -2098,6 +2112,7 @@ exports[`InstructorHomePageComponent should snap with one course with unpopulate
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -2123,6 +2138,7 @@ exports[`InstructorHomePageComponent should snap with one course with unpopulate
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand Down Expand Up @@ -2334,6 +2350,7 @@ exports[`InstructorHomePageComponent should snap with one course without feedbac
>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand Down Expand Up @@ -2366,6 +2383,7 @@ exports[`InstructorHomePageComponent should snap with one course without feedbac
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -2391,6 +2409,7 @@ exports[`InstructorHomePageComponent should snap with one course without feedbac
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand All @@ -2416,6 +2435,7 @@ exports[`InstructorHomePageComponent should snap with one course without feedbac
</span>
<span
class="dropdown"
container="body"
ngbdropdown=""
>
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h1>Home</h1>
<b class="course-details text-break">[{{ courseTabModel.course.courseId }}]: {{
courseTabModel.course.courseName }}</b>
<div class="card-header-btn-toolbar flex-lg-shrink-0" *ngIf="courseTabModel.isAjaxSuccess">
<span ngbDropdown>
<span ngbDropdown container="body">
<button type="button" class="btn btn-primary btn-sm" ngbDropdownToggle> Students </button>
<div ngbDropdownMenu (click)="$event.stopPropagation()">
<ng-container *ngIf="courseTabModel.instructorPrivilege.canModifyStudent">
Expand All @@ -57,23 +57,23 @@ <h1>Home</h1>
</a>
</div>
</span>
<span ngbDropdown>
<span ngbDropdown container="body">
<button type="button" class="btn btn-primary btn-sm" ngbDropdownToggle> Instructors </button>
<div ngbDropdownMenu (click)="$event.stopPropagation()">
<a class="btn btn-light btn-sm dropdown-item" tmRouterLink="/web/instructor/courses/edit"
[queryParams]="{courseid: courseTabModel.course.courseId}"> View / Edit
</a>
</div>
</span>
<span ngbDropdown>
<span ngbDropdown container="body">
<button type="button" class="btn btn-primary btn-sm" ngbDropdownToggle> Sessions </button>
<div ngbDropdownMenu (click)="$event.stopPropagation()">
<a class="btn btn-light btn-sm dropdown-item" tmRouterLink="/web/instructor/sessions"
[queryParams]="{courseid: courseTabModel.course.courseId}"> Add
</a>
</div>
</span>
<span ngbDropdown>
<span ngbDropdown container="body">
<button type="button" class="btn-course btn btn-primary btn-sm" ngbDropdownToggle> Course </button>
<div ngbDropdownMenu (click)="$event.stopPropagation()">
<a class="btn-archive-course btn btn-light btn-sm dropdown-item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe('InstructorHomePageComponent', () => {

const courseButton: any = fixture.debugElement.nativeElement.querySelector('.btn-course');
courseButton.click();
const archiveButton: any = fixture.debugElement.nativeElement.querySelector('.btn-archive-course');
const archiveButton: any = document.querySelector('body > div > div > .btn-archive-course');
archiveButton.click();

expect(component.courseTabModels.length).toEqual(1);
Expand Down Expand Up @@ -233,8 +233,8 @@ describe('InstructorHomePageComponent', () => {

const courseButton: any = fixture.debugElement.nativeElement.querySelector('.btn-course');
courseButton.click();
const archiveButton: any = fixture.debugElement.nativeElement.querySelector('.btn-delete-course');
archiveButton.click();
const deleteButton: any = document.querySelector('body > div > div > .btn-delete-course');
deleteButton.click();

expect(component.courseTabModels.length).toEqual(1);
expect(component.courseTabModels[0].course.courseId).toEqual('CS3281');
Expand Down
Loading