Skip to content

Conversation

hentrymartin
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-1503

What's in this PR?

  • Route modifications in scorecard

* The router outlet.
*/

import { FC, PropsWithChildren, useContext, useEffect, useMemo } from 'react'

Choose a reason for hiding this comment

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

Consider removing unused import PropsWithChildren since ScorecardsContainer does not utilize any children props.


return (
<>
<Outlet />

Choose a reason for hiding this comment

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

The <Outlet /> component is typically used to render child routes. Ensure that the routing logic correctly supports this use case, as it might be redundant with the <Routes>{childRoutes}</Routes> rendering.

@@ -1,10 +1,10 @@
import { FC, useCallback, useMemo, useState } from 'react'
import { FC, useCallback, useContext, useMemo, useState } from 'react'

Choose a reason for hiding this comment

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

It seems like useContext has been added to the import statement, but there is no usage of useContext in the current code diff. Ensure that useContext is actually needed; otherwise, it should be removed to avoid unnecessary imports.


import { PageTitle } from '~/libs/ui'
import { TableLoading } from '~/apps/admin/src/lib'

import { PageWrapper, ScorecardsFilter, TableNoRecord, TableScorecards } from '../../lib'
import { ScorecardsResponse, useFetchScorecards } from '../../lib/hooks'
import { PageWrapper, ScorecardsFilter, TableNoRecord, TableScorecards } from '../../../lib'

Choose a reason for hiding this comment

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

The import path for PageWrapper, ScorecardsFilter, TableNoRecord, and TableScorecards has been changed from ../../lib to ../../../lib. Verify that this change is correct and that the new path accurately reflects the location of these modules.

import { PageWrapper, ScorecardsFilter, TableNoRecord, TableScorecards } from '../../lib'
import { ScorecardsResponse, useFetchScorecards } from '../../lib/hooks'
import { PageWrapper, ScorecardsFilter, TableNoRecord, TableScorecards } from '../../../lib'
import { ScorecardsResponse, useFetchScorecards } from '../../../lib/hooks'

Choose a reason for hiding this comment

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

The import path for ScorecardsResponse and useFetchScorecards has been changed from ../../lib/hooks to ../../../lib/hooks. Ensure that this change is correct and that the new path accurately reflects the location of these hooks.

@@ -85,9 +95,22 @@ export const reviewRoutes: ReadonlyArray<PlatformRoute> = [
route: activeReviewAssigmentsRouteId,
},
{
element: <ScorecardsListPage />,
element: <ScorecardsContainer />,

Choose a reason for hiding this comment

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

The ScorecardsContainer component is introduced here, but ensure that it properly handles the routing logic for its children components ScorecardsListPage and ViewScorecardPage. Verify that the container is necessary and that it doesn't introduce unnecessary complexity.

{
element: <ViewScorecardPage />,
id: 'view-scorecard-page',
route: ':scorecardId',

Choose a reason for hiding this comment

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

The route :scorecardId suggests dynamic routing based on scorecard IDs. Ensure that the ViewScorecardPage component is equipped to handle cases where the scorecardId might be invalid or missing, and consider implementing error handling or redirection logic.


const ViewScorecardPage: FC = () => (
<div>View scorecard</div>
)

Choose a reason for hiding this comment

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

Consider adding a semicolon at the end of the line for consistency with the rest of the codebase.

},

],
element: <ScorecardsContainer />,

Choose a reason for hiding this comment

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

The element property is added here, but ensure that <ScorecardsContainer /> is correctly imported and defined in the file. If it is not imported, the application will fail to render this component.

},

],
element: <ScorecardsContainer />,
id: scorecardRouteId,

Choose a reason for hiding this comment

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

The id and route properties are set to scorecardRouteId. Verify that scorecardRouteId is defined and correctly imported in this file. If it is not defined, it will cause errors in routing.

@@ -29,6 +29,7 @@ const PaymentProviderTable: React.FC<PaymentMethodTableProps> = (props: PaymentM
<th className='body-ultra-small-bold'>CONNECTED PROVIDER</th>
<th className='body-ultra-small-bold'>PROVIDER ID</th>
<th className='body-ultra-small-bold'>STATUS</th>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}

Choose a reason for hiding this comment

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

Disabling the eslint rule jsx-a11y/control-has-associated-label might lead to accessibility issues. Consider providing an appropriate label for the control to ensure it is accessible to all users.

@@ -30,6 +30,7 @@ const TaxFormTable: React.FC<TaxFormTableProps> = (props: TaxFormTableProps) =>
<th className='body-ultra-small-bold'>FORM</th>
<th className='body-ultra-small-bold'>DATE FILED</th>
<th className='body-ultra-small-bold'>STATUS</th>
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}

Choose a reason for hiding this comment

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

Disabling the eslint rule jsx-a11y/control-has-associated-label may lead to accessibility issues. Consider providing an associated label for the control to ensure it is accessible to all users.

@himaniraghav3 himaniraghav3 merged commit 12ea744 into PM-1502-scorecards Aug 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants