Skip to content

Commit 5afa9e5

Browse files
committed
A few minor fixed related to Submission Management Page
#11 #12 #14
1 parent ba5b0ab commit 5afa9e5

File tree

7 files changed

+38
-10
lines changed

7 files changed

+38
-10
lines changed

config/default.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@
1717
/* If true the cookies set by this App will only be transmitted over secure
1818
* protocols like https. */
1919
"SECURE": false
20-
}
20+
},
21+
22+
/* Base URL of various parts of TC backend. */
23+
/* TODO: Should we move these properties under the API section of config? */
24+
"HELP_URL": "https://help.topcoder-dev.com",
25+
"OR_BASE_URL": "https://software.topcoder-dev.com",
26+
"STUDIO_URL": "https://studio.topcoder-dev.com",
27+
"TC_BASE_URL": "https://www.topcoder-dev.com"
2128
}

config/development.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
{
2-
"TC_BASE_URL": "https://www.topcoder-dev.com",
3-
"OR_BASE_URL": "https://software.topcoder-dev.com",
4-
"HELP_URL": "https://help.topcoder-dev.com"
5-
62
}

config/production.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"V3": "https://api.topcoder.com/v3"
66
},
77

8-
"TC_BASE_URL": "https://www.topcoder.com",
8+
"HELP_URL": "https://help.topcoder.com",
99
"OR_BASE_URL": "https://software.topcoder.com",
10-
"HELP_URL": "https://help.topcoder.com"
10+
"STUDIO_URL": "https://studio.topcoder.com",
11+
"TC_BASE_URL": "https://www.topcoder.com"
1112
}

src/shared/actions/smp.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
* My submissions management page specific actions.
33
*/
44

5+
/* global fetch */
6+
57
import _ from 'lodash';
8+
import 'isomorphic-fetch';
69
import { createActions } from 'redux-actions';
710
import { getApiV2, getApiV3 } from 'services/api';
11+
import config from 'utils/config';
12+
import logger from 'utils/logger';
813

914
const apiV2 = (auth) => getApiV2(auth.tokenV2);
1015
const apiV3 = (auth) => getApiV3(auth.tokenV3);
@@ -17,7 +22,23 @@ function deleteSubmission(challengeId, submissionId) {
1722
}
1823

1924
function downloadSubmission(tokens, type, submissionId) {
20-
return apiV2(tokens).fetch(`/${type}/download/${submissionId}?submissionType=${'original'}`);
25+
/*
26+
TODO: This will work with legacy API once we pass the tcsso cookie
27+
along with the request.
28+
const url = `${config.STUDIO_URL}?module=DownloadSubmission&sbmid=${submissionId}&sbt=original`;
29+
fetch(url, {
30+
mode: 'no-cors',
31+
});
32+
*/
33+
const endpoint = `/${type}/download/${submissionId}?submissionType=original`;
34+
return apiV2(tokens).get(endpoint).then(res =>
35+
new Promise(resolve =>
36+
res.json().then((json) => {
37+
if (res.status !== 200) logger.error(json);
38+
resolve(json);
39+
}),
40+
),
41+
);
2142
}
2243

2344
export default createActions({

src/shared/components/SubmissionManagement/Submission/styles.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ $submission-space-50: $base-unit * 10;
7474

7575
.action-col {
7676
text-align: center;
77+
path {
78+
fill: $tc-gray-80;
79+
}
7780

7881
.delete-icon {
7982
margin: 0 $submission-space-25;

src/shared/components/SubmissionManagement/SubmissionManagement/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $light-gray-color: $tc-gray-neutral-light;
7171
font-weight: 400;
7272
padding: 25px 50px;
7373
background: $light-gray-color;
74-
border-bottom: 1px solid $tc-gray-neutral-light;
74+
border-bottom: 1px solid $tc-gray-neutral-dark;
7575

7676
.left-col {
7777
padding-right: 20px;

src/shared/components/SubmissionManagement/SubmissionsTable/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ $submission-space-50: $base-unit * 10;
2525

2626
th {
2727
font-size: 13px;
28-
color: $tc-black;
28+
color: $tc-gray-50;
2929
font-weight: 500;
3030
line-height: $status-space-20;
3131
text-align: left;

0 commit comments

Comments
 (0)