-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[#11302] Increase search result limit with message prompt when limit is reached #11324
[#11302] Increase search result limit with message prompt when limit is reached #11324
Conversation
I'm OK with the proposed UX |
Hello! Is anyone able to advice on the updating of snapshot tests? I've followed the official jest documentation and tried the following 2 commands:
Both commands however produce an error of the following form for all 249 test cases (all failed to run):
Thus far, I have tried updating |
@TEAMMATES/active-mentors any help? |
Hey @tjtanjin! I usually do Hope this helps! |
@samuelfangjw Your suggestion helped, thank you! :) |
Hi @tjtanjin let us know once the PR is ready for review, thanks! |
Hi @jianhandev the PR is ready for review! |
@tjtanjin seems like there are some merge conflicts,can you resolve them first? thanks |
Guys, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
@daongochieu2810 @jianhandev For your kind review. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, just some clarification here
@tjtanjin can you create more data so that the search will return 50 or more results? so that we know it works as intended |
Hi! Here's a video showing the search return for 50 or more results: Screen.Recording.2021-08-23.at.9.08.55.PM.mov |
src/web/app/pages-admin/admin-search-page/admin-search-page.component.ts
Outdated
Show resolved
Hide resolved
…tanjin/teammates into increase-search-results-limit
src/web/app/pages-admin/admin-search-page/admin-search-page.component.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @wkurniawan07 @rrtheonlyone for your inputs. @tjtanjin moving forward, perhaps you can:
|
Guys, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
@tjtanjin Hi, any updates for this PR? |
…tructor and student search
…tanjin/teammates into increase-search-results-limit
@t-cheepeng @jianhandev @moziliar Apologies for the late update, I have committed changes based on given suggestions, kindly advice if the changes are appropriate. Thank you! |
src/web/app/pages-admin/admin-search-page/admin-search-page.component.ts
Outdated
Show resolved
Hide resolved
src/web/app/pages-admin/admin-search-page/admin-search-page.component.ts
Outdated
Show resolved
Hide resolved
@wkurniawan07 Thank you for the suggestions, I have made the changes accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok to accept the PR as is, but I'll leave behind a suggestion
} else if (this.students.length >= ApiConst.SEARCH_QUERY_SIZE_LIMIT) { | ||
this.statusMessageService.showWarningToast(`${ApiConst.SEARCH_QUERY_SIZE_LIMIT} student results | ||
${searchResultsLimitReached}`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's how I'm going to refactor this part:
const limit: number = ApiConst.SEARCH_QUERY_SIZE_LIMIT;
const limitsReached: string[] = [];
if (this.students.length >= limit) {
limitsReached.push(`${limit} student results`);
}
if (this.instructors.length >= limit) {
limitsReached.push(`${limit} instructor results`);
}
if (limitsReached.length) {
this.statusMessageService.showWarningToast(`${limitsReached.join(' and ')} have been shown on this page
but there may be more results not shown. Consider searching with more specific terms.`);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the code according to your suggestion, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes seem fine, all comments so far addressed
Fixes #11302
Outline of Solution
An example of how it would look like for a testing limit of 2 (instead of 50) is shown below for the admin search (the same behaviour is implemented for instructor search):