Skip to content

Commit

Permalink
new sidebar stuff, fix #5 filter out dupes etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
k88hudson committed Apr 9, 2018
1 parent ba32ca4 commit 4d7c1eb
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 9 deletions.
2 changes: 1 addition & 1 deletion content/components/BugList/BugList.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class BugList extends React.PureComponent {
</tbody>
</table>);
}
render() {
render() {
const {props} = this;
return (<div>
{props.title ? <h3>{props.title}</h3> : null}
Expand Down
3 changes: 2 additions & 1 deletion content/components/BugListView/BugListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export class BugListView extends React.PureComponent {
}
async componentWillMount() {
const BASE_QUERY = {
include_fields: this.props.columns.concat(["whiteboard", "keywords", "severity"])
include_fields: this.props.columns.concat(["whiteboard", "keywords", "severity"]),
resolved: ["---", "FIXED"]
};
const {bugs, query, uri} = await runQuery(Object.assign({}, BASE_QUERY, this.props.query));
this.setState({loaded: true, bugs, query, uri});
Expand Down
1 change: 1 addition & 0 deletions content/components/FeatureView/FeatureView.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class FeatureView extends React.PureComponent {
this.setState({bugs: [], loaded: false});
const {bugs} = await runQuery({
include_fields: allColumns,
resolved: ["---", "FIXED"],
custom: {
blocked: id,
}
Expand Down
13 changes: 9 additions & 4 deletions content/components/ReleaseReport/ReleaseReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,34 @@ export class ReleaseReport extends React.PureComponent {
}
async componentWillMount() {
this.setState({loaded: false})
const {bugs} = await runQuery({
const result = await runQuery({
include_fields: ["id", "summary", "blocks", "status"],
iteration: release,
resolved: ["---", "FIXED"],
custom: {
blocked: this.props.metas.map(m => m.id)
}
});
console.log(result)
// const bugs = require("../../../sandbox_results/1520741071242_RESULTS.json").results;
this.setState({bugs, loaded: true});
this.setState({bugs: result.bugs, loaded: true});
}
render() {
return (<div className={styles.container}>
<h1>Activity Stream {release}</h1>
<div className={styles.summary}>
<p>MVP bugs in this release must have an iteration of <strong><code>{release}.x</code></strong> to be counted towards the total.
Note that resolved bugs other than <code>FIXED</code> (e.g. <code>DUPLICATE</code>) are <em>not</em> included.</p>

<br />See <a href="https://docs.google.com/spreadsheets/d/1OTNN20IhUm_sPq6awL6cqFTShi4kqCGn6IRvQBL-bcQ">this document</a> for stats on our progress.</p>
<p>See <a href="https://docs.google.com/spreadsheets/d/1OTNN20IhUm_sPq6awL6cqFTShi4kqCGn6IRvQBL-bcQ">this document</a> for stats on our progress.</p>
</div>

{this.state.loaded ? this.props.metas.map(meta => {
const bugs = this.state.bugs.filter(b => b.blocks.includes(meta.id));
if (!bugs.length) return null;
const completionPercentage = Math.round((bugs.filter(b => b.status === "RESOLVED").length / bugs.length) * 100);
return (<div key={meta.id} className={styles.feature}>
<h3 className={styles.h3}>{meta.displayName}</h3>
<h3 className={styles.h3}>{meta.displayName} ({completionPercentage}% complete)</h3>
<p className={styles.featureSummary}>{meta.description}
</p>
<CompletionBar
Expand Down
7 changes: 6 additions & 1 deletion content/components/Router/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const RouterNav = withRouter(class _RouterNav extends React.PureComponent {
{routes.filter(route => !route.hidden).map((route, i) => route.spacer ?
<li key={i} className={styles.spacer} /> :
this.renderListItem(route))}
<li><a className={styles.navLink} href="https://github.com/k88hudson/bugzy/issues">
<span className={styles.icon + " " + styles["icon-alert"]} />
Report an issue
</a></li>
</ul>
</nav>);
}
Expand Down Expand Up @@ -114,7 +118,8 @@ export class Router extends React.PureComponent {
},
{spacer: true},
{
label: "About",
label: "About Bugzy",
icon: "info",
routeProps: {
path: "/about",
component: Preferences,
Expand Down
10 changes: 9 additions & 1 deletion content/components/Router/Router.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
}

.navLink {
display: block;
color: inherit;
text-decoration: none;
border-radius: 3px;
display: flex;
align-items: center;
&.active,
&:hover {
background-color: #ededf0;
Expand Down Expand Up @@ -59,3 +60,10 @@
.icon-rgb {
background-image: url("../../img/icons/rgb.svg");
}
.icon-alert {
background-image: url("../../img/icons/alert.svg");
}
.icon-info {
background-image: url("../../img/icons/info.svg");
}

46 changes: 46 additions & 0 deletions content/img/icons/alert.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions content/img/icons/info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "parcel watch content/index.html --public-url \"/\" & node server",
"bundle": "parcel build content/index.html --public-url \"/\"",
"start_prod": "node server",
"bundle_prod": "git checkout -B deploy && npm run bundle && git add -f dist",
"deploy": "git checkout -B deploy && npm run bundle && git add -f dist",
"test": "mocha test/**/*.test.js"
},
"author": "k88hudson@gmail.com",
Expand Down
7 changes: 7 additions & 0 deletions schema/query_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ const definitions = {
description: "Array of keywords",
type: "Array",
examples: ["uineeded"]
},
"j_top": {
displayName: "Custom search AND/OR",
description: "How should custom searches be combined? Note: default is AND",
type: {oneOf: ["", "OR", "AND_G"]}, // Note: AND_G means match all of the following against the same field
examples: ["OR"]
// NOTE: Additional blocks can be j2=OR, j3=OR
}
};

Expand Down

0 comments on commit 4d7c1eb

Please sign in to comment.