mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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": [
|
"public/app/features/teams/TeamSettings.test.tsx:2043271249": [
|
||||||
[0, 19, 13, "RegExp match", "2409514259"]
|
[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"]
|
[0, 19, 13, "RegExp match", "2409514259"]
|
||||||
],
|
],
|
||||||
"public/app/features/users/UsersTable.test.tsx:263958312": [
|
"public/app/features/users/UsersTable.test.tsx:263958312": [
|
||||||
|
@ -12,6 +12,12 @@ jest.mock('../../core/app_events', () => ({
|
|||||||
emit: jest.fn(),
|
emit: jest.fn(),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
jest.mock('app/core/services/context_srv', () => ({
|
||||||
|
contextSrv: {
|
||||||
|
user: { orgId: 1 },
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
const setup = (propOverrides?: object) => {
|
const setup = (propOverrides?: object) => {
|
||||||
const props: Props = {
|
const props: Props = {
|
||||||
navModel: {
|
navModel: {
|
||||||
|
@ -5,6 +5,7 @@ import { renderMarkdown } from '@grafana/data';
|
|||||||
import { HorizontalGroup, Pagination, VerticalGroup } from '@grafana/ui';
|
import { HorizontalGroup, Pagination, VerticalGroup } from '@grafana/ui';
|
||||||
import Page from 'app/core/components/Page/Page';
|
import Page from 'app/core/components/Page/Page';
|
||||||
import { getNavModel } from 'app/core/selectors/navModel';
|
import { getNavModel } from 'app/core/selectors/navModel';
|
||||||
|
import { contextSrv } from 'app/core/services/context_srv';
|
||||||
import { OrgUser, OrgRole, StoreState } from 'app/types';
|
import { OrgUser, OrgRole, StoreState } from 'app/types';
|
||||||
|
|
||||||
import InviteesTable from '../invites/InviteesTable';
|
import InviteesTable from '../invites/InviteesTable';
|
||||||
@ -106,6 +107,7 @@ export class UsersListPage extends PureComponent<Props, State> {
|
|||||||
<VerticalGroup spacing="md">
|
<VerticalGroup spacing="md">
|
||||||
<UsersTable
|
<UsersTable
|
||||||
users={paginatedUsers}
|
users={paginatedUsers}
|
||||||
|
orgId={contextSrv.user.orgId}
|
||||||
onRoleChange={(role, user) => this.onRoleChange(role, user)}
|
onRoleChange={(role, user) => this.onRoleChange(role, user)}
|
||||||
onRemoveUser={(user) => this.props.removeUser(user.userId)}
|
onRemoveUser={(user) => this.props.removeUser(user.userId)}
|
||||||
/>
|
/>
|
||||||
|
@ -26,6 +26,7 @@ exports[`Render should render List page 1`] = `
|
|||||||
<UsersTable
|
<UsersTable
|
||||||
onRemoveUser={[Function]}
|
onRemoveUser={[Function]}
|
||||||
onRoleChange={[Function]}
|
onRoleChange={[Function]}
|
||||||
|
orgId={1}
|
||||||
users={Array []}
|
users={Array []}
|
||||||
/>
|
/>
|
||||||
<HorizontalGroup
|
<HorizontalGroup
|
||||||
|
Loading…
Reference in New Issue
Block a user