fix(console): reduce initial load time (#8273)

This reduces the initial payload of the `listMyProjectOrgs` to get the
active org by setting the limit of the initial orgs to 100.

Partial of #8272

---------

Co-authored-by: Livio Spring <[email protected]>
This commit is contained in:
Max Peintner
2024-07-22 14:18:26 +00:00
committed by GitHub
co-authored by Livio Spring
parent 0e99c8356a
commit 215dbf0cf6
5 changed files with 61 additions and 45 deletions
@@ -26,6 +26,8 @@ export enum UserTarget {
EXTERNAL = 'external',
}
const USER_LIMIT = 25;
@Component({
selector: 'cnsl-search-user-autocomplete',
templateUrl: './search-user-autocomplete.component.html',
@@ -67,9 +69,9 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
// feat-3916 show users as soon as I am in the input field of the user
const query = new SearchQuery();
const lnQuery = new LoginNameQuery();
lnQuery.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE);
lnQuery.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE);
query.setLoginNameQuery(lnQuery);
this.userService.listUsers(10, 0, [query]).then((users) => {
this.userService.listUsers(USER_LIMIT, 0, [query]).then((users) => {
this.filteredUsers = users.resultList;
});
@@ -97,7 +99,7 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
query.setLoginNameQuery(lnQuery);
if (this.target === UserTarget.SELF) {
return from(this.userService.listUsers(10, 0, [query]));
return from(this.userService.listUsers(USER_LIMIT, 0, [query]));
} else {
return of();
}