From 154db61c6e1aad308fad9a138536355c1c7ba2bb Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Tue, 11 Feb 2020 21:10:17 +0200 Subject: [PATCH 01/15] Support statistics for groups --- src/shared/containers/Profile.jsx | 14 ++++++++--- src/shared/containers/ProfileStats.jsx | 20 ++++++++++----- .../routes/Communities/Blockchain/Routes.jsx | 12 +++++++++ src/shared/routes/Communities/CS/Routes.jsx | 12 +++++++++ .../routes/Communities/Cognitive/Routes.jsx | 12 +++++++++ .../routes/Communities/Community2/Routes.jsx | 12 +++++++++ .../routes/Communities/DemoExpert/Routes.jsx | 12 +++++++++ .../routes/Communities/Mobile/Routes.jsx | 12 +++++++++ src/shared/routes/Communities/QA/Routes.jsx | 12 +++++++++ src/shared/routes/Communities/SRMx/Routes.jsx | 12 +++++++++ .../routes/Communities/TCO01/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO02/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO03/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO04/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO05/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO06/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO07/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO08/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO09/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO10/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO11/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO12/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO13/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO14/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO15/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO16/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO17/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO18/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO19/Routes.jsx | 15 ++++++++++- .../routes/Communities/TCO20/Routes.jsx | 25 +++++++++++++++---- .../routes/Communities/TaskForce/Routes.jsx | 12 +++++++++ .../Communities/TcProdDev/Routes/index.jsx | 12 +++++++++ .../routes/Communities/Veterans/Routes.jsx | 12 +++++++++ .../routes/Communities/Wipro/Routes.jsx | 12 +++++++++ .../routes/Communities/Zurich/Routes.jsx | 12 +++++++++ src/shared/routes/Communities/iot/Routes.jsx | 12 +++++++++ 36 files changed, 478 insertions(+), 34 deletions(-) diff --git a/src/shared/containers/Profile.jsx b/src/shared/containers/Profile.jsx index 0d6afb6dde..f3cc1f16b6 100644 --- a/src/shared/containers/Profile.jsx +++ b/src/shared/containers/Profile.jsx @@ -1,6 +1,7 @@ /** * Connects the Redux store to the Profile display components. */ +import _ from 'lodash'; import React from 'react'; import PT from 'prop-types'; import { connect } from 'react-redux'; @@ -15,9 +16,10 @@ class ProfileContainer extends React.Component { const { handleParam, loadProfile, + meta, } = this.props; - loadProfile(handleParam); + loadProfile(handleParam, _.join(_.get(meta, 'groupIds', []))); } componentWillReceiveProps(nextProps) { @@ -25,10 +27,11 @@ class ProfileContainer extends React.Component { handleParam, profileForHandle, loadProfile, + meta, } = nextProps; if (handleParam !== profileForHandle) { - loadProfile(handleParam); + loadProfile(handleParam, _.join(_.get(meta, 'groupIds', []))); } } @@ -75,6 +78,7 @@ ProfileContainer.defaultProps = { profileForHandle: '', skills: null, stats: null, + meta: null, }; ProfileContainer.propTypes = { @@ -91,6 +95,7 @@ ProfileContainer.propTypes = { skills: PT.shape(), stats: PT.shape(), lookupData: PT.shape().isRequired, + meta: PT.shape(), }; const mapStateToProps = (state, ownProps) => ({ @@ -100,6 +105,7 @@ const mapStateToProps = (state, ownProps) => ({ externalAccounts: state.profile.externalAccounts, externalLinks: state.profile.externalLinks, handleParam: ownProps.match.params.handle, + meta: ownProps.meta, info: state.profile.info, loadingError: state.profile.loadingError, profileForHandle: state.profile.profileForHandle, @@ -112,7 +118,7 @@ function mapDispatchToProps(dispatch) { const a = actions.profile; const lookupActions = actions.lookup; return { - loadProfile: (handle) => { + loadProfile: (handle, groupIds) => { dispatch(a.clearProfile()); dispatch(a.loadProfile(handle)); dispatch(a.getAchievementsInit()); @@ -127,7 +133,7 @@ function mapDispatchToProps(dispatch) { dispatch(a.getExternalLinksDone(handle)); dispatch(a.getInfoDone(handle)); dispatch(a.getSkillsDone(handle)); - dispatch(a.getStatsDone(handle)); + dispatch(a.getStatsDone(handle, groupIds)); dispatch(lookupActions.getCountriesDone()); }, }; diff --git a/src/shared/containers/ProfileStats.jsx b/src/shared/containers/ProfileStats.jsx index b9404a1321..17540fc3b3 100644 --- a/src/shared/containers/ProfileStats.jsx +++ b/src/shared/containers/ProfileStats.jsx @@ -23,12 +23,15 @@ class ProfileStatsContainer extends React.Component { location, loadStats, loadStatsHistoryAndDistribution, + meta, } = this.props; + const trackAndSubTrack = getQueryParamsQuery(location); - loadStats(handleParam); + loadStats(handleParam, _.join(_.get(meta, 'groupIds', []))); if (shouldShowGraph(trackAndSubTrack)) { loadStatsHistoryAndDistribution( handleParam, + _.join(_.get(meta, 'groupIds', [])), trackAndSubTrack.track, trackAndSubTrack.subTrack, ); @@ -41,6 +44,7 @@ class ProfileStatsContainer extends React.Component { location: nextLocation, loadStats, loadStatsHistoryAndDistribution, + meta, } = nextProps; const { handleParam, @@ -51,7 +55,7 @@ class ProfileStatsContainer extends React.Component { const trackAndSubTrack = getQueryParamsQuery(location); if (nextHandleParam !== handleParam) { - loadStats(nextHandleParam); + loadStats(nextHandleParam, _.join(_.get(meta, 'groupIds', []))); if ( nextQueryParams.track !== trackAndSubTrack.track || nextQueryParams.subTrack !== trackAndSubTrack.subTrack @@ -60,6 +64,7 @@ class ProfileStatsContainer extends React.Component { && !nextQueryParams.tab) { loadStatsHistoryAndDistribution( nextHandleParam, + _.join(_.get(meta, 'groupIds', [])), nextQueryParams.track, nextQueryParams.subTrack, ); @@ -100,6 +105,7 @@ ProfileStatsContainer.defaultProps = { stats: null, info: null, achievements: null, + meta: null, }; ProfileStatsContainer.propTypes = { @@ -114,6 +120,7 @@ ProfileStatsContainer.propTypes = { info: PT.shape(), achievements: PT.arrayOf(PT.shape()), isLoading: PT.bool.isRequired, + meta: PT.shape(), }; const mapStateToProps = (state, ownProps) => { @@ -131,6 +138,7 @@ const mapStateToProps = (state, ownProps) => { statsDistribution: _.get(obj, 'statsDistribution.data'), activeChallengesCount: _.get(obj, 'activeChallengesCount'), info: state.profile.info, + meta: ownProps.meta, achievements: state.profile.achievements, }); }; @@ -140,17 +148,17 @@ function mapDispatchToProps(dispatch) { const pa = actions.profile; return { - loadStats: (handle) => { + loadStats: (handle, groupIds) => { dispatch(a.getStatsInit(handle)); - dispatch(a.getStatsDone(handle)); + dispatch(a.getStatsDone(handle, groupIds)); dispatch(pa.getInfoInit(handle)); dispatch(pa.getInfoDone(handle)); dispatch(a.getActiveChallengesInit(handle)); dispatch(a.getActiveChallengesDone(handle)); }, - loadStatsHistoryAndDistribution: (handle, track, subTrack) => { + loadStatsHistoryAndDistribution: (handle, groupIds, track, subTrack) => { dispatch(a.getStatsHistoryInit(handle)); - dispatch(a.getStatsHistoryDone(handle)); + dispatch(a.getStatsHistoryDone(handle, groupIds)); dispatch(a.getStatsDistributionInit(handle)); dispatch(a.getStatsDistributionDone(handle, track, subTrack)); }, diff --git a/src/shared/routes/Communities/Blockchain/Routes.jsx b/src/shared/routes/Communities/Blockchain/Routes.jsx index 8d30f50a53..9bbe28dc62 100644 --- a/src/shared/routes/Communities/Blockchain/Routes.jsx +++ b/src/shared/routes/Communities/Blockchain/Routes.jsx @@ -21,6 +21,8 @@ import PT from 'prop-types'; import React from 'react'; import Submission from 'routes/Submission'; import SubmissionManagement from 'routes/SubmissionManagement'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import TermsDetail from 'routes/TermsDetail'; import { Route, Switch } from 'react-router-dom'; import { ThemeProvider } from 'react-css-super-themr'; @@ -118,6 +120,16 @@ export default function Blockchain({ base, member, meta }) { exact path={`${base}/leaderboard`} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact diff --git a/src/shared/routes/Communities/CS/Routes.jsx b/src/shared/routes/Communities/CS/Routes.jsx index b636335429..39299ee036 100644 --- a/src/shared/routes/Communities/CS/Routes.jsx +++ b/src/shared/routes/Communities/CS/Routes.jsx @@ -17,6 +17,8 @@ import React from 'react'; import Submission from 'routes/Submission'; import SubmissionManagement from 'routes/SubmissionManagement'; import TermsDetail from 'routes/TermsDetail'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import theme from 'components/tc-communities/communities/cs/theme'; import { ThemeProvider } from 'react-css-super-themr'; import { Route, Switch } from 'react-router-dom'; @@ -80,6 +82,16 @@ export default function CS({ base, meta }) { exact path={`${base}/challenges/terms/detail/:termId`} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact diff --git a/src/shared/routes/Communities/Community2/Routes.jsx b/src/shared/routes/Communities/Community2/Routes.jsx index 9d647b0026..46885507e0 100644 --- a/src/shared/routes/Communities/Community2/Routes.jsx +++ b/src/shared/routes/Communities/Community2/Routes.jsx @@ -13,6 +13,8 @@ import PT from 'prop-types'; import React from 'react'; import Submission from 'routes/Submission'; import SubmissionManagement from 'routes/SubmissionManagement'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import TermsDetail from 'routes/TermsDetail'; import { Route, Switch } from 'react-router-dom'; import { ThemeProvider } from 'react-css-super-themr'; @@ -75,6 +77,16 @@ export default function Community2({ base, meta }) { exact path={`${base}/challenges/:challengeId(\\d{8}|\\d{5})/my-submissions`} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact diff --git a/src/shared/routes/Communities/DemoExpert/Routes.jsx b/src/shared/routes/Communities/DemoExpert/Routes.jsx index ddd492282d..8bec1b6a4f 100644 --- a/src/shared/routes/Communities/DemoExpert/Routes.jsx +++ b/src/shared/routes/Communities/DemoExpert/Routes.jsx @@ -14,6 +14,8 @@ import React from 'react'; import Submission from 'routes/Submission'; import SubmissionManagement from 'routes/SubmissionManagement'; import TermsDetail from 'routes/TermsDetail'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import { ThemeProvider } from 'react-css-super-themr'; import primaryButtonStyle from 'components/buttons/outline/round/open-sans/green-uppercase.scss'; @@ -75,6 +77,16 @@ export default function DemoExpert({ base, meta }) { exact path={`${base}/challenges/:challengeId(\\d{8}|\\d{5})/my-submissions`} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact diff --git a/src/shared/routes/Communities/Mobile/Routes.jsx b/src/shared/routes/Communities/Mobile/Routes.jsx index 8a09ae6a67..b01b84a89e 100644 --- a/src/shared/routes/Communities/Mobile/Routes.jsx +++ b/src/shared/routes/Communities/Mobile/Routes.jsx @@ -12,6 +12,8 @@ import React from 'react'; import Submission from 'routes/Submission'; import SubmissionManagement from 'routes/SubmissionManagement'; import TermsDetail from 'routes/TermsDetail'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import { ThemeProvider } from 'react-css-super-themr'; @@ -88,6 +90,16 @@ export default function Mobile({ base, meta }) { exact path={`${base}/challenges/terms/detail/:termId`} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact diff --git a/src/shared/routes/Communities/SRMx/Routes.jsx b/src/shared/routes/Communities/SRMx/Routes.jsx index 17c562e22b..d7b8867084 100644 --- a/src/shared/routes/Communities/SRMx/Routes.jsx +++ b/src/shared/routes/Communities/SRMx/Routes.jsx @@ -14,6 +14,8 @@ import React from 'react'; import Submission from 'routes/Submission'; import SubmissionManagement from 'routes/SubmissionManagement'; import TermsDetail from 'routes/TermsDetail'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import { ThemeProvider } from 'react-css-super-themr'; import primaryButtonStyle from 'components/buttons/outline/round/open-sans/green-uppercase.scss'; @@ -75,6 +77,16 @@ export default function SRMx({ base, meta }) { exact path={`${base}/challenges/:challengeId(\\d{8}|\\d{5})/my-submissions`} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact diff --git a/src/shared/routes/Communities/TCO01/Routes.jsx b/src/shared/routes/Communities/TCO01/Routes.jsx index 31b00fba55..d5fa2ba848 100644 --- a/src/shared/routes/Communities/TCO01/Routes.jsx +++ b/src/shared/routes/Communities/TCO01/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO01({ base }) { +export default function TCO01({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO01({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO01.defaultProps = { TCO01.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO02/Routes.jsx b/src/shared/routes/Communities/TCO02/Routes.jsx index 53a3e5aa05..5107d7f8eb 100644 --- a/src/shared/routes/Communities/TCO02/Routes.jsx +++ b/src/shared/routes/Communities/TCO02/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO02({ base }) { +export default function TCO02({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO02({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO02.defaultProps = { TCO02.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO03/Routes.jsx b/src/shared/routes/Communities/TCO03/Routes.jsx index e9e2d62874..d8863c4813 100644 --- a/src/shared/routes/Communities/TCO03/Routes.jsx +++ b/src/shared/routes/Communities/TCO03/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO03({ base }) { +export default function TCO03({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO03({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO03.defaultProps = { TCO03.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO04/Routes.jsx b/src/shared/routes/Communities/TCO04/Routes.jsx index 304c885a62..b37d306b6f 100644 --- a/src/shared/routes/Communities/TCO04/Routes.jsx +++ b/src/shared/routes/Communities/TCO04/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO04({ base }) { +export default function TCO04({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO04({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO04.defaultProps = { TCO04.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO05/Routes.jsx b/src/shared/routes/Communities/TCO05/Routes.jsx index c4ff510be5..c202645b94 100644 --- a/src/shared/routes/Communities/TCO05/Routes.jsx +++ b/src/shared/routes/Communities/TCO05/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO05({ base }) { +export default function TCO05({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO05({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO05.defaultProps = { TCO05.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO06/Routes.jsx b/src/shared/routes/Communities/TCO06/Routes.jsx index 528f49e61c..f3434ad565 100644 --- a/src/shared/routes/Communities/TCO06/Routes.jsx +++ b/src/shared/routes/Communities/TCO06/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO06({ base }) { +export default function TCO06({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO06({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO06.defaultProps = { TCO06.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO07/Routes.jsx b/src/shared/routes/Communities/TCO07/Routes.jsx index 6fc4ff542a..d6c3ee7d0f 100644 --- a/src/shared/routes/Communities/TCO07/Routes.jsx +++ b/src/shared/routes/Communities/TCO07/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO07({ base }) { +export default function TCO07({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO07({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO07.defaultProps = { TCO07.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO08/Routes.jsx b/src/shared/routes/Communities/TCO08/Routes.jsx index 4571266274..dcfa50e2f1 100644 --- a/src/shared/routes/Communities/TCO08/Routes.jsx +++ b/src/shared/routes/Communities/TCO08/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO08({ base }) { +export default function TCO08({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO08({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO08.defaultProps = { TCO08.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO09/Routes.jsx b/src/shared/routes/Communities/TCO09/Routes.jsx index c4b9392a2c..d886fb0470 100644 --- a/src/shared/routes/Communities/TCO09/Routes.jsx +++ b/src/shared/routes/Communities/TCO09/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO09({ base }) { +export default function TCO09({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO09({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO09.defaultProps = { TCO09.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO10/Routes.jsx b/src/shared/routes/Communities/TCO10/Routes.jsx index d339b8e989..3f650fcaa6 100644 --- a/src/shared/routes/Communities/TCO10/Routes.jsx +++ b/src/shared/routes/Communities/TCO10/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO10({ base }) { +export default function TCO10({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO10({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO10.defaultProps = { TCO10.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO11/Routes.jsx b/src/shared/routes/Communities/TCO11/Routes.jsx index 67d36218a9..53046b3ce3 100644 --- a/src/shared/routes/Communities/TCO11/Routes.jsx +++ b/src/shared/routes/Communities/TCO11/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO11({ base }) { +export default function TCO11({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO11({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO11.defaultProps = { TCO11.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO12/Routes.jsx b/src/shared/routes/Communities/TCO12/Routes.jsx index 7f676a8569..553f7479fd 100644 --- a/src/shared/routes/Communities/TCO12/Routes.jsx +++ b/src/shared/routes/Communities/TCO12/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO12({ base }) { +export default function TCO12({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO12({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO12.defaultProps = { TCO12.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO13/Routes.jsx b/src/shared/routes/Communities/TCO13/Routes.jsx index ee13fbd710..8d63302d76 100644 --- a/src/shared/routes/Communities/TCO13/Routes.jsx +++ b/src/shared/routes/Communities/TCO13/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO13({ base }) { +export default function TCO13({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO13({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO13.defaultProps = { TCO13.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO14/Routes.jsx b/src/shared/routes/Communities/TCO14/Routes.jsx index b55721221e..6130a6072b 100644 --- a/src/shared/routes/Communities/TCO14/Routes.jsx +++ b/src/shared/routes/Communities/TCO14/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO14({ base }) { +export default function TCO14({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO14({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO14.defaultProps = { TCO14.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO15/Routes.jsx b/src/shared/routes/Communities/TCO15/Routes.jsx index 7ec8acc9d0..300182524c 100644 --- a/src/shared/routes/Communities/TCO15/Routes.jsx +++ b/src/shared/routes/Communities/TCO15/Routes.jsx @@ -7,11 +7,13 @@ import Error404 from 'components/Error404'; import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO15({ base }) { +export default function TCO15({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO15({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO15.defaultProps = { TCO15.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO16/Routes.jsx b/src/shared/routes/Communities/TCO16/Routes.jsx index 039fbbea06..a29acb4046 100644 --- a/src/shared/routes/Communities/TCO16/Routes.jsx +++ b/src/shared/routes/Communities/TCO16/Routes.jsx @@ -8,10 +8,12 @@ import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; import { Route, Switch } from 'react-router-dom'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO16({ base }) { +export default function TCO16({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO16({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO16.defaultProps = { TCO16.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO17/Routes.jsx b/src/shared/routes/Communities/TCO17/Routes.jsx index 8c559717b1..81d625aec1 100644 --- a/src/shared/routes/Communities/TCO17/Routes.jsx +++ b/src/shared/routes/Communities/TCO17/Routes.jsx @@ -8,10 +8,12 @@ import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; import { Route, Switch } from 'react-router-dom'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO17({ base }) { +export default function TCO17({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO17({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO17.defaultProps = { TCO17.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO18/Routes.jsx b/src/shared/routes/Communities/TCO18/Routes.jsx index d7212dd9e9..4e4aca25d4 100644 --- a/src/shared/routes/Communities/TCO18/Routes.jsx +++ b/src/shared/routes/Communities/TCO18/Routes.jsx @@ -8,10 +8,12 @@ import Header from 'containers/tc-communities/Header'; import PT from 'prop-types'; import React from 'react'; import { Route, Switch } from 'react-router-dom'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import headerTheme from 'components/tc-communities/communities/tco/themes/header.scss'; -export default function TCO18({ base }) { +export default function TCO18({ base, meta }) { return ( ( @@ -22,6 +24,16 @@ export default function TCO18({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } @@ -45,4 +57,5 @@ TCO18.defaultProps = { TCO18.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO19/Routes.jsx b/src/shared/routes/Communities/TCO19/Routes.jsx index df59b48930..612e1f5de0 100644 --- a/src/shared/routes/Communities/TCO19/Routes.jsx +++ b/src/shared/routes/Communities/TCO19/Routes.jsx @@ -13,11 +13,13 @@ import ContentfulLoader from 'containers/ContentfulLoader'; import Blog from 'components/Contentful/Blog'; import { HeroImageLoader } from 'components/Contentful/BlogPost'; import ContentfulRoute from 'components/Contentful/Route'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import headerTheme from 'components/tc-communities/communities/tco19/themes/header.scss'; -export default function TCO19({ base }) { +export default function TCO19({ base, meta }) { return ( ( @@ -28,6 +30,16 @@ export default function TCO19({ base }) { theme={headerTheme} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> { @@ -90,4 +102,5 @@ TCO19.defaultProps = { TCO19.propTypes = { base: PT.string, + meta: PT.shape().isRequired, }; diff --git a/src/shared/routes/Communities/TCO20/Routes.jsx b/src/shared/routes/Communities/TCO20/Routes.jsx index 340653af6e..f1a78c31a8 100644 --- a/src/shared/routes/Communities/TCO20/Routes.jsx +++ b/src/shared/routes/Communities/TCO20/Routes.jsx @@ -5,9 +5,12 @@ import Error404 from 'components/Error404'; import PT from 'prop-types'; import React from 'react'; +import { Route, Switch } from 'react-router-dom'; import ContentfulRoute from 'components/Contentful/Route'; import ContentfulMenu from 'components/Contentful/Menu'; import Viewport from 'components/Contentful/Viewport'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; export default function TCO20({ base, meta }) { return ( @@ -22,11 +25,23 @@ export default function TCO20({ base, meta }) { /> ) : null } - } - id="2Ls9DElilYWV3X2p8qN2EN" - /> + + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> + } + id="dwRKUGPlAI6QrvBcHp2Ag" + /> + + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact diff --git a/src/shared/routes/Communities/TcProdDev/Routes/index.jsx b/src/shared/routes/Communities/TcProdDev/Routes/index.jsx index b8b6c659c9..d32e7d34b0 100644 --- a/src/shared/routes/Communities/TcProdDev/Routes/index.jsx +++ b/src/shared/routes/Communities/TcProdDev/Routes/index.jsx @@ -16,6 +16,8 @@ import { ThemeProvider } from 'react-css-super-themr'; import Submission from 'routes/Submission'; import SubmissionManagement from 'routes/SubmissionManagement'; import TermsDetail from 'routes/TermsDetail'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { Route, Switch } from 'react-router-dom'; import primaryButtonStyle from 'components/buttons/outline/round/open-sans/green-uppercase.scss'; @@ -76,6 +78,16 @@ export default function TcProdDev({ base, meta }) { exact path={`${base}/challenges/:challengeId(\\d{8}|\\d{5})/my-submissions`} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact diff --git a/src/shared/routes/Communities/Veterans/Routes.jsx b/src/shared/routes/Communities/Veterans/Routes.jsx index a76d6e48c1..3e2787f8b3 100644 --- a/src/shared/routes/Communities/Veterans/Routes.jsx +++ b/src/shared/routes/Communities/Veterans/Routes.jsx @@ -17,6 +17,8 @@ import React from 'react'; import Submission from 'routes/Submission'; import SubmissionManagement from 'routes/SubmissionManagement'; import TermsDetail from 'routes/TermsDetail'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import { ThemeProvider } from 'react-css-super-themr'; import { Route, Switch } from 'react-router-dom'; import { BUCKETS, registerBucket } from 'utils/challenge-listing/buckets'; @@ -102,6 +104,16 @@ export default function Veterans({ base, member, meta }) { exact path={`${base}/challenges/terms/detail/:termId`} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact diff --git a/src/shared/routes/Communities/Wipro/Routes.jsx b/src/shared/routes/Communities/Wipro/Routes.jsx index 0331cb9c75..881a7766dd 100644 --- a/src/shared/routes/Communities/Wipro/Routes.jsx +++ b/src/shared/routes/Communities/Wipro/Routes.jsx @@ -17,6 +17,8 @@ import React from 'react'; import Submission from 'routes/Submission'; import SubmissionManagement from 'routes/SubmissionManagement'; import TermsDetail from 'routes/TermsDetail'; +import Profile from 'routes/Profile'; +import ProfileStats from 'routes/ProfileStats'; import theme from 'components/tc-communities/communities/wipro/theme'; import { ThemeProvider } from 'react-css-super-themr'; import { Route, Switch } from 'react-router-dom'; @@ -69,6 +71,16 @@ export default function Wipro({ base, meta }) { exact path={`${base}/challenges/:challengeId(\\d{8}|\\d{5})/my-submissions`} /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})`} + /> + } + exact + path={`${base}/members/:handle([\\w\\-\\[\\].{}]{2,15})/details`} + /> } exact From 078671c2425a74568a66f86c9b359918b2d6521b Mon Sep 17 00:00:00 2001 From: Sushil Shinde Date: Wed, 12 Feb 2020 18:32:45 +0530 Subject: [PATCH 02/15] ci: deploy on test env ci: deploy on test env for QA --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94ff181a52..b4e4a0e993 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -183,6 +183,7 @@ workflows: branches: only: - develop + - feature-group-stats # This is beta env for production soft releases - "build-prod-beta": context : org-global From a0e43ececed489bdca6d050a5461858c9cce11f7 Mon Sep 17 00:00:00 2001 From: Sushil Shinde Date: Wed, 19 Feb 2020 13:13:56 +0530 Subject: [PATCH 03/15] ci: deploying on beta for the QA ci: deploying on beta for the QA --- .circleci/config.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b4e4a0e993..eb017b6a02 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,8 +174,7 @@ workflows: filters: branches: only: - - develop - - hot-fix-past-challenge-search + - develop # This is alternate dev env for parallel testing - "build-test": context : org-global @@ -183,15 +182,13 @@ workflows: branches: only: - develop - - feature-group-stats # This is beta env for production soft releases - "build-prod-beta": context : org-global filters: branches: only: - - develop - - smp-1 + - feature-group-stats # Production builds are exectuted only on tagged commits to the # master branch. - "build-prod": From a8d65b888d8e9b30d47869ed30be4cd5d1e305dd Mon Sep 17 00:00:00 2001 From: Atif Date: Wed, 26 Feb 2020 16:01:45 +0530 Subject: [PATCH 04/15] ci: deploying on dev ci: deploying on dev --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eb017b6a02..31e68af673 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,7 +174,7 @@ workflows: filters: branches: only: - - develop + - feature-group-stats # This is alternate dev env for parallel testing - "build-test": context : org-global @@ -188,7 +188,7 @@ workflows: filters: branches: only: - - feature-group-stats + - develop # Production builds are exectuted only on tagged commits to the # master branch. - "build-prod": From c0432e4e8bf2d324f093b0551835ec7bd1548e23 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 27 Feb 2020 10:04:45 +0800 Subject: [PATCH 05/15] target latest topcoder-react-lib test release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7ab415a68f..708557cc3d 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "supertest": "^3.1.0", "tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev", "tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3", - "topcoder-react-lib": "1000.7.0", + "topcoder-react-lib": "1000.10.0", "topcoder-react-ui-kit": "^1.0.11", "topcoder-react-utils": "0.7.8", "turndown": "^4.0.2", From 19d3d04a133e829fd7ecc056bd16d2227ce4bb9e Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 27 Feb 2020 12:31:54 +0800 Subject: [PATCH 06/15] ci: deploying on dev --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 31e68af673..07d4f53046 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,7 +174,7 @@ workflows: filters: branches: only: - - feature-group-stats + - feature-m2m-with-stats # This is alternate dev env for parallel testing - "build-test": context : org-global From 5a8ddb59755ba896029a015ed983788e5b019a54 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 27 Feb 2020 13:20:45 +0800 Subject: [PATCH 07/15] fix srm/mm undefine issue --- src/shared/components/ProfilePage/StatsCategory/index.jsx | 4 ++-- src/shared/components/ProfilePage/index.jsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shared/components/ProfilePage/StatsCategory/index.jsx b/src/shared/components/ProfilePage/StatsCategory/index.jsx index cc5549fbfc..ba64273a9c 100644 --- a/src/shared/components/ProfilePage/StatsCategory/index.jsx +++ b/src/shared/components/ProfilePage/StatsCategory/index.jsx @@ -60,10 +60,10 @@ class StatsCategory extends React.Component { const active = []; const subTracks = stats[track] ? stats[track].subTracks || [] : []; - if (stats[track].SRM) { + if (stats[track] && stats[track].SRM) { subTracks.push({ ...stats[track].SRM, name: 'SRM' }); } - if (stats[track].MARATHON_MATCH) { + if (stats[track] && stats[track].MARATHON_MATCH) { subTracks.push({ ...stats[track].MARATHON_MATCH, name: 'MARATHON MATCH' }); } diff --git a/src/shared/components/ProfilePage/index.jsx b/src/shared/components/ProfilePage/index.jsx index e75a626daf..0518d4976d 100644 --- a/src/shared/components/ProfilePage/index.jsx +++ b/src/shared/components/ProfilePage/index.jsx @@ -80,10 +80,10 @@ class ProfilePage extends React.Component { const active = []; const subTracks = stats && stats[track] ? stats[track].subTracks || [] : []; - if (stats && stats[track].SRM) { + if (stats && stats[track] && stats[track].SRM) { subTracks.push({ ...stats[track].SRM, name: 'SRM' }); } - if (stats && stats[track].MARATHON_MATCH) { + if (stats && stats[track] && stats[track].MARATHON_MATCH) { subTracks.push({ ...stats[track].MARATHON_MATCH, name: 'MARATHON MATCH' }); } From aed469f35feae5a9b7e192f9b7d345ab43aa899a Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 27 Feb 2020 18:52:16 +0800 Subject: [PATCH 08/15] fix stats issues on profile --- src/shared/components/ProfilePage/Skill/index.jsx | 2 +- .../components/ProfilePage/StatsCategory/index.jsx | 12 ++++++++---- src/shared/components/ProfilePage/index.jsx | 13 +++++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/shared/components/ProfilePage/Skill/index.jsx b/src/shared/components/ProfilePage/Skill/index.jsx index 3969491b02..ad2e27adee 100644 --- a/src/shared/components/ProfilePage/Skill/index.jsx +++ b/src/shared/components/ProfilePage/Skill/index.jsx @@ -37,7 +37,7 @@ const Skill = ({ Skill.propTypes = { tagId: PT.string.isRequired, tagName: PT.string.isRequired, - isVerified: PT.string.isRequired, + isVerified: PT.bool.isRequired, }; export default Skill; diff --git a/src/shared/components/ProfilePage/StatsCategory/index.jsx b/src/shared/components/ProfilePage/StatsCategory/index.jsx index ba64273a9c..15c2673472 100644 --- a/src/shared/components/ProfilePage/StatsCategory/index.jsx +++ b/src/shared/components/ProfilePage/StatsCategory/index.jsx @@ -43,7 +43,11 @@ const isActiveSubtrack = (subtrack) => { class StatsCategory extends React.Component { getActiveTracks() { - const { stats } = this.props; + let { stats } = this.props; + if (_.isArray(stats)) { + // eslint-disable-next-line prefer-destructuring + stats = stats[0]; + } const activeTracks = []; if (stats.COPILOT && stats.COPILOT.fulfillment) { @@ -60,10 +64,10 @@ class StatsCategory extends React.Component { const active = []; const subTracks = stats[track] ? stats[track].subTracks || [] : []; - if (stats[track] && stats[track].SRM) { + if (stats[track].SRM) { subTracks.push({ ...stats[track].SRM, name: 'SRM' }); } - if (stats[track] && stats[track].MARATHON_MATCH) { + if (stats[track].MARATHON_MATCH) { subTracks.push({ ...stats[track].MARATHON_MATCH, name: 'MARATHON MATCH' }); } @@ -183,7 +187,7 @@ StatsCategory.defaultProps = { StatsCategory.propTypes = { handle: PT.string.isRequired, - stats: PT.shape().isRequired, + stats: PT.arrayOf(PT.shape()).isRequired, inModal: PT.bool, className: PT.string, }; diff --git a/src/shared/components/ProfilePage/index.jsx b/src/shared/components/ProfilePage/index.jsx index 0518d4976d..e170802bd4 100644 --- a/src/shared/components/ProfilePage/index.jsx +++ b/src/shared/components/ProfilePage/index.jsx @@ -63,7 +63,12 @@ class ProfilePage extends React.Component { } getActiveTracks() { - const { copilot, stats } = this.props; + const { copilot } = this.props; + let { stats } = this.props; + if (_.isArray(stats)) { + // eslint-disable-next-line prefer-destructuring + stats = stats[0]; + } const activeTracks = []; if (copilot && stats && stats.COPILOT && stats.COPILOT.fulfillment) { @@ -80,10 +85,10 @@ class ProfilePage extends React.Component { const active = []; const subTracks = stats && stats[track] ? stats[track].subTracks || [] : []; - if (stats && stats[track] && stats[track].SRM) { + if (stats && stats[track].SRM) { subTracks.push({ ...stats[track].SRM, name: 'SRM' }); } - if (stats && stats[track] && stats[track].MARATHON_MATCH) { + if (stats && stats[track].MARATHON_MATCH) { subTracks.push({ ...stats[track].MARATHON_MATCH, name: 'MARATHON MATCH' }); } @@ -306,7 +311,7 @@ ProfilePage.propTypes = { externalLinks: PT.arrayOf(PT.shape()), info: PT.shape().isRequired, skills: PT.shape(), - stats: PT.shape(), + stats: PT.arrayOf(PT.shape()), lookupData: PT.shape().isRequired, }; From 471c9efe07c85de65a3371f2c6602abdf0b5e889 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 27 Feb 2020 20:42:18 +0800 Subject: [PATCH 09/15] fix history data --- src/shared/components/ProfilePage/Stats/index.jsx | 11 +++++++---- src/shared/containers/Profile.jsx | 2 +- src/shared/containers/ProfileStats.jsx | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/shared/components/ProfilePage/Stats/index.jsx b/src/shared/components/ProfilePage/Stats/index.jsx index 71fade4aeb..3cf04d5119 100644 --- a/src/shared/components/ProfilePage/Stats/index.jsx +++ b/src/shared/components/ProfilePage/Stats/index.jsx @@ -5,9 +5,8 @@ import _ from 'lodash'; import React from 'react'; import PT from 'prop-types'; -import { Link } from 'react-router-dom'; import ReactSVG from 'react-svg'; -import { isomorphy } from 'topcoder-react-utils'; +import { Link, isomorphy } from 'topcoder-react-utils'; import { getRatingColor } from 'utils/tc'; import Th from 'assets/images/th.svg'; import LeftArrow from 'assets/images/arrow-prev.svg'; @@ -50,7 +49,6 @@ class ProfileStats extends React.Component { render() { const { - stats, statsDistribution, statsHistory, track, @@ -60,6 +58,11 @@ class ProfileStats extends React.Component { handleParam, activeChallengesCount, } = this.props; + let { stats } = this.props; + if (_.isArray(stats)) { + // eslint-disable-next-line prefer-destructuring + stats = stats[0]; + } const { activeGraph, showModal } = this.state; @@ -300,7 +303,7 @@ ProfileStats.defaultProps = { }; ProfileStats.propTypes = { - stats: PT.shape().isRequired, + stats: PT.arrayOf(PT.shape()).isRequired, handleParam: PT.string.isRequired, track: PT.string.isRequired, subTrack: PT.string.isRequired, diff --git a/src/shared/containers/Profile.jsx b/src/shared/containers/Profile.jsx index f3cc1f16b6..a58beee2ae 100644 --- a/src/shared/containers/Profile.jsx +++ b/src/shared/containers/Profile.jsx @@ -93,7 +93,7 @@ ProfileContainer.propTypes = { loadProfile: PT.func.isRequired, profileForHandle: PT.string, skills: PT.shape(), - stats: PT.shape(), + stats: PT.arrayOf(PT.shape()), lookupData: PT.shape().isRequired, meta: PT.shape(), }; diff --git a/src/shared/containers/ProfileStats.jsx b/src/shared/containers/ProfileStats.jsx index 17540fc3b3..8632a5a5ed 100644 --- a/src/shared/containers/ProfileStats.jsx +++ b/src/shared/containers/ProfileStats.jsx @@ -116,7 +116,7 @@ ProfileStatsContainer.propTypes = { handleParam: PT.string.isRequired, statsHistory: PT.shape(), statsDistribution: PT.shape(), - stats: PT.shape(), + stats: PT.arrayOf(PT.shape()), info: PT.shape(), achievements: PT.arrayOf(PT.shape()), isLoading: PT.bool.isRequired, @@ -157,7 +157,7 @@ function mapDispatchToProps(dispatch) { dispatch(a.getActiveChallengesDone(handle)); }, loadStatsHistoryAndDistribution: (handle, groupIds, track, subTrack) => { - dispatch(a.getStatsHistoryInit(handle)); + dispatch(a.getStatsHistoryInit(handle, groupIds)); dispatch(a.getStatsHistoryDone(handle, groupIds)); dispatch(a.getStatsDistributionInit(handle)); dispatch(a.getStatsDistributionDone(handle, track, subTrack)); From 8f1091d664c5a8565375ba84baf6208679c9c3e5 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 2 Mar 2020 17:12:02 +0800 Subject: [PATCH 10/15] update the topcoder-react-lib version and deploy to dev --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7fe004a398..89c5dd0e26 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "supertest": "^3.1.0", "tc-accounts": "git+https://github.com/appirio-tech/accounts-app.git#dev", "tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.3", - "topcoder-react-lib": "1000.10.0", + "topcoder-react-lib": "1000.10.1", "topcoder-react-ui-kit": "^1.0.11", "topcoder-react-utils": "0.7.8", "turndown": "^4.0.2", From 457dfcd1a94add55843afe14ce2167dc0560185e Mon Sep 17 00:00:00 2001 From: Sushil Shinde Date: Tue, 3 Mar 2020 18:45:52 +0530 Subject: [PATCH 11/15] [skip ci] [skip ci] --- docs/deployment-env.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/deployment-env.md b/docs/deployment-env.md index f6b5999d8a..ad2db75180 100644 --- a/docs/deployment-env.md +++ b/docs/deployment-env.md @@ -48,3 +48,4 @@ workflows: - develop ``` 4. Commit the changes +5. Status of the deployment environments can be checked here https://cci-reporter.herokuapp.com/ From a53ad368feb310276f3487b7aead4859d8669454 Mon Sep 17 00:00:00 2001 From: Sushil Shinde Date: Tue, 3 Mar 2020 18:48:24 +0530 Subject: [PATCH 12/15] [skip ci] [skip ci] --- CONTRIBUTING.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9a253e9f1..981ec03452 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,4 +68,9 @@ Optional. The footer should contain any information about **Breaking Changes** a reference GitHub issues that this commit **Closes**. **Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. -The rest of the commit message is then used for this. \ No newline at end of file +The rest of the commit message is then used for this. + +### Generate Change long +``` +npm run release:changelog +``` From 4e8a3dabbc44e77e9a56d44deac4ff5cdc5e6dc8 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Tue, 3 Mar 2020 22:36:08 +0800 Subject: [PATCH 13/15] disable stats link detail on profile --- .../components/ProfilePage/__snapshots__/index.jsx.snap | 2 ++ src/shared/components/ProfilePage/StatsCategory/index.jsx | 5 ++++- src/shared/components/ProfilePage/StatsCategory/styles.scss | 4 ++++ src/shared/components/ProfilePage/index.jsx | 5 ++++- src/shared/containers/ProfileStats.jsx | 2 ++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/__tests__/shared/components/ProfilePage/__snapshots__/index.jsx.snap b/__tests__/shared/components/ProfilePage/__snapshots__/index.jsx.snap index fb48f813bb..ca1b6c174a 100644 --- a/__tests__/shared/components/ProfilePage/__snapshots__/index.jsx.snap +++ b/__tests__/shared/components/ProfilePage/__snapshots__/index.jsx.snap @@ -199,6 +199,7 @@ exports[`renders a full Profile correctly 1`] = ` className="" handle="testHandle" inModal={false} + meta={null} stats={ Object { "COPILOT": Object { @@ -699,6 +700,7 @@ exports[`renders an empty Profile correctly 1`] = ` className="" handle="testHandle" inModal={false} + meta={null} stats={ Object { "COPILOT": null, diff --git a/src/shared/components/ProfilePage/StatsCategory/index.jsx b/src/shared/components/ProfilePage/StatsCategory/index.jsx index 15c2673472..391836fc20 100644 --- a/src/shared/components/ProfilePage/StatsCategory/index.jsx +++ b/src/shared/components/ProfilePage/StatsCategory/index.jsx @@ -93,6 +93,7 @@ class StatsCategory extends React.Component { handle, className, inModal, + meta, } = this.props; const activeTracks = this.getActiveTracks(); @@ -117,7 +118,7 @@ class StatsCategory extends React.Component {
- +
) } @@ -302,6 +303,7 @@ ProfilePage.defaultProps = { achievements: [], skills: null, stats: null, + meta: null, }; ProfilePage.propTypes = { @@ -313,6 +315,7 @@ ProfilePage.propTypes = { skills: PT.shape(), stats: PT.arrayOf(PT.shape()), lookupData: PT.shape().isRequired, + meta: PT.shape(), }; export default ProfilePage; diff --git a/src/shared/containers/ProfileStats.jsx b/src/shared/containers/ProfileStats.jsx index 8632a5a5ed..1a07fadec1 100644 --- a/src/shared/containers/ProfileStats.jsx +++ b/src/shared/containers/ProfileStats.jsx @@ -78,6 +78,7 @@ class ProfileStatsContainer extends React.Component { loadingError, location, isLoading, + meta, } = this.props; const { track, subTrack, tab } = getQueryParamsQuery(location); @@ -93,6 +94,7 @@ class ProfileStatsContainer extends React.Component { track={track} subTrack={subTrack} tab={tab} + meta={meta} /> ); } From 5c716983b03073071edbcb4ddee1d1e6ac0e0919 Mon Sep 17 00:00:00 2001 From: Sushil Shinde Date: Wed, 4 Mar 2020 12:39:05 +0530 Subject: [PATCH 14/15] ci: deploying on dev env for smoke testing --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 32dc134d71..f94780002f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -175,13 +175,13 @@ workflows: branches: only: - feature-m2m-with-stats + - develop # This is alternate dev env for parallel testing - "build-test": context : org-global filters: branches: only: - - develop - nav-hot-fix - hot-fixes-leaderboard # This is beta env for production soft releases From 5d68699a645722c5bd119b478c02a2bbe80033c2 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Thu, 5 Mar 2020 10:35:12 +0800 Subject: [PATCH 15/15] fix profile redirection --- src/shared/components/tc-communities/Header/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/tc-communities/Header/index.jsx b/src/shared/components/tc-communities/Header/index.jsx index da1c5b11fa..5daed56884 100644 --- a/src/shared/components/tc-communities/Header/index.jsx +++ b/src/shared/components/tc-communities/Header/index.jsx @@ -66,7 +66,7 @@ function Header(props) { items: [{ enforceA: true, icon: , - link: `${BASE_URL}/members/${normalizedProfile.handle}`, + link: `${meta ? _.replace(BASE_URL, 'www', meta.subdomains[0]) : BASE_URL}/members/${normalizedProfile.handle}`, title: 'My Profile', }, { openNewTab: true,