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

Issue 763 - Changed relevant HTML anchors to use Button components instead #774

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ test_position_paper.doc
env/
.vscode/

huxley/service.json
huxley-venv/
huxley/service.json
25 changes: 9 additions & 16 deletions huxley/www/js/components/AdvisorPaperView.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import React from "react";

var { _accessSafe } = require("utils/_accessSafe");
var { AssignmentStore } = require("stores/AssignmentStore");
var { Button } = require("components/core/Button");
var { CommitteeStore } = require("stores/CommitteeStore");
var { CountryStore } = require("stores/CountryStore");
var { CurrentUserStore } = require("stores/CurrentUserStore");
Expand Down Expand Up @@ -246,33 +247,25 @@ class AdvisorPaperView extends React.Component {
var fileName = names ? names[names.length - 1] : null;
var gradedFileName = fileName ? "graded_" + fileName : null;
var downloadPaper = paper ? (
<a
className={cx({
button: true,
"button-small": true,
"button-green": true,
"rounded-small": true,
})}
<Button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also missing Button import I believe, but looks good otherwise

color="green"
size="small"
href={originalHrefData}
download={fileName}
>
&#10515;
</a>
</Button>
) : null;
var gradedPaper =
paper && graded ? (
<a
className={cx({
button: true,
"button-small": true,
"button-blpaperue": true,
"rounded-small": true,
})}
<Button
color="green"
size="small"
href={gradedHrefData}
download={gradedFileName}
>
&#10515;
</a>
</Button>
) : null;

var category1 = null;
Expand Down
26 changes: 9 additions & 17 deletions huxley/www/js/components/PaperGradeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,36 +40,28 @@ class PaperGradeTable extends React.Component {
var fileName = fileNames[fileNames.length - 1];
var gradedName = gradedHrefData ? "graded_" + fileName : null;
var downloadGraded = gradedHrefData ? (
<a
className={cx({
button: true,
"button-large": true,
"button-green": true,
"rounded-small": true,
})}
<Button
color="green"
size="large"
href={gradedHrefData}
download={gradedName}
>
Download Graded
</a>
</Button>
) : null;
buttons = (
<div>
<Button color="red" onClick={this._handleUnset}>
Go Back
</Button>
<a
className={cx({
button: true,
"button-large": true,
"button-green": true,
"rounded-small": true,
})}
href={hrefData}
<Button
color="green"
size="large"
href={gradedHrefData}
download={fileName}
>
Download Original
</a>
</Button>
{downloadGraded}
<Button
color="blue"
Expand Down
24 changes: 8 additions & 16 deletions huxley/www/js/components/PaperSubmissionTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,25 @@ class PaperSubmissionTable extends React.Component {
var fileNames = paper.file.split("/");
var fileName = fileNames[fileNames.length - 1];
var gradedButton = paper.graded ? (
<a
className={cx({
button: true,
"button-large": true,
"button-blue": true,
"rounded-small": true,
})}
<Button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import to Button at the top of the file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think line 8 const { Button } = require("components/core/Button"); should work, since other Button components from previous commits use that

size="large"
color="blue"
href={gradedHrefData}
download={"graded_" + fileName}
>
Download Graded Paper
</a>
</Button>
) : null;
buttons = (
<div>
<a
className={cx({
button: true,
"button-large": true,
"button-green": true,
"rounded-small": true,
})}
<Button
size="large"
color="green"
href={hrefData}
download={fileName}
>
Download Paper
</a>
</Button>
{gradedButton}
</div>
);
Expand Down