From ddcf2f5e1c9a833f0dad760385a510c43d547b83 Mon Sep 17 00:00:00 2001 From: manisha Date: Mar 30 2021 09:40:57 +0000 Subject: [PATCH 1/2] added BugStats component --- diff --git a/src/landingpage/common/BugStats.js b/src/landingpage/common/BugStats.js new file mode 100644 index 0000000..938dadd --- /dev/null +++ b/src/landingpage/common/BugStats.js @@ -0,0 +1,39 @@ +import React from 'react' + +const BugStats = (props) => { + const { milestone, stats } = props; + + return ( +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ {milestone} +
Proposed Blockers{stats.blockers_proposed}
Accepted Blockers{stats.blockers}
Proposed FEs{stats.fe_proposed}
Accepted FEs{stats.fe}
+
+ ) +} + +export default BugStats From d549f01b83b986902eb2f46db5034161b3acf271 Mon Sep 17 00:00:00 2001 From: manisha Date: Mar 30 2021 16:06:35 +0000 Subject: [PATCH 2/2] removed lodash and added uniqueID function --- diff --git a/package.json b/package.json index 20d0779..9af4daa 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "dependencies": { "bootstrap": "^4.4.1", "dateformat": "^3.0.3", + "nanoid": "^3.1.22", + "ramda": "^0.27.1", "react": "^16.5.2", "react-dom": "^16.5.2", "react-redux": "^7.2.1", diff --git a/src/helpers/uniqueID.js b/src/helpers/uniqueID.js new file mode 100644 index 0000000..d168497 --- /dev/null +++ b/src/helpers/uniqueID.js @@ -0,0 +1,7 @@ +import { nanoid } from 'nanoid'; + +const uniqueID = (string) => { + return string + nanoid(); +} + +export default uniqueID; \ No newline at end of file diff --git a/src/landingpage/Hideable.js b/src/landingpage/Hideable.js index aac075a..9295373 100644 --- a/src/landingpage/Hideable.js +++ b/src/landingpage/Hideable.js @@ -1,10 +1,10 @@ import React, { Component } from "react" -import _ from "lodash" +import uniqueID from "../helpers/uniqueID" class Hideable extends Component { constructor(props) { super(props) - this.id = _.uniqueId("hideable-id-") + this.id = uniqueID("hideable-id-") } render() { diff --git a/src/landingpage/LandingPage.js b/src/landingpage/LandingPage.js index b1bee82..5ae38fe 100644 --- a/src/landingpage/LandingPage.js +++ b/src/landingpage/LandingPage.js @@ -7,9 +7,7 @@ import Events from "./Events" import Blockers from "./Blockers" import Minutes from "./Minutes" import Hideable from "./Hideable" - -import _ from "lodash" - +import * as R from 'ramda' import { connect } from "react-redux" import { loadData } from "../actions/reduxActions" @@ -70,9 +68,9 @@ class LandingPage extends Component { blockers: , minutes: , } - let components = _.chunk( - this.state.config_mode ? this.available_components : this.state.enabled_components, - 2 + let components = R.splitEvery( + 2, + this.state.config_mode ? this.available_components : this.state.enabled_components ) components = components.map((row) => ( @@ -86,6 +84,7 @@ class LandingPage extends Component { {available_components[item]} + ))} )) diff --git a/src/wizard/components.js b/src/wizard/components.js index d17540b..4b2c8f3 100644 --- a/src/wizard/components.js +++ b/src/wizard/components.js @@ -1,11 +1,11 @@ import React, { Component } from "react" import { Card, CardHeader, CardBody, UncontrolledCollapse, Row } from "reactstrap" -import _ from "lodash" +import uniqueID from "../helpers/uniqueID" class CollapsableCard extends Component { render() { const { title, expand_text, expand_class, children } = this.props - const id = _.uniqueId("collapsable-card-id-") + const id = uniqueID("collapsable-card-id-") return ( @@ -27,7 +27,7 @@ class CollapsableCard extends Component { class CollapsableBadge extends Component { render() { const { expand_text, expand_class, children, type } = this.props - const id = _.uniqueId("collapsable-badge-id-") + const id = uniqueID("collapsable-badge-id-") return ( diff --git a/yarn.lock b/yarn.lock index 85bfaa4..4e47ea6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6907,6 +6907,11 @@ nan@^2.12.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw== +nanoid@^3.1.22: + version "3.1.22" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.22.tgz#b35f8fb7d151990a8aebd5aa5015c03cf726f844" + integrity sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ== + nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -8505,6 +8510,11 @@ raf@^3.4.1: dependencies: performance-now "^2.1.0" +ramda@^0.27.1: + version "0.27.1" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9" + integrity sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw== + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"