2021-04-14 16:52:15 +00:00
|
|
|
import PropTypes from "prop-types";
|
|
|
|
|
import teamInterface, { ITeam } from "./team";
|
2016-10-21 23:13:41 +00:00
|
|
|
|
|
|
|
|
export default PropTypes.shape({
|
2021-08-16 14:30:19 +00:00
|
|
|
created_at: PropTypes.string,
|
|
|
|
|
updated_at: PropTypes.string,
|
|
|
|
|
id: PropTypes.number,
|
|
|
|
|
name: PropTypes.string,
|
2016-10-21 23:13:41 +00:00
|
|
|
email: PropTypes.string,
|
2021-10-26 14:24:16 +00:00
|
|
|
role: PropTypes.string,
|
2016-10-21 23:13:41 +00:00
|
|
|
force_password_reset: PropTypes.bool,
|
2021-04-29 13:47:33 +00:00
|
|
|
gravatar_url: PropTypes.string,
|
|
|
|
|
sso_enabled: PropTypes.bool,
|
2021-08-16 14:30:19 +00:00
|
|
|
global_role: PropTypes.string,
|
|
|
|
|
api_only: PropTypes.bool,
|
2021-04-09 10:44:57 +00:00
|
|
|
teams: PropTypes.arrayOf(teamInterface),
|
2016-10-21 23:13:41 +00:00
|
|
|
});
|
2021-03-24 13:18:56 +00:00
|
|
|
|
|
|
|
|
export interface IUser {
|
2021-08-16 14:30:19 +00:00
|
|
|
created_at?: string;
|
|
|
|
|
updated_at?: string;
|
|
|
|
|
id: number;
|
|
|
|
|
name: string;
|
2021-04-14 16:52:15 +00:00
|
|
|
email: string;
|
2021-10-26 14:24:16 +00:00
|
|
|
role: string;
|
2021-04-14 16:52:15 +00:00
|
|
|
force_password_reset: boolean;
|
2021-04-29 13:47:33 +00:00
|
|
|
gravatar_url: string;
|
2022-03-03 22:05:54 +00:00
|
|
|
gravatarURL?: string; // Remove when CoreLayout.jsx is refactored to Typescript (it's adding this property to User)
|
2021-04-29 13:47:33 +00:00
|
|
|
sso_enabled: boolean;
|
2021-08-16 14:30:19 +00:00
|
|
|
global_role: string | null;
|
|
|
|
|
api_only: boolean;
|
2021-04-09 10:44:57 +00:00
|
|
|
teams: ITeam[];
|
2021-04-29 13:47:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The shape of the request body when updating a user.
|
|
|
|
|
*/
|
|
|
|
|
export interface IUserUpdateBody {
|
|
|
|
|
global_role?: string | null;
|
|
|
|
|
teams?: ITeam[];
|
|
|
|
|
name?: string;
|
|
|
|
|
email?: string;
|
|
|
|
|
sso_enabled?: boolean;
|
2021-03-24 13:18:56 +00:00
|
|
|
}
|
2021-10-26 14:24:16 +00:00
|
|
|
|
|
|
|
|
export interface IUserFormErrors {
|
2022-03-01 18:28:51 +00:00
|
|
|
email?: string | null;
|
|
|
|
|
name?: string | null;
|
|
|
|
|
password?: string | null;
|
|
|
|
|
sso_enabled?: boolean | null;
|
2021-10-26 14:24:16 +00:00
|
|
|
}
|
2022-01-13 23:11:45 +00:00
|
|
|
|
|
|
|
|
export interface ICreateUserFormData {
|
|
|
|
|
email: string;
|
|
|
|
|
global_role: string | null;
|
|
|
|
|
name: string;
|
|
|
|
|
password?: string | null;
|
|
|
|
|
sso_enabled?: boolean | undefined;
|
|
|
|
|
teams: ITeam[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IUpdateUserFormData {
|
|
|
|
|
currentUserId?: number;
|
|
|
|
|
email?: string;
|
|
|
|
|
global_role?: string | null;
|
|
|
|
|
name?: string;
|
|
|
|
|
password?: string | null;
|
|
|
|
|
sso_enabled?: boolean;
|
|
|
|
|
teams?: ITeam[];
|
|
|
|
|
}
|
2022-04-01 06:42:26 +00:00
|
|
|
|
|
|
|
|
export interface ICreateUserWithInvitationFormData {
|
|
|
|
|
email: string;
|
|
|
|
|
invite_token: string;
|
|
|
|
|
name: string;
|
|
|
|
|
password: string;
|
|
|
|
|
password_confirmation: string;
|
|
|
|
|
}
|