mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
AccessControl: Pass current org id to UsersTable (#49584)
* Pass current org id to UsersTable * Mock contextSrv and update snapshot
This commit is contained in:
parent
1796a1d277
commit
ef6b53ed23
@ -197,7 +197,7 @@ exports[`no enzyme tests`] = {
|
||||
"public/app/features/teams/TeamSettings.test.tsx:2043271249": [
|
||||
[0, 19, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"public/app/features/users/UsersListPage.test.tsx:3908145117": [
|
||||
"public/app/features/users/UsersListPage.test.tsx:2518052139": [
|
||||
[0, 19, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"public/app/features/users/UsersTable.test.tsx:263958312": [
|
||||
|
@ -12,6 +12,12 @@ jest.mock('../../core/app_events', () => ({
|
||||
emit: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.mock('app/core/services/context_srv', () => ({
|
||||
contextSrv: {
|
||||
user: { orgId: 1 },
|
||||
},
|
||||
}));
|
||||
|
||||
const setup = (propOverrides?: object) => {
|
||||
const props: Props = {
|
||||
navModel: {
|
||||
|
@ -5,6 +5,7 @@ import { renderMarkdown } from '@grafana/data';
|
||||
import { HorizontalGroup, Pagination, VerticalGroup } from '@grafana/ui';
|
||||
import Page from 'app/core/components/Page/Page';
|
||||
import { getNavModel } from 'app/core/selectors/navModel';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { OrgUser, OrgRole, StoreState } from 'app/types';
|
||||
|
||||
import InviteesTable from '../invites/InviteesTable';
|
||||
@ -106,6 +107,7 @@ export class UsersListPage extends PureComponent<Props, State> {
|
||||
<VerticalGroup spacing="md">
|
||||
<UsersTable
|
||||
users={paginatedUsers}
|
||||
orgId={contextSrv.user.orgId}
|
||||
onRoleChange={(role, user) => this.onRoleChange(role, user)}
|
||||
onRemoveUser={(user) => this.props.removeUser(user.userId)}
|
||||
/>
|
||||
|
@ -26,6 +26,7 @@ exports[`Render should render List page 1`] = `
|
||||
<UsersTable
|
||||
onRemoveUser={[Function]}
|
||||
onRoleChange={[Function]}
|
||||
orgId={1}
|
||||
users={Array []}
|
||||
/>
|
||||
<HorizontalGroup
|
||||
|
Loading…
Reference in New Issue
Block a user