From c5e21cdf4883a9f13978eb71133b5b7b58123b79 Mon Sep 17 00:00:00 2001
From: Okwuidegbe Emmanuel <okwuidegbeemmanuel@gmail.com>
Date: Apr 03 2021 08:34:53 +0000
Subject: [PATCH 1/5] Reduce redundancy in Blockers.js


---

diff --git a/src/landingpage/Blockers.js b/src/landingpage/Blockers.js
index 30b923a..a5537ba 100644
--- a/src/landingpage/Blockers.js
+++ b/src/landingpage/Blockers.js
@@ -1,85 +1,28 @@
 import React, { Component } from "react"
 import { Row } from "reactstrap"
 import SourceLink from "./SourceLink"
+import FinalStat from "./stats/FinalStat"
+import BetaStat from "./stats/BetaStat"
 
-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>
-
-            <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>
-      )
-  }
+const Blockers = ({data, release}) => {
+  
+  if (data)
+    return (
+      <div>
+        <h1 className="padded">
+          Fedora {release} blockers and FEs{" "}
+          <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />
+        </h1>
+        <Row>
+          <div className="col-md-6">
+            <BetaStat data={data}/>
+          </div>
+          <div className="col-md-6">
+            <FinalStat data={data}/>
+          </div>
+        </Row>
+      </div>
+    )
 }
 
 export default Blockers
diff --git a/src/landingpage/stats/BetaStat.js b/src/landingpage/stats/BetaStat.js
new file mode 100644
index 0000000..554f19d
--- /dev/null
+++ b/src/landingpage/stats/BetaStat.js
@@ -0,0 +1,35 @@
+import React from "react"
+
+const BetaStat = ({data}) => {
+  return (
+    <table className="events">
+      <thead>
+        <tr>
+          <td colSpan="2">
+            <b>Beta</b>
+          </td>
+        </tr>
+      </thead>
+      <tbody>
+        <tr>
+          <td>Proposed Blockers</td>
+          <td className="bugscount">{data.beta_blockers_proposed}</td>
+        </tr>
+        <tr>
+          <td>Accepted Blockers</td>
+          <td className="bugscount">{data.beta_blockers}</td>
+        </tr>
+        <tr>
+          <td>Proposed FEs</td>
+          <td className="bugscount">{data.beta_fe_proposed}</td>
+        </tr>
+        <tr>
+          <td>Accepted FEs</td>
+          <td className="bugscount">{data.beta_fe}</td>
+        </tr>
+      </tbody>
+    </table>
+  )
+}
+
+export default BetaStat
\ No newline at end of file
diff --git a/src/landingpage/stats/FinalStat.js b/src/landingpage/stats/FinalStat.js
new file mode 100644
index 0000000..cb8cc7e
--- /dev/null
+++ b/src/landingpage/stats/FinalStat.js
@@ -0,0 +1,35 @@
+import React from "react"
+
+const FinalStat = ({data}) => {
+  return (
+    <table className="events">
+      <thead>
+        <tr>
+          <td colSpan="2">
+            <b>Final</b>
+          </td>
+        </tr>
+      </thead>
+      <tbody>
+        <tr>
+          <td>Proposed Blockers</td>
+          <td className="bugscount">{data.final_blockers_proposed}</td>
+        </tr>
+        <tr>
+          <td>Accepted Blockers</td>
+          <td className="bugscount">{data.final_blockers}</td>
+        </tr>
+        <tr>
+          <td>Proposed FEs</td>
+          <td className="bugscount">{data.final_fe_proposed}</td>
+        </tr>
+        <tr>
+          <td>Accepted FEs</td>
+          <td className="bugscount">{data.final_fe}</td>
+        </tr>
+      </tbody>
+    </table>
+  )
+}
+
+export default FinalStat
\ No newline at end of file

From db90d90601d407b784f4fa7e8502df27eed354ef Mon Sep 17 00:00:00 2001
From: Okwuidegbe Emmanuel <okwuidegbeemmanuel@gmail.com>
Date: Apr 03 2021 19:28:38 +0000
Subject: [PATCH 2/5] Reduce redundancy in Blockers.js


---

diff --git a/src/landingpage/Blockers.js b/src/landingpage/Blockers.js
index 30b923a..8bd1b02 100644
--- a/src/landingpage/Blockers.js
+++ b/src/landingpage/Blockers.js
@@ -1,85 +1,28 @@
-import React, { Component } from "react"
+import React from "react"
 import { Row } from "reactstrap"
 import SourceLink from "./SourceLink"
+import FinalStat from "./stats/FinalStat"
+import BetaStat from "./stats/BetaStat"
 
-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>
-
-            <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>
-      )
-  }
+const Blockers = ({data, release}) => {
+  
+  if (data)
+    return (
+      <div>
+        <h1 className="padded">
+          Fedora {release} blockers and FEs{" "}
+          <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />
+        </h1>
+        <Row>
+          <div className="col-md-6">
+            <BetaStat data={data}/>
+          </div>
+          <div className="col-md-6">
+            <FinalStat data={data}/>
+          </div>
+        </Row>
+      </div>
+    )
 }
 
 export default Blockers
diff --git a/src/landingpage/stats/BetaStat.js b/src/landingpage/stats/BetaStat.js
new file mode 100644
index 0000000..554f19d
--- /dev/null
+++ b/src/landingpage/stats/BetaStat.js
@@ -0,0 +1,35 @@
+import React from "react"
+
+const BetaStat = ({data}) => {
+  return (
+    <table className="events">
+      <thead>
+        <tr>
+          <td colSpan="2">
+            <b>Beta</b>
+          </td>
+        </tr>
+      </thead>
+      <tbody>
+        <tr>
+          <td>Proposed Blockers</td>
+          <td className="bugscount">{data.beta_blockers_proposed}</td>
+        </tr>
+        <tr>
+          <td>Accepted Blockers</td>
+          <td className="bugscount">{data.beta_blockers}</td>
+        </tr>
+        <tr>
+          <td>Proposed FEs</td>
+          <td className="bugscount">{data.beta_fe_proposed}</td>
+        </tr>
+        <tr>
+          <td>Accepted FEs</td>
+          <td className="bugscount">{data.beta_fe}</td>
+        </tr>
+      </tbody>
+    </table>
+  )
+}
+
+export default BetaStat
\ No newline at end of file
diff --git a/src/landingpage/stats/FinalStat.js b/src/landingpage/stats/FinalStat.js
new file mode 100644
index 0000000..cb8cc7e
--- /dev/null
+++ b/src/landingpage/stats/FinalStat.js
@@ -0,0 +1,35 @@
+import React from "react"
+
+const FinalStat = ({data}) => {
+  return (
+    <table className="events">
+      <thead>
+        <tr>
+          <td colSpan="2">
+            <b>Final</b>
+          </td>
+        </tr>
+      </thead>
+      <tbody>
+        <tr>
+          <td>Proposed Blockers</td>
+          <td className="bugscount">{data.final_blockers_proposed}</td>
+        </tr>
+        <tr>
+          <td>Accepted Blockers</td>
+          <td className="bugscount">{data.final_blockers}</td>
+        </tr>
+        <tr>
+          <td>Proposed FEs</td>
+          <td className="bugscount">{data.final_fe_proposed}</td>
+        </tr>
+        <tr>
+          <td>Accepted FEs</td>
+          <td className="bugscount">{data.final_fe}</td>
+        </tr>
+      </tbody>
+    </table>
+  )
+}
+
+export default FinalStat
\ No newline at end of file

From 90d76396a2e1b68ea80796e15e093f866e9d2e3c Mon Sep 17 00:00:00 2001
From: Okwuidegbe Emmanuel <okwuidegbeemmanuel@gmail.com>
Date: Apr 08 2021 14:29:21 +0000
Subject: [PATCH 4/5] Merge branch 'reduced_redundancy_in_blockers' of ssh://pagure.io/forks/emma50/fedora-qa/landingpage into reduced_redundancy_in_blockers


---

diff --git a/src/landingpage/Blockers.js b/src/landingpage/Blockers.js
index 8bd1b02..b6ed4fe 100644
--- a/src/landingpage/Blockers.js
+++ b/src/landingpage/Blockers.js
@@ -1,8 +1,6 @@
 import React from "react"
-import { Row } from "reactstrap"
 import SourceLink from "./SourceLink"
-import FinalStat from "./stats/FinalStat"
-import BetaStat from "./stats/BetaStat"
+import Stats from "./Stats"
 
 const Blockers = ({data, release}) => {
   
@@ -13,14 +11,7 @@ const Blockers = ({data, release}) => {
           Fedora {release} blockers and FEs{" "}
           <SourceLink href="https://qa.fedoraproject.org/blockerbugs/" />
         </h1>
-        <Row>
-          <div className="col-md-6">
-            <BetaStat data={data}/>
-          </div>
-          <div className="col-md-6">
-            <FinalStat data={data}/>
-          </div>
-        </Row>
+        <Stats data={data} />
       </div>
     )
 }
diff --git a/src/landingpage/Stats.js b/src/landingpage/Stats.js
new file mode 100644
index 0000000..e2d9b26
--- /dev/null
+++ b/src/landingpage/Stats.js
@@ -0,0 +1,67 @@
+import React from "react"
+import { Row } from "reactstrap"
+
+const Stats = ({data}) => (
+  <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">{data.beta_blockers_proposed}</td>
+          </tr>
+          <tr>
+            <td>Accepted Blockers</td>
+            <td className="bugscount">{data.beta_blockers}</td>
+          </tr>
+          <tr>
+            <td>Proposed FEs</td>
+            <td className="bugscount">{data.beta_fe_proposed}</td>
+          </tr>
+          <tr>
+            <td>Accepted FEs</td>
+            <td className="bugscount">{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">{data.final_blockers_proposed}</td>
+          </tr>
+          <tr>
+            <td>Accepted Blockers</td>
+            <td className="bugscount">{data.final_blockers}</td>
+          </tr>
+          <tr>
+            <td>Proposed FEs</td>
+            <td className="bugscount">{data.final_fe_proposed}</td>
+          </tr>
+          <tr>
+            <td>Accepted FEs</td>
+            <td className="bugscount">{data.final_fe}</td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+  </Row>
+)
+
+export default Stats
\ No newline at end of file
diff --git a/src/landingpage/stats/BetaStat.js b/src/landingpage/stats/BetaStat.js
deleted file mode 100644
index 554f19d..0000000
--- a/src/landingpage/stats/BetaStat.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import React from "react"
-
-const BetaStat = ({data}) => {
-  return (
-    <table className="events">
-      <thead>
-        <tr>
-          <td colSpan="2">
-            <b>Beta</b>
-          </td>
-        </tr>
-      </thead>
-      <tbody>
-        <tr>
-          <td>Proposed Blockers</td>
-          <td className="bugscount">{data.beta_blockers_proposed}</td>
-        </tr>
-        <tr>
-          <td>Accepted Blockers</td>
-          <td className="bugscount">{data.beta_blockers}</td>
-        </tr>
-        <tr>
-          <td>Proposed FEs</td>
-          <td className="bugscount">{data.beta_fe_proposed}</td>
-        </tr>
-        <tr>
-          <td>Accepted FEs</td>
-          <td className="bugscount">{data.beta_fe}</td>
-        </tr>
-      </tbody>
-    </table>
-  )
-}
-
-export default BetaStat
\ No newline at end of file
diff --git a/src/landingpage/stats/FinalStat.js b/src/landingpage/stats/FinalStat.js
deleted file mode 100644
index cb8cc7e..0000000
--- a/src/landingpage/stats/FinalStat.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import React from "react"
-
-const FinalStat = ({data}) => {
-  return (
-    <table className="events">
-      <thead>
-        <tr>
-          <td colSpan="2">
-            <b>Final</b>
-          </td>
-        </tr>
-      </thead>
-      <tbody>
-        <tr>
-          <td>Proposed Blockers</td>
-          <td className="bugscount">{data.final_blockers_proposed}</td>
-        </tr>
-        <tr>
-          <td>Accepted Blockers</td>
-          <td className="bugscount">{data.final_blockers}</td>
-        </tr>
-        <tr>
-          <td>Proposed FEs</td>
-          <td className="bugscount">{data.final_fe_proposed}</td>
-        </tr>
-        <tr>
-          <td>Accepted FEs</td>
-          <td className="bugscount">{data.final_fe}</td>
-        </tr>
-      </tbody>
-    </table>
-  )
-}
-
-export default FinalStat
\ No newline at end of file

