meta description and favicon update, correct error in MyEntries

This commit is contained in:
Mateusz Tylka 2023-02-14 10:00:15 +01:00
parent 02fd22b56f
commit 935a09abe9
4 changed files with 64 additions and 73 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000"/> <meta name="theme-color" content="#000000"/>
<meta <meta
name="description" name="description"
content="Web site created using create-react-app" content="A data challenge platform for machine learning research, competition, cooperation and reproducibility."
/> />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png"/> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png"/>
<!-- <!--

View File

@ -1,58 +1,68 @@
import {API} from '../utils/globals'; import { API } from '../utils/globals';
import KeyCloakService from '../services/KeyCloakService'; import KeyCloakService from '../services/KeyCloakService';
const getMyEntries = (challengeName, setDataOriginalState, setDataStateForSearch, setDataState, setLoadingState, setScoreSorted) => { const getMyEntries = (
fetch(`${API}/challenge-my-submissions/${challengeName}`, { challengeName,
headers: {'Authorization': `Bearer ${KeyCloakService.getToken()}`} setDataOriginalState,
}) setDataStateForSearch,
.then(response => response.json()) setDataState,
.then(data => { setLoadingState,
setDataOriginalState(data); setScoreSorted
let item = {}; ) => {
let result = []; fetch(`${API}/challenge-my-submissions/${challengeName}`, {
let initSetScoreSorted = []; headers: { Authorization: `Bearer ${KeyCloakService.getToken()}` },
let tests = data.tests; })
for (let submission of data.submissions) { .then((response) => response.json())
for (let evaluation of submission.evaluations) { .then((data) => {
item = { setDataOriginalState(data);
...item, let item = {};
evaluations: { let result = [];
...item.evaluations, let initSetScoreSorted = [];
[`${evaluation.test.metric}.${evaluation.test.name}`]: evaluation.score let tests = data.tests;
} for (let submission of data.submissions) {
}; for (let evaluation of submission.evaluations) {
} item = {
for (let test of tests) { ...item,
if (item.evaluations) { evaluations: {
if (!Object.hasOwn(item.evaluations, `${test.metric}.${test.name}`)) { ...item.evaluations,
item = { [`${evaluation.test.metric}.${evaluation.test.name}`]:
...item, evaluation.score,
evaluations: { },
...item.evaluations, };
[`${test.metric}.${test.name}`]: '-1' }
} for (let test of tests) {
}; if (item.evaluations) {
} if (
} !Object.hasOwn(item.evaluations, `${test.metric}.${test.name}`)
} ) {
item = { item = {
...item, ...item,
id: submission.id, evaluations: {
submitter: submission.submitter, ...item.evaluations,
when: submission.when, [`${test.metric}.${test.name}`]: '-1',
}; },
result.push(item); };
item = {};
} }
// eslint-disable-next-line no-unused-vars }
for (let _ of tests) { }
initSetScoreSorted.push(false); item = {
} ...item,
setScoreSorted(initSetScoreSorted); id: submission.id,
setDataStateForSearch(result); submitter: submission.submitter,
setDataState(result); when: submission.when,
setLoadingState(false); };
}); result.push(item);
item = {};
}
// eslint-disable-next-line no-unused-vars
for (let _ of tests) {
initSetScoreSorted.push(false);
}
setScoreSorted(initSetScoreSorted);
setDataStateForSearch(result);
setDataState(result);
setLoadingState(false);
});
}; };
export default getMyEntries; export default getMyEntries;

View File

@ -152,29 +152,10 @@ const MyEntries = (props) => {
const desktopRender = () => { const desktopRender = () => {
return ( return (
<FlexColumn padding="24px" as="section" width="100%" maxWidth="1400px"> <FlexColumn padding="24px" as="section" width="100%" maxWidth="1400px">
<H2 as="h2" margin="0 0 32px 0">
My entries
</H2>{' '}
<FlexColumn padding="24px 12px" width="70%" as="section" id="start"> <FlexColumn padding="24px 12px" width="70%" as="section" id="start">
<H2 as="h2" margin="0 0 12px 0"> <H2 as="h2" margin="0 0 12px 0">
My Entries My Entries
</H2> </H2>
{!loading ? (
<>
<Search searchQueryHandler={searchQueryHandler} />
<Pager
pageNr={pageNr}
width="48px"
borderRadius="64px"
pages={CALC_PAGES(myEntries)}
nextPage={nextPage}
previousPage={previousPage}
number={`${pageNr} / ${CALC_PAGES(myEntries)}`}
/>
</>
) : (
<Loading />
)}
</FlexColumn> </FlexColumn>
{myEntries && !loading ? ( {myEntries && !loading ? (
<> <>