Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ workflows:
branches:
only:
- dev
- PROD-4406_new-dice
- justin_fixes
- talent_search_fixes
- PROD-4398_integrate-userflow-remove-sprig

- deployQa:
context: org-global
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,5 @@
}
}
]
},
"volta": {
"node": "16.15.0",
"yarn": "1.22.19"
}
}
Binary file not shown.
4 changes: 2 additions & 2 deletions src/apps/accounts/src/lib/assets/security/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { ReactComponent as MFAImage } from './mfa.svg'
import { ReactComponent as AppleStore } from './apple-store.svg'
import credentialImage from './credential.png'
import { ReactComponent as UnSuccessfullDiceVerificationIcon } from './unsuccessful.svg'
import diceIdLogo from './dicelogo.png'
import diceIdLogoBig from './dicelogobig.png'
import diceIdLogoSmall from './dicelogosmall.png'
import googlePlay from './google-play.png'

export {
AppleStore,
credentialImage,
diceIdLogo,
diceIdLogoBig,
diceIdLogoSmall,
googlePlay,
MFAImage,
UnSuccessfullDiceVerificationIcon,
}
46 changes: 17 additions & 29 deletions src/apps/accounts/src/settings/tabs/account/security/Security.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'
import { toast } from 'react-toastify'
import { KeyedMutator } from 'swr'
import { noop } from 'lodash'

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

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

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

useEffect(() => {
if (mfaStatusData) {
setMFAEnabled(mfaStatusData.mfaEnabled)
setDiceEnabled(mfaStatusData.diceEnabled)
}
}, [mfaStatusData])

Expand All @@ -37,9 +36,8 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
mfaEnabled: !mfaEnabled,
},
})
.then(response => {
setMFAEnabled(response.result.content.mfaEnabled)
setDiceEnabled(response.result.content.diceEnabled)
.then(() => {
setMFAEnabled(!mfaEnabled)
toast.success('Your Multi Factor Authentication (MFA) status was updated.')
triggerSurvey()
})
Expand All @@ -48,27 +46,6 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
})
}

function handleUserDiceChange(): void {
if (!diceEnabled) {
return
}

updateMemberMFAStatusAsync(props.profile.userId, {
param: {
diceEnabled: !diceEnabled,
},
})
.then(response => {
setMFAEnabled(response.result.content.mfaEnabled)
setDiceEnabled(response.result.content.diceEnabled)
toast.success('Your DICE credential was disabled.')
triggerSurvey()
})
.catch(() => {
toast.error('Something went wrong. Please try again later.')
})
}

function handleDiceModalStatus(): void {
setSetupDiceModalOpen(!setupDiceModalOpen)
}
Expand All @@ -93,6 +70,7 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
name='mfaStatus'
onChange={handleUserMFAChange}
value={mfaEnabled}
disabled={mfaStatusData?.diceEnabled}
/>
)}
/>
Expand All @@ -108,11 +86,12 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
actionElement={(
<div className={styles.diceBtnWrap}>
{
diceEnabled ? (
mfaStatusData?.diceEnabled ? (
<FormToggleSwitch
name='diceEnabled'
onChange={handleUserDiceChange}
onChange={noop}
value={mfaStatusData?.diceEnabled as boolean}
disabled={mfaStatusData?.diceEnabled}
/>
) : (
<Button
Expand All @@ -125,6 +104,15 @@ const Security: FC<SecurityProps> = (props: SecurityProps) => {
/>
)
}
{
mfaStatusData?.diceEnabled && (
<Tooltip
content='Please reach out to support@topcoder.com for deactivating Dice ID.'
>
<IconSolid.InformationCircleIcon />
</Tooltip>
)
}
</div>
)}
/>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
margin: auto;
}

.credentialImage {
height: 280px;
width: 400px;
align-self: center;
}

.diceBigLogo {
margin: $sp-4 0;
}
Expand Down
Loading