Skip to content

Commit

Permalink
feat: add the new api to the profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
iso9000t committed Jan 14, 2025
1 parent db6a489 commit 03aaaf8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const makeOptions = (isAdmin, projectKey, { organizationSlug, projectSlug
email: option.email || '',
disabled: isAssignedProject,
isAssigned: isAssignedProject,
userAvatar: URLS.dataUserPhoto(projectKey, isAdmin ? option.userId : option.login, true),
userAvatar: URLS.userAvatar(isAdmin ? option.userId : option.login, true),
assignedProjects: option.assignedProjects || {},
assignedOrganizations: option.assignedOrganizations || {},
userRole: option.userRole,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const messages = defineMessages({
@connect(
(state) => ({
userId: userInfoSelector(state).userId,
currentUserId: userInfoSelector(state).id,
accountType: userInfoSelector(state).accountType,
isDemoInstance: isDemoInstanceSelector(state),
}),
Expand All @@ -96,6 +97,7 @@ const messages = defineMessages({
export class PersonalInfoBlock extends Component {
static propTypes = {
userId: PropTypes.string,
currentUserId: PropTypes.number,
accountType: PropTypes.string,
intl: PropTypes.object.isRequired,
showModalAction: PropTypes.func.isRequired,
Expand All @@ -109,14 +111,16 @@ export class PersonalInfoBlock extends Component {
};
static defaultProps = {
userId: '',
currentUserId: null,
accountType: '',
isDemoInstance: false,
};

state = {
avatarSource: URLS.dataPhoto(),
avatarSource: URLS.userAvatar(this.props.currentUserId, false),
forceUpdateInProgress: false,
};

onChangePassword = () => {
this.props.tracking.trackEvent(PROFILE_PAGE_EVENTS.CHANGE_PASSWORD_CLICK);
this.props.showModalAction({
Expand Down Expand Up @@ -158,7 +162,6 @@ export class PersonalInfoBlock extends Component {
if (accountType === UPSA) {
return 'epam';
}

return accountType.toLowerCase();
};

Expand All @@ -180,9 +183,11 @@ export class PersonalInfoBlock extends Component {
});
});
};

uploadNewImage = (image) => {
this.setState({ avatarSource: image });
};

removeImage = () => {
this.setState({ avatarSource: URLS.dataPhoto(Date.now()) });
};
Expand Down

0 comments on commit 03aaaf8

Please sign in to comment.