Skip to content

Commit 7390382

Browse files
committed
Files: отображать загружаемые файлы сразу
1 parent fcaaf83 commit 7390382

2 files changed

Lines changed: 34 additions & 31 deletions

File tree

hwproj.front/src/components/Homeworks/CourseHomeworkExperimental.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,13 +461,13 @@ const CourseHomeworkExperimental: FC<{
461461
<Typography component="div" style={{color: "#454545"}} gutterBottom variant="body1">
462462
<MarkdownPreview value={homework.description!}/>
463463
</Typography>
464-
{props.isProcessing ? (
465-
<div style={{display: 'flex', alignItems: 'center', color: '#1976d2', fontWeight: '500'}}>
466-
<CircularProgress size="20px"/>
467-
&nbsp;&nbsp;Обрабатываем файлы...
468-
</div>
469-
) : filesInfo.length > 0 && (
464+
{filesInfo.length > 0 && (
470465
<div>
466+
{props.isProcessing &&
467+
<div style={{display: 'flex', alignItems: 'center', color: '#1976d2', fontWeight: '500'}}>
468+
<CircularProgress size="20px"/>
469+
&nbsp;&nbsp;Обрабатываем файлы...
470+
</div>}
471471
<FilesPreviewList
472472
showOkStatus={props.isMentor}
473473
filesInfo={filesInfo}

hwproj.front/src/components/Solutions/TaskSolutionComponent.tsx

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,31 +1063,34 @@ const TaskSolutionComponent: FC<ISolutionProps> = (props) => {
10631063
</Grid>
10641064
</Stack>
10651065
</Grid>
1066-
<Grid item spacing={8}>
1067-
{solution.comment &&
1068-
<Grid item style={{marginBottom: -10}} spacing={4}>
1069-
{showOriginalCommentText
1070-
? <Typography
1071-
style={{marginBottom: 15, whiteSpace: 'break-spaces'}}>{solution.comment}</Typography>
1072-
: <MarkdownPreview value={solution.comment}/>}
1073-
</Grid>
1074-
}
1075-
{props.isProcessing ? (
1076-
<div style={{ display: 'flex', alignItems: 'center', color: '#1976d2', fontWeight: '500' }}>
1077-
<CircularProgress size="20px" />
1078-
&nbsp;&nbsp;Обрабатываем файлы...
1079-
</div>
1080-
) : filesInfo.length > 0 && (
1081-
<div>
1082-
<FilesPreviewList
1083-
showOkStatus={ !props.forMentor }
1084-
filesInfo={filesInfo}
1085-
onClickFileInfo={async (fileInfo: IFileInfo) => {
1086-
const url = await ApiSingleton.customFilesApi.getDownloadFileLink(fileInfo.id!)
1087-
window.open(url, '_blank');
1088-
}}
1089-
/>
1090-
</div>
1066+
<Grid item spacing={8}>
1067+
{solution.comment &&
1068+
<Grid item style={{marginBottom: -10}} spacing={4}>
1069+
{showOriginalCommentText
1070+
? <Typography
1071+
style={{
1072+
marginBottom: 15,
1073+
whiteSpace: 'break-spaces'
1074+
}}>{solution.comment}</Typography>
1075+
: <MarkdownPreview value={solution.comment}/>}
1076+
</Grid>
1077+
}
1078+
{filesInfo.length > 0 && (
1079+
<div>
1080+
{props.isProcessing && <div
1081+
style={{display: 'flex', alignItems: 'center', color: '#1976d2', fontWeight: '500'}}>
1082+
<CircularProgress size="20px"/>
1083+
&nbsp;&nbsp;Обрабатываем файлы...
1084+
</div>}
1085+
<FilesPreviewList
1086+
showOkStatus={!props.forMentor}
1087+
filesInfo={filesInfo}
1088+
onClickFileInfo={async (fileInfo: IFileInfo) => {
1089+
const url = await ApiSingleton.customFilesApi.getDownloadFileLink(fileInfo.id!)
1090+
window.open(url, '_blank');
1091+
}}
1092+
/>
1093+
</div>
10911094
)}
10921095
</Grid>
10931096
</Grid>

0 commit comments

Comments
 (0)