From c5e21cdf4883a9f13978eb71133b5b7b58123b79 Mon Sep 17 00:00:00 2001 From: Okwuidegbe Emmanuel 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 ( -
-

- Fedora {this.props.release} blockers and FEs{" "} - -

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- Beta -
Proposed Blockers{this.props.data.beta_blockers_proposed}
Accepted Blockers{this.props.data.beta_blockers}
Proposed FEs{this.props.data.beta_fe_proposed}
Accepted FEs{this.props.data.beta_fe}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- Final -
Proposed Blockers{this.props.data.final_blockers_proposed}
Accepted Blockers{this.props.data.final_blockers}
Proposed FEs{this.props.data.final_fe_proposed}
Accepted FEs{this.props.data.final_fe}
-
-
-
- ) - } +const Blockers = ({data, release}) => { + + if (data) + return ( +
+

+ Fedora {release} blockers and FEs{" "} + +

+ +
+ +
+
+ +
+
+
+ ) } 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 ( + + + + + + + + + + + + + + + + + + + + + + + + +
+ Beta +
Proposed Blockers{data.beta_blockers_proposed}
Accepted Blockers{data.beta_blockers}
Proposed FEs{data.beta_fe_proposed}
Accepted FEs{data.beta_fe}
+ ) +} + +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 ( + + + + + + + + + + + + + + + + + + + + + + + + +
+ Final +
Proposed Blockers{data.final_blockers_proposed}
Accepted Blockers{data.final_blockers}
Proposed FEs{data.final_fe_proposed}
Accepted FEs{data.final_fe}
+ ) +} + +export default FinalStat \ No newline at end of file From db90d90601d407b784f4fa7e8502df27eed354ef Mon Sep 17 00:00:00 2001 From: Okwuidegbe Emmanuel 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 ( -
-

- Fedora {this.props.release} blockers and FEs{" "} - -

- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- Beta -
Proposed Blockers{this.props.data.beta_blockers_proposed}
Accepted Blockers{this.props.data.beta_blockers}
Proposed FEs{this.props.data.beta_fe_proposed}
Accepted FEs{this.props.data.beta_fe}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
- Final -
Proposed Blockers{this.props.data.final_blockers_proposed}
Accepted Blockers{this.props.data.final_blockers}
Proposed FEs{this.props.data.final_fe_proposed}
Accepted FEs{this.props.data.final_fe}
-
-
-
- ) - } +const Blockers = ({data, release}) => { + + if (data) + return ( +
+

+ Fedora {release} blockers and FEs{" "} + +

+ +
+ +
+
+ +
+
+
+ ) } 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 ( + + + + + + + + + + + + + + + + + + + + + + + + +
+ Beta +
Proposed Blockers{data.beta_blockers_proposed}
Accepted Blockers{data.beta_blockers}
Proposed FEs{data.beta_fe_proposed}
Accepted FEs{data.beta_fe}
+ ) +} + +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 ( + + + + + + + + + + + + + + + + + + + + + + + + +
+ Final +
Proposed Blockers{data.final_blockers_proposed}
Accepted Blockers{data.final_blockers}
Proposed FEs{data.final_fe_proposed}
Accepted FEs{data.final_fe}
+ ) +} + +export default FinalStat \ No newline at end of file From 90d76396a2e1b68ea80796e15e093f866e9d2e3c Mon Sep 17 00:00:00 2001 From: Okwuidegbe Emmanuel 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{" "} - -
- -
-
- -
-
+ ) } 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}) => ( + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ Beta +
Proposed Blockers{data.beta_blockers_proposed}
Accepted Blockers{data.beta_blockers}
Proposed FEs{data.beta_fe_proposed}
Accepted FEs{data.beta_fe}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ Final +
Proposed Blockers{data.final_blockers_proposed}
Accepted Blockers{data.final_blockers}
Proposed FEs{data.final_fe_proposed}
Accepted FEs{data.final_fe}
+
+
+) + +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 ( - - - - - - - - - - - - - - - - - - - - - - - - -
- Beta -
Proposed Blockers{data.beta_blockers_proposed}
Accepted Blockers{data.beta_blockers}
Proposed FEs{data.beta_fe_proposed}
Accepted FEs{data.beta_fe}
- ) -} - -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 ( - - - - - - - - - - - - - - - - - - - - - - - - -
- Final -
Proposed Blockers{data.final_blockers_proposed}
Accepted Blockers{data.final_blockers}
Proposed FEs{data.final_fe_proposed}
Accepted FEs{data.final_fe}
- ) -} - -export default FinalStat \ No newline at end of file