Skip to content

Commit

Permalink
Fixing bugs, appearance improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed Apr 20, 2023
1 parent da0ebfa commit ac41ac4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SourceCodeBox from '../SourceCodeBox';
import DateTime from '../../widgets/DateTime';
import Button from '../../widgets/TheButton';
import GroupsNameContainer from '../../../containers/GroupsNameContainer';
import { CloseIcon } from '../../icons';
import { CloseIcon, CodeFileIcon } from '../../icons';

class PlagiarismCodeBoxWithSelector extends Component {
state = { selectedFile: 0, dialogOpen: false };
Expand Down Expand Up @@ -62,6 +62,9 @@ class PlagiarismCodeBoxWithSelector extends Component {
key={file.id}
className={this.state.selectedFile === idx ? 'table-primary' : 'clickable'}
onClick={this.state.selectedFile !== idx ? () => this.selectFile(idx) : null}>
<td className="text-nowrap shrink-col">
<CodeFileIcon className="text-muted" gapLeft gapRight />
</td>
<td>
<code>
{file.solutionFile.name}
Expand Down
17 changes: 11 additions & 6 deletions src/pages/SolutionPlagiarisms/SolutionPlagiarisms.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Callout from '../../components/widgets/Callout';
import { AssignmentSolutionNavigation } from '../../components/layout/Navigation';
import ResourceRenderer from '../../components/helpers/ResourceRenderer';
import PlagiarismCodeBoxWithSelector from '../../components/Solutions/PlagiarismCodeBoxWithSelector';
import { BanIcon, PlagiarismIcon, UserIcon } from '../../components/icons';
import Icon, { BanIcon, PlagiarismIcon, UserIcon } from '../../components/icons';
import UsersNameContainer from '../../containers/UsersNameContainer';

import { fetchRuntimeEnvironments } from '../../redux/modules/runtimeEnvironments';
Expand Down Expand Up @@ -227,9 +227,14 @@ class SolutionPlagiarisms extends Component {
className={'clickable' + (plagiarismSource === selectedSource ? ' table-primary' : '')}
onClick={() => this.selectPlagiarismSource(plagiarismSource)}>
<td className="text-nowrap">
<UsersNameContainer userId={plagiarismSource} noAvatar noAutoload />
<Icon icon="person-dots-from-line" className="text-muted" />
</td>
<td className="text-nowrap">
<strong>
<UsersNameContainer userId={plagiarismSource} noAvatar noAutoload />
</strong>
</td>
<td className="text-nowrap text-muted small">
<FormattedMessage
id="app.solutionPlagiarisms.selectSourceTable.files"
defaultMessage="{count} {count, plural, one {file} other {files}}"
Expand All @@ -238,19 +243,19 @@ class SolutionPlagiarisms extends Component {
</td>

{plagiarisms[plagiarismSource].length === 0 ? (
<td colSpan={2} className="text-nowrap">
<td colSpan={2} className="text-nowrap text-muted small">
{plagiarisms[plagiarismSource][0].similarity * 100} %
</td>
) : (
<>
<td className="text-nowrap">
<td className="text-nowrap text-muted small">
<FormattedMessage
id="app.solutionPlagiarisms.selectSourceTable.max"
defaultMessage="max"
/>
: {Math.max(plagiarisms[plagiarismSource].map(p => p.similarity)) * 100} %
: {Math.max(...plagiarisms[plagiarismSource].map(p => p.similarity)) * 100} %
</td>
<td className="text-nowrap">
<td className="text-nowrap text-muted small">
<FormattedMessage
id="app.solutionPlagiarisms.selectSourceTable.avg"
defaultMessage="average"
Expand Down

0 comments on commit ac41ac4

Please sign in to comment.