diff --git a/src/App.js b/src/App.js
index 6b18280..8d3d647 100644
--- a/src/App.js
+++ b/src/App.js
@@ -35,7 +35,7 @@ const App = () => {
KeyCloakService.doLogin();
}
}
- }, 500);
+ }, 1500);
});
const loggedBarVisibleHandler = () => {
diff --git a/src/api/challengeSubmissionPost.js b/src/api/challengeSubmissionPost.js
index 38f3737..d99bf0b 100644
--- a/src/api/challengeSubmissionPost.js
+++ b/src/api/challengeSubmissionPost.js
@@ -1,29 +1,27 @@
import KeyCloakService from '../services/KeyCloakService';
import {API} from '../utils/globals';
-async function postData(url = '', data = {}) {
- const response = await fetch(url, {
+const challengeSubmission = (challengeName, repoUrl, repoBranch, description) => {
+ const details = {
+ 'f1': description,
+ 'f3': repoUrl,
+ 'f4': repoBranch
+ };
+ let formBody = [];
+ for (let property in details) {
+ let encodedKey = encodeURIComponent(property);
+ let encodedValue = encodeURIComponent(details[property]);
+ formBody.push(encodedKey + '=' + encodedValue);
+ }
+ formBody = formBody.join('&');
+ return fetch(`${API}/challenge-submission/${challengeName}`, {
method: 'POST',
- mode: 'no-cors',
- cache: 'no-cache',
- credentials: 'same-origin',
headers: {
- 'Content-Type': 'application/json',
+ 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Authorization': `Bearer ${KeyCloakService.getToken()}`
},
- redirect: 'follow',
- referrerPolicy: 'no-referrer',
- body: JSON.stringify(data)
+ body: formBody
});
- return response.json();
-}
-
-const challengeSubmission = (challengeName, repoUrl, repoBranch, description) => {
- postData(`${API}/challenge-submission/${challengeName}`,
- {f1: description, f3: repoUrl, f4: repoBranch})
- .then((data) => {
- console.log(data);
- });
};
export default challengeSubmission;
diff --git a/src/assets/filter_direction.svg b/src/assets/filter_direction.svg
new file mode 100644
index 0000000..5e232d0
--- /dev/null
+++ b/src/assets/filter_direction.svg
@@ -0,0 +1,6 @@
+
diff --git a/src/components/sections/Leaderboard/Leaderboard.js b/src/components/sections/Leaderboard/Leaderboard.js
index 0c0d315..27938bd 100644
--- a/src/components/sections/Leaderboard/Leaderboard.js
+++ b/src/components/sections/Leaderboard/Leaderboard.js
@@ -129,7 +129,7 @@ const Leaderboard = (props) => {
const desktopRender = () => {
return (
-
+
Leaderboard
diff --git a/src/components/sections/Leaderboard/_renderSubmissions.js b/src/components/sections/Leaderboard/_renderSubmissions.js
index 6ebc3f3..ebc5081 100644
--- a/src/components/sections/Leaderboard/_renderSubmissions.js
+++ b/src/components/sections/Leaderboard/_renderSubmissions.js
@@ -2,17 +2,19 @@ import {ELEMENTS_PER_PAGE, IS_MOBILE} from '../../../utils/globals';
import {FlexColumn, FlexRow, Grid} from '../../../utils/containers';
import {Body, Medium} from '../../../utils/fonts';
import styled from 'styled-components';
+import theme from '../../../utils/theme';
+
const Line = styled(FlexRow)`
position: absolute;
- top: -6px;
+ top: ${({top}) => top ? top : 'auto'};
+ bottom: ${({bottom}) => bottom ? bottom : 'auto'};
left: 0;
width: 100%;
background-color: ${({theme}) => theme.colors.dark04};
- height: 1px;
+ height: ${({height}) => height ? height : '1px'};
`;
-
const sortBySwitch = (submissions, metricChoose, sortBy) => {
switch (sortBy) {
case 0:
@@ -24,7 +26,6 @@ const sortBySwitch = (submissions, metricChoose, sortBy) => {
case 2:
return submissions.sort((a, b) => a.times - b.times);
case 3:
- console.log(submissions[0].when);
return submissions.sort((a, b) => (a.when > b.when) ? 1 : ((b.when > a.when) ? -1 : 0));
case 4:
return submissions.sort((a, b) => (a.submitter > b.submitter) ? 1 : ((b.submitter > a.submitter) ? -1 : 0));
@@ -35,7 +36,6 @@ const sortBySwitch = (submissions, metricChoose, sortBy) => {
case 6:
return submissions.sort((a, b) => b.times - a.times);
case 7:
- console.log(submissions[0].when);
return submissions.sort((a, b) => (a.when < b.when) ? 1 : ((b.when < a.when) ? -1 : 0));
default:
return submissions.sort((a, b) => b.evaluations[metricChoose].score - a.evaluations[metricChoose].score);
@@ -58,17 +58,19 @@ const _renderSubmissions = (pageNr, submissions, gridGap, metricChoose, sortBy,
}, index) => {
return (
+ gridGap='20px' position='relative' width='100%' padding='4px'>
{index === 0 ? headerElements.map((elem, i) => {
return (
{elem}
+ minWidth={elem === 'result' ? '72px' : 'none'} fontSize='18px' as='td'>
+ {elem}
+
);
}) : ''}
+ {index === 0 ? : ''}
{index + n}
@@ -91,7 +93,7 @@ const _renderSubmissions = (pageNr, submissions, gridGap, metricChoose, sortBy,
{when ? `${when.slice(11, 16)} ${when.slice(0, 10)}`
: 'xxx'}