Skip to content

Member Profiles - BAU Sprint 6 #859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bfb8d00
Hotfix remove ? mark on how skills work
kkartunov Jul 31, 2023
d29dc7a
fix missing human name for UI_PROTOTYPE_COMPETITION
kkartunov Jul 31, 2023
97e0932
TAL-37 - update completeness meter when user update their profiles
vas3a Aug 1, 2023
704a889
MP-317 - trigger profile completeness update on updating skill & work
vas3a Aug 1, 2023
367aa3e
MP-329 - hide "+0 more skills"
vas3a Aug 1, 2023
2fe99fd
Update default prod env value for sprig
vas3a Aug 1, 2023
c8327e2
MP-316 - fix input-select: reposition on visible & fix click outside …
vas3a Aug 1, 2023
475df25
Merge pull request #856 from topcoder-platform/release-hotfixes
vas3a Aug 1, 2023
f1ceab4
MP-332 TCO trip winners
kkartunov Aug 1, 2023
5bdd704
Merge pull request #857 from topcoder-platform/release-hotfixes
kkartunov Aug 1, 2023
bf0ff67
MP-330 - use name from members API if available
vas3a Aug 2, 2023
997b134
Merge pull request #858 from topcoder-platform/MP-330
kkartunov Aug 2, 2023
8568446
MP-316 - allow social links edit
vas3a Aug 1, 2023
e71ed59
remove autofocus
vas3a Aug 2, 2023
8e26ba3
MP-141 fix trait exists errors
kkartunov Aug 2, 2023
e014c69
Merge pull request #861 from topcoder-platform/release-hotfixes
kkartunov Aug 2, 2023
89f6d10
Merge branch 'dev' of github.com:topcoder-platform/platform-ui into M…
vas3a Aug 2, 2023
f976c5d
Merge pull request #860 from topcoder-platform/MP-316_social-links-mo…
vas3a Aug 2, 2023
f678721
MP-336 - fix mobile issues for social links
vas3a Aug 3, 2023
58e683d
Merge pull request #862 from topcoder-platform/MP-336_social-links-mo…
vas3a Aug 3, 2023
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
2 changes: 1 addition & 1 deletion .environments/.env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ REACT_APP_DATADOG_PUBLIC_TOKEN=puba0825671e469d16f940c5a30dc738f11

REACT_APP_MEMBER_VERIFY_LOOKER=3322

REACT_APP_SPRIG_ENV_ID=bUcousVQ0-yF
REACT_APP_SPRIG_ENV_ID=a-IZBZ6-r7bU

# Filestack configuration for uploading Submissions
REACT_APP_FILESTACK_API_KEY=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '~/libs/ui'
import {
updateMemberPasswordAsync,
updateMemberTraitsAsync,
updateOrCreateMemberTraitsAsync,
useMemberTraits,
UserProfile,
UserTrait,
Expand Down Expand Up @@ -69,7 +69,7 @@ const UserAndPassword: FC<UserAndPasswordProps> = (props: UserAndPasswordProps)
}

function handleUserConsentChange(): void {
updateMemberTraitsAsync(props.profile.handle, [{
updateOrCreateMemberTraitsAsync(props.profile.handle, [{
categoryName: 'Personalization',
traitId: 'personalization',
traits: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { bind } from 'lodash'
import { KeyedMutator } from 'swr'
import { toast } from 'react-toastify'

import { updateMemberTraitsAsync, useMemberTraits, UserProfile, UserTraits } from '~/libs/core'
import { updateOrCreateMemberTraitsAsync, useMemberTraits, UserProfile, UserTraits } from '~/libs/core'
import { Button, Collapsible, FormToggleSwitch } from '~/libs/ui'
import { triggerSprigSurvey } from '~/apps/accounts/src/lib'

Expand Down Expand Up @@ -38,7 +38,7 @@ const Communities: FC<CommunitiesProps> = (props: CommunitiesProps) => {
[communityId]: !memberCommunities?.[communityId],
}

updateMemberTraitsAsync(props.profile.handle, [{
updateOrCreateMemberTraitsAsync(props.profile.handle, [{
categoryName: 'Communities',
traitId: 'communities',
traits: {
Expand Down
9 changes: 2 additions & 7 deletions src/apps/accounts/src/settings/tabs/tools/devices/Devices.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { toast } from 'react-toastify'
import classNames from 'classnames'

import {
createMemberTraitsAsync,
updateMemberTraitsAsync,
updateOrCreateMemberTraitsAsync,
useMemberDevicesLookup,
UserProfile,
UserTrait,
Expand All @@ -31,11 +31,6 @@ interface DevicesProps {
profile: UserProfile
}

const methodsMap: { [key: string]: any } = {
create: createMemberTraitsAsync,
update: updateMemberTraitsAsync,
}

const Devices: FC<DevicesProps> = (props: DevicesProps) => {
const formElRef: MutableRefObject<HTMLDivElement | any> = useRef()

Expand Down Expand Up @@ -293,7 +288,7 @@ const Devices: FC<DevicesProps> = (props: DevicesProps) => {
setIsEditMode(false)
})
} else {
methodsMap[!deviceTypesData || !deviceTypesData.length ? 'create' : 'update'](
updateOrCreateMemberTraitsAsync(
props.profile.handle,
[{
categoryName: 'Device',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { bind, isEmpty, reject, trim } from 'lodash'
import { toast } from 'react-toastify'
import classNames from 'classnames'

import { createMemberTraitsAsync, updateMemberTraitsAsync, UserProfile, UserTrait } from '~/libs/core'
import { updateMemberTraitsAsync, updateOrCreateMemberTraitsAsync, UserProfile, UserTrait } from '~/libs/core'
import { Button, Collapsible, ConfirmModal, IconOutline, InputSelect, InputText } from '~/libs/ui'
import {
FinancialInstitutionIcon,
Expand All @@ -23,11 +23,6 @@ interface ServiceProviderProps {
profile: UserProfile
}

const methodsMap: { [key: string]: any } = {
create: createMemberTraitsAsync,
update: updateMemberTraitsAsync,
}

const ServiceProvider: FC<ServiceProviderProps> = (props: ServiceProviderProps) => {
const formElRef: MutableRefObject<HTMLDivElement | any> = useRef()

Expand Down Expand Up @@ -166,7 +161,7 @@ const ServiceProvider: FC<ServiceProviderProps> = (props: ServiceProviderProps)
setIsEditMode(false)
})
} else {
methodsMap[!serviceProviderTypesData || !serviceProviderTypesData.length ? 'create' : 'update'](
updateOrCreateMemberTraitsAsync(
props.profile.handle,
[{
categoryName: 'Service Provider',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { bind, isEmpty, reject, trim } from 'lodash'
import { toast } from 'react-toastify'
import classNames from 'classnames'

import { createMemberTraitsAsync, updateMemberTraitsAsync, UserProfile, UserTrait } from '~/libs/core'
import { updateMemberTraitsAsync, updateOrCreateMemberTraitsAsync, UserProfile, UserTrait } from '~/libs/core'
import { Button, Collapsible, ConfirmModal, IconOutline, InputSelect, InputText } from '~/libs/ui'
import { SettingSection, SoftwareIcon, triggerSprigSurvey } from '~/apps/accounts/src/lib'

Expand All @@ -15,11 +15,6 @@ interface SoftwareProps {
profile: UserProfile
}

const methodsMap: { [key: string]: any } = {
create: createMemberTraitsAsync,
update: updateMemberTraitsAsync,
}

const Software: FC<SoftwareProps> = (props: SoftwareProps) => {
const formElRef: MutableRefObject<HTMLDivElement | any> = useRef()

Expand Down Expand Up @@ -154,7 +149,7 @@ const Software: FC<SoftwareProps> = (props: SoftwareProps) => {
setIsEditMode(false)
})
} else {
methodsMap[!softwareTypesData || !softwareTypesData.length ? 'create' : 'update'](
updateOrCreateMemberTraitsAsync(
props.profile.handle,
[{
categoryName: 'Software',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { bind, isEmpty, reject, trim } from 'lodash'
import { toast } from 'react-toastify'
import classNames from 'classnames'

import { createMemberTraitsAsync, updateMemberTraitsAsync, UserProfile, UserTrait } from '~/libs/core'
import { updateMemberTraitsAsync, updateOrCreateMemberTraitsAsync, UserProfile, UserTrait } from '~/libs/core'
import { Button, Collapsible, ConfirmModal, IconOutline, InputText } from '~/libs/ui'
import { SettingSection, SubscriptionsIcon, triggerSprigSurvey } from '~/apps/accounts/src/lib'

Expand All @@ -14,11 +14,6 @@ interface SubscriptionsProps {
profile: UserProfile
}

const methodsMap: { [key: string]: any } = {
create: createMemberTraitsAsync,
update: updateMemberTraitsAsync,
}

const Subscriptions: FC<SubscriptionsProps> = (props: SubscriptionsProps) => {
const formElRef: MutableRefObject<HTMLDivElement | any> = useRef()

Expand Down Expand Up @@ -139,7 +134,7 @@ const Subscriptions: FC<SubscriptionsProps> = (props: SubscriptionsProps) => {
setIsEditMode(false)
})
} else {
methodsMap[!subscriptionsTypesData || !subscriptionsTypesData.length ? 'create' : 'update'](
updateOrCreateMemberTraitsAsync(
props.profile.handle,
[{
categoryName: 'Subscription',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
SetStateAction,
useEffect,
useLayoutEffect,
useMemo,
useRef,
useState,
} from 'react'
Expand Down Expand Up @@ -44,6 +45,11 @@ const UserCertificationViewBase: FC<UserCertificationViewBaseProps> = (props: Us
const isOwnProfile: boolean = !!props.profile?.email

const isModalView: boolean = queryParams.get('view-style') === 'modal'
const userName = useMemo(() => (
!!(props.profile?.firstName || props.profile?.lastName)
? `${props.profile.firstName} ${props.profile.lastName}`
: props.enrollment?.userName
), [props.profile, props.enrollment])

const [isMemberVerified, setIsMemberVerified]: [boolean, Dispatch<SetStateAction<boolean>>]
= useState<boolean>(false)
Expand Down Expand Up @@ -95,7 +101,7 @@ const UserCertificationViewBase: FC<UserCertificationViewBaseProps> = (props: Us
completionUuid={props.enrollment.completionUuid ?? undefined}
isMemberVerified={isMemberVerified}
userProfile={props.profile}
userName={props.enrollment.userName}
userName={userName}
isOwner={isOwnProfile}
validationUrl={validationUrl}
isPreview={props.isPreview}
Expand Down
2 changes: 2 additions & 0 deletions src/apps/profiles/src/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export function subTrackLabelToHumanName(label: string): string {
return 'Development'
case 'ARCHITECTURE':
return 'Architecture'
case 'UI_PROTOTYPE_COMPETITION':
return 'UI Prototype Competition'

default: return label
}
Expand Down
4 changes: 2 additions & 2 deletions src/apps/profiles/src/member-profile/MemberProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const MemberProfilePage: FC<{}> = () => {
if (routeParams.memberHandle) {
profileGetPublicAsync(routeParams.memberHandle)
.then(userProfile => {
setProfile(userProfile)
setProfile({ ...userProfile } as UserProfile)
setProfileReady(true)
})
// TODO: NOT FOUND PAGE redirect/dispaly
Expand All @@ -41,7 +41,7 @@ const MemberProfilePage: FC<{}> = () => {
const refreshProfile = useCallback((handle: string) => (
profileGetPublicAsync(handle)
.then(userProfile => {
setProfile(userProfile)
setProfile({ ...userProfile } as UserProfile)
if (userProfile) {
notifyUniNavi(userProfile)
triggerSprigSurvey(userProfile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { toast } from 'react-toastify'

import { BaseModal, Button, InputText, InputTextarea } from '~/libs/ui'
import {
createMemberTraitsAsync,
updateMemberProfileAsync,
updateMemberTraitsAsync,
updateOrCreateMemberTraitsAsync,
UserProfile,
UserTrait,
UserTraitCategoryNames,
Expand All @@ -22,11 +21,6 @@ interface ModifyAboutMeModalProps {
memberPersonalizationTraitsData: UserTrait[] | undefined
}

const methodsMap: { [key: string]: any } = {
create: createMemberTraitsAsync,
update: updateMemberTraitsAsync,
}

const ModifyAboutMeModal: FC<ModifyAboutMeModalProps> = (props: ModifyAboutMeModalProps) => {
const [memberTitle, setMemberTitle]: [
string | undefined,
Expand Down Expand Up @@ -79,7 +73,7 @@ const ModifyAboutMeModal: FC<ModifyAboutMeModalProps> = (props: ModifyAboutMeMod
props.profile.handle,
{ description: updatedDescription },
),
methodsMap[!!props.memberPersonalizationTraitsData ? 'update' : 'create'](props.profile.handle, [{
updateOrCreateMemberTraitsAsync(props.profile.handle, [{
categoryName: UserTraitCategoryNames.personalization,
traitId: UserTraitIds.personalization,
traits: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
import { AddButton, EditMemberPropertyBtn, EmptySection } from '../../components'
import { MemberTCAInfo } from '../tca-info'
import { notifyUniNavi, triggerSprigSurvey } from '../../lib'
import { triggerSprigSurvey } from '../../lib'

import { ModifyEducationModal } from './ModifyEducationModal'
import { EducationCard } from './EducationCard'
Expand All @@ -23,6 +23,7 @@ import styles from './EducationAndCertifications.module.scss'
interface EducationAndCertificationsProps {
profile: UserProfile
authProfile: UserProfile | undefined
refreshProfile: (handle: string) => void
}

const EducationAndCertifications: FC<EducationAndCertificationsProps> = (props: EducationAndCertificationsProps) => {
Expand Down Expand Up @@ -70,7 +71,7 @@ const EducationAndCertifications: FC<EducationAndCertificationsProps> = (props:
setTimeout(() => {
setIsEditMode(false)
mutateTraits()
notifyUniNavi(props.profile)
props.refreshProfile(props.profile.handle)
triggerSprigSurvey(props.profile)
}, 1000)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import classNames from 'classnames'

import { BaseModal, Button, IconOutline, InputSelect, InputText } from '~/libs/ui'
import {
createMemberTraitsAsync,
updateMemberTraitsAsync,
updateOrCreateMemberTraitsAsync,
UserProfile,
UserTrait,
UserTraitCategoryNames,
Expand All @@ -25,11 +24,6 @@ interface ModifyEducationModalProps {
education: UserTrait[] | undefined
}

const methodsMap: { [key: string]: any } = {
create: createMemberTraitsAsync,
update: updateMemberTraitsAsync,
}

const years: number[] = range(1979, getYear(new Date()) + 10)
const yearOptions: any = years
.map(v => ({
Expand Down Expand Up @@ -78,7 +72,7 @@ const ModifyEducationModal: FC<ModifyEducationModalProps> = (props: ModifyEducat

setIsSaving(true)

methodsMap[!!props.education ? 'update' : 'create'](props.profile.handle, [{
updateOrCreateMemberTraitsAsync(props.profile.handle, [{
categoryName: UserTraitCategoryNames.education,
traitId: UserTraitIds.education,
traits: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import classNames from 'classnames'

import { BaseModal, Button, IconOutline, InputSelect } from '~/libs/ui'
import {
createMemberTraitsAsync,
updateMemberTraitsAsync,
updateOrCreateMemberTraitsAsync,
UserProfile,
UserTrait,
UserTraitCategoryNames,
Expand All @@ -25,11 +24,6 @@ interface ModifyLanguagesModalProps {
memberLanguages: UserTrait[] | undefined
}

const methodsMap: { [key: string]: any } = {
create: createMemberTraitsAsync,
update: updateMemberTraitsAsync,
}

const ModifyLanguagesModal: FC<ModifyLanguagesModalProps> = (props: ModifyLanguagesModalProps) => {
const formElRef: MutableRefObject<HTMLDivElement | any> = useRef()

Expand Down Expand Up @@ -88,7 +82,7 @@ const ModifyLanguagesModal: FC<ModifyLanguagesModalProps> = (props: ModifyLangua

setIsSaving(true)

methodsMap[!!props.memberLanguages ? 'update' : 'create'](props.profile.handle, [{
updateOrCreateMemberTraitsAsync(props.profile.handle, [{
categoryName: UserTraitCategoryNames.languages,
traitId: UserTraitIds.languages,
traits: {
Expand Down
Loading