Searchable service accounts (#45844)

* WIP

* draft of WIP

* feat: search and filtering works 🌈

* Update pkg/models/org_user.go

* Apply suggestions from code review

* refactor: remove unsed function

* refactor: formatting

* Apply suggestions from code review

Co-authored-by: J Guerreiro <joao.guerreiro@grafana.com>

* WIP

* comment

* Update public/app/features/serviceaccounts/ServiceAccountsListPage.tsx

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* review comments

* wip

* working search and initial load of service accounts

* number of tokens working

* removed api call

* Apply suggestions from code review

* added accescontrol param

* accesscontrol prefix corrected

Co-authored-by: J Guerreiro <joao.guerreiro@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
This commit is contained in:
Eric Leijonmarck
2022-03-04 12:04:07 +01:00
committed by GitHub
parent 45e4611807
commit 3d168eb34b
10 changed files with 354 additions and 90 deletions

View File

@@ -1,4 +1,4 @@
import { WithAccessControlMetadata } from '@grafana/data';
import { SelectableValue, WithAccessControlMetadata } from '@grafana/data';
import { ApiKey, OrgRole, Role } from '.';
export interface OrgServiceAccount extends WithAccessControlMetadata {
@@ -43,12 +43,19 @@ export interface ServiceAccountProfileState {
tokens: ApiKey[];
}
export type ServiceAccountFilter = Record<string, string | boolean | SelectableValue[]>;
export interface ServiceAccountsState {
serviceAccounts: ServiceAccountDTO[];
searchQuery: string;
searchPage: number;
isLoading: boolean;
roleOptions: Role[];
serviceAccountToRemove: ServiceAccountDTO | null;
builtInRoles: Record<string, Role[]>;
// search / filtering
query: string;
perPage: number;
page: number;
totalPages: number;
showPaging: boolean;
filters: ServiceAccountFilter[];
}