Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
670fdf0
Initial AI ratings implementation
jmgasper Jun 4, 2026
6241f8e
Update to ratings shown on profile page and expose new AI Exponential…
jmgasper Jun 4, 2026
15b41e6
Deploy branch
jmgasper Jun 4, 2026
c1ac650
Points tracking, processing, and display on profile.
jmgasper Jun 4, 2026
22dce22
More profile updates
jmgasper Jun 4, 2026
53d7dbd
UI fixes for bugs noted
jmgasper Jun 4, 2026
96e2d30
Tweaks for roles and engagement availability selection
jmgasper Jun 5, 2026
601919c
PM-5261: Keep rating position details together
jmgasper Jun 5, 2026
1328d48
PM-5260: Fix rating popup typography
jmgasper Jun 5, 2026
323ef4a
PM-5258: Format award badge tooltips
jmgasper Jun 5, 2026
a4bd63a
PM-5257: Align mobile rating card data
jmgasper Jun 5, 2026
951c930
PM-5253: Fix rating card typography
jmgasper Jun 5, 2026
75cc78d
PM-5227: tighten profile preferred-role display
jmgasper Jun 5, 2026
e3f3e52
Merge pull request #1900 from topcoder-platform/PM-5261-1
jmgasper Jun 5, 2026
35b4456
Merge pull request #1901 from topcoder-platform/PM-5260
jmgasper Jun 5, 2026
e88f049
Merge pull request #1902 from topcoder-platform/PM-5258
jmgasper Jun 5, 2026
d2fd4a7
Merge pull request #1903 from topcoder-platform/PM-5257
jmgasper Jun 5, 2026
8e61968
Merge pull request #1904 from topcoder-platform/PM-5253
jmgasper Jun 5, 2026
d7e4cfe
Merge pull request #1905 from topcoder-platform/PM-5227
jmgasper Jun 5, 2026
2d447d5
PM-5230: Show latest profile rating
jmgasper Jun 5, 2026
2ad75c1
Merge ai-ratings into PM-5230
jmgasper Jun 5, 2026
7ba96fd
Merge pull request #1906 from topcoder-platform/PM-5230
jmgasper Jun 9, 2026
b06aecd
PM-5256: Fix challenge points typography
jmgasper Jun 9, 2026
e29f655
PM-5274: Enlarge challenge points breakdown arrow
jmgasper Jun 9, 2026
2b532df
PM-5277: Fix preferred role styling
jmgasper Jun 9, 2026
96ec6f9
Fixes for adding manual reviewer
jmgasper Jun 9, 2026
1dfdfb3
PM-5259: Fix rating popup position tiers
jmgasper Jun 9, 2026
96d6095
PM-5263: Improve low-rating card contrast
jmgasper Jun 9, 2026
f634976
Merge pull request #1915 from topcoder-platform/PM-5277
jmgasper Jun 9, 2026
f918f8f
Merge pull request #1913 from topcoder-platform/PM-5256
jmgasper Jun 9, 2026
568f70c
Merge pull request #1914 from topcoder-platform/PM-5274
jmgasper Jun 9, 2026
53116fe
Merge pull request #1919 from topcoder-platform/PM-5259
jmgasper Jun 9, 2026
0b622c0
Merge pull request #1920 from topcoder-platform/PM-5263
jmgasper Jun 9, 2026
3ee497e
PM-5264: Show top one percent for highest ratings
jmgasper Jun 9, 2026
cac65cf
PM-5257: Fix rating card width at narrow mobile sizes
jmgasper Jun 9, 2026
7f7bef2
PM-5262: Fix points breakdown modal styling
jmgasper Jun 9, 2026
492445f
Merge pull request #1925 from topcoder-platform/PM-5262
jmgasper Jun 9, 2026
1ff719a
Merge pull request #1923 from topcoder-platform/PM-5257-1
jmgasper Jun 9, 2026
d7e1e63
Merge pull request #1922 from topcoder-platform/PM-5264
jmgasper Jun 9, 2026
93222f0
Merge in dev changes
jmgasper Jun 9, 2026
c21a5f9
PM-5293: Move specification resize handle inside editor
jmgasper Jun 10, 2026
45e90fe
PM-5265: Add awards see less toggle
jmgasper Jun 10, 2026
6f32196
PM-5300: Disable public review for design reviewers
jmgasper Jun 10, 2026
90c2852
Merge pull request #1932 from topcoder-platform/PM-5265-1
jmgasper Jun 10, 2026
6717083
Merge pull request #1931 from topcoder-platform/PM-5293
jmgasper Jun 10, 2026
029074f
Merge pull request #1933 from topcoder-platform/PM-5300
jmgasper Jun 10, 2026
39381db
PM-5349: add reports talent tab
jmgasper Jun 15, 2026
977b60a
PM-5324: Hide percentile for zero ratings
jmgasper Jun 15, 2026
d1d4db8
PM-5221: show Data Science Challenge stats
jmgasper Jun 15, 2026
eb9c732
PM-5257: Keep mobile rating data in one row
jmgasper Jun 15, 2026
d721f0d
Merge pull request #1941 from topcoder-platform/PM-5257-2
jmgasper Jun 15, 2026
4d01396
Merge remote-tracking branch 'origin/ai-ratings' into PM-5221
jmgasper Jun 15, 2026
0400eeb
Merge remote-tracking branch 'origin/ai-ratings' into PM-5324
jmgasper Jun 15, 2026
99dc794
Merge pull request #1939 from topcoder-platform/PM-5324
jmgasper Jun 15, 2026
c50a0c5
Merge pull request #1940 from topcoder-platform/PM-5221
jmgasper Jun 15, 2026
028d520
Merge pull request #1938 from topcoder-platform/PM-5349
jmgasper Jun 15, 2026
f233c66
PM-5349: allow Talent Managers to access Talent tab
jmgasper Jun 15, 2026
2ebd145
Merge pull request #1942 from topcoder-platform/PM-5349-1
jmgasper Jun 15, 2026
9bff6f9
Set new terms UUID for 2026
jmgasper Jun 16, 2026
a257047
Merge pull request #1946 from topcoder-platform/ai-ratings
jmgasper Jun 16, 2026
e677f89
Merge pull request #1947 from topcoder-platform/terms
jmgasper Jun 17, 2026
d63dd47
PM-5378: Allow Design phase shortening in schedule editor
jmgasper Jun 17, 2026
5db271a
Billing account display tweaks
jmgasper Jun 17, 2026
973c908
PM-5245: Use persisted engagement payment splits
jmgasper Jun 17, 2026
a3826aa
Terms update for PM-5330
jmgasper Jun 17, 2026
3d0d629
Merge pull request #1949 from topcoder-platform/PM-5245
jmgasper Jun 17, 2026
f6917a7
Merge pull request #1948 from topcoder-platform/PM-5378
jmgasper Jun 17, 2026
8db2064
Update to NDA UUID for new NDA docusign template
jmgasper Jun 17, 2026
c889b35
Merge pull request #1950 from topcoder-platform/PM-5245
jmgasper Jun 17, 2026
2962ff4
PM-5382: Clip profile avatar to circular mask
jmgasper Jun 17, 2026
4f27d8e
PM-5383: Show principal skills preview toggle
jmgasper Jun 17, 2026
25fb24b
PM-5385: Left align mobile role interest text
jmgasper Jun 17, 2026
0b93edd
PM-5386: Update profile rating percentile display
jmgasper Jun 17, 2026
ff40eeb
PM-5387: Show highest profile rating
jmgasper Jun 17, 2026
69024a3
PM-5221: show Data Science challenges as Code stats
jmgasper Jun 17, 2026
db472c1
PM-5374: Fix blank Filestack env fallback
jmgasper Jun 17, 2026
7f7b186
PM-5231: Show example validation scoring in submissions
jmgasper Jun 17, 2026
38d7ca7
PM-5384: Reduce profile photo username gap
jmgasper Jun 17, 2026
6124dc7
Merge pull request #1959 from topcoder-platform/PM-5384
jmgasper Jun 17, 2026
174bb19
Merge pull request #1958 from topcoder-platform/PM-5231-1
jmgasper Jun 17, 2026
488398c
Merge pull request #1957 from topcoder-platform/PM-5374
jmgasper Jun 17, 2026
d7fcddf
Merge pull request #1956 from topcoder-platform/PM-5221-1
jmgasper Jun 17, 2026
12c255a
Update for prod Filestack config'
jmgasper Jun 17, 2026
fbd561c
Merge pull request #1955 from topcoder-platform/PM-5387
jmgasper Jun 17, 2026
c333856
Merge pull request #1954 from topcoder-platform/PM-5386
jmgasper Jun 17, 2026
8b54801
Merge pull request #1953 from topcoder-platform/PM-5385
jmgasper Jun 17, 2026
f8afa5e
Merge pull request #1952 from topcoder-platform/PM-5383
jmgasper Jun 17, 2026
43e7e3f
Merge pull request #1951 from topcoder-platform/PM-5382
jmgasper Jun 17, 2026
45f3ad3
Merge branch 'dev' of github.com:topcoder-platform/platform-ui into dev
jmgasper Jun 17, 2026
129ef6c
Restrict challenge types to specific values, ignoring additional ones…
jmgasper Jun 17, 2026
c2850e2
PM-5221: show Data Science challenges as Data Science stats
jmgasper Jun 18, 2026
5bafb56
Tweaks for test submission flow in MM setup
jmgasper Jun 18, 2026
3390d12
PM-5223: show QA stats in Testing
jmgasper Jun 18, 2026
3f7f0c1
Merge pull request #1961 from topcoder-platform/PM-5223
jmgasper Jun 18, 2026
2c8e184
PM-5231: Show failed validation scores
jmgasper Jun 18, 2026
9a4d387
Merge pull request #1960 from topcoder-platform/PM-5221-2
jmgasper Jun 18, 2026
4453e53
PM-5394: Left align mobile rating position
jmgasper Jun 18, 2026
7c9870e
PM-5395: Fix rating modal top percentile display
jmgasper Jun 18, 2026
6077ac3
Merge pull request #1964 from topcoder-platform/PM-5395
jmgasper Jun 18, 2026
0f8088f
Merge pull request #1963 from topcoder-platform/PM-5394
jmgasper Jun 18, 2026
8c135c4
Merge pull request #1962 from topcoder-platform/PM-5231-2
jmgasper Jun 18, 2026
ebb5af2
PM-5396: show AI Engineering under Development
jmgasper Jun 18, 2026
c75f11b
PM-5398: Fix member stats typography
jmgasper Jun 18, 2026
67ff3fd
Updates for PM-5330
jmgasper Jun 18, 2026
904173d
Merge pull request #1966 from topcoder-platform/PM-5398
jmgasper Jun 18, 2026
67e867a
Merge pull request #1965 from topcoder-platform/PM-5396
jmgasper Jun 18, 2026
8a6fc96
PM-5401: Keep member stats text readable with TCO banner
jmgasper Jun 18, 2026
61adeec
Merge pull request #1967 from topcoder-platform/PM-5401
jmgasper Jun 18, 2026
8f0c447
PM-5402: Stack high rating marker label
jmgasper Jun 18, 2026
1875a22
PM-5403: Reduce profile section spacing
jmgasper Jun 18, 2026
a3a51a3
PM-5397: Show AI Engineering challenge history
jmgasper Jun 19, 2026
4117a85
Merge pull request #1969 from topcoder-platform/PM-5403
jmgasper Jun 19, 2026
e4d64b0
Merge pull request #1970 from topcoder-platform/PM-5397
jmgasper Jun 19, 2026
23151c5
Merge pull request #1968 from topcoder-platform/PM-5402
jmgasper Jun 19, 2026
cfe1c48
PM-5384: Tune profile photo name spacing
jmgasper Jun 19, 2026
3c53520
Merge pull request #1971 from topcoder-platform/PM-5384-1
jmgasper Jun 19, 2026
aa28463
PM-5402: Stack high rating marker sooner
jmgasper Jun 19, 2026
4b74cf5
PM-5401: Align member stats chevrons
jmgasper Jun 19, 2026
9ad5d42
PM-5365 - fix lock message
vas3a Jun 19, 2026
ed92f88
Merge pull request #1974 from topcoder-platform/PM-5365_fix-lock-message
vas3a Jun 19, 2026
5be81d2
PM-5406: Close rating tooltip with info modal
jmgasper Jun 22, 2026
0ec6caf
PM-5412: Disable closed phase start dates
jmgasper Jun 22, 2026
b9cc090
Merge pull request #1975 from topcoder-platform/PM-5406
jmgasper Jun 22, 2026
0afd74d
Merge pull request #1973 from topcoder-platform/PM-5401-1
jmgasper Jun 22, 2026
3ff1a6e
Merge pull request #1972 from topcoder-platform/PM-5402-1
jmgasper Jun 22, 2026
83061d0
Merge pull request #1976 from topcoder-platform/PM-5412
jmgasper Jun 22, 2026
d785dbb
PM-5378: Stabilize Work phase schedule edits
jmgasper Jun 22, 2026
9aac436
PM-5401: Reserve member stats chevron column
jmgasper Jun 22, 2026
265e853
Merge pull request #1978 from topcoder-platform/PM-5378-1
jmgasper Jun 22, 2026
07d01a9
PM-5402: Stack extreme rating markers
jmgasper Jun 22, 2026
cb032f0
PM-5433: Fix profile subtrack summary counters
jmgasper Jun 22, 2026
49770fd
PM-5407: Show preferred roles without rating
jmgasper Jun 22, 2026
ed3839b
Merge pull request #1982 from topcoder-platform/PM-5407
jmgasper Jun 22, 2026
3460355
Merge pull request #1981 from topcoder-platform/PM-5433
jmgasper Jun 22, 2026
9f4d456
Stats fixes
jmgasper Jun 22, 2026
3ec7670
Merge pull request #1979 from topcoder-platform/PM-5401-2
jmgasper Jun 22, 2026
5ce65c6
Merge pull request #1980 from topcoder-platform/PM-5402-2
jmgasper Jun 22, 2026
36d5c70
Merge
jmgasper Jun 23, 2026
44294ae
Merge pull request #1983 from topcoder-platform/PM-5407
jmgasper Jun 23, 2026
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 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ workflows:
branches:
only:
- dev
- hide_ba_details
- ai-ratings
tags:
only: /^dev-.*/

Expand Down
9 changes: 6 additions & 3 deletions .environments/.env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ REACT_APP_MEMBER_VERIFY_LOOKER=3322
REACT_APP_SPRIG_ENV_ID=a-IZBZ6-r7bU

# Filestack configuration for uploading Submissions
REACT_APP_FILESTACK_API_KEY=
REACT_APP_FILESTACK_REGION=
REACT_APP_FILESTACK_SUBMISSION_CONTAINER=
REACT_APP_FILESTACK_API_KEY='AzFINuQoqTmqw0QEoaw9az'
REACT_APP_FILESTACK_REGION=us-east-1
REACT_APP_FILESTACK_SUBMISSION_CONTAINER='topcoder-submissions-dmz'
REACT_APP_FILESTACK_UPLOAD_PROGRESS_INTERVAL=100
REACT_APP_FILESTACK_UPLOAD_RETRY=2
REACT_APP_FILESTACK_UPLOAD_TIMEOUT=1800000
23 changes: 16 additions & 7 deletions src/apps/engagements/src/lib/hooks/useTermsAgreementGate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import {
getDocuSignUrl,
getTermDetails,
} from '../services'
import { extractTermId } from '../utils'
import {
extractTermId,
resolveDocuSignTemplateId,
resolveStandardTermsConfig,
} from '../utils'

type TermsConfig = {
id: string
Expand Down Expand Up @@ -56,11 +60,15 @@ type TermsViewData = {
isElectronicallyAgreeable: boolean
}

const TERMS_ID = extractTermId(EnvironmentConfig.TERMS_URL)
const STANDARD_TERMS = resolveStandardTermsConfig(
EnvironmentConfig.DEFAULT_STANDARD_TERMS_UUID,
EnvironmentConfig.TERMS_URL,
)
const TERMS_ID = STANDARD_TERMS.id
const NDA_TERMS_ID = extractTermId(EnvironmentConfig.NDA_TERMS_URL)

const TERMS_CONFIG: TermsConfig[] = [
{ id: TERMS_ID ?? '', label: 'Standard Topcoder Terms', url: EnvironmentConfig.TERMS_URL },
{ id: TERMS_ID ?? '', label: 'Standard Topcoder Terms', url: STANDARD_TERMS.url },
{ id: NDA_TERMS_ID ?? '', label: 'Topcoder NDA', url: EnvironmentConfig.NDA_TERMS_URL },
].filter(term => term.id)

Expand Down Expand Up @@ -281,11 +289,12 @@ export const useTermsAgreementGate = (
() => getTermsViewData(termsDetails),
[termsDetails],
)
const docuSignTemplateId = termsDetails?.docusignTemplateId
const docuSignTemplateId = resolveDocuSignTemplateId(
termsDetails,
EnvironmentConfig.NDA_DOCUSIGN_TEMPLATE_ID,
)
const isDocuSignTerm = Boolean(
termsDetails?.agreeabilityType
&& termsDetails.agreeabilityType !== 'Electronically-agreeable'
&& docuSignTemplateId,
termsDetails && docuSignTemplateId,
)
const termsUrl = activeTerm?.url || termsDetails?.url

Expand Down
55 changes: 55 additions & 0 deletions src/apps/engagements/src/lib/utils/terms.utils.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import {
extractTermId,
replaceTermIdInUrl,
resolveDocuSignTemplateId,
resolveStandardTermsConfig,
} from './terms.utils'

describe('engagement terms utils', () => {
const OLD_TERMS_ID = '317cd8f9-d66c-4f2a-8774-63c612d99cd4'
const NEW_TERMS_ID = '0a507fb7-3fe0-402b-b121-1a24af4a9cf1'
const NEW_NDA_TEMPLATE_ID = '400b989d-1c75-4889-b6f6-421e1f924709'
const TERMS_URL = `https://www.topcoder-dev.com/challenges/terms/detail/${OLD_TERMS_ID}`

it('extracts the terms id from a terms detail URL', () => {
expect(extractTermId(TERMS_URL))
.toBe(OLD_TERMS_ID)
})

it('rewrites a terms detail URL with the configured term id', () => {
expect(replaceTermIdInUrl(TERMS_URL, NEW_TERMS_ID))
.toBe(`https://www.topcoder-dev.com/challenges/terms/detail/${NEW_TERMS_ID}`)
})

it('prefers the configured Standard Terms id over the fallback terms URL id', () => {
expect(resolveStandardTermsConfig(NEW_TERMS_ID, TERMS_URL))
.toEqual({
id: NEW_TERMS_ID,
url: `https://www.topcoder-dev.com/challenges/terms/detail/${NEW_TERMS_ID}`,
})
})

it('falls back to the terms URL id when no configured Standard Terms id is provided', () => {
expect(resolveStandardTermsConfig(undefined, TERMS_URL))
.toEqual({
id: OLD_TERMS_ID,
url: TERMS_URL,
})
})

it('prefers the configured DocuSign template for NDA terms', () => {
expect(resolveDocuSignTemplateId({
docusignTemplateId: 'old-template-id',
title: 'Topcoder Member Non-Disclosure Agreement v3.0',
}, NEW_NDA_TEMPLATE_ID))
.toBe(NEW_NDA_TEMPLATE_ID)
})

it('keeps the Terms API DocuSign template for non-NDA terms', () => {
expect(resolveDocuSignTemplateId({
docusignTemplateId: 'assignment-template-id',
title: 'Assignment Terms',
}, NEW_NDA_TEMPLATE_ID))
.toBe('assignment-template-id')
})
})
113 changes: 113 additions & 0 deletions src/apps/engagements/src/lib/utils/terms.utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
export type ResolvedTermsConfig = {
id?: string
url?: string
}

type TermsTemplateDetails = {
docusignTemplateId?: string | number
title?: string
}

const NDA_TITLE_PATTERN = /\bnda\b|non[-\s]?disclosure/i

/**
* Extracts the trailing terms identifier from a terms detail URL or path.
*
* @param termsUrl - Full terms URL, relative path, or plain slash-delimited terms path.
* @returns The trailing terms identifier, or undefined when the input is empty.
*/
export const extractTermId = (termsUrl?: string): string | undefined => {
if (!termsUrl) {
return undefined
Expand All @@ -19,3 +37,98 @@ export const extractTermId = (termsUrl?: string): string | undefined => {
return parts[parts.length - 1]
}
}

/**
* Rewrites an existing terms detail URL so it points at the supplied terms identifier.
*
* @param termsUrl - Current terms detail URL or path used as the URL template.
* @param termId - Terms identifier that should replace the trailing URL segment.
* @returns A terms detail URL for the supplied identifier, or the original URL when it cannot be rewritten.
*/
export const replaceTermIdInUrl = (
termsUrl?: string,
termId?: string,
): string | undefined => {
const trimmedTermId = termId?.trim()
if (!termsUrl || !trimmedTermId) {
return termsUrl
}

const trimmedTermsUrl = termsUrl.trim()
if (!trimmedTermsUrl) {
return undefined
}

try {
const parsed = new URL(trimmedTermsUrl)
const parts = parsed.pathname.split('/')
.filter(Boolean)

if (parts.length === 0) {
return trimmedTermsUrl
}

parts[parts.length - 1] = trimmedTermId
parsed.pathname = `/${parts.join('/')}`
return parsed.toString()
} catch {
const parts = trimmedTermsUrl.split('/')
.filter(Boolean)

if (parts.length === 0) {
return trimmedTermsUrl
}

parts[parts.length - 1] = trimmedTermId
return parts.join('/')
}
}

/**
* Resolves the Standard Terms ID and detail URL used by engagement agreement checks.
*
* @param defaultStandardTermsId - Preferred Standard Terms UUID from environment configuration.
* @param termsUrl - Fallback Standard Terms detail URL.
* @returns The resolved Standard Terms identifier and a matching detail URL.
*/
export const resolveStandardTermsConfig = (
defaultStandardTermsId?: string,
termsUrl?: string,
): ResolvedTermsConfig => {
const id = defaultStandardTermsId?.trim() || extractTermId(termsUrl)

return {
id,
url: replaceTermIdInUrl(termsUrl, id),
}
}

/**
* Checks whether a terms record represents an NDA-style agreement.
*
* @param term - Terms API details or search result payload.
* @returns true when the term title is NDA/non-disclosure related.
*/
export const isNdaTerm = (term?: TermsTemplateDetails): boolean => (
NDA_TITLE_PATTERN.test(term?.title ?? '')
)

/**
* Resolves the DocuSign template id for a terms record.
*
* @param term - Terms API details or search result payload.
* @param configuredNdaTemplateId - Preferred DocuSign template id for NDA terms.
* @returns The configured NDA template id for NDA terms, otherwise the Terms API template id.
*/
export const resolveDocuSignTemplateId = (
term?: TermsTemplateDetails,
configuredNdaTemplateId?: string,
): string | number | undefined => {
const normalizedConfiguredNdaTemplateId = configuredNdaTemplateId?.trim()

if (normalizedConfiguredNdaTemplateId && isNdaTerm(term)) {
return normalizedConfiguredNdaTemplateId
}

return term?.docusignTemplateId
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
getUserDataForApplication,
updateUserDataForApplication,
} from '../../lib/services'
import { extractTermId } from '../../lib/utils'
import { extractTermId, resolveStandardTermsConfig } from '../../lib/utils'
import { rootRoute } from '../../engagements.routes'

import type { ApplicationFormData, PrePopulatedUserData } from './application-form.types'
Expand Down Expand Up @@ -50,9 +50,14 @@ const getIsSubmitDisabled = (params: SubmitDisabledParams): boolean => (
|| (params.hasSubmitted && !params.isValid)
)

const STANDARD_TERMS = resolveStandardTermsConfig(
EnvironmentConfig.DEFAULT_STANDARD_TERMS_UUID,
EnvironmentConfig.TERMS_URL,
)

const TERMS_STATUS_CONFIG: TermsStatusConfig[] = [
{
id: extractTermId(EnvironmentConfig.TERMS_URL) ?? '',
id: STANDARD_TERMS.id ?? '',
label: 'Standard Topcoder Terms',
},
{
Expand Down
5 changes: 2 additions & 3 deletions src/apps/onboarding/src/models/PersonalizationInfo.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
export interface OpenToWorkTrait {
availability?: string
preferredRoles?: string[]
}

export default interface PersonalizationInfo {
referAs?: string
profileSelfTitle?: string
preferredRoles?: string[]
shortBio?: string
links?: Array<{ url: string; name: string }>
openToWork?: {
availability?: string,
preferredRoles?: string[],
}
}

export const emptyPersonalizationInfo: () => PersonalizationInfo = () => ({
links: [],
openToWork: {
availability: '',
preferredRoles: [],
},
preferredRoles: [],
profileSelfTitle: '',
referAs: '',
shortBio: '',
Expand Down
7 changes: 3 additions & 4 deletions src/apps/onboarding/src/pages/open-to-work/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const PageOpenToWorkContent: FC<PageOpenToWorkContentProps> = props => {
const [formValue, setFormValue] = useState<OpenToWorkData>({
availability: undefined,
availableForGigs: !!props.availableForGigs,
preferredRoles: [],
})

const [submitAttempted, setSubmitAttempted] = useState(false)
Expand All @@ -66,7 +65,6 @@ export const PageOpenToWorkContent: FC<PageOpenToWorkContentProps> = props => {
...prev,
availability: openToWorkItem?.availability,
availableForGigs: !!props.availableForGigs,
preferredRoles: openToWorkItem?.preferredRoles ?? [],
}))
}, [memberPersonalizationTraits, props.availableForGigs])

Expand Down Expand Up @@ -103,13 +101,14 @@ export const PageOpenToWorkContent: FC<PageOpenToWorkContentProps> = props => {
setLoading(true)

const existing = memberPersonalizationTraits?.[0]?.traits?.data?.[0] || {}
const openToWork = { ...(existing.openToWork || {}) }
delete openToWork.preferredRoles

const personalizationData = [{
...existing,
openToWork: {
...(existing.openToWork || {}),
...openToWork,
availability: formValue.availability,
preferredRoles: formValue.preferredRoles,
},
}]

Expand Down
1 change: 0 additions & 1 deletion src/apps/onboarding/src/redux/actions/member.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ export const createPersonalizationsPayloadData: any = (personalizations: Persona
openToWork: openToWork
? {
availability: openToWork.availability,
preferredRoles: openToWork.preferredRoles,
}
: undefined,
profileSelfTitle,
Expand Down
Loading
Loading