| |
@@ -1,85 +1,25 @@
|
| |
- import React, { Component } from "react"
|
| |
- import { Row } from "reactstrap"
|
| |
- import SourceLink from "./SourceLink"
|
| |
+ import React, { useState } from "react";
|
| |
+ import { Row } from "reactstrap";
|
| |
+ import SourceLink from "./SourceLink";
|
| |
+ import BugStats from "./BugStats";
|
| |
|
| |
- class Blockers extends Component {
|
| |
- constructor(props) {
|
| |
- super(props)
|
| |
- this.state = { blockerbugs: {}, release: 0 }
|
| |
- }
|
| |
|
| |
- render() {
|
| |
- if (this.props.data)
|
| |
- return (
|
| |
- <div>
|
| |
- <h1 className="padded">
|
| |
- Fedora {this.props.release} blockers and FEs{" "}
|
| |
- <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />
|
| |
- </h1>
|
| |
- <Row>
|
| |
- <div className="col-md-6">
|
| |
- <table className="events">
|
| |
- <thead>
|
| |
- <tr>
|
| |
- <td colSpan="2">
|
| |
- <b>Beta</b>
|
| |
- </td>
|
| |
- </tr>
|
| |
- </thead>
|
| |
- <tbody>
|
| |
- <tr>
|
| |
- <td>Proposed Blockers</td>
|
| |
- <td className="bugscount">{this.props.data.beta_blockers_proposed}</td>
|
| |
- </tr>
|
| |
- <tr>
|
| |
- <td>Accepted Blockers</td>
|
| |
- <td className="bugscount">{this.props.data.beta_blockers}</td>
|
| |
- </tr>
|
| |
- <tr>
|
| |
- <td>Proposed FEs</td>
|
| |
- <td className="bugscount">{this.props.data.beta_fe_proposed}</td>
|
| |
- </tr>
|
| |
- <tr>
|
| |
- <td>Accepted FEs</td>
|
| |
- <td className="bugscount">{this.props.data.beta_fe}</td>
|
| |
- </tr>
|
| |
- </tbody>
|
| |
- </table>
|
| |
- </div>
|
| |
+ const Blockers = (props) => {
|
| |
+ const [blockerbugs] = useState({});
|
| |
+ const [release] = useState(0);
|
| |
|
| |
- <div className="col-md-6">
|
| |
- <table className="events">
|
| |
- <thead>
|
| |
- <tr>
|
| |
- <td colSpan="2">
|
| |
- <b>Final</b>
|
| |
- </td>
|
| |
- </tr>
|
| |
- </thead>
|
| |
- <tbody>
|
| |
- <tr>
|
| |
- <td>Proposed Blockers</td>
|
| |
- <td className="bugscount">{this.props.data.final_blockers_proposed}</td>
|
| |
- </tr>
|
| |
- <tr>
|
| |
- <td>Accepted Blockers</td>
|
| |
- <td className="bugscount">{this.props.data.final_blockers}</td>
|
| |
- </tr>
|
| |
- <tr>
|
| |
- <td>Proposed FEs</td>
|
| |
- <td className="bugscount">{this.props.data.final_fe_proposed}</td>
|
| |
- </tr>
|
| |
- <tr>
|
| |
- <td>Accepted FEs</td>
|
| |
- <td className="bugscount">{this.props.data.final_fe}</td>
|
| |
- </tr>
|
| |
- </tbody>
|
| |
- </table>
|
| |
- </div>
|
| |
- </Row>
|
| |
- </div>
|
| |
- )
|
| |
- }
|
| |
- }
|
| |
+ if (props.data)
|
| |
+ return (
|
| |
+ <div>
|
| |
+ <h1 className="padded">
|
| |
+ Fedora {props.release} blockers and FEs{" "}
|
| |
+ <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />
|
| |
+ </h1>
|
| |
+ <Row>
|
| |
+ <BugStats data={props.data} />
|
| |
+ </Row>
|
| |
+ </div>
|
| |
+ );
|
| |
+ };
|
| |
|
| |
- export default Blockers
|
| |
+ export default Blockers;
|
| |
This change is related to this thread https://pagure.io/fedora-qa/landingpage/issue/6
My changes are:
/ I have created two functional Components called Beta Stats and Final Stat /
/ Moved the beta table to the final table to the corresponding functional component /
/ I have then passed the props.data into each Beta Stats and Final Stat Components /
optional changes:
/This wasn't part of the plan but I converted Blockers from class component to functional component also replaced the contractors with react Hooks as a developer is always good to be up to date with the tech stack /