-
Notifications
You must be signed in to change notification settings - Fork 13
Topcoder Admin App - Marathon Match Functionality #1092
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.blockTableContainer { | ||
position: relative; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/** | ||
* Manage Submission Page. | ||
*/ | ||
import { FC } from 'react' | ||
import { useParams } from 'react-router-dom' | ||
import classNames from 'classnames' | ||
|
||
import { LinkButton } from '~/libs/ui' | ||
|
||
import { | ||
useManageBusEvent, | ||
useManageBusEventProps, | ||
useManageChallengeSubmissions, | ||
useManageChallengeSubmissionsProps, | ||
} from '../../lib/hooks' | ||
import { | ||
ActionLoading, | ||
PageWrapper, | ||
SubmissionTable, | ||
TableLoading, | ||
TableNoRecord, | ||
} from '../../lib' | ||
|
||
import styles from './ManageSubmissionPage.module.scss' | ||
|
||
interface Props { | ||
className?: string | ||
} | ||
|
||
export const ManageSubmissionPage: FC<Props> = (props: Props) => { | ||
const { challengeId = '' }: { challengeId?: string } = useParams<{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The destructuring of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @suppermancool - Can you double check this please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmgasper, the intermediate type annotation is required by eslint without it the 'yarn lint' will fail |
||
challengeId: string | ||
}>() | ||
const { isRunningTest, isRunningTestBool, doPostBusEvent }: useManageBusEventProps | ||
= useManageBusEvent() | ||
|
||
const { | ||
isLoading, | ||
submissions, | ||
isRemovingSubmission, | ||
isRemovingSubmissionBool, | ||
isRemovingReviewSummations, | ||
isRemovingReviewSummationsBool, | ||
doRemoveSubmission, | ||
doRemoveReviewSummations, | ||
showSubmissionHistory, | ||
setShowSubmissionHistory, | ||
}: useManageChallengeSubmissionsProps | ||
= useManageChallengeSubmissions(challengeId) | ||
|
||
return ( | ||
<PageWrapper | ||
pageTitle='Submission Management' | ||
className={classNames(styles.container, props.className)} | ||
headerActions={( | ||
<LinkButton primary light to='./../..' size='lg'> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a more descriptive path for the |
||
Back | ||
</LinkButton> | ||
)} | ||
> | ||
{isLoading ? ( | ||
<TableLoading /> | ||
) : ( | ||
<> | ||
{submissions.length === 0 ? ( | ||
<TableNoRecord /> | ||
) : ( | ||
<div className={styles.blockTableContainer}> | ||
<SubmissionTable | ||
datas={submissions} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The prop There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @suppermancool - Can you fix please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmgasper done in the latest commit |
||
isRemovingSubmission={isRemovingSubmission} | ||
doRemoveSubmission={doRemoveSubmission} | ||
isRemovingReviewSummations={ | ||
isRemovingReviewSummations | ||
} | ||
doRemoveReviewSummations={ | ||
doRemoveReviewSummations | ||
} | ||
isRunningTest={isRunningTest} | ||
doPostBusEvent={doPostBusEvent} | ||
showSubmissionHistory={showSubmissionHistory} | ||
setShowSubmissionHistory={setShowSubmissionHistory} | ||
/> | ||
|
||
{(isRemovingSubmissionBool | ||
|| isRunningTestBool | ||
|| isRemovingReviewSummationsBool) && ( | ||
<ActionLoading /> | ||
)} | ||
</div> | ||
)} | ||
</> | ||
)} | ||
</PageWrapper> | ||
) | ||
} | ||
|
||
export default ManageSubmissionPage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as ManageSubmissionPage } from './ManageSubmissionPage' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* App config for bus event | ||
*/ | ||
import { v4 as uuidv4 } from 'uuid' | ||
|
||
import { RequestBusAPI } from '../lib/models' | ||
|
||
/** | ||
* Create data for bus event | ||
* @param submissionId submission id | ||
* @param testType test type | ||
* @returns data for bus event | ||
*/ | ||
export const CREATE_BUS_EVENT_DATA_SUBMISSION_MARATHON_MATCH = ( | ||
submissionId: string, | ||
testType: string, | ||
): RequestBusAPI => ({ | ||
'mime-type': 'application/json', | ||
originator: 'MMFinalScoreProcessor', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a constant or configuration setting for the originator value 'MMFinalScoreProcessor' to avoid hardcoding it directly in the function. This can improve maintainability and make it easier to update if the originator changes in the future. |
||
payload: { | ||
id: uuidv4(), | ||
resource: 'score', | ||
submissionId, | ||
testType, | ||
}, | ||
timestamp: new Date() | ||
.toISOString(), | ||
topic: 'submission.notification.score', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider using a constant or configuration setting for the topic value 'submission.notification.score' to avoid hardcoding it directly in the function. This can improve maintainability and make it easier to update if the topic changes in the future. |
||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ import { | |
import { useEventCallback } from '../../hooks' | ||
import { Challenge, ChallengeFilterCriteria, ChallengeType } from '../../models' | ||
import { Paging } from '../../models/challenge-management/Pagination' | ||
import { checkIsMM } from '../../utils' | ||
|
||
import { MobileListView } from './MobileListView' | ||
import styles from './ChallengeList.module.scss' | ||
|
@@ -134,6 +135,7 @@ const Actions: FC<{ | |
challenge: Challenge | ||
currentFilters: ChallengeFilterCriteria | ||
}> = props => { | ||
const isMM = useMemo(() => checkIsMM(props.challenge), [props.challenge]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider renaming the |
||
const [openDropdown, setOpenDropdown] = useState(false) | ||
const navigate = useNavigate() | ||
const goToManageUser = useEventCallback(() => { | ||
|
@@ -208,6 +210,16 @@ const Actions: FC<{ | |
> | ||
Resources | ||
</li> | ||
{isMM && ( | ||
<li | ||
onClick={function onClick() { | ||
navigate(`${props.challenge.id}/manage-submission`) | ||
setOpenDropdown(false) | ||
}} | ||
> | ||
Submissions | ||
</li> | ||
)} | ||
</ul> | ||
</DropdownMenu> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@import '@libs/ui/styles/includes'; | ||
|
||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
padding-bottom: $sp-8; | ||
|
||
@include ltelg { | ||
padding-bottom: $sp-4; | ||
} | ||
} | ||
|
||
.rowActions { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.desktopTable { | ||
td { | ||
vertical-align: middle; | ||
} | ||
} |
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 component
<ManageSubmissionPage />
is added here, but ensure that it is imported correctly at the top of the file. If it's not imported, it will cause a runtime error.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.
@suppermancool - Can you double check t his please?
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.
@jmgasper this code is correct