fix after merge from master

This commit is contained in:
Peter Holmberg
2018-10-02 13:19:11 +02:00
parent 09b681326e
commit 6d6416c04d
10 changed files with 59 additions and 22 deletions

View File

@@ -6,7 +6,7 @@ const setup = (propOverrides?: object) => {
const props: Props = {
searchQuery: '',
setUsersSearchQuery: jest.fn(),
showInvites: false,
showInvites: jest.fn(),
pendingInvitesCount: 0,
canInvite: false,
externalUserMngLinkUrl: '',

View File

@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { setUsersSearchQuery } from './state/actions';
import { getInviteesCount, getUsersSearchQuery } from './state/selectors';
interface Props {
export interface Props {
searchQuery: string;
setUsersSearchQuery: typeof setUsersSearchQuery;
showInvites: () => void;

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { shallow } from 'enzyme';
import { UsersListPage, Props } from './UsersListPage';
import { Invitee, NavModel, User } from 'app/types';
import { Invitee, NavModel, OrgUser } from 'app/types';
import { getMockUser } from './__mocks__/userMocks';
import appEvents from '../../core/app_events';
@@ -12,7 +12,7 @@ jest.mock('../../core/app_events', () => ({
const setup = (propOverrides?: object) => {
const props: Props = {
navModel: {} as NavModel,
users: [] as User[],
users: [] as OrgUser[],
invitees: [] as Invitee[],
searchQuery: '',
externalUserMngInfo: '',

View File

@@ -5,7 +5,7 @@ import PageHeader from 'app/core/components/PageHeader/PageHeader';
import UsersActionBar from './UsersActionBar';
import UsersTable from 'app/features/users/UsersTable';
import InviteesTable from './InviteesTable';
import { Invitee, NavModel, User } from 'app/types';
import { Invitee, NavModel, OrgUser } from 'app/types';
import appEvents from 'app/core/app_events';
import { loadUsers, loadInvitees, revokeInvite, setUsersSearchQuery, updateUser, removeUser } from './state/actions';
import { getNavModel } from '../../core/selectors/navModel';
@@ -14,7 +14,7 @@ import { getInvitees, getUsers, getUsersSearchQuery } from './state/selectors';
export interface Props {
navModel: NavModel;
invitees: Invitee[];
users: User[];
users: OrgUser[];
searchQuery: string;
externalUserMngInfo: string;
loadUsers: typeof loadUsers;

View File

@@ -1,12 +1,12 @@
import React from 'react';
import { shallow } from 'enzyme';
import UsersTable, { Props } from './UsersTable';
import { User } from 'app/types';
import { OrgUser } from 'app/types';
import { getMockUsers } from './__mocks__/userMocks';
const setup = (propOverrides?: object) => {
const props: Props = {
users: [] as User[],
users: [] as OrgUser[],
onRoleChange: jest.fn(),
onRemoveUser: jest.fn(),
};

View File

@@ -1,10 +1,10 @@
import React, { SFC } from 'react';
import { User } from 'app/types';
import { OrgUser } from 'app/types';
export interface Props {
users: User[];
onRoleChange: (role: string, user: User) => void;
onRemoveUser: (user: User) => void;
users: OrgUser[];
onRoleChange: (role: string, user: OrgUser) => void;
onRemoveUser: (user: OrgUser) => void;
}
const UsersTable: SFC<Props> = props => {

View File

@@ -1,7 +1,7 @@
import { ThunkAction } from 'redux-thunk';
import { StoreState } from '../../../types';
import { getBackendSrv } from '../../../core/services/backend_srv';
import { Invitee, User } from 'app/types';
import { Invitee, OrgUser } from 'app/types';
export enum ActionTypes {
LoadUsers = 'LOAD_USERS',
@@ -11,7 +11,7 @@ export enum ActionTypes {
export interface LoadUsersAction {
type: ActionTypes.LoadUsers;
payload: User[];
payload: OrgUser[];
}
export interface LoadInviteesAction {
@@ -24,7 +24,7 @@ export interface SetUsersSearchQueryAction {
payload: string;
}
const usersLoaded = (users: User[]): LoadUsersAction => ({
const usersLoaded = (users: OrgUser[]): LoadUsersAction => ({
type: ActionTypes.LoadUsers,
payload: users,
});
@@ -57,7 +57,7 @@ export function loadInvitees(): ThunkResult<void> {
};
}
export function updateUser(user: User): ThunkResult<void> {
export function updateUser(user: OrgUser): ThunkResult<void> {
return async dispatch => {
await getBackendSrv().patch(`/api/org/users/${user.userId}`, user);
dispatch(loadUsers());

View File

@@ -1,10 +1,10 @@
import { Invitee, User, UsersState } from 'app/types';
import { Invitee, OrgUser, UsersState } from 'app/types';
import { Action, ActionTypes } from './actions';
import config from '../../../core/config';
export const initialState: UsersState = {
invitees: [] as Invitee[],
users: [] as User[],
users: [] as OrgUser[],
searchQuery: '',
canInvite: !config.disableLoginForm && !config.externalUserMngLinkName,
externalUserMngInfo: config.externalUserMngInfo,