PromucFlow_constructor/app/client/src/constants/userConstants.ts

51 lines
1.1 KiB
TypeScript
Raw Normal View History

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;
fix: fix usage pulse fallback (#21735) ## Description Added a fallback value (crypto.randomUUID) when there is an issue with generating the key from segment Fixes #https://github.com/appsmithorg/cloud-services/issues/582 Fixes #https://github.com/appsmithorg/cloud-services/issues/583 ## Type of change - Bug fix (non-breaking change which fixes an issue) - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? - Manual - Cypress ### Test Plan > Add Testsmith test cases links that relate to this PR ### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: balajisoundar <balaji@appsmith.com>
2023-04-06 12:21:58 +00:00
isAnonymous?: boolean;
};
2020-01-03 08:49:47 +00:00
export interface UserApplication {
id: string;
name: string;
}
2020-01-03 08:49:47 +00:00
export const CurrentUserDetailsRequestPayload = {
id: "profile",
2020-01-03 08:49:47 +00:00
};
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;
};