Skip to content

Commit 827709e

Browse files
Merge pull request #5289 from topcoder-platform/hide-my-communities
Hide My Communities from My Dashboard
2 parents 68664ef + cd3e449 commit 827709e

File tree

6 files changed

+56
-50
lines changed

6 files changed

+56
-50
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ workflows:
244244
filters:
245245
branches:
246246
only:
247-
- free
247+
- hide-my-communities
248248
# This is beta env for production soft releases
249249
- "build-prod-beta":
250250
context : org-global

__tests__/shared/components/__snapshots__/TopcoderFooter.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ exports[`Matches shallow shapshot 1`] = `
601601
<span
602602
className="src-shared-components-TopcoderFooter-___style__copyright-notice___24f5v"
603603
>
604-
© 2020 Topcoder
604+
© 2021 Topcoder
605605
<a
606606
className="src-shared-components-TopcoderFooter-___style__link___3-nzm"
607607
href="https://www.topcoder-dev.com/policy"

__tests__/shared/components/challenge-listing/Sidebar/__snapshots__/Footer.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ exports[`Matches shallow shapshot 1`] = `
6969
className="src-shared-components-challenge-listing-Sidebar-Footer-___style__copyright___ghkHg"
7070
>
7171
Topcoder ©
72-
2020
72+
2021
7373
</p>
7474
</div>
7575
`;

src/shared/components/Dashboard/CurrentActivity/Header/index.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import './style.scss';
1010

1111
export default function Header({
1212
// numChallenges,
13-
numCommunities,
13+
// numCommunities,
1414
switchTab,
1515
tab,
1616
}) {
@@ -22,39 +22,43 @@ export default function Header({
2222
if (numChallenges) myChallengesTitle += ` (${numChallenges})`;
2323
*/
2424

25-
let myCommunitiesTitle = 'My Communities';
26-
if (numCommunities) myCommunitiesTitle += ` (${numCommunities})`;
25+
// let myCommunitiesTitle = 'My Communities';
26+
// if (numCommunities) myCommunitiesTitle += ` (${numCommunities})`;
2727

2828
return (
2929
<div styleName="container">
3030
<Carousel
3131
alignItems="start"
3232
>
33+
<Option />
3334
{/* {/* Temporary hide My Active Challenges - community-app#5004
3435
<Option
3536
selected={tab === TABS.MY_ACTIVE_CHALLENGES}
3637
select={() => switchTab(TABS.MY_ACTIVE_CHALLENGES)}
3738
title={myChallengesTitle}
3839
/>
3940
*/}
41+
{/* Hide My Communities community-app#5288
4042
<Option
4143
selected={tab === TABS.COMMUNITIES}
4244
select={() => switchTab(TABS.COMMUNITIES)}
4345
title={myCommunitiesTitle}
4446
/>
47+
*/}
4548
<Option
4649
selected={tab === TABS.SRMS}
4750
select={() => switchTab(TABS.SRMS)}
4851
title="SRMs"
4952
/>
53+
<Option />
5054
</Carousel>
5155
</div>
5256
);
5357
}
5458

5559
Header.propTypes = {
5660
// numChallenges: PT.number.isRequired,
57-
numCommunities: PT.number.isRequired,
61+
// numCommunities: PT.number.isRequired,
5862
switchTab: PT.func.isRequired,
5963
tab: PT.string.isRequired,
6064
};

src/shared/components/Dashboard/CurrentActivity/index.jsx

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import PT from 'prop-types';
55
import _ from 'lodash';
66
import { TABS } from 'actions/page/dashboard';
77

8-
import { challenge as challengeUtils } from 'topcoder-react-lib';
8+
// import { challenge as challengeUtils } from 'topcoder-react-lib';
99

10-
import Challenges from './Challenges';
11-
import Communities from './Communities';
10+
// import Challenges from './Challenges';
11+
// import Communities from './Communities';
1212
import Header from './Header';
1313
import Srms from './Srms';
1414

1515
import './styles.scss';
1616

17-
const Filter = challengeUtils.filter;
17+
// const Filter = challengeUtils.filter;
1818

1919
/* eslint-disable react/no-unused-state */
2020

@@ -52,44 +52,46 @@ export default class MyChallenges extends React.Component {
5252

5353
render() {
5454
const {
55-
challengeFilter,
56-
challenges,
57-
challengesLoading,
58-
communities,
59-
communitiesLoading,
60-
communityStats,
61-
selectChallengeDetailsTab,
62-
setChallengeListingFilter,
63-
showChallengeFilter,
55+
// challengeFilter,
56+
// challenges,
57+
// challengesLoading,
58+
// communities,
59+
// communitiesLoading,
60+
// communityStats,
61+
// selectChallengeDetailsTab,
62+
// setChallengeListingFilter,
63+
// showChallengeFilter,
6464
srms,
6565
srmsLoading,
66-
switchChallengeFilter,
67-
switchShowChallengeFilter,
66+
// switchChallengeFilter,
67+
// switchShowChallengeFilter,
6868
switchTab,
6969
tab,
70-
unregisterFromChallenge,
71-
userGroups,
72-
userResources,
73-
challengeTypesMap,
70+
// unregisterFromChallenge,
71+
// userGroups,
72+
// userResources,
73+
// challengeTypesMap,
7474
} = this.props;
7575

76+
/* Hide My Communities community-app#5288
7677
const myCommunities = communities.filter(x => _.intersection(userGroups, x.groupIds).length)
7778
.map((community) => {
7879
const filter = Filter.getFilterFunction(community.challengeFilter);
7980
const res = _.clone(community);
8081
res.number = challenges.filter(x => filter(x)).length;
8182
return res;
8283
});
84+
*/
8385

8486
return (
8587
<div styleName="container">
8688
<Header
87-
numChallenges={challenges.length}
88-
numCommunities={myCommunities.length}
89+
// numChallenges={challenges.length}
90+
// numCommunities={myCommunities.length}
8991
switchTab={switchTab}
9092
tab={tab}
9193
/>
92-
{
94+
{ /*
9395
tab === TABS.MY_ACTIVE_CHALLENGES ? (
9496
<Challenges
9597
challengeFilter={challengeFilter}
@@ -111,16 +113,16 @@ export default class MyChallenges extends React.Component {
111113
challengeTypesMap={challengeTypesMap}
112114
/>
113115
) : null
114-
}
115-
{
116+
*/}
117+
{/* Hide My Communities community-app#5288
116118
tab === TABS.COMMUNITIES ? (
117119
<Communities
118120
communities={myCommunities}
119121
communitiesLoading={communitiesLoading}
120122
communityStats={communityStats}
121123
/>
122124
) : null
123-
}
125+
*/}
124126
{
125127
tab === TABS.SRMS ? (
126128
<Srms
@@ -135,28 +137,28 @@ export default class MyChallenges extends React.Component {
135137
}
136138

137139
MyChallenges.defaultProps = {
138-
challenges: [],
139-
userResources: [],
140+
// challenges: [],
141+
// userResources: [],
140142
};
141143

142144
MyChallenges.propTypes = {
143-
challengeFilter: PT.string.isRequired,
144-
challenges: PT.arrayOf(PT.object),
145-
challengesLoading: PT.bool.isRequired,
146-
communities: PT.arrayOf(PT.object).isRequired,
147-
communitiesLoading: PT.bool.isRequired,
148-
communityStats: PT.shape().isRequired,
149-
selectChallengeDetailsTab: PT.func.isRequired,
150-
setChallengeListingFilter: PT.func.isRequired,
151-
showChallengeFilter: PT.bool.isRequired,
145+
// challengeFilter: PT.string.isRequired,
146+
// challenges: PT.arrayOf(PT.object),
147+
// challengesLoading: PT.bool.isRequired,
148+
// communities: PT.arrayOf(PT.object).isRequired,
149+
// communitiesLoading: PT.bool.isRequired,
150+
// communityStats: PT.shape().isRequired,
151+
// selectChallengeDetailsTab: PT.func.isRequired,
152+
// setChallengeListingFilter: PT.func.isRequired,
153+
// showChallengeFilter: PT.bool.isRequired,
152154
srms: PT.arrayOf(PT.object).isRequired,
153155
srmsLoading: PT.bool.isRequired,
154-
switchChallengeFilter: PT.func.isRequired,
155-
switchShowChallengeFilter: PT.func.isRequired,
156+
// switchChallengeFilter: PT.func.isRequired,
157+
// switchShowChallengeFilter: PT.func.isRequired,
156158
switchTab: PT.func.isRequired,
157159
tab: PT.oneOf(_.values(TABS)).isRequired,
158-
unregisterFromChallenge: PT.func.isRequired,
159-
userGroups: PT.arrayOf(PT.string).isRequired,
160-
userResources: PT.arrayOf(PT.shape()),
161-
challengeTypesMap: PT.shape().isRequired,
160+
// unregisterFromChallenge: PT.func.isRequired,
161+
// userGroups: PT.arrayOf(PT.string).isRequired,
162+
// userResources: PT.arrayOf(PT.shape()),
163+
// challengeTypesMap: PT.shape().isRequired,
162164
};

src/shared/reducers/page/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function create(state = {}) {
9393
[a.switchTab]: onSwitchTab,
9494
}, _.defaults(state, {
9595
challengeFilter: '',
96-
tab: TABS.COMMUNITIES, // Temporary hide MY ACTIVE CHALLENGES - community-app#5004
96+
tab: TABS.SRMS, // Temporary hide MY ACTIVE CHALLENGES - community-app#5004
9797
showAnnouncement: true,
9898
showChallengeFilter: false,
9999
xlBadge: '',

0 commit comments

Comments
 (0)