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
Expand Up @@ -86,12 +86,8 @@ const CopilotOpportunityDetails: FC<{}> = () => {
const [activeTab, setActiveTab]: [string, Dispatch<SetStateAction<string>>] = useState<string>(activeTabHash)

useEffect(() => {
if (isAdminOrPM) {
setActiveTab(activeTabHash)
} else {
setActiveTab('0')
}
}, [activeTabHash, isAdminOrPM])
setActiveTab(activeTabHash)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the isAdminOrPM condition changes the behavior of the useEffect hook. Previously, the activeTab was set to '0' if the user was not an admin or PM. Now, it always sets activeTab to activeTabHash. Ensure this change aligns with the intended functionality and does not introduce any unintended behavior for non-admin/PM users.

}, [activeTabHash])

const handleTabChange = useCallback((tabId: string): void => {
setActiveTab(tabId)
Expand Down Expand Up @@ -286,7 +282,7 @@ const CopilotOpportunityDetails: FC<{}> = () => {
<TabsNavbar
defaultActive={activeTab}
onChange={handleTabChange}
tabs={getCopilotDetailsTabsConfig(isAdminOrPM, copilotApplications?.length || 0)}
tabs={getCopilotDetailsTabsConfig(copilotApplications?.length || 0)}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getCopilotDetailsTabsConfig function call has been modified to remove the isAdminOrPM parameter. Ensure that this change does not affect the logic that determines the tabs configuration, especially if the tabs need to be different for admin or PM users.

/>
)
}
Expand All @@ -297,7 +293,7 @@ const CopilotOpportunityDetails: FC<{}> = () => {
opportunity={opportunity}
members={members}
onApplied={onApplied}
isAdminOrPM
isAdminOrPM={isAdminOrPM}
/>
)}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export enum CopilotDetailsTabViews {
applications = '1',
}

export const getCopilotDetailsTabsConfig = (isAdminOrPM: boolean, count: number): TabsNavItem[] => (isAdminOrPM ? [
export const getCopilotDetailsTabsConfig = (count: number): TabsNavItem[] => ([

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter isAdminOrPM has been removed from the function getCopilotDetailsTabsConfig. Ensure that this change is intentional and that the logic dependent on this parameter is no longer needed.

{
id: CopilotDetailsTabViews.details,
title: 'Details',
Expand All @@ -18,11 +18,6 @@ export const getCopilotDetailsTabsConfig = (isAdminOrPM: boolean, count: number)
id: CopilotDetailsTabViews.applications,
title: 'Applications',
},
] : [
{
id: CopilotDetailsTabViews.details,
title: 'Details',
},
])

export const CopilotDetailsTabsConfig: TabsNavItem[] = [
Expand Down
2 changes: 1 addition & 1 deletion src/apps/copilots/src/services/copilot-opportunities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function copilotOpportunityFactory(data: any): CopilotOpportunity {
return {
...data,
...data.data,
projectName: data.project.name,
projectName: data.project?.name,
}
}

Expand Down
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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The imports for SetStateAction and Dispatch have been removed. Ensure these are not needed elsewhere in the component, as their removal might affect state management if they were previously used.

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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import for LearnConfig has been removed. Verify that this configuration is not required elsewhere in the component, as its removal might lead to missing configuration settings.

interface EnrollCtaBtnProps {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import for DiceModal has been removed. Confirm that this modal is not used in the component, as its removal might affect the UI functionality if it was previously utilized.

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])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency array for the useEffect hook has been modified. Ensure that removing profile?.isWipro and profile?.diceEnabled from the dependencies does not affect the logic that relies on these properties. If the logic depends on changes to these properties, they should be included in the dependency array.


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
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of REQUIRE_DICE_ID from the LearnConfigModel interface may affect any existing code that relies on this property. Ensure that all references to REQUIRE_DICE_ID are updated or removed accordingly in the codebase to prevent runtime errors.

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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import statement for getReactEnv has been removed. Ensure that this function is no longer needed in the codebase. If it is still required, consider re-adding it or refactoring the code to accommodate its absence.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable isTcAcademyPolicyModal is declared but not used in the code. Consider removing it if it's unnecessary to avoid unused state variables.

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment on line 424 seems to be incomplete or not aligned with the current code logic. Consider updating the comment to accurately reflect the conditions being checked in the if statement.

if (isLoggedIn
&& (!LearnConfig.REQUIRE_DICE_ID || !profile?.isWipro || !!profile?.diceEnabled)
&& !!certificateProgress?.academicHonestyPolicyAcceptedAt) {
return
}
Expand Down
Loading