Skip to content

Commit bddc0c2

Browse files
authored
Merge pull request #935 from topcoder-platform/revert-934-PROD-4406_new-dice
Revert "Prod 4406 new dice -> dev"
2 parents 682844d + 8d67cc9 commit bddc0c2

File tree

13 files changed

+188
-130
lines changed

13 files changed

+188
-130
lines changed

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ workflows:
259259
branches:
260260
only:
261261
- dev
262-
- PROD-4406_new-dice
262+
- justin_fixes
263+
- talent_search_fixes
264+
- PROD-4398_integrate-userflow-remove-sprig
263265

264266
- deployQa:
265267
context: org-global

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,5 @@
246246
}
247247
}
248248
]
249-
},
250-
"volta": {
251-
"node": "16.15.0",
252-
"yarn": "1.22.19"
253249
}
254250
}
-46.1 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { ReactComponent as MFAImage } from './mfa.svg'
22
import { ReactComponent as AppleStore } from './apple-store.svg'
3-
import credentialImage from './credential.png'
3+
import { ReactComponent as UnSuccessfullDiceVerificationIcon } from './unsuccessful.svg'
44
import diceIdLogo from './dicelogo.png'
55
import diceIdLogoBig from './dicelogobig.png'
66
import diceIdLogoSmall from './dicelogosmall.png'
77
import googlePlay from './google-play.png'
88

99
export {
1010
AppleStore,
11-
credentialImage,
1211
diceIdLogo,
1312
diceIdLogoBig,
1413
diceIdLogoSmall,
1514
googlePlay,
1615
MFAImage,
16+
UnSuccessfullDiceVerificationIcon,
1717
}

src/apps/accounts/src/settings/tabs/account/security/Security.tsx

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'
22
import { toast } from 'react-toastify'
33
import { KeyedMutator } from 'swr'
4+
import { noop } from 'lodash'
45

5-
import { Button, Collapsible, FormToggleSwitch } from '~/libs/ui'
6+
import { Button, Collapsible, FormToggleSwitch, IconSolid, Tooltip } from '~/libs/ui'
67
import { diceIdLogo, MFAImage, SettingSection, triggerSurvey } from '~/apps/accounts/src/lib'
78
import { MemberMFAStatus, updateMemberMFAStatusAsync, useMemberMFAStatus, UserProfile } from '~/libs/core'
89

@@ -22,12 +23,10 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
2223
} = useMemberMFAStatus(props.profile.userId)
2324

2425
const [mfaEnabled, setMFAEnabled]: [boolean, Dispatch<SetStateAction<boolean>>] = useState(false)
25-
const [diceEnabled, setDiceEnabled]: [boolean, Dispatch<SetStateAction<boolean>>] = useState(false)
2626

2727
useEffect(() => {
2828
if (mfaStatusData) {
2929
setMFAEnabled(mfaStatusData.mfaEnabled)
30-
setDiceEnabled(mfaStatusData.diceEnabled)
3130
}
3231
}, [mfaStatusData])
3332

@@ -37,9 +36,8 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
3736
mfaEnabled: !mfaEnabled,
3837
},
3938
})
40-
.then(response => {
41-
setMFAEnabled(response.result.content.mfaEnabled)
42-
setDiceEnabled(response.result.content.diceEnabled)
39+
.then(() => {
40+
setMFAEnabled(!mfaEnabled)
4341
toast.success('Your Multi Factor Authentication (MFA) status was updated.')
4442
triggerSurvey()
4543
})
@@ -48,27 +46,6 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
4846
})
4947
}
5048

51-
function handleUserDiceChange(): void {
52-
if (!diceEnabled) {
53-
return
54-
}
55-
56-
updateMemberMFAStatusAsync(props.profile.userId, {
57-
param: {
58-
diceEnabled: !diceEnabled,
59-
},
60-
})
61-
.then(response => {
62-
setMFAEnabled(response.result.content.mfaEnabled)
63-
setDiceEnabled(response.result.content.diceEnabled)
64-
toast.success('Your DICE credential was disabled.')
65-
triggerSurvey()
66-
})
67-
.catch(() => {
68-
toast.error('Something went wrong. Please try again later.')
69-
})
70-
}
71-
7249
function handleDiceModalStatus(): void {
7350
setSetupDiceModalOpen(!setupDiceModalOpen)
7451
}
@@ -93,6 +70,7 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
9370
name='mfaStatus'
9471
onChange={handleUserMFAChange}
9572
value={mfaEnabled}
73+
disabled={mfaStatusData?.diceEnabled}
9674
/>
9775
)}
9876
/>
@@ -108,11 +86,12 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
10886
actionElement={(
10987
<div className={styles.diceBtnWrap}>
11088
{
111-
diceEnabled ? (
89+
mfaStatusData?.diceEnabled ? (
11290
<FormToggleSwitch
11391
name='diceEnabled'
114-
onChange={handleUserDiceChange}
92+
onChange={noop}
11593
value={mfaStatusData?.diceEnabled as boolean}
94+
disabled={mfaStatusData?.diceEnabled}
11695
/>
11796
) : (
11897
<Button
@@ -125,6 +104,15 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
125104
/>
126105
)
127106
}
107+
{
108+
mfaStatusData?.diceEnabled && (
109+
<Tooltip
110+
content='Please reach out to support@topcoder.com for deactivating Dice ID.'
111+
>
112+
<IconSolid.InformationCircleIcon />
113+
</Tooltip>
114+
)
115+
}
128116
</div>
129117
)}
130118
/>

src/apps/accounts/src/settings/tabs/account/security/dice-setup-modal/ConnectionHandler/index.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/apps/accounts/src/settings/tabs/account/security/dice-setup-modal/DiceSetupModal.module.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@
3434
margin: auto;
3535
}
3636

37-
.credentialImage {
38-
height: 280px;
39-
width: 400px;
40-
align-self: center;
41-
}
42-
4337
.diceBigLogo {
4438
margin: $sp-4 0;
4539
}

0 commit comments

Comments
 (0)