#15 Added BugStats component
Merged 2 years ago by lbrabec. Opened 3 years ago by manishakanyal.
fedora-qa/ manishakanyal/landingpage BugStatsTable  into  master

added BugStats component
manisha • 3 years ago  
file modified
+3 -59
@@ -1,6 +1,7 @@ 

  import React, { Component } from "react"

  import { Row } from "reactstrap"

  import SourceLink from "./SourceLink"

+ import BugStats from "./common/BugStats"

  

  class Blockers extends Component {

    constructor(props) {
@@ -17,65 +18,8 @@ 

              <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>

- 

-             <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>

+             <BugStats milestone = {"Beta"} stats = {this.props.data.beta} />

+             <BugStats milestone = {"Final"} stats = {this.props.data.final} />

            </Row>

          </div>

        )

@@ -0,0 +1,39 @@ 

+ import React from 'react'

+ 

+ const BugStats = (props) => {

+     const { milestone, stats } = props;

+     

+     return (

+             <div className="col-md-6">

+               <table className="events">

+                 <thead>

+                   <tr>

+                     <td colSpan="2">

+                       <b>{milestone}</b>

+                     </td>

+                   </tr>

+                 </thead>

+                 <tbody>

+                   <tr>

+                     <td>Proposed Blockers</td>

+                     <td className="bugscount">{stats.blockers_proposed}</td>

+                   </tr>

+                   <tr>

+                     <td>Accepted Blockers</td>

+                     <td className="bugscount">{stats.blockers}</td>

+                   </tr>

+                   <tr>

+                     <td>Proposed FEs</td>

+                     <td className="bugscount">{stats.fe_proposed}</td>

+                   </tr>

+                   <tr>

+                     <td>Accepted FEs</td>

+                     <td className="bugscount">{stats.fe}</td>

+                   </tr>

+                 </tbody>

+               </table>

+             </div>

+     )

+ }

+ 

+ export default BugStats

Added BugStats component but mapping is not done should we proceed with data manipulation on frontend or backend?

@lbrabec, The approach I can think of is going through every key in an object and create new objects which can have data of the two different cases(beta and final in our case).

@manishakanyal Thank you for your email how can I help you with this component?  I know about the frontend but I am not familiar with a backend.  @lbrabec  told me that I can work on any ticket regardless of who is doing it.

Metadata Update from @lbrabec:
- Pull-request tagged with: review in progress

3 years ago

@manishakanyal, I spoke with @frantisekz, the API change will be deployed to stg sometime next week, I'll ping you when the deployment is done so you can proceed.

Metadata Update from @lbrabec:
- Pull-request tagged with: Pending on others

3 years ago

@frantisekz had some spare cycles and deployed the change to stg right now.

The change is backwards compatible (i.e. there are both "old" and "new" keys in the API response), but that is just temporary so the old code works for others.

Metadata Update from @lbrabec:
- Pull-request untagged with: pending on others

3 years ago

1 new commit added

  • used bugstats component
3 years ago

@lbrabec, I've made the needed changes. Can you have a look at this, please?

Looks good, thanks.

Please rebase on current master (there is conflict you'll need to fix) and squash the commits to one.

rebased onto 82838a3

3 years ago

@lbrabec, I've fixed the merge conflict and rebased it. Can you have a look at it, please?

Metadata Update from @lbrabec:
- Pull-request untagged with: review in progress
- Pull-request tagged with: review done

3 years ago

Pull-Request has been merged by lbrabec

2 years ago