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
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 0 additions & 8 deletions src/apps/accounts/src/lib/assets/security/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import { ReactComponent as MFAImage } from './mfa.svg'
import { ReactComponent as AppleStore } from './apple-store.svg'
import credentialImage from './credential.png'
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,
}
4 changes: 0 additions & 4 deletions src/apps/accounts/src/lib/assets/security/mfa.svg

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Dispatch, FC, SetStateAction, useCallback, useContext, useState } from 'react'
import { FC, useCallback, useContext } from 'react'
import { NavigateFunction, useNavigate } from 'react-router-dom'

import { Button } from '~/libs/ui'
import { profileContext, ProfileContextData } from '~/libs/core'

import { getAuthenticateAndEnrollRoute, getTCACertificationEnrollPath } from '../../learn.routes'
import { LearnConfig } from '../../config'
import { DiceModal } from '../../course-details/course-curriculum/dice-modal'

interface EnrollCtaBtnProps {
certification: string
Expand All @@ -15,15 +13,9 @@ interface EnrollCtaBtnProps {
const EnrollCtaBtn: FC<EnrollCtaBtnProps> = (props: EnrollCtaBtnProps) => {
const navigate: NavigateFunction = useNavigate()
const { initialized: profileReady, profile }: ProfileContextData = useContext(profileContext)
const [isDiceModalOpen, setIsDiceModalOpen]: [boolean, Dispatch<SetStateAction<boolean>>]
= useState<boolean>(false)

const isLoggedIn: boolean = profileReady && !!profile

function onDiceModalClose(): void {
setIsDiceModalOpen(false)
}

/**
* Handle user click on start course/resume/login button
*/
Expand All @@ -37,15 +29,8 @@ const EnrollCtaBtn: FC<EnrollCtaBtnProps> = (props: EnrollCtaBtnProps) => {
return
}

// if the user is wipro and s/he hasn't set up DICE,
// let the user know
if (LearnConfig.REQUIRE_DICE_ID && profile?.isWipro && !profile.diceEnabled) {
setIsDiceModalOpen(true)
return
}

navigate(getTCACertificationEnrollPath(props.certification))
}, [isLoggedIn, profile?.isWipro, profile?.diceEnabled, props, navigate])
}, [isLoggedIn, props, navigate])

return (
<>
Expand All @@ -55,11 +40,6 @@ const EnrollCtaBtn: FC<EnrollCtaBtnProps> = (props: EnrollCtaBtnProps) => {
label={isLoggedIn ? 'Enroll Now' : 'Log in to enroll'}
onClick={handleEnrollClick}
/>

<DiceModal
isOpen={isDiceModalOpen}
onClose={onDiceModalClose}
/>
</>
)
}
Expand Down
1 change: 0 additions & 1 deletion src/apps/learn/src/config/learn-config.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ export interface LearnConfigModel {
value: string,
}
CLIENT: string
REQUIRE_DICE_ID: boolean | undefined
}
2 changes: 0 additions & 2 deletions src/apps/learn/src/config/learn.default.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { EnvironmentConfig } from '~/config'
import { getReactEnv } from '~/config/environments/react-env'

import { LearnConfigModel } from './learn-config.model'

Expand All @@ -14,5 +13,4 @@ export const LearnConfigDefault: LearnConfigModel = {
value: 'certificate-container',
},
CLIENT: 'https://fcc.topcoder-dev.com:4431',
REQUIRE_DICE_ID: `${getReactEnv<string>('REQUIRE_DICE_ID', '')}` === 'true',
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ import {
getLessonPathFromCurrentLesson,
LEARN_PATHS,
} from '../../learn.routes'
import { LearnConfig } from '../../config'

import { CurriculumSummary } from './curriculum-summary'
import { TcAcademyPolicyModal } from './tc-academy-policy-modal'
import { DiceModal } from './dice-modal'
import styles from './CourseCurriculum.module.scss'

interface CourseCurriculumProps {
Expand All @@ -47,8 +45,6 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp

const [isTcAcademyPolicyModal, setIsTcAcademyPolicyModal]: [boolean, Dispatch<SetStateAction<boolean>>]
= useState<boolean>(false)
const [isDiceModalOpen, setIsDiceModalOpen]: [boolean, Dispatch<SetStateAction<boolean>>]
= useState<boolean>(false)

const status: string = props.progress?.status ?? UserCertificationProgressStatus.inititialized
const completedPercentage: number = (props.progress?.courseProgressPercentage ?? 0) / 100
Expand Down Expand Up @@ -98,17 +94,6 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp
return
}

// if the user is wipro and s/he hasn't set up DICE,
// let the user know
if (
LearnConfig.REQUIRE_DICE_ID
&& props.profile?.isWipro
&& !props.profile.diceEnabled
) {
setIsDiceModalOpen(true)
return
}

// Check if user accepted policy and resume(or start) the course
if (props.progress?.academicHonestyPolicyAcceptedAt) {
handleStartCourse()
Expand Down Expand Up @@ -188,10 +173,6 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp
setIsTcAcademyPolicyModal(false)
}

function onDiceModalClose(): void {
setIsDiceModalOpen(false)
}

return (
<>
<div className={styles.wrap}>
Expand Down Expand Up @@ -232,11 +213,6 @@ const CourseCurriculum: FC<CourseCurriculumProps> = (props: CourseCurriculumProp
onClose={onAcademicHonestyModalClose}
onConfirm={handlePolicyAccept}
/>

<DiceModal
isOpen={isDiceModalOpen}
onClose={onDiceModalClose}
/>
</>
)
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 1 addition & 4 deletions src/apps/learn/src/free-code-camp/FreeCodeCamp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
getCoursePath,
getLessonPathFromModule,
} from '../learn.routes'
import { LearnConfig } from '../config'
import { CoursePageContextValue, useCoursePageContext } from '../course-page-wrapper'

import { useCheckAndMarkCourseCompleted } from './hooks/use-mark-course-completed'
Expand Down Expand Up @@ -410,7 +409,7 @@ const FreeCodeCamp: FC<{}> = () => {

/**
* Check if the user accepted the academic honesty policy
* and either is not a wipro user or the wipro user has dice enabled.
* and either is not a wipro user.
* if not, redirect user to course details page to accept the policy
*/
useLayoutEffect(() => {
Expand All @@ -421,11 +420,9 @@ const FreeCodeCamp: FC<{}> = () => {
}

// if the user is logged in,
// and the user is a either not wipro user or is a wipro user with dice enabled,
// and if the user has accepted the academic honesty policy,
// the user is permitted to take the course, so there's nothing to do.
if (isLoggedIn
&& (!LearnConfig.REQUIRE_DICE_ID || !profile?.isWipro || !!profile?.diceEnabled)
&& !!certificateProgress?.academicHonestyPolicyAcceptedAt) {
return
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 0 additions & 8 deletions src/apps/wallet-admin/src/lib/assets/security/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import { ReactComponent as MFAImage } from './mfa.svg'
import { ReactComponent as AppleStore } from './apple-store.svg'
import credentialImage from './credential.png'
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,
}
4 changes: 0 additions & 4 deletions src/apps/wallet-admin/src/lib/assets/security/mfa.svg

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 0 additions & 8 deletions src/apps/wallet/src/lib/assets/security/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import { ReactComponent as MFAImage } from './mfa.svg'
import { ReactComponent as AppleStore } from './apple-store.svg'
import credentialImage from './credential.png'
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,
}
4 changes: 0 additions & 4 deletions src/apps/wallet/src/lib/assets/security/mfa.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/libs/core/lib/auth/user-functions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export {
getDiceStatusAsync as userGetDiceStatusAsync,
updatePasswordAsync as userUpdatePasswordAsync,
} from './user.functions'
1 change: 0 additions & 1 deletion src/libs/core/lib/auth/user-functions/user-store/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export {
getMfaStatusAsync as userStoreGetMfaStatusAsync,
patchAsync as userStorePatchAsync,
} from './user-xhr.store'
export { type UserPatchRequest } from './user-xhr.store'
Loading
Loading