Skip to content
Merged
Changes from all commits
Commits
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
@@ -1,6 +1,6 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2025 DBeaver Corp and others
* Copyright (C) 2020-2026 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
Expand All @@ -24,10 +24,10 @@
update: () => void;
}

export function useUsersTable(filters: IUserFilters) {

Check warning on line 27 in webapp/packages/plugin-authentication-administration/src/Administration/Users/UsersTable/useUsersTable.tsx

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Missing return type on function
const usersResource = useService(UsersResource);
const searchFilter = filters.search.trim().toLowerCase();
const enabledStateFilter = filters.status === 'true' ? true : filters.status === 'false' ? false : undefined;

Check warning on line 30 in webapp/packages/plugin-authentication-administration/src/Administration/Users/UsersTable/useUsersTable.tsx

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Do not nest ternary expressions
const pagination = useOffsetPagination(UsersResource, {
key: UsersResourceFilterKey(searchFilter, enabledStateFilter),
});
Expand All @@ -42,12 +42,12 @@
return pagination.hasNextPage;
},
get users() {
usersLoader.data; // triggers suspense, behaves differently than forceSuspense action cause used on the getter level

Check warning on line 45 in webapp/packages/plugin-authentication-administration/src/Administration/Users/UsersTable/useUsersTable.tsx

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Expected an assignment or function call and instead saw an expression

return filters.filterUsers(
Array.from(
new Set([
...this.usersLoader.resource.get(UsersResourceFilterKey(searchFilter, enabledStateFilter)),
...(this.searchFilter ? this.usersLoader.resource.get(UsersResourceFilterKey(this.searchFilter, this.enabledStateFilter)) : []),
...usersResource.get(pagination.allPages),
]),
)
Expand All @@ -69,13 +69,15 @@
},
}),
{
searchFilter: observable.ref,
enabledStateFilter: observable.ref,
usersLoader: observable.ref,
loadableState: observable.ref,
users: computed<AdminUser[]>({ equals: (first, second) => isArraysEqual(first, second, undefined, true) }),
update: action.bound,
loadMore: action.bound,
},
{ usersLoader, loadableState: usersLoader },
{ searchFilter, enabledStateFilter, usersLoader, loadableState: usersLoader },
);

return state;
Expand Down
Loading