File tree Expand file tree Collapse file tree
hwproj.front/src/components/Tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,13 +36,28 @@ const StudentStatsCell: FC<ITaskStudentCellProps & { borderLeftColor?: string }>
3636 < Chip color = { "default" } size = { "small" } label = { ratedSolutionsCount } />
3737 </ Stack > ;
3838
39+ const handleCellClick = ( e : React . MouseEvent ) => {
40+ // Формируем URL
41+ const url = forMentor
42+ ? `/task/${ props . taskId } /${ props . studentId } `
43+ : `/task/${ props . taskId } `
44+ // Проверяем, была ли нажата Ctrl/Cmd
45+ const isSpecialClick = e . ctrlKey || e . metaKey ;
46+
47+ if ( isSpecialClick ) {
48+ // Открываем в новой вкладке
49+ window . open ( url , '_blank' , 'noopener,noreferrer' ) ;
50+ } else {
51+ // Переходим в текущей вкладке
52+ navigate ( url ) ;
53+ }
54+ } ;
55+
3956 return (
4057 < Tooltip arrow disableInteractive enterDelay = { 2000 }
4158 title = { < span style = { { whiteSpace : 'pre-line' } } > { tooltipTitle } </ span > } >
4259 < TableCell
43- onClick = { ( ) => forMentor
44- ? navigate ( `/task/${ props . taskId } /${ props . studentId } ` )
45- : navigate ( `/task/${ props . taskId } ` ) }
60+ onClick = { handleCellClick }
4661 component = "td"
4762 padding = "none"
4863 variant = { "body" }
You can’t perform that action at this time.
0 commit comments