Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 2 additions & 3 deletions src/shared/actions/page/submission_management.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ const Api = services.api.default;

function loadAiWorkflowRunsInit() {}

function loadAiWorkflowRunsDone(tokenV3, submissionId, aiWorkflowId) {
function loadAiWorkflowRunsDone(tokenV3, submissionId) {
const api = new Api(config.API.V6, tokenV3);
const url = `/workflows/${aiWorkflowId}/runs?submissionId=${submissionId}`;
const url = `/workflows/runs?submissionId=${submissionId}`;

return api.get(url)
.then(res => res.json())
.then(data => ({
submissionId,
aiWorkflowId,
runs: data,
}))
.catch((err) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ export default function Submission(props) {
}
}

console.log('showScreeningDetails updated to:', showScreeningDetails);


return (
<tr styleName="submission-row">
<td styleName="id-col">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ $submission-space-50: $base-unit * 10;
.review-button {
cursor: pointer;
color: $color-turq-160;
font-size: small;
font-size: medium;
font-weight: 700;
}

.download-button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export default function SubmissionsTable(props) {
<div styleName="workflow-table">
<TableWorkflowRuns
workflowRuns={workflowRunsForSubmission}
challengeId={challenge.id}
/>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ const TABLE_DATE_FORMAT = 'MMM DD YYYY, HH:mm A';
const getRunStatusText = (run) => {
if (!run) return '';

if (run.status === 'IN_PROGRESS' || run.status === 'QUEUED') return 'Pending';
if (run.status === 'FAILED') return 'Failed';
if (run.status === 'IN_PROGRESS' || run.status === 'QUEUED') return 'PENDING';
if (run.status === 'FAILED') return 'FAILED';
if (run.status === 'SUCCESS') {
const passingScore = run.workflow && run.workflow.scorecard
? run.workflow.scorecard.minimumPassingScore
: 0;
return run.score >= passingScore ? 'Passed' : 'Failed Score';
return run.score >= passingScore ? 'PASSED' : 'FAILED';
}

return run.status;
};

export default function TableWorkflowRuns(props) {
const { workflowRuns } = props;
const { workflowRuns, challengeId } = props;
if (!workflowRuns || Object.keys(workflowRuns).length === 0) {
return null;
}
Expand Down Expand Up @@ -54,7 +54,7 @@ export default function TableWorkflowRuns(props) {
if (run.workflow.id) {
return (
<a
href={`${config.REVIEW_APP_URL}/scorecard/${run.workflow.scorecard.id}`}
href={`${config.REVIEW_APP_URL}/active-challenges/${challengeId}/reviews/${run.submissionId}?workflowId=${run.workflowId}`}
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -80,4 +80,5 @@ TableWorkflowRuns.defaultProps = {

TableWorkflowRuns.propTypes = {
workflowRuns: PT.shape(),
challengeId: PT.string.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $submission-space-25: $base-unit * 5;
$submission-space-50: $base-unit * 10;

.workflow-table {
margin: 20px;
margin: 20px 0px;
border-collapse: collapse;

th,
Expand All @@ -19,7 +19,7 @@ $submission-space-50: $base-unit * 10;
font-weight: 600;
line-height: $status-space-20;
vertical-align: middle;
padding: 8px 12px !important;
padding: 12px !important;
}

th {
Expand Down
16 changes: 6 additions & 10 deletions src/shared/containers/SubmissionManagement/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,11 @@ class SubmissionManagementPageContainer extends React.Component {
if (!challenge || !Array.isArray(challenge.reviewers) || !mySubmissions) return;

mySubmissions.forEach((submission) => {
challenge.reviewers.forEach((reviewer) => {
if (!reviewer.aiWorkflowId) return;
const key = `${submission.id}`;
if (this.loadedWorkflowKeys.has(key)) return;

const key = `${submission.id}-${reviewer.aiWorkflowId}`;
if (this.loadedWorkflowKeys.has(key)) return;

this.loadedWorkflowKeys.add(key);
loadAiWorkflowRuns(authTokens, submission.id, reviewer.aiWorkflowId);
});
this.loadedWorkflowKeys.add(key);
loadAiWorkflowRuns(authTokens, submission.id);
});


Expand Down Expand Up @@ -637,10 +633,10 @@ const mapDispatchToProps = dispatch => ({
dispatch(a.getSubmissionsDone(challengeId, tokens.tokenV3));
},

loadAiWorkflowRuns: (tokens, submissionId, aiWorkflowId) => {
loadAiWorkflowRuns: (tokens, submissionId) => {
dispatch(smpActions.page.submissionManagement.loadAiWorkflowRunsInit());
dispatch(smpActions.page.submissionManagement.loadAiWorkflowRunsDone(
tokens.tokenV3, submissionId, aiWorkflowId,
tokens.tokenV3, submissionId,
));
},
});
Expand Down
Loading