-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[AC-2559] - BUG - Refactor members search observable chains #9230
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9230 +/- ##
=======================================
Coverage 28.15% 28.15%
=======================================
Files 2372 2372
Lines 70068 70063 -5
Branches 13149 13149
=======================================
Hits 19729 19729
+ Misses 48775 48770 -5
Partials 1564 1564 ☔ View full report in Codecov by Sentry. |
No New Or Fixed Issues Found |
apps/web/src/app/admin-console/organizations/members/people.component.html
Outdated
Show resolved
Hide resolved
this.resetPaging(); | ||
} | ||
return !isSearching && this.users && this.users.length > this.pageSize; | ||
}), |
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 concerned here we have 3 other variables that affect this callback, but because it's now an observable, it's only going to be recalculated when isSearching
emits.
Thinking aloud here, those other variables are:
this.users
- part of this logic is that the component is paging whenthis.users.length
exceeds the pre-set page size.this.users.length
can change independent ofisSearching$
, so I think this needs to be an observable that can be combined withisSearching$
.this.didScroll
- the logic here seems to be, "if you scrolled down enough to get the next page of results, and then you search, reset the paging". I think that's still OK, because it's not actually triggered by a change indidScroll
- it's more like a record of what the user's already done. So I think we can leave that.this.pageSize
- this is a constant which will never change, so it's fine
I'm not super familiar with this paging logic (really it should be replaced by infinite scroll) but this seems like a potential gotcha that I want to make sure we think about.
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.
Thanks for syncing on this! Where we landed was that this is fine for now, and I've created AC-2673 to remove the old paging logic.
* fix: update observable chains for search, refs AC-2559 * fix: remove comment, reorganize variables, refs AC-2559 * chore: remove ngOnInit from base people component, refs AC-2559 * chore: remove async declaration from resetPaging, refs AC-2559 * chore: replace bit-search ngmodel with formControl, refs AC-2559 * chore: move destroy pattern out of base class, refs AC-2559 * fix: remove ngOnDestroy super call, refs AC-2559 * Improve performance issues --------- Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Co-authored-by: Thomas Rittson <trittson@bitwarden.com> (cherry picked from commit 8335d8f)
Type of change
Objective
Code changes
apps/web/src/app/admin-console/common/base.people.component.ts
searchText
trackingFormControl
for search text manipulation and information bindingisPaging
into one of the above mentioned observablesapps/web/src/app/admin-console/organizations/members/people.component.html
searchText
references to take either the control or the read-only valueisPaging
method calls with the new observable, retrieving data via the async pipeapps/web/src/app/admin-console/organizations/members/people.component.ts
search
text is availablebitwarden_license/bit-web/src/app/admin-console/providers/manage/people.component.html
searchText
references to take either the control or the read-only valueisPaging
method calls with the new observable, retrieving data via the async pipebitwarden_license/bit-web/src/app/admin-console/providers/manage/people.component.ts
search
text is availableScreenshots
Screen.Recording.2024-05-16.at.9.15.12.PM.mov
Before you submit