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

Ux improvements2 #156

Merged
merged 21 commits into from
Dec 29, 2017
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
28b26c2
Improving submission results table. Pascal exit codes added.
Dec 19, 2017
8484098
Allow multi-row comments for solutions.
Dec 20, 2017
3110557
Images in localized texts should fit in the tab pane.
Neloop Dec 20, 2017
9f5d214
Adding language to list of all submissions of an assignment. It also …
Dec 20, 2017
30305cb
Merge branch 'ux-improvements2' of https://github.com/ReCodEx/web-app…
Dec 20, 2017
fd4dfb6
A buf fixed.
Dec 23, 2017
0c620a2
CAS login modifications not to close popup window too soon.
Dec 24, 2017
fc207c7
CAS authentication in popup window redesigned.
Dec 27, 2017
c29d75e
Workaround for older nodejs environments added to logger middleware.
Dec 27, 2017
cac24e3
Attempt to fix a minor problem with CAS auth.
Dec 27, 2017
6a04e7c
Another attempt to fix minor CAS bug.
Dec 27, 2017
1d30c00
Fixed bug in routing.
Dec 27, 2017
8e57ae2
Merge branch 'master' of https://github.com/ReCodEx/web-app into ux-i…
Dec 27, 2017
859223d
Target language added to submission detail table.
Dec 27, 2017
03f2e90
Ellipsis imposed on note column in Submissions table.
Dec 27, 2017
1af3dd7
An icon added to solutions table announcing when comments were made t…
Dec 29, 2017
cf21c5e
Fixing eslint and reflecting a minor API-data modification.
Dec 29, 2017
46ef2ae
Final adjustments.
Dec 29, 2017
324c2bc
Fixing bug in Group localization.
Dec 29, 2017
e03b7f0
Fixing tests to reflect modification in actions middleware.
Dec 29, 2017
103da4b
Translations and one minor issue reported in review.
Dec 29, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ prod/
package-lock.json

/run_server.bat
/run_export_strings.bat
53 changes: 53 additions & 0 deletions src/components/Assignments/SubmissionsTable/CommentsIcon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
import Icon from 'react-fontawesome';

const createIcon = commentsStats => {
if (commentsStats.authoredCount === 0) {
return <Icon name="comment-o" />;
}
if (commentsStats.authoredCount === commentsStats.count) {
return <Icon name="comment" flip="horizontal" />;
}
return <Icon name="comments-o" />;
};

const CommentsIcon = ({ id, commentsStats = null }) =>
<span>
{Boolean(commentsStats) &&
commentsStats.count > 0 &&
<OverlayTrigger
placement="right"
overlay={
<Tooltip id={`${id}-comment`}>
<div>
<FormattedMessage
id="app.submissionsTable.commentsIcon.count"
defaultMessage="Total Comments: {count}"
values={{ count: commentsStats.count }}
/>
</div>
{commentsStats.last &&
commentsStats.last.text &&
<div>
<FormattedMessage
id="app.submissionsTable.commentsIcon.last"
defaultMessage="Last Comment: {last}"
values={{ last: commentsStats.last.text }}
/>
</div>}
</Tooltip>
}
>
{createIcon(commentsStats)}
</OverlayTrigger>}
</span>;

CommentsIcon.propTypes = {
id: PropTypes.string.isRequired,
commentsStats: PropTypes.object
};

export default CommentsIcon;
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,36 @@ import PropTypes from 'prop-types';
import { FormattedDate, FormattedTime, FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
import AssignmentStatusIcon from '../Assignment/AssignmentStatusIcon';
import CommentsIcon from './CommentsIcon';

const EvaluationFailedTableRow = ({ link, note, solution: { createdAt } }) =>
const EvaluationFailedTableRow = ({
link,
note,
solution: { createdAt },
runtimeEnvironment = null,
commentsStats = null
}) =>
<tr>
<td>
<AssignmentStatusIcon id={link} status="evaluation-failed" />
</td>
<td>
<CommentsIcon id={link} commentsStats={commentsStats} />
</td>
<td className="text-nowrap">
<FormattedDate value={createdAt * 1000} />
&nbsp;
<FormattedTime value={createdAt * 1000} />
</td>
<td className="text-center">
<td className="text-center text-nowrap">
<span className="text-danger">-</span>
</td>
<td className="text-center">
<td className="text-center text-nowrap">
<span className="text-danger">-</span>
</td>
<td className="text-center text-nowrap">
{runtimeEnvironment ? runtimeEnvironment.name : '-'}
</td>
<td>
{note}
</td>
Expand All @@ -35,10 +48,12 @@ const EvaluationFailedTableRow = ({ link, note, solution: { createdAt } }) =>

EvaluationFailedTableRow.propTypes = {
link: PropTypes.string.isRequired,
note: PropTypes.string.isRequired,
note: PropTypes.any.isRequired,
solution: PropTypes.shape({
createdAt: PropTypes.number.isRequired
}).isRequired
}).isRequired,
commentsStats: PropTypes.object,
runtimeEnvironment: PropTypes.object
};

export default EvaluationFailedTableRow;
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ import React from 'react';
import { FormattedMessage } from 'react-intl';
import { WarningIcon } from '../../icons';

const FailedLoadingSubmissionTableRow = () => (
const FailedLoadingSubmissionTableRow = () =>
<tr>
<td colSpan={5} className="text-center">
<WarningIcon />
{' '}
<td colSpan={8} className="text-center">
<WarningIcon />{' '}
<FormattedMessage
id="app.submissionsTable.failedLoading"
defaultMessage="Could not load this submission."
/>
</td>
</tr>
);
</tr>;

export default FailedLoadingSubmissionTableRow;
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { Link } from 'react-router';
import AssignmentStatusIcon from '../Assignment/AssignmentStatusIcon';
import Points from './Points';
import CommentsIcon from './CommentsIcon';

const FailedSubmissionTableRow = ({
link,
Expand All @@ -17,23 +18,28 @@ const FailedSubmissionTableRow = ({
maxPoints,
bonusPoints,
solution: { createdAt },
accepted
accepted,
runtimeEnvironment = null,
commentsStats = null
}) =>
<tr>
<td>
<AssignmentStatusIcon id={link} status="failed" accepted={accepted} />
</td>
<td>
<CommentsIcon id={link} commentsStats={commentsStats} />
</td>
<td className="text-nowrap">
<FormattedDate value={createdAt * 1000} />
&nbsp;
<FormattedTime value={createdAt * 1000} />
</td>
<td className="text-center">
<td className="text-center text-nowrap">
<span className="text-danger">
<FormattedNumber style="percent" value={score} />
</span>
</td>
<td className="text-center">
<td className="text-center text-nowrap">
<span className="text-danger">
<Points
points={points}
Expand All @@ -42,6 +48,9 @@ const FailedSubmissionTableRow = ({
/>
</span>
</td>
<td className="text-center text-nowrap">
{runtimeEnvironment ? runtimeEnvironment.name : '-'}
</td>
<td>
{note}
</td>
Expand All @@ -57,7 +66,7 @@ const FailedSubmissionTableRow = ({

FailedSubmissionTableRow.propTypes = {
link: PropTypes.string.isRequired,
note: PropTypes.string.isRequired,
note: PropTypes.any.isRequired,
maxPoints: PropTypes.number.isRequired,
bonusPoints: PropTypes.number.isRequired,
lastSubmission: PropTypes.shape({
Expand All @@ -69,7 +78,9 @@ FailedSubmissionTableRow.propTypes = {
solution: PropTypes.shape({
createdAt: PropTypes.number.isRequired
}).isRequired,
accepted: PropTypes.bool
accepted: PropTypes.bool,
commentsStats: PropTypes.object,
runtimeEnvironment: PropTypes.object
};

export default FailedSubmissionTableRow;
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@ import React from 'react';
import { FormattedMessage } from 'react-intl';
import { LoadingIcon } from '../../icons';

const LoadingSubmissionTableRow = () => (
const LoadingSubmissionTableRow = () =>
<tr>
<td colSpan={5} className="text-center">
<LoadingIcon />
{' '}
<td colSpan={8} className="text-center">
<LoadingIcon />{' '}
<FormattedMessage
id="app.submissionsTable.loading"
defaultMessage="Loading submitted solutions ..."
/>
</td>
</tr>
);
</tr>;

export default LoadingSubmissionTableRow;
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';

const NoSolutionYetTableRow = () => (
const NoSolutionYetTableRow = () =>
<tr>
<td colSpan={5} className="text-center">
<td colSpan={8} className="text-center">
<FormattedMessage
id="app.submissionsTable.noSolutionsFound"
defaultMessage="No solutions were submitted yet."
/>
</td>
</tr>
);
</tr>;

export default NoSolutionYetTableRow;
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ import PropTypes from 'prop-types';
import { FormattedDate, FormattedTime, FormattedMessage } from 'react-intl';
import { Link } from 'react-router';
import AssignmentStatusIcon from '../Assignment/AssignmentStatusIcon';
import CommentsIcon from './CommentsIcon';

const NotEvaluatedSubmissionTableRow = ({
link,
note,
solution: { createdAt },
lastSubmission
lastSubmission,
runtimeEnvironment = null,
commentsStats = null
}) =>
<tr>
<td>
Expand All @@ -18,12 +21,18 @@ const NotEvaluatedSubmissionTableRow = ({
/>
</td>
<td>
<CommentsIcon id={link} commentsStats={commentsStats} />
</td>
<td className="text-nowrap">
<FormattedDate value={createdAt * 1000} />
&nbsp;
<FormattedTime value={createdAt * 1000} />
</td>
<td className="text-center">-</td>
<td className="text-center">- / -</td>
<td className="text-center text-nowrap">-</td>
<td className="text-center text-nowrap">- / -</td>
<td className="text-center text-nowrap">
{runtimeEnvironment ? runtimeEnvironment.name : '-'}
</td>
<td>
{note}
</td>
Expand All @@ -39,11 +48,13 @@ const NotEvaluatedSubmissionTableRow = ({

NotEvaluatedSubmissionTableRow.propTypes = {
link: PropTypes.string.isRequired,
note: PropTypes.string.isRequired,
note: PropTypes.any.isRequired,
solution: PropTypes.shape({
createdAt: PropTypes.number.isRequired
}).isRequired,
lastSubmission: PropTypes.object
lastSubmission: PropTypes.object,
commentsStats: PropTypes.object,
runtimeEnvironment: PropTypes.object
};

export default NotEvaluatedSubmissionTableRow;
Loading