Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(submit-score): remove multiple file upload attribute, add accept attribute #2320

6 changes: 3 additions & 3 deletions client/src/pages/course/submit-scores.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import UploadOutlined from '@ant-design/icons/UploadOutlined';
import { Button, Form, List, message, Table, Typography, Upload } from 'antd';
import { UploadFile } from 'antd/lib/upload/interface';
import type { UploadChangeParam, UploadFile } from 'antd/lib/upload/interface';
import { PageLayoutSimple } from 'components/PageLayout';
import { CourseTaskSelect } from 'components/Forms';
import csv from 'csvtojson';
Expand Down Expand Up @@ -40,7 +40,7 @@ export function SubmitScorePage() {

const handleTaskChange = () => setSubmitResults([]);

const handleFileChose = (info: any) => {
const handleFileChose = (info: UploadChangeParam<UploadFile>) => {
let newSelectedFileList: Map<string, UploadFile> = new Map(selectedFileList);
switch (info.file.status) {
case 'uploading':
Expand Down Expand Up @@ -109,7 +109,7 @@ export function SubmitScorePage() {
<Upload
fileList={Array.from(selectedFileList).map(([, file]) => file)}
onChange={handleFileChose}
multiple={true}
accept=".csv"
>
<Button>
<UploadOutlined /> Select files
Expand Down