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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ test('Matches shallow shapshot', () => {
const renderer = new Renderer();
renderer.render((
<SubmissionsTable
challenge={{ id: 'test-challenge' }}
showDetails={{ 12345: true }}
submissionObjects={[{
id: '12345',
Expand All @@ -17,6 +18,7 @@ test('Matches shallow shapshot', () => {

renderer.render((
<SubmissionsTable
challenge={{ id: 'test-challenge' }}
showDetails={{ 12345: true }}
track="Design"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ exports[`Matches shallow shapshot 1`] = `
</thead>
<tbody>
<Submission
challenge={
Object {
"id": "test-challenge",
}
}
onDelete={[Function]}
onDownload={[Function]}
onOpenDownloadArtifactsModal={[Function]}
Expand All @@ -49,6 +54,7 @@ exports[`Matches shallow shapshot 1`] = `
className="src-shared-components-SubmissionManagement-SubmissionsTable-___styles__workflow-table___WCWMZ"
>
<TableWorkflowRuns
challengeId="test-challenge"
workflowRuns={null}
/>
</div>
Expand Down
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 @@ -76,8 +76,10 @@ export default function TableWorkflowRuns(props) {

TableWorkflowRuns.defaultProps = {
workflowRuns: [],
challengeId: '',
};

TableWorkflowRuns.propTypes = {
workflowRuns: PT.shape(),
challengeId: PT.string,
};
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 0;
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