diff --git a/__tests__/shared/components/__snapshots__/LeaderboardAvatar.jsx.snap b/__tests__/shared/components/__snapshots__/LeaderboardAvatar.jsx.snap index b048b0d49f..e58da78c44 100644 --- a/__tests__/shared/components/__snapshots__/LeaderboardAvatar.jsx.snap +++ b/__tests__/shared/components/__snapshots__/LeaderboardAvatar.jsx.snap @@ -4,6 +4,7 @@ exports[`Matches shallow shapshot 1`] = ` han 897d 19:18h @@ -249,6 +250,7 @@ exports[`Matches shallow shapshot shapshot 1 3`] = ` "position": undefined, } } + openNewTab={false} url="" /> @@ -277,6 +279,7 @@ exports[`Matches shallow shapshot shapshot 1 3`] = ` "position": undefined, } } + openNewTab={false} url="" /> @@ -305,6 +308,7 @@ exports[`Matches shallow shapshot shapshot 1 3`] = ` "position": undefined, } } + openNewTab={false} url="" /> @@ -317,6 +321,7 @@ exports[`Matches shallow shapshot shapshot 1 3`] = ` "isLastItem": true, } } + openNewTab={false} url="#winner" />
@@ -160,6 +162,7 @@ exports[`Matches shallow shapshot shapshot 2 1`] = `
@@ -281,6 +285,7 @@ exports[`Matches shallow shapshot shapshot 3 1`] = `
diff --git a/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap b/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap index 30b04a5317..4dddf2985b 100644 --- a/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap +++ b/__tests__/shared/components/challenge-listing/Listing/__snapshots__/Bucket.jsx.snap @@ -49,6 +49,7 @@ exports[`Matches shallow shapshot 1`] = ` } } onTechTagClicked={[Function]} + openChallengesInNewTabs={false} sampleWinnerProfile={undefined} />

- If you are accessing TopGear Learning Platform from Wipro backbone network, click on continue to access the platform. -

-

- To access TopGear Learning Platform outside of Wipro network, please follow the below instructions: + If you are accessing TopGear + + Learning + + Platform from + + Wipro backbone network + + , click on “ + + CONTINUE + + ” to access the platform.

- Send an email to - - devenvaccessreq.topgear@wipro.com - - with subject line - - Internet TopGear portal access - - . You will receive an email within 24 hours with details for accessing TopGear portal through Virtual Desktop. Using Virtual Desktop you can access - - https://topgear-app.wipro.com - - to learn new technologies. + Learning + + Platform + + outside of Wipro network + + , please follow the below instructions:

+
    +
  1. + Send an email to + + devenvaccessreq.topgear@wipro.com + + with subject line + + Internet TopGear portal access + + . +
  2. +
  3. + You will receive an email + + within 24 hours + + with details for accessing TopGear portal through Virtual Desktop. +
  4. +
  5. + Using Virtual Desktop you can access + + https://topgear-app.wipro.com + + to + + learn + + new technologies. +
  6. +
diff --git a/__tests__/shared/containers/SubmissionManagement.jsx b/__tests__/shared/containers/SubmissionManagement.jsx index 89be9353d1..ccf47c240b 100644 --- a/__tests__/shared/containers/SubmissionManagement.jsx +++ b/__tests__/shared/containers/SubmissionManagement.jsx @@ -102,7 +102,7 @@ test('Triggers data loading, if necessary', () => { .toHaveBeenCalledWith(12345, 'Token V3', 'Token V2'); expect(mockChallengeActions.challenge.getSubmissionsInit).toHaveBeenCalled(); expect(mockChallengeActions.challenge.getSubmissionsDone) - .toHaveBeenCalledWith(12345, 'Token V3', 'Token V2'); + .toHaveBeenCalledWith(12345, 'Token V2'); }); const obj = TU.renderIntoDocument(( @@ -167,7 +167,7 @@ test('loadMySubmissions dispatches', () => { }, 54321); expect(mockChallengeActions.challenge.getSubmissionsInit).toHaveBeenCalled(); expect(mockChallengeActions.challenge.getSubmissionsDone) - .toHaveBeenCalledWith(54321, 'Token V3', 'Token V2'); + .toHaveBeenCalledWith(54321, 'Token V2'); }); test('onBtnDefault', () => { diff --git a/docs/how-to-add-a-new-topcoder-community.md b/docs/how-to-add-a-new-topcoder-community.md index dc3292a2e6..99e6dba124 100644 --- a/docs/how-to-add-a-new-topcoder-community.md +++ b/docs/how-to-add-a-new-topcoder-community.md @@ -13,6 +13,7 @@ To add a new community with the name **demo**, we should follow the following pr "challengeFilter": { "groupIds": ["12345"] }, + "challengeListing": {}, "communityId": "demo", "communitySelector": [{ "label": "Demo Community", @@ -77,6 +78,8 @@ To add a new community with the name **demo**, we should follow the following pr "tags": ["JavaScript"] } ``` + - `challengeListing` - *Object* - Optional. When provided, it holds configuration for the challenge listing shown inside the community. This config object may have the following fields: + - `openChallengesInNewTabs` - *Boolean* - Optional. When set, challenge listing opens challenge details pages in new tabs. Defaults to `true`. - `communityId` - *String* - Unique ID of this community. - `communitySelector` - *Object Array* - Specifies data for the community selection dropdown inside the community header. Each object MUST HAVE `label` and `value` string fields, and MAY HAVE `redirect` field. If `redirect` field is specified, a click on that option in the dropdown will redirect user to the specified URL. - `groupId` - *String* - This value of group ID is now used to fetch community statistics. Probably, it makes sense to use this value everywhere where `authorizedGroupIds` array is used, however, at the moment, these two are independent. diff --git a/package.json b/package.json index f949bb91ed..f1fee26ebd 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,6 @@ "babel-preset-stage-2": "^6.22.0", "babel-register": "^6.24.0", "body-parser": "^1.17.1", - "browserslist": "2.1.5", "browser-cookies": "^1.1.0", "classnames": "^2.2.5", "config": "^1.25.1", diff --git a/src/server/tc-communities/wipro/metadata.json b/src/server/tc-communities/wipro/metadata.json index c2426cae38..d066d205b3 100644 --- a/src/server/tc-communities/wipro/metadata.json +++ b/src/server/tc-communities/wipro/metadata.json @@ -5,6 +5,9 @@ "challengeFilter": { "groupIds": ["20000000"] }, + "challengeListing": { + "openChallengesInNewTabs": true + }, "communityId": "wipro", "communityName": "TopGear Community", "communitySelector": [{ diff --git a/src/shared/actions/challenge.js b/src/shared/actions/challenge.js index 3e458dd502..7f0343af15 100644 --- a/src/shared/actions/challenge.js +++ b/src/shared/actions/challenge.js @@ -8,8 +8,6 @@ import { getService as getChallengesService } from 'services/challenges'; import { decodeToken } from 'tc-accounts'; import { getApiV2 } from '../services/api'; -const apiV2 = auth => getApiV2(auth.tokenV2); - /** * Payload creator for CHALLENGE/FETCH_DETAILS_INIT action, * which marks that we are about to fetch details of the specified challenge. @@ -42,8 +40,8 @@ function getDetailsDone(challengeId, tokenV3, tokenV2) { ]); } -function getSubmissionsDone(tokens, challengeId) { - return apiV2(tokens).fetch(`/challenges/submissions/${challengeId}/mySubmissions`) +function getSubmissionsDone(challengeId, tokenV2) { + return getApiV2(tokenV2).fetch(`/challenges/submissions/${challengeId}/mySubmissions`) .then(response => response.json()) .then(response => response.submissions); } diff --git a/src/shared/components/LeaderboardAvatar/index.jsx b/src/shared/components/LeaderboardAvatar/index.jsx index 29580f8052..9bc6e7f916 100644 --- a/src/shared/components/LeaderboardAvatar/index.jsx +++ b/src/shared/components/LeaderboardAvatar/index.jsx @@ -8,6 +8,7 @@ import './style.scss'; const VISIBLE_CHARACTERS = 3; const MOCK_PHOTO = 'https://acrobatusers.com/assets/images/template/author_generic.jpg'; +/* TODO: Should be functional component! */ class LeaderboardAvatar extends Component { constructor(props) { super(props); @@ -24,11 +25,15 @@ class LeaderboardAvatar extends Component { } render() { - const { domain, url } = this.props; + const { domain, openNewTab, url } = this.props; const { member } = this.state; const targetURL = url || `//${domain}/members/${member.handle}`; return ( - + {member.photoURL ? avatar false} + styleName="register-button" + target={openChallengesInNewTabs ? '_blank' : undefined} > { @@ -330,7 +334,7 @@ class ChallengeStatus extends Component { } renderLeaderboard() { - const { challenge } = this.props; + const { challenge, openChallengesInNewTabs } = this.props; const { DS_CHALLENGE_URL, CHALLENGE_URL } = this.state; const { id, track } = challenge; @@ -353,7 +357,14 @@ class ChallengeStatus extends Component { const leaderboard = winners && winners.map((winner) => { if (winner.isLastItem) { - return ; + return ( + + ); } const userProfile = getProfile(winner); return ( @@ -382,12 +393,13 @@ class ChallengeStatus extends Component { ChallengeStatus.defaultProps = { challenge: {}, detailLink: '', - sampleWinnerProfile: undefined, + openChallengesInNewTabs: false, }; ChallengeStatus.propTypes = { challenge: PT.shape(), detailLink: PT.string, + openChallengesInNewTabs: PT.bool, }; export default ChallengeStatus; diff --git a/src/shared/components/challenge-listing/ChallengeCard/index.jsx b/src/shared/components/challenge-listing/ChallengeCard/index.jsx index 64aa22aab7..1c3b5fec3b 100644 --- a/src/shared/components/challenge-listing/ChallengeCard/index.jsx +++ b/src/shared/components/challenge-listing/ChallengeCard/index.jsx @@ -1,5 +1,3 @@ -/* eslint jsx-a11y/no-static-element-interactions:0 */ - import _ from 'lodash'; import config from 'utils/config'; import moment from 'moment'; @@ -22,10 +20,16 @@ const getEndDate = date => moment(date).format('MMM DD'); // Convert a number to string with thousands separated by comma const numberWithCommas = n => (n ? n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') : 0); +/* TODO: Note that this component uses a dirty trick to cheat linter and to be + * able to modify an argument: it aliases challenge prop, then mutates it in + * the way it wants. Not good at all! If necessary, modification of challenge + * object received from the API should be done in the normalization function! */ + function ChallengeCard({ challenge: passedInChallenge, - sampleWinnerProfile, onTechTagClicked, + openChallengesInNewTabs, + sampleWinnerProfile, }) { const challenge = passedInChallenge; @@ -36,18 +40,21 @@ function ChallengeCard({ challenge.prize = challenge.prizes || []; // challenge.totalPrize = challenge.prize.reduce((x, y) => y + x, 0) - const challengeDetailLink = () => { + let challengeDetailLink; + { const challengeUrl = `${config.URL.BASE}/challenge-details/`; - const mmDetailUrl = `${config.URL.COMMUNITY}/tc?module=MatchDetails&rd=`; // Marathon Match details if (challenge.track === 'DATA_SCIENCE') { - const id = `${challenge.id}`; - if (id.length < ID_LENGTH) { - return `${mmDetailUrl}${challenge.id}`; - } - return `${challengeUrl}${challenge.id}/?type=develop`; + const mmDetailUrl = `${config.URL.COMMUNITY}/tc?module=MatchDetails&rd=`; + /* TODO: Don't we have a better way, whether a challenge is MM or not? */ + const isMM = _.toString(challenge.id).length < ID_LENGTH; + challengeDetailLink = isMM + ? `${mmDetailUrl}${challenge.id}` + : `${challengeUrl}${challenge.id}/?type=develop`; + } else { + challengeDetailLink = + `${challengeUrl}${challenge.id}/?type=${challenge.track.toLowerCase()}`; } - return `${challengeUrl}${challenge.id}/?type=${challenge.track.toLowerCase()}`; - }; + } const registrationPhase = challenge.allPhases.filter(phase => phase.phaseType === 'Registration')[0]; const isRegistrationOpen = registrationPhase ? registrationPhase.phaseStatus === 'Open' : false; @@ -69,9 +76,11 @@ function ChallengeCard({
- - {challenge.name} - + {challenge.name}
{challenge.status === 'ACTIVE' ? 'Ends ' : 'Ended '} @@ -93,7 +102,8 @@ function ChallengeCard({
@@ -104,12 +114,14 @@ function ChallengeCard({ ChallengeCard.defaultProps = { onTechTagClicked: _.noop, challenge: {}, + openChallengesInNewTabs: false, sampleWinnerProfile: undefined, }; ChallengeCard.propTypes = { onTechTagClicked: PT.func, challenge: PT.shape(), + openChallengesInNewTabs: PT.bool, sampleWinnerProfile: PT.shape(), }; @@ -151,8 +163,9 @@ class Tags extends React.Component { /* TODO: Find out why all tags beside the first one are prepended * with whitespaces? */ onClick={() => this.onClick(c.trim())} - >{c} - + role="button" + tabIndex={0} + >{c} )); } return ''; diff --git a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx index 69c6ff0959..e4909beed2 100644 --- a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx +++ b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx @@ -22,6 +22,7 @@ export default function Bucket({ expand, loading, loadMore, + openChallengesInNewTabs, setFilterState, setSort, sort, @@ -50,6 +51,7 @@ export default function Bucket({ setFilterState({ tags: [tag] })} + openChallengesInNewTabs={openChallengesInNewTabs} key={item.id} /> )); @@ -101,6 +103,7 @@ Bucket.defaultProps = { expand: _.noop, loading: false, loadMore: null, + openChallengesInNewTabs: false, sort: null, }; @@ -111,6 +114,7 @@ Bucket.propTypes = { challenges: PT.arrayOf(PT.shape()).isRequired, loading: PT.bool, loadMore: PT.func, + openChallengesInNewTabs: PT.bool, setFilterState: PT.func.isRequired, setSort: PT.func.isRequired, sort: PT.string, diff --git a/src/shared/components/challenge-listing/Listing/index.jsx b/src/shared/components/challenge-listing/Listing/index.jsx index 6c97b2edbb..f1e72cbc04 100644 --- a/src/shared/components/challenge-listing/Listing/index.jsx +++ b/src/shared/components/challenge-listing/Listing/index.jsx @@ -17,6 +17,7 @@ export default function Listing({ loadingPastChallenges, loadMoreDraft, loadMorePast, + openChallengesInNewTabs, selectBucket, setFilterState, setSort, @@ -47,6 +48,7 @@ export default function Listing({ expanded loading={loading} loadMore={loadMore} + openChallengesInNewTabs={openChallengesInNewTabs} setFilterState={setFilterState} setSort={sort => setSort(activeBucket, sort)} sort={sorts[activeBucket]} @@ -76,6 +78,7 @@ export default function Listing({ expand={() => selectBucket(bucket)} loading={loading} loadMore={loadMore} + openChallengesInNewTabs={openChallengesInNewTabs} setFilterState={setFilterState} setSort={sort => setSort(bucket, sort)} sort={sorts[bucket]} @@ -98,14 +101,15 @@ export default function Listing({ } Listing.defaultProps = { + challenges: [], + currentFilterName: '', + expanded: false, groupId: '', loadMoreDraft: null, loadMorePast: null, onTechTagClicked: _.noop, onExpandFilterResult: _.noop, - currentFilterName: '', - challenges: [], - expanded: false, + openChallengesInNewTabs: false, }; Listing.propTypes = { @@ -121,6 +125,7 @@ Listing.propTypes = { loadingPastChallenges: PT.bool.isRequired, loadMoreDraft: PT.func, loadMorePast: PT.func, + openChallengesInNewTabs: PT.bool, selectBucket: PT.func.isRequired, setFilterState: PT.func.isRequired, setSort: PT.func.isRequired, diff --git a/src/shared/components/challenge-listing/index.jsx b/src/shared/components/challenge-listing/index.jsx index 9abef8bca8..651ac2850e 100755 --- a/src/shared/components/challenge-listing/index.jsx +++ b/src/shared/components/challenge-listing/index.jsx @@ -74,6 +74,7 @@ export default function ChallengeListing(props) { loadingPastChallenges={props.loadingPastChallenges} loadMoreDraft={props.loadMoreDraft} loadMorePast={props.loadMorePast} + openChallengesInNewTabs={props.openChallengesInNewTabs} selectBucket={props.selectBucket} setFilterState={props.setFilterState} setSort={props.setSort} @@ -137,13 +138,14 @@ export default function ChallengeListing(props) { } ChallengeListing.defaultProps = { - groupId: '', + auth: null, communityFilter: null, communityName: null, + groupId: '', + hideTcLinksInFooter: false, loadMoreDraft: null, loadMorePast: null, - hideTcLinksInFooter: false, - auth: null, + openChallengesInNewTabs: false, }; ChallengeListing.propTypes = { @@ -159,6 +161,7 @@ ChallengeListing.propTypes = { loadingPastChallenges: PT.bool.isRequired, loadMoreDraft: PT.func, loadMorePast: PT.func, + openChallengesInNewTabs: PT.bool, selectBucket: PT.func.isRequired, setFilterState: PT.func.isRequired, setSort: PT.func.isRequired, diff --git a/src/shared/components/tc-communities/Header/index.jsx b/src/shared/components/tc-communities/Header/index.jsx index 0ec4196d86..b574c67a8b 100644 --- a/src/shared/components/tc-communities/Header/index.jsx +++ b/src/shared/components/tc-communities/Header/index.jsx @@ -245,7 +245,13 @@ Header.propTypes = { title: PT.string.isRequired, url: PT.string.isRequired, })), - logos: PT.arrayOf(PT.string), + logos: PT.arrayOf(PT.oneOfType([ + PT.string, + PT.shape({ + img: PT.string.isRequired, + url: PT.string, + }), + ])), additionalLogos: PT.arrayOf(PT.string), hideSearch: PT.bool, chevronOverAvatar: PT.bool, diff --git a/src/shared/components/tc-communities/communities/wipro/Learn/index.jsx b/src/shared/components/tc-communities/communities/wipro/Learn/index.jsx index 6d38531d63..844dc114ce 100644 --- a/src/shared/components/tc-communities/communities/wipro/Learn/index.jsx +++ b/src/shared/components/tc-communities/communities/wipro/Learn/index.jsx @@ -44,9 +44,19 @@ export default function Learn() { }} >
-

If you are accessing TopGear Learning Platform from Wipro backbone network, click on continue to access the platform.

-

To access TopGear Learning Platform outside of Wipro network, please follow the below instructions:

-

Send an email to devenvaccessreq.topgear@wipro.com with subject line Internet TopGear portal access. You will receive an email within 24 hours with details for accessing TopGear portal through Virtual Desktop. Using Virtual Desktop you can access https://topgear-app.wipro.com to learn new technologies.

+

If you are accessing TopGear Learning Platform from Wipro backbone network, click on “CONTINUE” to access the platform.

+

To access TopGear Learning Platform outside of Wipro network, please follow the below instructions:

+
    +
  1. + Send an email to devenvaccessreq.topgear@wipro.com with subject line Internet TopGear portal access. +
  2. +
  3. + You will receive an email within 24 hours with details for accessing TopGear portal through Virtual Desktop. +
  4. +
  5. + Using Virtual Desktop you can access https://topgear-app.wipro.com to learn new technologies. +
  6. +
diff --git a/src/shared/components/tc-communities/communities/wipro/Learn/style.scss b/src/shared/components/tc-communities/communities/wipro/Learn/style.scss index c781aff4e5..15b0d03b5b 100644 --- a/src/shared/components/tc-communities/communities/wipro/Learn/style.scss +++ b/src/shared/components/tc-communities/communities/wipro/Learn/style.scss @@ -4,6 +4,14 @@ padding-bottom: 60px; } +.highlighted { + background: #ffc; +} + +.ddashUnderline { + border-bottom: 1px dashed #333; +} + .resourcesTitle { padding-bottom: 50px; padding-top: 0; @@ -85,7 +93,7 @@ .message { color: #333; - font: 14px/22px 'Akkurat regular', sans-serif; + font: 16px/22px 'Akkurat regular', sans-serif; opacity: 0.7; a { @@ -95,16 +103,27 @@ &:focus, &:visited { color: #0092ff; + font-family: 'Times New Roman', Times, serif; outline: none; text-decoration: underline; } } em { + font-family: 'Times New Roman', Times, serif; font-style: italic; } + ol { + list-style: decimal inside; + padding-left: 24px; + } + p { margin-bottom: 24px; } + + strong { + font-weight: bold; + } } diff --git a/src/shared/containers/SubmissionManagement/index.jsx b/src/shared/containers/SubmissionManagement/index.jsx index 2e3237218c..7022ac767f 100644 --- a/src/shared/containers/SubmissionManagement/index.jsx +++ b/src/shared/containers/SubmissionManagement/index.jsx @@ -186,7 +186,7 @@ const mapDispatchToProps = dispatch => ({ loadMySubmissions: (tokens, challengeId) => { const a = challengeActions.challenge; dispatch(a.getSubmissionsInit()); - dispatch(a.getSubmissionsDone(challengeId, tokens.tokenV3, tokens.tokenV2)); + dispatch(a.getSubmissionsDone(challengeId, tokens.tokenV2)); }, }); diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx index c4b751e5b8..8837a2daf3 100644 --- a/src/shared/containers/challenge-listing/Listing/index.jsx +++ b/src/shared/containers/challenge-listing/Listing/index.jsx @@ -31,12 +31,6 @@ import style from './styles.scss'; let mounted = false; export class ListingContainer extends React.Component { - /* TODO: We should add here an automatic periodical update of the loaded - * challenges, say once each 5 minutes. Otherwise, it is possible that a - * visitor has the same challenge listing page open for too long, navigating - * withing it, without triggering refresh of the cached challenges - not - * good! */ - componentDidMount() { this.props.markHeaderMenu(); @@ -179,6 +173,7 @@ export class ListingContainer extends React.Component { loadingChallenges={Boolean(this.props.loadingActiveChallengesUUID)} loadingDraftChallenges={Boolean(this.props.loadingDraftChallengesUUID)} loadingPastChallenges={Boolean(this.props.loadingPastChallengesUUID)} + openChallengesInNewTabs={this.props.openChallengesInNewTabs} selectBucket={selectBucket} hideTcLinksInFooter={hideTcLinksInSidebarFooter} @@ -215,6 +210,7 @@ ListingContainer.defaultProps = { communityId: null, communityName: null, listingOnly: false, + openChallengesInNewTabs: false, }; ListingContainer.propTypes = { @@ -248,6 +244,7 @@ ListingContainer.propTypes = { loadingDraftChallengesUUID: PT.string.isRequired, loadingPastChallengesUUID: PT.string.isRequired, markHeaderMenu: PT.func.isRequired, + openChallengesInNewTabs: PT.bool, selectBucket: PT.func.isRequired, selectCommunity: PT.func.isRequired, setFilter: PT.func.isRequired, @@ -281,6 +278,7 @@ const mapStateToProps = (state, ownProps) => { loadingPastChallengesUUID: cl.loadingPastChallengesUUID, loadingChallengeSubtracks: cl.loadingChallengeSubtracks, loadingChallengeTags: cl.loadingChallengeTags, + openChallengesInNewTabs: ownProps.openChallengesInNewTabs, selectedCommunityId: cl.selectedCommunityId, sorts: cl.sorts, activeBucket: cl.sidebar.activeBucket, diff --git a/src/shared/containers/tc-communities/Page/index.jsx b/src/shared/containers/tc-communities/Page/index.jsx index fae49f7589..36ec83f283 100644 --- a/src/shared/containers/tc-communities/Page/index.jsx +++ b/src/shared/containers/tc-communities/Page/index.jsx @@ -171,6 +171,9 @@ export class Page extends Component { history={this.props.history} hideTcLinksInSidebarFooter={this.props.meta.communityId === 'wipro'} location={this.props.location} + openChallengesInNewTabs={ + _.get(this.props.meta, 'challengeListing.openChallengesInNewTabs') + } />); break; } @@ -260,6 +263,9 @@ Page.propTypes = { authorizedGroupIds: PT.arrayOf(PT.string), challengeFilterTag: PT.string, groupId: PT.string, + challengeListing: PT.shape({ + openChallengesInNewTabs: PT.bool, + }), communityId: PT.string, communityName: PT.string, communitySelector: PT.arrayOf(PT.shape()), @@ -271,7 +277,13 @@ Page.propTypes = { leaderboardApiUrl: PT.string, loading: PT.bool, - logos: PT.arrayOf(PT.string).isRequired, + logos: PT.arrayOf(PT.oneOfType([ + PT.string, + PT.shape({ + img: PT.string.isRequired, + url: PT.string, + }), + ])), additionalLogos: PT.arrayOf(PT.string), stats: PT.shape(), hideSearch: PT.bool, diff --git a/src/shared/reducers/tc-communities/meta.js b/src/shared/reducers/tc-communities/meta.js index b876e041ab..4b3592f944 100644 --- a/src/shared/reducers/tc-communities/meta.js +++ b/src/shared/reducers/tc-communities/meta.js @@ -16,25 +16,25 @@ function onDone(state, action) { // if everything is ok, populate data from payload return { ...state, + additionalLogos: action.payload.additionalLogos, authorizedGroupIds: action.payload.authorizedGroupIds, challengeFilter: action.payload.challengeFilter, - challengeFilterTag: action.payload.challengeFilterTag, - groupId: action.payload.groupId, + challengeListing: action.payload.challengeListing, + chevronOverAvatar: action.payload.chevronOverAvatar, communityId: action.payload.communityId, communityName: action.payload.communityName, communitySelector: action.payload.communitySelector, cssUrl: action.payload.style, - logos: action.payload.logos, - hideSearch: action.payload.hideSearch, - additionalLogos: action.payload.additionalLogos, - chevronOverAvatar: action.payload.chevronOverAvatar, - footerText: action.payload.footerText, - stats: action.payload.stats, - menuItems: action.payload.menuItems, failed: false, + footerText: action.payload.footerText, + hideSearch: action.payload.hideSearch, + groupId: action.payload.groupId, leaderboardApiUrl: action.payload.leaderboardApiUrl, loading: false, + logos: action.payload.logos, + menuItems: action.payload.menuItems, newsFeed: action.payload.newsFeed, + stats: action.payload.stats, }; } // if community is not found or other error