mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ServiceAccount: Add pagination to service accout table (#77044)
* Add pagination to service account table
This commit is contained in:
parent
00c9981c51
commit
b156267e39
@ -16,6 +16,7 @@ jest.mock('app/core/core', () => ({
|
||||
}));
|
||||
|
||||
const setup = (propOverrides: Partial<Props>) => {
|
||||
const changePageMock = jest.fn();
|
||||
const changeQueryMock = jest.fn();
|
||||
const fetchACOptionsMock = jest.fn();
|
||||
const fetchServiceAccountsMock = jest.fn();
|
||||
@ -33,6 +34,7 @@ const setup = (propOverrides: Partial<Props>) => {
|
||||
showPaging: false,
|
||||
totalPages: 1,
|
||||
serviceAccounts: [],
|
||||
changePage: changePageMock,
|
||||
changeQuery: changeQueryMock,
|
||||
fetchACOptions: fetchACOptionsMock,
|
||||
fetchServiceAccounts: fetchServiceAccountsMock,
|
||||
|
@ -4,7 +4,16 @@ import React, { useEffect, useState } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { GrafanaTheme2, OrgRole } from '@grafana/data';
|
||||
import { ConfirmModal, FilterInput, LinkButton, RadioButtonGroup, useStyles2, InlineField } from '@grafana/ui';
|
||||
import {
|
||||
ConfirmModal,
|
||||
FilterInput,
|
||||
LinkButton,
|
||||
RadioButtonGroup,
|
||||
useStyles2,
|
||||
InlineField,
|
||||
Pagination,
|
||||
} from '@grafana/ui';
|
||||
import { Flex } from '@grafana/ui/src/unstable';
|
||||
import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
import PageLoader from 'app/core/components/PageLoader/PageLoader';
|
||||
@ -15,6 +24,7 @@ import { CreateTokenModal, ServiceAccountToken } from './components/CreateTokenM
|
||||
import ServiceAccountListItem from './components/ServiceAccountsListItem';
|
||||
import {
|
||||
changeQuery,
|
||||
changePage,
|
||||
fetchACOptions,
|
||||
fetchServiceAccounts,
|
||||
deleteServiceAccount,
|
||||
@ -34,6 +44,7 @@ function mapStateToProps(state: StoreState) {
|
||||
}
|
||||
|
||||
const mapDispatchToProps = {
|
||||
changePage,
|
||||
changeQuery,
|
||||
fetchACOptions,
|
||||
fetchServiceAccounts,
|
||||
@ -46,6 +57,9 @@ const mapDispatchToProps = {
|
||||
const connector = connect(mapStateToProps, mapDispatchToProps);
|
||||
|
||||
export const ServiceAccountsListPageUnconnected = ({
|
||||
page,
|
||||
changePage,
|
||||
totalPages,
|
||||
serviceAccounts,
|
||||
isLoading,
|
||||
roleOptions,
|
||||
@ -238,6 +252,10 @@ export const ServiceAccountsListPageUnconnected = ({
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<Flex justifyContent="flex-end">
|
||||
<Pagination hideWhenSinglePage currentPage={page} numberOfPages={totalPages} onNavigate={changePage} />
|
||||
</Flex>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user