Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Make priority a column (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
muffinresearch committed Feb 9, 2018
1 parent fb92e76 commit f1d4e8e
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 19 deletions.
29 changes: 25 additions & 4 deletions src/App.css
Expand Up @@ -17,15 +17,36 @@
}

.p1,
.p2 {
border: 1px solid rgba(255, 0, 57, 0.7);
.p2,
.p3,
.p4,
.p5 {
border-radius: 3px;
color: rgba(255, 0, 57, 1);
color: #fff;
padding: 3px 5px;
margin-right: 5px;
font-size: 12px;
}

.p1 {
background: #ff0039;
}

.p2 {
background: #d70022;
}

.p3 {
background: #a4000f;
}

.p4 {
background: #5a0002;
}

.p5 {
background: #3e0200;
}

.contributor,
.unassigned {
height: 21px;
Expand Down
28 changes: 21 additions & 7 deletions src/MilestoneIssues.js
Expand Up @@ -85,6 +85,11 @@ class MilestoneIssues extends Component {
verified: '#00A21D',
prReady: '#ffc107',
open: '#666966',
p1: '#ff0039',
p2: '#d70022',
p3: '#a4000f',
p4: '#5a0002',
p5: '#3e0200',
}

render() {
Expand Down Expand Up @@ -132,12 +137,17 @@ class MilestoneIssues extends Component {

const stateLabelTextColor = colourIsLight(stateLabelColor) ? '#000' : '#fff';

let priorityLabel;
if (this.hasLabelContainingString(issue, 'p1')) {
priorityLabel = <span className="p1">P1</span>;
} else if (this.hasLabelContainingString(issue, 'p2')) {
priorityLabel = <span className="p2">P2</span>;
}
let priorityLabel = null;
let issuePriority = '';

const priorities = ['p1', 'p2', 'p3', 'p4', 'p5'];

priorities.forEach((priority) => {
if (this.hasLabelContainingString(issue, priority)) {
priorityLabel = <span className={priority}>{priority.toUpperCase()}</span>;
issuePriority = priority;
}
});

const repoName = issue.repository_url.split('/').slice(-1).join('/');
/* eslint-disable jsx-a11y/href-no-hash */
Expand All @@ -151,9 +161,11 @@ class MilestoneIssues extends Component {
{assigneeName}
</div>
</Td>
<Td column="priority" className="issue-priority" value={issuePriority}>
{priorityLabel}
</Td>
<Td column="issue" className="issue-title">
<a rel="noopener noreferrer" target="_blank" href={issue.html_url}>
{priorityLabel ? priorityLabel : null }
{issue.title} <span className="glyphicon glyphicon-link"></span>
</a>
</Td>
Expand All @@ -180,6 +192,7 @@ class MilestoneIssues extends Component {
column: 'assignee',
sortFunction: this.issueSort
},
'priority',
'repo',
'size',
{
Expand All @@ -188,6 +201,7 @@ class MilestoneIssues extends Component {
}]}>
<Thead>
<Th column="assignee">Assignee</Th>
<Th column="priority">Priority</Th>
<Th column="issue">Issue</Th>
<Th column="repo">Repo</Th>
<Th column="details">Details</Th>
Expand Down
40 changes: 32 additions & 8 deletions yarn.lock
Expand Up @@ -1415,6 +1415,10 @@ center-align@^0.1.1:
align-text "^0.1.3"
lazy-cache "^1.0.3"

chain-function@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/chain-function/-/chain-function-1.0.0.tgz#0d4ab37e7e18ead0bdc47b920764118ce58733dc"

chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
Expand Down Expand Up @@ -5783,7 +5787,7 @@ prop-types-extra@^1.0.1:
dependencies:
warning "^3.0.0"

prop-types@^15.5.10, prop-types@^15.6.0:
prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0:
version "15.6.0"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
dependencies:
Expand Down Expand Up @@ -5900,9 +5904,9 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.1.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-bootstrap@0.31.5:
version "0.31.5"
resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-0.31.5.tgz#57040fa8b1274e1e074803c21a1b895fdabea05a"
react-bootstrap@0.32.1:
version "0.32.1"
resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-0.32.1.tgz#60624c1b48a39d773ef6cce6421a4f33ecc166bb"
dependencies:
babel-runtime "^6.11.6"
classnames "^2.2.5"
Expand All @@ -5911,7 +5915,9 @@ react-bootstrap@0.31.5:
keycode "^2.1.2"
prop-types "^15.5.10"
prop-types-extra "^1.0.1"
react-overlays "^0.7.4"
react-overlays "^0.8.0"
react-prop-types "^0.4.0"
react-transition-group "^2.0.0"
uncontrollable "^4.1.0"
warning "^3.0.0"

Expand Down Expand Up @@ -5960,14 +5966,21 @@ react-helmet@5.0.3:
prop-types "^15.5.4"
react-side-effect "^1.1.0"

react-overlays@^0.7.4:
version "0.7.4"
resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-0.7.4.tgz#ef2ec652c3444ab8aa014262b18f662068e56d5c"
react-overlays@^0.8.0:
version "0.8.3"
resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-0.8.3.tgz#fad65eea5b24301cca192a169f5dddb0b20d3ac5"
dependencies:
classnames "^2.2.5"
dom-helpers "^3.2.1"
prop-types "^15.5.10"
prop-types-extra "^1.0.1"
react-transition-group "^2.2.0"
warning "^3.0.0"

react-prop-types@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/react-prop-types/-/react-prop-types-0.4.0.tgz#f99b0bfb4006929c9af2051e7c1414a5c75b93d0"
dependencies:
warning "^3.0.0"

react-router-dom@4.2.2:
Expand Down Expand Up @@ -6051,6 +6064,17 @@ react-test-renderer@^16.0.0-0, react-test-renderer@^16.1.1:
object-assign "^4.1.1"
prop-types "^15.6.0"

react-transition-group@^2.0.0, react-transition-group@^2.2.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.2.1.tgz#e9fb677b79e6455fd391b03823afe84849df4a10"
dependencies:
chain-function "^1.0.0"
classnames "^2.2.5"
dom-helpers "^3.2.0"
loose-envify "^1.3.1"
prop-types "^15.5.8"
warning "^3.0.0"

react@16.2.0:
version "16.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba"
Expand Down

0 comments on commit f1d4e8e

Please sign in to comment.