PromucFlow_constructor/app/client/src/constants/userConstants.ts
Nayan 1296faef8e
feat: [Feature] Use photo asset id instead of email address for profile picture in comments (#7434)
* -set user photo id when adding a new comment thread

* -update user data when users remove their profile photo

* -updated photo id in comments when user changes or set a profile photo

* -remove photoid from thread, kept it in comment only

* -resized uploaded profile image

* -added test for delete profile photo

* -add test for the comment set user photo

* -check user change event handler is called in delete user photo

* -add test for checking user photo change event is triggered after upload photo

* -fixed tests due to changes

* -make profile pictures thumbnail only

* - used get photo by asset id API to show user photo in comment card
- set cache control header in get asset by id API

* - stop using email address to show user photo
2021-09-20 15:03:39 +06:00

34 lines
755 B
TypeScript

export const ANONYMOUS_USERNAME = "anonymousUser";
type Gender = "MALE" | "FEMALE";
export type User = {
email: string;
organizationIds: string[];
username: string;
name: string;
gender: Gender;
emptyInstance?: boolean;
};
export interface UserApplication {
id: string;
name: string;
}
export const CurrentUserDetailsRequestPayload = {
id: "profile",
};
export const DefaultCurrentUserDetails: User = {
name: ANONYMOUS_USERNAME,
email: ANONYMOUS_USERNAME,
organizationIds: [],
username: ANONYMOUS_USERNAME,
gender: "MALE",
};
// 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";