From 948d53446a9916c46221e22458d14a207924338f Mon Sep 17 00:00:00 2001 From: himaniraghav3 Date: Mon, 19 Jan 2026 14:59:46 +0530 Subject: [PATCH] PM-2394 cleanup looker based user verification --- .../hiring-manager-view/HiringManagerView.tsx | 7 ----- .../UserCertificationViewBase.tsx | 18 ------------ .../lib/profile/profile-functions/index.ts | 1 - .../profile-functions/profile-store/index.ts | 1 - .../profile-store/profile-xhr.store.ts | 7 ----- .../profile-functions/profile.functions.ts | 28 +------------------ 6 files changed, 1 insertion(+), 61 deletions(-) diff --git a/src/apps/learn/src/lib/components/hiring-manager-view/HiringManagerView.tsx b/src/apps/learn/src/lib/components/hiring-manager-view/HiringManagerView.tsx index 1bc295dd1..7e441665b 100644 --- a/src/apps/learn/src/lib/components/hiring-manager-view/HiringManagerView.tsx +++ b/src/apps/learn/src/lib/components/hiring-manager-view/HiringManagerView.tsx @@ -18,7 +18,6 @@ import { DefaultMemberIcon, IconOutline, LinkButton, - VerifiedMemberBadge, } from '~/libs/ui' import { EnvironmentConfig } from '~/config' import { UserProfile } from '~/libs/core' @@ -61,7 +60,6 @@ export interface HiringManagerViewProps { completionUuid?: string isPreview?: boolean isModalView?: boolean - isMemberVerified?: boolean isOwner?: boolean userProfile?: UserProfile userName?: string @@ -182,11 +180,6 @@ const HiringManagerView: FC = (props: HiringManagerViewP

{props.userName}

{props.userProfile.handle}

- { - props.isMemberVerified ? ( - - ) : undefined - }
{props.certification.title}
diff --git a/src/apps/learn/src/tca-certificate/user-certification-view/UserCertificationViewBase.tsx b/src/apps/learn/src/tca-certificate/user-certification-view/UserCertificationViewBase.tsx index c311f07e8..37d68e801 100644 --- a/src/apps/learn/src/tca-certificate/user-certification-view/UserCertificationViewBase.tsx +++ b/src/apps/learn/src/tca-certificate/user-certification-view/UserCertificationViewBase.tsx @@ -1,19 +1,14 @@ import { - Dispatch, FC, MutableRefObject, - SetStateAction, - useEffect, useLayoutEffect, useMemo, useRef, - useState, } from 'react' import { useSearchParams } from 'react-router-dom' import { LoadingSpinner } from '~/libs/ui' import { - getVerificationStatusAsync, UserProfile, } from '~/libs/core' @@ -51,20 +46,8 @@ const UserCertificationViewBase: FC = (props: Us : props.enrollment?.userName ), [props.profile, props.enrollment]) - const [isMemberVerified, setIsMemberVerified]: [boolean, Dispatch>] - = useState(false) - const validationUrl: string = getTCACertificationValidationUrl(props.enrollment?.completionUuid as string) - useEffect(() => { - if (!props.enrollment?.userHandle) { - return - } - - getVerificationStatusAsync(props.enrollment?.userHandle) - .then(verified => setIsMemberVerified(verified)) - }, [props.enrollment]) - useLayoutEffect(() => { const el: HTMLElement = elRef.current if (!el || !isModalView) { @@ -99,7 +82,6 @@ const UserCertificationViewBase: FC = (props: Us certification={props.certification} completedAt={(props.enrollment.completedAt ?? undefined) as string} completionUuid={props.enrollment.completionUuid ?? undefined} - isMemberVerified={isMemberVerified} userProfile={props.profile} userName={userName} isOwner={isOwnProfile} diff --git a/src/libs/core/lib/profile/profile-functions/index.ts b/src/libs/core/lib/profile/profile-functions/index.ts index ed8ec1d6c..8ee213b1c 100644 --- a/src/libs/core/lib/profile/profile-functions/index.ts +++ b/src/libs/core/lib/profile/profile-functions/index.ts @@ -4,7 +4,6 @@ export { getLoggedInAsync as profileGetLoggedInAsync, getMemberStatsAsync, getPublicAsync as profileGetPublicAsync, - getVerificationStatusAsync, editNameAsync as profileEditNameAsync, updatePrimaryMemberRoleAsync, updateMemberEmailPreferencesAsync, diff --git a/src/libs/core/lib/profile/profile-functions/profile-store/index.ts b/src/libs/core/lib/profile/profile-functions/profile-store/index.ts index f74524d04..6210fc38f 100644 --- a/src/libs/core/lib/profile/profile-functions/profile-store/index.ts +++ b/src/libs/core/lib/profile/profile-functions/profile-store/index.ts @@ -2,7 +2,6 @@ export { get as profileStoreGet, patchName as profileStorePatchName, getMemberStats, - getVerification, } from './profile-xhr.store' export { diff --git a/src/libs/core/lib/profile/profile-functions/profile-store/profile-xhr.store.ts b/src/libs/core/lib/profile/profile-functions/profile-store/profile-xhr.store.ts index 452f8c88f..90daffba1 100644 --- a/src/libs/core/lib/profile/profile-functions/profile-store/profile-xhr.store.ts +++ b/src/libs/core/lib/profile/profile-functions/profile-store/profile-xhr.store.ts @@ -9,14 +9,12 @@ import { UserEmailPreferences } from '../../user-email-preference.model' import { UserProfile } from '../../user-profile.model' import { UserStats } from '../../user-stats.model' import { UserTraits } from '../../user-traits.model' -import { UserVerify } from '../../user-verify.model' import { countryLookupURL, memberEmailPreferencesURL, memberModifyURL, profile as profileUrl, - verify as verifyUrl, } from './profile-endpoint.config' export function get(handle: string): Promise { @@ -29,11 +27,6 @@ export function patchName(handle: string, request: EditNameRequest): Promise(profileUrl(handle), request) } -// reads from looker where member verified status is stored -export function getVerification(): Promise { - return xhrGetAsync(verifyUrl()) -} - export function getMemberStats(handle: string): Promise { return xhrGetAsync(`${profileUrl(handle)}/stats`) .then(stats => (!stats.length ? undefined : stats[0])) diff --git a/src/libs/core/lib/profile/profile-functions/profile.functions.ts b/src/libs/core/lib/profile/profile-functions/profile.functions.ts index 581723f3a..b51a1de93 100644 --- a/src/libs/core/lib/profile/profile-functions/profile.functions.ts +++ b/src/libs/core/lib/profile/profile-functions/profile.functions.ts @@ -9,10 +9,9 @@ import { UserEmailPreferences } from '../user-email-preference.model' import { UserProfile } from '../user-profile.model' import { UserStats } from '../user-stats.model' import { UserTrait, UserTraits } from '../user-traits.model' -import { UserVerify } from '../user-verify.model' import { profileFactoryCreate } from './profile-factory' -import { getMemberStats, getVerification, profileStoreGet, profileStorePatchName } from './profile-store' +import { getMemberStats, profileStoreGet, profileStorePatchName } from './profile-store' import { createMemberTraits, deleteMemberTrait, @@ -58,31 +57,6 @@ export async function editNameAsync(handle: string, profile: EditNameRequest): P return profileStorePatchName(handle, profile) } -export async function getVerificationStatusAsync(handle: string): Promise { - - // get verification statuses - // in DEV this looker API is mocked data response - const verfiedMembers: UserVerify[] = await getVerification() - - // filter by member - return verfiedMembers.some(member => { - let isVerified: boolean = false - if (member['user.handle'] && member['user.handle'].toLowerCase() === handle.toLowerCase()) { - isVerified = true - } - - // On DEV we have a mocked data response with silghtly different structure - if ( - member['member_verification_dev.handle'] - && member['member_verification_dev.handle'].toLowerCase() === handle.toLowerCase() - ) { - isVerified = true - } - - return isVerified - }) -} - export async function getMemberStatsAsync(handle: string): Promise { return getMemberStats(handle) }