-
Notifications
You must be signed in to change notification settings - Fork 13
Topcoder Admin App - Misc Update 0601 #1093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1,7 +1,7 @@ | |||
import { FC, useMemo } from 'react' | |||
import { format } from 'date-fns' | |||
|
|||
import { CheckIcon, XIcon } from '@heroicons/react/solid' | |||
import { CheckIcon } from '@heroicons/react/solid' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The XIcon
import has been removed. Ensure that this icon is not used elsewhere in the component. If it is needed, it should be re-imported.
@@ -36,22 +35,15 @@ const ApproveButton: FC<{ | |||
openReviews: number | |||
approvingReviewerId: number | |||
onApproveApplication: ReviewerListProps['onApproveApplication'] | |||
onUnapproveApplication: ReviewerListProps['onUnapproveApplication'] | |||
}> = props => { | |||
const handleApprove = useEventCallback((): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The onUnapproveApplication
prop has been removed from the component's props. Ensure that this is intentional and that the functionality for unapproving an application is no longer required.
const handleRemove = useEventCallback((): void => { | ||
props.onUnapproveApplication(props.reviewer) | ||
}) | ||
|
||
const isApproving = props.approvingReviewerId === props.reviewer.userId | ||
const isOtherApproving = props.approvingReviewerId > 0 | ||
const hideApproveButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The handleRemove
function has been removed. Verify that the removal of this function aligns with the intended functionality changes, as it was previously used to handle unapproving applications.
@@ -61,19 +53,7 @@ const ApproveButton: FC<{ | |||
className={styles.approvingLoadingSpinner} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The showRemoveButton
logic has been removed. Confirm that the removal of this logic is intended and that the UI no longer requires a remove button for approved applications.
</Button> | ||
) | ||
) : ( | ||
!hideApproveButton && ( | ||
<Button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variant='danger'
prop was removed from the Button
component. If this was intentional, ensure that the styling and behavior of the button still meet the requirements. If it was not intentional, consider adding it back to maintain the previous styling.
@@ -2,11 +2,11 @@ | |||
* Model for table roles filter | |||
*/ | |||
export type TableRolesFilter = { | |||
id: string | |||
id?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The id
field has been changed to optional. Ensure that this change aligns with the intended functionality and that all parts of the application that rely on this field being present are updated accordingly.
modifiedAtString: string | ||
createdByHandle: string | ||
modifiedByHandle: string | ||
createdAtString?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The createdAtString
field has been made optional. Verify that this change does not affect any logic that assumes this field is always present.
createdByHandle: string | ||
modifiedByHandle: string | ||
createdAtString?: string | ||
modifiedAtString?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The modifiedAtString
field is now optional. Check if there are any dependencies or logic that require this field to be non-optional.
modifiedByHandle: string | ||
createdAtString?: string | ||
modifiedAtString?: string | ||
createdByHandle?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The createdByHandle
field has been changed to optional. Ensure that this change does not break any existing functionality that expects this field to be mandatory.
createdAtString?: string | ||
modifiedAtString?: string | ||
createdByHandle?: string | ||
modifiedByHandle?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The modifiedByHandle
field is now optional. Confirm that this change is consistent with the application's requirements and does not introduce any issues.
@@ -134,7 +134,7 @@ export function isValidNumber(value: number | undefined): boolean { | |||
/** | |||
* validation schema for form new billing account | |||
*/ | |||
export const formEditBillingAccountSchema: Yup.ObjectSchema<FormEditBillingAccount> | |||
export const formAddBillingAccountSchema: Yup.ObjectSchema<FormEditBillingAccount> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name formAddBillingAccountSchema
suggests that this schema is for adding a new billing account, but the type FormEditBillingAccount
implies it is for editing. Ensure the naming is consistent with the intended use of the schema.
/** | ||
* validation schema for form new billing account | ||
*/ | ||
export const formEditBillingAccountSchema: Yup.ObjectSchema<FormEditBillingAccount> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable formEditBillingAccountSchema
is declared twice in the file. Consider renaming the newly added schema to avoid conflicts and ensure clarity.
.trim() | ||
.required('Description is required.'), | ||
endDate: Yup.date() | ||
.required('End date is required.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a .nullable()
method to the endDate
field to handle cases where the date might be null.
salesTax: Yup.number() | ||
.required('Sales tax is required.'), | ||
startDate: Yup.date() | ||
.required('Start date is required.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a .nullable()
method to the startDate
field to handle cases where the date might be null.
.trim() | ||
.required('PO Number is required.'), | ||
salesTax: Yup.number() | ||
.required('Sales tax is required.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The salesTax
field should have a .typeError('Invalid number.')
similar to other number fields for consistency in error messaging.
@@ -7,7 +7,7 @@ import { | |||
useRef, | |||
useState, | |||
} from 'react' | |||
import { NavigateFunction, useNavigate, useParams } from 'react-router-dom' | |||
import { useParams } from 'react-router-dom' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NavigateFunction
and useNavigate
imports have been removed. Ensure that these are not used elsewhere in the file, as their removal could lead to runtime errors if they are still needed.
@@ -63,7 +63,6 @@ export const ManageReviewerPage: FC = () => { | |||
challengeId: string | |||
}>() | |||
const [challengeUuid, setChallengeUuid] = useState('') | |||
const navigate: NavigateFunction = useNavigate() | |||
const [filterCriteria, setFilterCriteria]: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The navigate
variable declaration has been removed. Ensure that this removal does not affect any navigation functionality within the component. If navigate
was used elsewhere in the code, consider refactoring those parts to avoid errors.
primary | ||
onClick={handleRejectPendingConfirmDialog} | ||
size='lg' | ||
to={`${rootRoute}/challenge-management/${challengeUuid}/manage-user`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The to
prop in the LinkButton
component should be reviewed to ensure it correctly constructs the URL. Verify that rootRoute
, challengeUuid
, and the rest of the path are correctly defined and concatenated to form a valid URL.
@@ -232,7 +233,6 @@ export const ManageReviewerPage: FC = () => { | |||
reviewers={reviewers} | |||
openReviews={openReviews} | |||
onApproveApplication={approve} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The onUnapproveApplication
prop has been removed. Ensure that this is intentional and that the functionality for unapproving applications is no longer needed. If it is still required, consider re-adding it or implementing the functionality elsewhere.
Challenge https://www.topcoder.com/challenges/9142a4d0-2806-4ff2-b023-a69c274daac8