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 - Sessions table #12501

Merged
merged 58 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
04c4a12
refactor(sessions-table): add cell-with-tooltip component
Zxun2 Jun 12, 2023
9bc8088
refactor(sessions-table): add group-buttons component
Zxun2 Jun 12, 2023
c60762d
refactor(sessions-table): add response-rate component
Zxun2 Jun 12, 2023
55994d7
refactor(sessions-table): add mvp
Zxun2 Jun 12, 2023
c1653b0
refactor(sessions-table): add enum to header map
Zxun2 Jun 13, 2023
f7b85e9
refactor(sessions-table): bug fixes and misc changes
Zxun2 Jun 13, 2023
f36a2ca
refactor(sessions-table): fix linting
Zxun2 Jun 14, 2023
d110c07
fix: linting
Zxun2 Jun 20, 2023
ffdacf5
fix: linting max-len
Zxun2 Jun 28, 2023
58807ea
fix: adjust stylings on response rate
Zxun2 Jun 28, 2023
d41f5bd
Merge branch 'master' of https://github.com/Zxun2/teammates into zong…
Zxun2 Jun 28, 2023
c4f9343
fix: update failing snapshots
Zxun2 Jun 28, 2023
006be8a
refactor(sessions-table): add header and table id
Zxun2 Jun 28, 2023
a66ea9b
refactor(sessions-table): add setMainTableStyle and optional headers
Zxun2 Jun 28, 2023
67f5b5e
feat: update id on sessions table
Zxun2 Jun 28, 2023
3ba0859
fix: update snapshots
Zxun2 Jun 28, 2023
0dad991
Merge branch 'master' of https://github.com/Zxun2/teammates into zong…
Zxun2 Jul 1, 2023
b5f4d39
refactor(sessions-table): update optional chaining
Zxun2 Jul 1, 2023
e827f04
refactor(sessions-table): publish and unpublish behaviour
Zxun2 Jul 1, 2023
97662df
fix: linting
Zxun2 Jul 1, 2023
62f6e4c
fix: update snapshots
Zxun2 Jul 1, 2023
6b87d00
fix: update id
Zxun2 Jul 1, 2023
66ed7c5
fix: reset sorting when retrieving idx
Zxun2 Jul 1, 2023
0c53b61
refactor(sessions-table): rename components
Zxun2 Jul 2, 2023
9078062
fix: columns appeared when not expected
Zxun2 Jul 3, 2023
ee6541a
fix: failing e2etests and associated changes
Zxun2 Jul 6, 2023
3e7780a
Merge branch 'master' into zongxun/refactor-sessions-table
Zxun2 Jul 6, 2023
03e3b1a
cleanup(sessions-table): minor changes
Zxun2 Jul 6, 2023
32d578a
Merge branch 'zongxun/refactor-sessions-table' of https://github.com/…
Zxun2 Jul 6, 2023
626ffde
misc: re-organisation
Zxun2 Jul 7, 2023
2c10fdb
fix: linting
Zxun2 Jul 7, 2023
202e6b9
fix: remove e2e stability changes
Zxun2 Jul 12, 2023
5af70b7
Merge branch 'master' into zongxun/refactor-sessions-table
Zxun2 Jul 12, 2023
cf25949
misc: revert formatting
Zxun2 Jul 12, 2023
ea701b6
misc: revert formatting-1
Zxun2 Jul 13, 2023
1610d14
misc: revert formatting-2
Zxun2 Jul 13, 2023
230baba
misc: revert formatting-3
Zxun2 Jul 13, 2023
69989a4
misc: revert formatting-4
Zxun2 Jul 13, 2023
fb9467a
misc: revert formatting-5
Zxun2 Jul 13, 2023
44cc147
misc: revert formatting-6
Zxun2 Jul 13, 2023
b12d5d7
Merge branch 'master' of https://github.com/Zxun2/teammates into zong…
Zxun2 Jul 13, 2023
863634b
fix: update linting and component tests
Zxun2 Jul 13, 2023
56a3d80
fix: restore individual sessions
Zxun2 Jul 13, 2023
88e4ede
Merge branch 'master' into zongxun/refactor-sessions-table
Zxun2 Jul 13, 2023
3244316
Merge branch 'master' into zongxun/refactor-sessions-table
Zxun2 Jul 14, 2023
4af7979
Merge branch 'master' into zongxun/refactor-sessions-table
Zxun2 Jul 15, 2023
37042ed
Merge branch 'master' into zongxun/refactor-sessions-table
Zxun2 Jul 16, 2023
1247a7d
Merge branch 'master' into zongxun/refactor-sessions-table
Zxun2 Jul 18, 2023
8099697
misc: switch initial sort by for instructor home page
Zxun2 Jul 21, 2023
845bce5
feat: add sort order to sortable table
Zxun2 Jul 22, 2023
3e18f26
fix: linting
Zxun2 Jul 22, 2023
3e220a4
fix: update snapshots
Zxun2 Jul 22, 2023
c124fc3
Merge branch 'master' into zongxun/refactor-sessions-table
Zxun2 Jul 22, 2023
d873d80
misc: update stylings
Zxun2 Jul 23, 2023
2feb718
misc: update snapshots
Zxun2 Jul 23, 2023
10b797b
Merge branch 'zongxun/refactor-sessions-table' of https://github.com/…
Zxun2 Jul 23, 2023
c71468a
misc: update SessionsTableHeaderColorScheme to SortableTableColorScheme
Zxun2 Jul 23, 2023
a162d4e
fix: linting
Zxun2 Jul 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public void testAll() {

______TS("verify loaded data");
FeedbackSessionAttributes[] loadedSessions = { openSession, closedSession };
feedbackSessionsPage.sortByCourseId();
Zxun2 marked this conversation as resolved.
Show resolved Hide resolved
feedbackSessionsPage.verifySessionsTable(loadedSessions);

______TS("verify response rate");
Expand Down Expand Up @@ -218,7 +217,6 @@ public void testAll() {
FeedbackSessionAttributes[] sessionsForRestore = { openSession, newSession, closedSession, copiedSession2,
copiedSession };
feedbackSessionsPage.restoreSession(closedSession);

feedbackSessionsPage.verifyStatusMessage("The feedback session has been restored.");
feedbackSessionsPage.sortBySessionsName();
feedbackSessionsPage.verifySessionsTable(sessionsForRestore);
Expand All @@ -229,6 +227,8 @@ public void testAll() {
______TS("permanently delete session");
FeedbackSessionAttributes[] sessionsForDelete = { copiedSession, copiedSession2, closedSession,
openSession };

feedbackSessionsPage.sortBySessionsName();
feedbackSessionsPage.moveToRecycleBin(newSession);
feedbackSessionsPage.deleteSession(newSession);

Expand All @@ -239,8 +239,7 @@ public void testAll() {
verifyAbsentInDatabase(newSession);

______TS("restore all session");
FeedbackSessionAttributes[] sessionsForRestoreAll = { openSession, closedSession, copiedSession2,
copiedSession };
FeedbackSessionAttributes[] sessionsForRestoreAll = { copiedSession, copiedSession2, closedSession, openSession };
feedbackSessionsPage.moveToRecycleBin(copiedSession);
feedbackSessionsPage.moveToRecycleBin(copiedSession2);
feedbackSessionsPage.restoreAllSessions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ public void testAll() {
homePage.sortCoursesByCreationDate();
courseIndex = 1;
otherCourseIndex = 0;
FeedbackSessionAttributes[] otherCourseSessionsWithCopy2 = { copiedSession2, otherCourseSession };
homePage.verifyCourseTabDetails(otherCourseIndex, otherCourse, otherCourseSessionsWithCopy2);
FeedbackSessionAttributes[] otherCourseSessionsWithCopyTwo = { copiedSession2, otherCourseSession };
homePage.verifyCourseTabDetails(otherCourseIndex, otherCourse, otherCourseSessionsWithCopyTwo);
assertNotNull(getSoftDeletedSession(copiedSession.getFeedbackSessionName(),
instructor.getGoogleId()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class InstructorFeedbackSessionsPage extends AppPage {
@FindBy(id = "btn-create-session")
private WebElement createSessionButton;

@FindBy(className = "sessions-table")
@FindBy(id = "sessions-table")
private WebElement sessionsTable;

@FindBy(id = "deleted-sessions-heading")
Expand Down Expand Up @@ -501,6 +501,8 @@ && getFeedbackSessionName(i).equals(sessionName)) {

private int getSoftDeletedFeedbackSessionRowId(String courseId, String sessionName) {
int i = 0;
assertEquals(courseId, getSoftDeletedFeedbackSessionCourseId(i));
assertEquals(sessionName, getSoftDeletedFeedbackSessionName(i));

while (i < getNumSoftDeletedFeedbackSessions()) {
if (getSoftDeletedFeedbackSessionCourseId(i).equals(courseId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private String getCourseDetails(int courseTabIndex) {
}

private WebElement getSessionsTable(int courseTabIndex) {
return getCourseTab(courseTabIndex).findElement(By.className("sessions-table"));
return getCourseTab(courseTabIndex).findElement(By.id("sessions-table-" + courseTabIndex));
}

private String getDateString(Instant instant, String timeZone) {
Expand Down
2 changes: 1 addition & 1 deletion src/e2e/resources/data/InstructorHomePageE2ETest.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"creatorEmail": "IHome.instructor.tmms@gmail.tmt",
"instructions": "Please please fill in the following questions.",
"createdTime": "2012-03-20T23:59:00Z",
"startTime": "2012-03-29T15:00:00Z",
"startTime": "2012-03-29T04:00:00Z",
"endTime": "2012-05-01T04:00:00Z",
"sessionVisibleFromTime": "2012-03-28T16:00:00Z",
"resultsVisibleFromTime": "2012-05-01T16:00:00Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,44 @@ export class ContributionQuestionStatisticsComponent
value: statistics.results[email].claimed,
customComponent: {
component: ContributionComponent,
componentData: { value: statistics.results[email].claimed },
componentData: () => {
return {
value: statistics.results[email].claimed,
};
},
},
},
{
value: statistics.results[email].perceived,
customComponent: {
component: ContributionComponent,
componentData: { value: statistics.results[email].perceived },
componentData: () => {
return {
value: statistics.results[email].perceived,
};
},
},
},
{
value: this.emailToDiff[email],
customComponent: {
component: ContributionComponent,
componentData: { value: this.emailToDiff[email], diffOnly: true },
componentData: () => {
return {
value: this.emailToDiff[email],
diffOnly: true,
};
},
},
},
{
customComponent: {
component: ContributionRatingsListComponent,
componentData: { ratingsList: statistics.results[email].perceivedOthers },
componentData: () => {
return {
ratingsList: statistics.results[email].perceivedOthers,
};
},
},
},
];
Expand Down
Loading
Loading