PromucFlow_constructor/app/client/src/constants/userConstants.ts
Ankita Kinger e618c73205
chore: Adding adminSettingsVisible variable in User type (#18961)
adding adminSettingsVisible variable in User type
2022-12-15 11:42:46 +05:30

50 lines
1.1 KiB
TypeScript

export const ANONYMOUS_USERNAME = "anonymousUser";
type Gender = "MALE" | "FEMALE";
export type User = {
email: string;
workspaceIds: string[];
username: string;
name: string;
gender: Gender;
emptyInstance?: boolean;
photoId?: string;
isSuperUser: boolean;
role?: string;
useCase?: string;
isConfigurable: boolean;
enableTelemetry: boolean;
adminSettingsVisible?: boolean;
};
export interface UserApplication {
id: string;
name: string;
}
export const CurrentUserDetailsRequestPayload = {
id: "profile",
};
export const DefaultCurrentUserDetails: User = {
name: ANONYMOUS_USERNAME,
email: ANONYMOUS_USERNAME,
workspaceIds: [],
username: ANONYMOUS_USERNAME,
gender: "MALE",
isSuperUser: false,
isConfigurable: false,
enableTelemetry: false,
adminSettingsVisible: false,
};
// TODO keeping it here instead of the USER_API since it leads to cyclic deps errors during tests
export const USER_PHOTO_URL = "v1/users/photo";
export const USER_PHOTO_ASSET_URL = "v1/assets";
export type UserRoleUsecasePayload = {
role: string;
useCase: string;
};