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

[#12329] Refactoring of sortable tables - Instructor courses page #12537

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b71443a
fixed overlapping button issue
singhabhyudita Jun 16, 2023
c51b8ce
Overflow fixed
singhabhyudita Jun 19, 2023
1aec748
Updating failing checks
singhabhyudita Jun 19, 2023
66e75f8
Reduced padding at ends and for the info button
singhabhyudita Jun 22, 2023
97f02b3
Corresponding snapshots updated
singhabhyudita Jun 22, 2023
b6f8889
Padding changed to horizontal axis
singhabhyudita Jun 27, 2023
fae9e81
Merge branch 'master' into master
singhabhyudita Jun 27, 2023
440822d
Merge branch 'master' of https://github.com/TEAMMATES/teammates
singhabhyudita Jun 27, 2023
11f0dd9
Merge branch 'master' of https://github.com/singhabhyudita/teammates
singhabhyudita Jun 27, 2023
f17341d
snapshots updated
singhabhyudita Jun 27, 2023
c8f8e6c
custom styling added
singhabhyudita Jun 27, 2023
d1e20fa
Merge branch 'master' of https://github.com/TEAMMATES/teammates
singhabhyudita Jun 28, 2023
202899f
Merge branch 'master' into master
singhabhyudita Jun 29, 2023
fc5c267
Merge branch 'master' of https://github.com/TEAMMATES/teammates
singhabhyudita Jun 29, 2023
1383d61
Merge branch 'master' of https://github.com/singhabhyudita/teammates
singhabhyudita Jun 29, 2023
05ba8ea
working on admin sort features
singhabhyudita Jul 5, 2023
0852e9b
Merge branch 'master' of https://github.com/TEAMMATES/teammates
singhabhyudita Jul 5, 2023
9571087
Merge branch 'master' of https://github.com/TEAMMATES/teammates
singhabhyudita Jul 12, 2023
ec55173
Merge branch 'master' of https://github.com/TEAMMATES/teammates
singhabhyudita Jul 20, 2023
565d473
instructor courses page refactored
singhabhyudita Jul 21, 2023
254a6ea
snapshots updated, dependency cycle fixed
singhabhyudita Jul 25, 2023
f60d29b
Merge branch 'master' of https://github.com/TEAMMATES/teammates into …
singhabhyudita Jul 25, 2023
e1dc26f
updated
singhabhyudita Jul 27, 2023
3310bb5
linting
singhabhyudita Jul 30, 2023
08b685b
Merge branch 'master' of https://github.com/TEAMMATES/teammates into …
singhabhyudita Jul 30, 2023
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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<a id="btn-enroll" class="btn btn-light btn-sm custom-button-active" *ngIf="course.canModifyStudent"
ngbTooltip="Enroll student into the course" tmRouterLink="/web/instructor/courses/enroll"
[queryParams]="{courseid: course.course.courseId}">
Enroll
</a>
<button id="btn-enroll-disabled" class="btn btn-light btn-sm disabled"
*ngIf="!course.canModifyStudent">
Enroll
</button>
<div ngbDropdown class="d-inline-block">
<button id="btn-other-actions" class="btn btn-light btn-sm custom-button-active" ngbDropdownToggle>Other
Actions</button>
<div ngbDropdownMenu>
<a class="btn btn-primary btn-sm dropdown-item clickable"
tmRouterLink="/web/instructor/courses/details" [queryParams]="{courseid: course.course.courseId}">
View
</a>
<a class="btn btn-primary btn-sm dropdown-item clickable"
tmRouterLink="/web/instructor/courses/edit" [queryParams]="{courseid: course.course.courseId}">
Edit
</a>
<button id="btn-copy" class="btn btn-primary btn-sm dropdown-item clickable"
*ngIf="course.canModifyCourse"
(click)="onCopy(course.course.courseId, course.course.courseName, course.course.timeZone)"
ngbTooltip="Copy the course and its corresponding sessions" placement="left" container="body"
[disabled]="isCopyingCourse">
Copy
</button>
<button id="btn-archive" class="btn btn-primary btn-sm dropdown-item clickable"
(click)="changeArchiveStatus(course.course.courseId, true)"
ngbTooltip="Archive the course so that it will not be shown in the home page any more (you can still access it from the 'Courses' tab)"
placement="left" container="body">
Archive
</button>

<button id="btn-soft-delete" class="btn btn-primary btn-sm dropdown-item clickable"
*ngIf="course.canModifyCourse" (click)="onDelete(course.course.courseId)"
ngbTooltip="Delete the course and its corresponding students and sessions" placement="left"
container="body">
Delete
</button>
<button id="btn-soft-delete-disabled" class="btn btn-primary btn-sm dropdown-item disabled"
*ngIf="!course.canModifyCourse">
Delete
</button>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
import { NgbDropdownModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
import { Course } from '../../../../types/api-output';
import { TeammatesRouterModule } from '../../../components/teammates-router/teammates-router.module';

interface CourseModel {
course: Course;
canModifyCourse: boolean;
canModifyStudent: boolean;
isLoadingCourseStats: boolean;
}
@Component({
selector: 'tm-actions',
templateUrl: './cell-with-actions.component.html',
standalone: true,
imports: [
CommonModule,
TeammatesRouterModule,
NgbDropdownModule,
NgbTooltipModule,
],
})
export class ActionsComponent {
@Input() course!: CourseModel;
@Input() isCopyingCourse!: boolean;
@Input() onCopy: (courseId: string, courseName: string, timeZone: string) => void = () => {};
@Input() changeArchiveStatus: (courseId: string, toArchive: boolean) => void = () => {};
@Input() onDelete!: (courseId: string) => Promise<void>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<button id="btn-unarchive" class="btn btn-light btn-sm custom-button-archived"
(click)="changeArchiveStatus(course.course.courseId, false)">
Unarchive
</button>
<button id="btn-soft-delete-archived" class="btn btn-light btn-sm custom-button-archived" *ngIf="course.canModifyCourse"
(click)="onDelete(course.course.courseId)"
ngbTooltip="Delete the course and its corresponding students and sessions">
Delete
</button>
<button id="btn-soft-delete-archived-disabled" class="btn btn-light btn-sm disabled"
*ngIf="!course.canModifyCourse">
Delete
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
import { Course } from '../../../../types/api-output';
import { TeammatesRouterModule } from '../../../components/teammates-router/teammates-router.module';

interface CourseModel {
course: Course;
canModifyCourse: boolean;
canModifyStudent: boolean;
isLoadingCourseStats: boolean;
}
@Component({
selector: 'tm-archived-actions',
templateUrl: './cell-with-archived-actions.component.html',
standalone: true,
imports: [
CommonModule,
TeammatesRouterModule,
NgbTooltipModule,
],
})
export class ArchivedActionsComponent {
@Input() course!: CourseModel;
@Input() changeArchiveStatus: (courseId: string, toArchive: boolean) => void = () => {};
@Input() onDelete!: (courseId: string) => Promise<void>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div><span *ngIf="!courseStats[courseId]">
<a *ngIf="!isLoadingCourseStats" id="show-statistics"
(click)="getCourseStats()">
Show
</a>
</span>
<span *ngIf="courseStats[courseId]">
{{ courseStats[courseId][column] }}
</span></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';

@Component({
selector: 'tm-course-stats',
templateUrl: './cell-with-course-stats.component.html',
standalone: true,
imports: [
CommonModule,
],
})
export class CourseStatsComponent {
@Input() courseId: string = '';
@Input() column: string = '';
@Input() courseStats: Record<string, Record<string, number>> = {};
@Input() isLoadingCourseStats: boolean = false;
@Input() getCourseStats: () => void = () => {};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<button id="btn-restore" class="btn btn-light btn-sm" *ngIf="course.canModifyCourse"
(click)="onRestore(course.course.courseId)"
ngbTooltip="Restore the deleted course and its corresponding students and sessions">
Restore
</button>
<button id="btn-restore-disabled" class="btn btn-light btn-sm disabled"
*ngIf="!course.canModifyCourse">
Restore
</button>
<button id="btn-delete" class="btn btn-light btn-sm text-danger" *ngIf="course.canModifyCourse"
(click)="onDeletePermanently(course.course.courseId)"
ngbTooltip="Permanently delete the course and its corresponding students and sessions">
Delete Permanently
</button>
<button id="btn-delete-disabled" class="btn btn-light btn-sm disabled text-danger"
*ngIf="!course.canModifyCourse">
Delete Permanently
</button>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';
import { Course } from '../../../../types/api-output';
import { TeammatesRouterModule } from '../../../components/teammates-router/teammates-router.module';

interface CourseModel {
course: Course;
canModifyCourse: boolean;
canModifyStudent: boolean;
isLoadingCourseStats: boolean;
}
@Component({
selector: 'tm-deleted-actions',
templateUrl: './cell-with-deleted-actions.component.html',
standalone: true,
imports: [
CommonModule,
TeammatesRouterModule,
NgbTooltipModule,
],
})
export class DeletedActionsComponent {
@Input() course!: CourseModel;
@Input() onRestore: (courseId: string) => void = () => {};
@Input() onDeletePermanently!: (courseId: string) => Promise<void>;
}
Loading