Skip to content

Commit 374b0e1

Browse files
authored
Merge pull request #850 from topcoder-platform/issue-849
The tab order in the Experience modal is broken
2 parents f917379 + a62338d commit 374b0e1

File tree

135 files changed

+1884
-1905
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+1884
-1905
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"dependencies": {
2424
"@datadog/browser-logs": "^4.21.2",
2525
"@heroicons/react": "^1.0.6",
26+
"@popperjs/core": "^2.11.8",
2627
"@sprig-technologies/sprig-browser": "^2.20.1",
2728
"@storybook/addon-actions": "^7.0.5",
2829
"@storybook/react": "^7.0.5",
@@ -83,6 +84,7 @@
8384
"react-helmet": "^6.1.0",
8485
"react-html-parser": "^2.0.2",
8586
"react-markdown": "8.0.6",
87+
"react-popper": "^2.3.0",
8688
"react-redux": "^8.0.4",
8789
"react-redux-toastr": "^7.6.10",
8890
"react-responsive": "^9.0.0-beta.5",

src/apps/accounts/src/settings/tabs/account/address/MemberAddress.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Dispatch, FC, SetStateAction, useState } from 'react'
1+
import { Dispatch, FC, SetStateAction, useMemo, useState } from 'react'
22
import { toast } from 'react-toastify'
33
import { bind, trim } from 'lodash'
44
import classNames from 'classnames'
@@ -24,6 +24,12 @@ const MemberAddress: FC<MemberAddressProps> = (props: MemberAddressProps) => {
2424
const countryLookup: CountryLookup[] | undefined
2525
= useCountryLookup()
2626

27+
const contries = useMemo(() => (countryLookup || []).map((cl: CountryLookup) => ({
28+
label: cl.country,
29+
value: cl.countryCode,
30+
}))
31+
.sort((a, b) => a.label.localeCompare(b.label)), [countryLookup])
32+
2733
const [formValues, setFormValues]: [any, Dispatch<any>] = useState({
2834
country: props.profile.homeCountryCode || props.profile.competitionCountryCode,
2935
...props.profile.addresses ? props.profile.addresses[0] : {},
@@ -162,10 +168,7 @@ const MemberAddress: FC<MemberAddressProps> = (props: MemberAddressProps) => {
162168
value={formValues.zip}
163169
/>
164170
<InputSelect
165-
options={(countryLookup || []).map((cl: CountryLookup) => ({
166-
label: cl.country,
167-
value: cl.countryCode,
168-
}))}
171+
options={contries}
169172
value={formValues.country}
170173
onChange={bind(handleFormValueChange, this, 'country')}
171174
name='country'

src/apps/profiles/src/components/AssemblyDetailsModal/AssemblyDetailsModal.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* eslint-disable complexity */import { Dispatch, FC, SetStateAction, useMemo, useState } from 'react'
2-
import { bind, isEmpty, keys } from 'lodash'
2+
import { isEmpty, keys } from 'lodash'
33
import Highcharts from 'highcharts'
44
import HighchartsReact from 'highcharts-react-official'
55

6-
import { BaseModal, Button, LoadingSpinner } from '~/libs/ui'
6+
import { BaseModal, LoadingSpinner } from '~/libs/ui'
77
import {
88
MemberStats,
99
ratingToCSScolor,
@@ -23,7 +23,6 @@ import styles from './AssemblyDetailsModal.module.scss'
2323
type SRMViewTypes = 'STATISTICS' | 'CHALLENGES DETAILS'
2424

2525
interface AssemblyDetailsModalProps {
26-
isAssemblyDetailsOpen: boolean
2726
onClose: () => void
2827
assemblyStats: MemberStats | undefined
2928
profile: UserProfile | undefined
@@ -77,14 +76,16 @@ const AssemblyDetailsModal: FC<AssemblyDetailsModalProps> = (props: AssemblyDeta
7776
return options
7877
}, [memberStatsDist])
7978

79+
// TODO: enable this function when challenges history is available
80+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8081
function toggleViewType(newViewType: SRMViewTypes): void {
8182
setviewType(newViewType)
8283
}
8384

8485
return (
8586
<BaseModal
8687
onClose={props.onClose}
87-
open={props.isAssemblyDetailsOpen}
88+
open
8889
size='body'
8990
title='ASSEMBLY COMPETITION'
9091
>
@@ -124,7 +125,8 @@ const AssemblyDetailsModal: FC<AssemblyDetailsModalProps> = (props: AssemblyDeta
124125
</div>
125126

126127
<div className={styles.content}>
127-
<div className={styles.contentHeader}>
128+
{/* TODO: Add Assembly Details with challenges history */}
129+
{/* <div className={styles.contentHeader}>
128130
<h4>{viewType}</h4>
129131
<div className={styles.contentHeaderActions}>
130132
<Button
@@ -140,7 +142,7 @@ const AssemblyDetailsModal: FC<AssemblyDetailsModalProps> = (props: AssemblyDeta
140142
{viewType !== 'CHALLENGES DETAILS' ? 'CHALLENGES DETAILS' : 'STATISTICS'}
141143
</Button>
142144
</div>
143-
</div>
145+
</div> */}
144146

145147
<div className={styles.contentBody}>
146148
{

src/apps/profiles/src/components/BannersIconsDetailsModal/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/apps/profiles/src/components/BugHuntDetailsModal/BugHuntDetailsModal.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ import styles from './BugHuntDetailsModal.module.scss'
1313
type BugHuntViewTypes = 'CHALLENGES DETAILS'
1414

1515
interface BugHuntDetailsModalProps {
16-
isBugHuntDetailsOpen: boolean
1716
onClose: () => void
1817
bugHuntStats: MemberStats | undefined
1918
}
2019

2120
const BugHuntDetailsModal: FC<BugHuntDetailsModalProps> = (props: BugHuntDetailsModalProps) => {
21+
// TODO: Add Bug Hunt Details with challenges history
22+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2223
const [viewType]: [BugHuntViewTypes, Dispatch<SetStateAction<BugHuntViewTypes>>]
2324
= useState<BugHuntViewTypes>('CHALLENGES DETAILS')
2425

2526
return (
2627
<BaseModal
2728
onClose={props.onClose}
28-
open={props.isBugHuntDetailsOpen}
29+
open
2930
size='body'
3031
title='BUG HUNT'
3132
>
@@ -49,7 +50,8 @@ const BugHuntDetailsModal: FC<BugHuntDetailsModalProps> = (props: BugHuntDetails
4950
</div>
5051
</div>
5152

52-
<div className={styles.content}>
53+
{/* TODO: Add Bug Hunt Details with challenges history */}
54+
{/* <div className={styles.content}>
5355
<div className={styles.contentHeader}>
5456
<h4>{viewType}</h4>
5557
</div>
@@ -62,7 +64,7 @@ const BugHuntDetailsModal: FC<BugHuntDetailsModalProps> = (props: BugHuntDetails
6264
6365
}
6466
</div>
65-
</div>
67+
</div> */}
6668
</div>
6769
</BaseModal>
6870
)

src/apps/profiles/src/components/CodeDetailsModal/CodeDetailsModal.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* eslint-disable complexity */
22
import { Dispatch, FC, SetStateAction, useMemo, useState } from 'react'
3-
import { bind, isEmpty, keys } from 'lodash'
3+
import { isEmpty, keys } from 'lodash'
44
import Highcharts from 'highcharts'
55
import HighchartsReact from 'highcharts-react-official'
66

7-
import { BaseModal, Button, LoadingSpinner } from '~/libs/ui'
7+
import { BaseModal, LoadingSpinner } from '~/libs/ui'
88
import {
99
MemberStats,
1010
StatsHistory,
@@ -23,7 +23,6 @@ import styles from './CodeDetailsModal.module.scss'
2323
type CodeViewTypes = 'STATISTICS' | 'CHALLENGES DETAILS'
2424

2525
interface CodeDetailsModalProps {
26-
isCodeDetailsOpen: boolean
2726
onClose: () => void
2827
codeStats: MemberStats | undefined
2928
profile: UserProfile | undefined
@@ -74,14 +73,16 @@ const CodeDetailsModal: FC<CodeDetailsModalProps> = (props: CodeDetailsModalProp
7473
return options
7574
}, [memberStatsDist])
7675

76+
// TODO: Enable this when we have challenges details data
77+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7778
function toggleViewType(newViewType: CodeViewTypes): void {
7879
setviewType(newViewType)
7980
}
8081

8182
return (
8283
<BaseModal
8384
onClose={props.onClose}
84-
open={props.isCodeDetailsOpen}
85+
open
8586
size='body'
8687
title='Code'
8788
>
@@ -110,7 +111,8 @@ const CodeDetailsModal: FC<CodeDetailsModalProps> = (props: CodeDetailsModalProp
110111
<div className={styles.content}>
111112
<div className={styles.contentHeader}>
112113
<h4>{viewType}</h4>
113-
<div className={styles.contentHeaderActions}>
114+
{/* TODO: Add button when we have challenges details data */}
115+
{/* <div className={styles.contentHeaderActions}>
114116
<Button
115117
primary
116118
onClick={bind(
@@ -123,7 +125,7 @@ const CodeDetailsModal: FC<CodeDetailsModalProps> = (props: CodeDetailsModalProp
123125
{' '}
124126
{viewType !== 'CHALLENGES DETAILS' ? 'CHALLENGES DETAILS' : 'STATISTICS'}
125127
</Button>
126-
</div>
128+
</div> */}
127129
</div>
128130

129131
<div className={styles.contentBody}>

src/apps/profiles/src/components/ContentCreationDetailsModal/ContentCreationDetailsModal.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* eslint-disable complexity */
22
import { Dispatch, FC, SetStateAction, useMemo, useState } from 'react'
3-
import { bind, isEmpty, keys } from 'lodash'
3+
import { isEmpty, keys } from 'lodash'
44
import Highcharts from 'highcharts'
55
import HighchartsReact from 'highcharts-react-official'
66

7-
import { BaseModal, Button, LoadingSpinner } from '~/libs/ui'
7+
import { BaseModal, LoadingSpinner } from '~/libs/ui'
88
import {
99
MemberStats,
1010
ratingToCSScolor,
@@ -24,7 +24,6 @@ import styles from './ContentCreationDetailsModal.module.scss'
2424
type TestScenViewTypes = 'STATISTICS' | 'CHALLENGES DETAILS'
2525

2626
interface ContentCreationDetailsModalProps {
27-
isContentCreationDetailsOpen: boolean
2827
onClose: () => void
2928
contentCreationStats: MemberStats | undefined
3029
profile: UserProfile | undefined
@@ -75,14 +74,16 @@ const ContentCreationDetailsModal: FC<ContentCreationDetailsModalProps> = (props
7574
return options
7675
}, [memberStatsDist])
7776

77+
// TODO: Enable this when we have challenges details data
78+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7879
function toggleViewType(newViewType: TestScenViewTypes): void {
7980
setviewType(newViewType)
8081
}
8182

8283
return (
8384
<BaseModal
8485
onClose={props.onClose}
85-
open={props.isContentCreationDetailsOpen}
86+
open
8687
size='body'
8788
title='CONTENT CREATION'
8889
>
@@ -124,7 +125,8 @@ const ContentCreationDetailsModal: FC<ContentCreationDetailsModalProps> = (props
124125
<div className={styles.content}>
125126
<div className={styles.contentHeader}>
126127
<h4>{viewType}</h4>
127-
<div className={styles.contentHeaderActions}>
128+
{/* TODO: Enable this when we have challenges details data */}
129+
{/* <div className={styles.contentHeaderActions}>
128130
<Button
129131
primary
130132
onClick={bind(
@@ -137,7 +139,7 @@ const ContentCreationDetailsModal: FC<ContentCreationDetailsModalProps> = (props
137139
{' '}
138140
{viewType !== 'CHALLENGES DETAILS' ? 'CHALLENGES DETAILS' : 'STATISTICS'}
139141
</Button>
140-
</div>
142+
</div> */}
141143
</div>
142144

143145
<div className={styles.contentBody}>

src/apps/profiles/src/components/CopilotDetailsModal/CopilotDetailsModal.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ import { UserStats } from '~/libs/core'
66
import styles from './CopilotDetailsModal.module.scss'
77

88
interface CopilotDetailsModalProps {
9-
isCopilotDetailsOpen: boolean
109
onClose: () => void
1110
copilotDetails: UserStats['COPILOT']
1211
}
1312

1413
const CopilotDetailsModal: FC<CopilotDetailsModalProps> = (props: CopilotDetailsModalProps) => (
1514
<BaseModal
1615
onClose={props.onClose}
17-
open={props.isCopilotDetailsOpen}
16+
open
1817
size='lg'
1918
title='COPILOT'
2019
>

src/apps/profiles/src/components/DesignF2FDetailsModal/DesignF2FDetailsModal.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ import styles from './DesignF2FDetailsModal.module.scss'
1313
type WebDesignViewTypes = 'CHALLENGES DETAILS'
1414

1515
interface DesignF2FDetailsModalProps {
16-
isDesignF2FDetailsOpen: boolean
1716
onClose: () => void
1817
designF2FStats: MemberStats | undefined
1918
}
2019

2120
const DesignF2FDetailsModal: FC<DesignF2FDetailsModalProps> = (props: DesignF2FDetailsModalProps) => {
21+
// TODO: Enable this when we have challenges details data
22+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2223
const [viewType]: [WebDesignViewTypes, Dispatch<SetStateAction<WebDesignViewTypes>>]
2324
= useState<WebDesignViewTypes>('CHALLENGES DETAILS')
2425

2526
return (
2627
<BaseModal
2728
onClose={props.onClose}
28-
open={props.isDesignF2FDetailsOpen}
29+
open
2930
size='body'
3031
title='DESIGN FIRST2FINISH'
3132
>
@@ -62,7 +63,8 @@ const DesignF2FDetailsModal: FC<DesignF2FDetailsModalProps> = (props: DesignF2FD
6263
</div>
6364
</div>
6465

65-
<div className={styles.content}>
66+
{/* TODO: Enable this when we have challenges details data */}
67+
{/* <div className={styles.content}>
6668
<div className={styles.contentHeader}>
6769
<h4>{viewType}</h4>
6870
</div>
@@ -75,7 +77,7 @@ const DesignF2FDetailsModal: FC<DesignF2FDetailsModalProps> = (props: DesignF2FD
7577
7678
}
7779
</div>
78-
</div>
80+
</div> */}
7981
</div>
8082
</BaseModal>
8183
)

src/apps/profiles/src/components/F2FDetailsModal/F2FDetailsModal.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ import styles from './F2FDetailsModal.module.scss'
1313
type BugHuntViewTypes = 'CHALLENGES DETAILS'
1414

1515
interface F2FDetailsModalProps {
16-
isF2FDetailsOpen: boolean
1716
onClose: () => void
1817
f2fStats: MemberStats | undefined
1918
}
2019

2120
const F2FDetailsModal: FC<F2FDetailsModalProps> = (props: F2FDetailsModalProps) => {
21+
// TODO: Add F2F details data
22+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2223
const [viewType]: [BugHuntViewTypes, Dispatch<SetStateAction<BugHuntViewTypes>>]
2324
= useState<BugHuntViewTypes>('CHALLENGES DETAILS')
2425

2526
return (
2627
<BaseModal
2728
onClose={props.onClose}
28-
open={props.isF2FDetailsOpen}
29+
open
2930
size='body'
3031
title='FIRST2FINISH'
3132
>
@@ -49,7 +50,8 @@ const F2FDetailsModal: FC<F2FDetailsModalProps> = (props: F2FDetailsModalProps)
4950
</div>
5051
</div>
5152

52-
<div className={styles.content}>
53+
{/* TODO: Add F2F details data */}
54+
{/* <div className={styles.content}>
5355
<div className={styles.contentHeader}>
5456
<h4>{viewType}</h4>
5557
</div>
@@ -62,7 +64,7 @@ const F2FDetailsModal: FC<F2FDetailsModalProps> = (props: F2FDetailsModalProps)
6264
6365
}
6466
</div>
65-
</div>
67+
</div> */}
6668
</div>
6769
</BaseModal>
6870
)

0 commit comments

Comments
 (0)