Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const ProfilePageLayout: FC<ProfilePageLayoutProps> = (props: ProfilePageLayoutP
const isAdminOrTM = props.authProfile?.roles?.includes(UserRole.administrator)
|| props.authProfile?.roles?.includes(UserRole.talentManager)

const canSeeProfileCompleteness = props.authProfile?.handle === props.profile.handle || isAdminOrTM
const isSelf = props.authProfile?.handle === props.profile.handle

const canSeeProfileCompleteness = isSelf || isAdminOrTM

const [isDownloading, setIsDownloading]: [boolean, Dispatch<SetStateAction<boolean>>]
= useState<boolean>(false)
Expand Down Expand Up @@ -124,8 +126,8 @@ const ProfilePageLayout: FC<ProfilePageLayoutProps> = (props: ProfilePageLayoutP
{canSeeProfileCompleteness && (
<ProfileCompleteness
profile={props.profile}
authProfile={props.authProfile}
isAdminOrTM={isAdminOrTM}
isSelf={isSelf}
/>
)}
<div className={styles.sectionWrap}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import styles from './ProfileCompleteness.module.scss'

interface ProfileCompletenessProps {
profile: UserProfile
authProfile: UserProfile | undefined
isAdminOrTM?: boolean
isSelf: boolean
}

const ProfileCompleteness: FC<ProfileCompletenessProps> = props => {
Expand All @@ -17,9 +17,7 @@ const ProfileCompleteness: FC<ProfileCompletenessProps> = props => {
const isLoading = completeness.isLoading
const isCompleted = completed === 100

const isCustomer = props.authProfile?.roles.some(r => r.indexOf(' Customer') > -1)

const hideCompletenessMeter = isLoading || isCompleted || isCustomer
const hideCompletenessMeter = isLoading || isCompleted
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[❗❗ correctness]
The removal of the isCustomer check from the hideCompletenessMeter condition changes the behavior of the component. Ensure that this change aligns with the intended functionality, as it will now display the completeness meter for users previously identified as customers.


useEffect(() => { completeness?.mutate() }, [props.profile])

Expand All @@ -43,7 +41,7 @@ const ProfileCompleteness: FC<ProfileCompletenessProps> = props => {
<div className={styles.wrap}>
<strong>Profile: </strong>
{`${completed}% Complete`}
{!props.isAdminOrTM
{props.isSelf
&& (
<div>
<small>
Expand All @@ -59,7 +57,7 @@ const ProfileCompleteness: FC<ProfileCompletenessProps> = props => {
</small>
</div>
)}
{props.isAdminOrTM
{props.isAdminOrTM && !props.isSelf
Comment thread
himaniraghav3 marked this conversation as resolved.
&& (
<div>
<small>
Expand Down
Loading