Skip to content

Commit bf6d6c6

Browse files
authored
Merge pull request #6985 from topcoder-platform/develop
Prod relese - May end
2 parents bc34600 + b76d878 commit bf6d6c6

File tree

7 files changed

+12
-281
lines changed

7 files changed

+12
-281
lines changed

__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap

-40
Original file line numberDiff line numberDiff line change
@@ -171,46 +171,6 @@ exports[`Matches shallow shapshot 2`] = `
171171
/>
172172
</div>
173173
</div>
174-
<div
175-
className="src-shared-components-challenge-listing-Filters-FiltersPanel-___style__filter-row___2Vfd_"
176-
>
177-
<div
178-
className="src-shared-components-challenge-listing-Filters-FiltersPanel-___style__filter___1-QUz src-shared-components-challenge-listing-Filters-FiltersPanel-___style__filter___1-QUz src-shared-components-challenge-listing-Filters-FiltersPanel-___style__community___3EFG7"
179-
>
180-
<label
181-
className="src-shared-components-challenge-listing-Filters-FiltersPanel-___style__label___3W9TU"
182-
htmlFor="community-select"
183-
>
184-
Sub communities
185-
<input
186-
type="hidden"
187-
/>
188-
</label>
189-
<Select
190-
arrowRenderer={[Function]}
191-
autoBlur={true}
192-
clearable={false}
193-
id="community-select"
194-
onChange={[Function]}
195-
options={
196-
Array [
197-
Object {
198-
"data": <div>
199-
Sample community
200-
</div>,
201-
"label": "Sample community",
202-
"name": "Sample community",
203-
"value": "123",
204-
},
205-
]
206-
}
207-
selectRef={[Function]}
208-
simpleValue={true}
209-
value=""
210-
valueRenderer={[Function]}
211-
/>
212-
</div>
213-
</div>
214174
</div>
215175
<div
216176
className="src-shared-components-challenge-listing-Filters-FiltersPanel-___style__buttons___2r3xW"

src/shared/components/challenge-detail/Specification/index.jsx

-33
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export default function ChallengeDetailsView(props) {
5656
reviewScorecardId,
5757
screeningScorecardId,
5858
forumId,
59-
selfService,
6059
} = legacy;
6160

6261
let stockArtValue = '';
@@ -231,38 +230,6 @@ export default function ChallengeDetailsView(props) {
231230
description
232231
&& (
233232
<article>
234-
{
235-
selfService && (
236-
<p styleName="note">
237-
<strong>
238-
On Demand Challenges are customer-initiated single round design challenges.
239-
</strong>
240-
<br />
241-
Please note the following important information for Topcoder competitors who participate in this challenge:
242-
<ul>
243-
<li>Any communication needed, should be done directly with the customer in the Challenge Forum.</li>
244-
<li>In order to pass challenge screening and review, all challenge requirements and requested screens must be completed as described below.</li>
245-
<li>Submission source files must be created with the application(s) listed in the requirements.</li>
246-
<li>There will be no appeals or final fixes.</li>
247-
<li>The challenge winner selections will be based upon completed requirements and associated Topcoder review scoring.</li>
248-
</ul>
249-
<br />
250-
<strong>
251-
REQUEST MARVEL PROTOTYPES HERE:
252-
</strong>
253-
<br />
254-
<a href="https://discussions.topcoder.com/discussion/15528/request-marvel-access-for-on-demand-challenges">
255-
Request Marvel for On Demand Challenges
256-
</a>
257-
<br />
258-
<strong>
259-
DO NOT request Marvel access in the challenge forum with the customer.
260-
</strong>
261-
<br />
262-
Figma or XD Prototypes are acceptable for submissions created with those applications.
263-
</p>
264-
)
265-
}
266233
<h2>
267234
Challenge Summary
268235
</h2>

src/shared/components/challenge-detail/Specification/styles.scss

+2
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ a[href*="/talent-routes/details"] {
462462
border-radius: 3px;
463463
font-weight: 500;
464464
text-decoration: none;
465+
display: flex;
466+
gap: 8px;
465467

466468
&:hover {
467469
text-decoration: none;

src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export default function ChallengeStatus(props) {
6161
newChallengeDetails,
6262
selectChallengeDetailsTab,
6363
openChallengesInNewTabs,
64-
userId,
6564
isLoggedIn,
6665
} = props;
6766

@@ -242,9 +241,13 @@ export default function ChallengeStatus(props) {
242241
if (statusPhase) phaseMessage = statusPhase.name;
243242
else if (status === 'Draft') phaseMessage = DRAFT_MSG;
244243

245-
const users = challenge.users || {};
244+
const showRegisterInfo = false;
246245

247-
const showRegisterInfo = (challenge.currentPhaseNames || []).includes('Registration') && !users[userId];
246+
// NOTE: the commented code below can be used to turn the "Register" button
247+
// back on from the challenge listing page, if we ever want that again.
248+
// This was turned off (set to always false above) via a change request in TOP-1549
249+
// const showRegisterInfo = (challenge.currentPhaseNames || [])
250+
// .includes('Registration') && !users[userId];
248251

249252
return (
250253
<div styleName={showRegisterInfo ? 'challenge-progress with-register-button' : 'challenge-progress'}>
@@ -316,7 +319,6 @@ ChallengeStatus.defaultProps = {
316319
detailLink: '',
317320
openChallengesInNewTabs: false,
318321
className: '',
319-
userId: '',
320322
};
321323

322324
ChallengeStatus.propTypes = {
@@ -327,6 +329,5 @@ ChallengeStatus.propTypes = {
327329
openChallengesInNewTabs: PT.bool, // eslint-disable-line react/no-unused-prop-types
328330
selectChallengeDetailsTab: PT.func.isRequired,
329331
className: PT.string,
330-
userId: PT.number,
331332
isLoggedIn: PT.bool.isRequired,
332333
};

src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx

+1-201
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,26 @@
2424
import _ from 'lodash';
2525
import React, { useState, useEffect } from 'react';
2626
import PT from 'prop-types';
27-
import Select from 'components/Select';
2827
import DateRangePicker from 'components/DateRangePicker';
2928
import moment from 'moment';
3029
import Tooltip from 'components/Tooltip';
31-
import { config, Link } from 'topcoder-react-utils';
30+
import { config } from 'topcoder-react-utils';
3231
import { COMPOSE, PRIORITY } from 'react-css-super-themr';
3332
import { REVIEW_OPPORTUNITY_TYPES } from 'utils/tc';
3433
import { isFilterEmpty, isPastBucket, BUCKETS } from 'utils/challenge-listing/buckets';
3534
import SwitchWithLabel from 'components/SwitchWithLabel';
3635
import ChallengeSearchBar from 'containers/challenge-listing/ChallengeSearchBar';
3736
import { challenge as challengeUtils } from 'topcoder-react-lib';
3837
import { createStaticRanges } from 'utils/challenge-listing/date-range';
39-
import ArrowIcon from 'assets/images/ico-arrow-down.svg';
4038
import CircleIcon from 'assets/images/icon-circle.svg';
4139
import Button from '../Button';
4240
import UiSimpleRemove from '../../Icons/ui-simple-remove.svg';
4341
import BucketSelector from '../../Sidebar/BucketSelector';
44-
import CheckmarkIcon from './CheckmarkIcon';
4542
import style from './style.scss';
4643

4744
const Filter = challengeUtils.filter;
4845

4946
export default function FiltersPanel({
50-
communityFilters,
5147
defaultCommunityId,
5248
filterState,
5349
// challenges,
@@ -92,156 +88,10 @@ export default function FiltersPanel({
9288
);
9389
}
9490

95-
const isVisitorRegisteredToCommunity = (visitorGroupIds, communityGroupIds) => Boolean(
96-
_.intersection(visitorGroupIds, communityGroupIds).length,
97-
);
98-
9991
// const isAllBucket = activeBucket === BUCKETS.ALL;
10092

101-
const getLabel = (community) => {
102-
const { communityName } = community;
103-
if (!isAuth) {
104-
return (
105-
<div>
106-
{communityName}
107-
</div>
108-
);
109-
}
110-
111-
// eslint-disable-next-line max-len
112-
const visitorGroupIds = (auth.profile && auth.profile.groups) ? auth.profile.groups.map(g => g.id) : [];
113-
const visitorRegisteredToCommunity = isVisitorRegisteredToCommunity(
114-
visitorGroupIds,
115-
community.groupIds,
116-
);
117-
118-
const registrationStatus = visitorRegisteredToCommunity
119-
? (
120-
<div>
121-
Registered
122-
</div>
123-
)
124-
: (
125-
<div>
126-
You are
127-
{' '}
128-
<span styleName="bold uppercase">
129-
not
130-
</span>
131-
{' '}
132-
registered.
133-
<Link
134-
onMouseDown={(e) => {
135-
const url = community.mainSubdomain ? (
136-
config.URL.BASE.replace(/www/, community.mainSubdomain)
137-
) : `/community/${community.communityId}`;
138-
window.open(url);
139-
e.stopPropagation();
140-
e.preventDefault();
141-
}}
142-
styleName="learn-more-link"
143-
to=""
144-
openInNewTab
145-
>
146-
Learn more
147-
</Link>
148-
</div>
149-
);
150-
151-
// const filterFunction = Filter.getFilterFunction(community.challengeFilter);
152-
// const challengesInCommunity = challenges.filter(filterFunction).length;
153-
154-
const selectItem = (
155-
<div styleName="community-select-item">
156-
<div>
157-
<div styleName="community-name">
158-
<div>
159-
{communityName}
160-
</div>
161-
{visitorRegisteredToCommunity && (
162-
<div styleName="checkmark-icon-container">
163-
<CheckmarkIcon color="#fff" />
164-
</div>
165-
)}
166-
</div>
167-
<div styleName="registration-status">
168-
{communityName === 'All'
169-
? 'Select to see all challenges'
170-
: registrationStatus}
171-
</div>
172-
</div>
173-
<div>
174-
{/* {challengesInCommunity} */}
175-
</div>
176-
</div>
177-
);
178-
179-
if (communityName === 'All') {
180-
return selectItem;
181-
}
182-
183-
return (
184-
<div>
185-
<Tooltip
186-
position="bottom"
187-
trigger={['hover']}
188-
content={(
189-
<div style={{ padding: '15px', fontSize: '13px', borderRadius: '5px' }}>
190-
<p>
191-
You are
192-
{ !visitorRegisteredToCommunity && (
193-
<span styleName="bold">
194-
NOT
195-
</span>
196-
)}
197-
{' '}
198-
registered for this sub community.
199-
</p>
200-
<p>
201-
There are
202-
{/* {challengesInCommunity} */}
203-
{' '}
204-
challenges in this sub community
205-
</p>
206-
</div>
207-
)}
208-
>
209-
{selectItem}
210-
</Tooltip>
211-
</div>
212-
);
213-
};
214-
215-
const mapCommunityOps = (community) => {
216-
if (community.challengeFilter
217-
&& community.challengeFilter.events && community.challengeFilter.events.length) {
218-
return `event_${community.challengeFilter.events[0]}`;
219-
}
220-
221-
return community.communityName === 'All' ? '' : community.groupIds[0];
222-
};
223-
224-
const communityOps = communityFilters.filter(community => (
225-
((!community.hidden && !community.hideFilter) || community.communityName === 'All') && !community.communityName.includes('TCO')
226-
))
227-
.map(community => ({
228-
label: community.communityName,
229-
value: mapCommunityOps(community),
230-
name: community.communityName,
231-
data: getLabel(community),
232-
}));
233-
23493
// const mapOps = item => ({ label: item, value: item });
23594
const mapTypes = item => ({ label: item.name, value: item.abbreviation });
236-
const getCommunityOption = () => {
237-
if (filterState.events && filterState.events.length) {
238-
return `event_${filterState.events[0]}`;
239-
}
240-
if (filterState.groups && filterState.groups.length) {
241-
return filterState.groups[0];
242-
}
243-
return '';
244-
};
24595

24696
const isTrackOn = track => filterState.tracks && filterState.tracks[track];
24797

@@ -572,52 +422,6 @@ export default function FiltersPanel({
572422
) : null
573423
}
574424

575-
{ !isReviewOpportunitiesBucket && !(recommendedToggle && activeBucket === 'openForRegistration')
576-
&& (
577-
<div styleName="filter-row">
578-
<div styleName="filter filter community">
579-
<label htmlFor="community-select" styleName="label">
580-
Sub communities
581-
<input type="hidden" />
582-
</label>
583-
<Select
584-
autoBlur
585-
clearable={false}
586-
id="community-select"
587-
// onChange={selectCommunity}
588-
onChange={(value) => {
589-
if (value && value.startsWith('event_')) {
590-
const event = value.split('_')[1];
591-
setFilterState({
592-
..._.clone(filterState),
593-
events: event === '' ? [] : [event],
594-
groups: [],
595-
});
596-
} else {
597-
const group = value;
598-
setFilterState({
599-
..._.clone(filterState),
600-
groups: group === '' ? [] : [group],
601-
events: [],
602-
});
603-
}
604-
// setFilterState({ ..._.clone(filterState), groups: [value] });
605-
}}
606-
options={communityOps}
607-
simpleValue
608-
value={getCommunityOption()}
609-
valueRenderer={option => (
610-
<span styleName="active-community">
611-
{option.name}
612-
</span>
613-
)}
614-
arrowRenderer={ArrowIcon}
615-
/>
616-
</div>
617-
</div>
618-
)
619-
}
620-
621425
{
622426
isRecommendedChallengesVisible && _.get(auth, 'user.userId')
623427
&& (
@@ -707,10 +511,6 @@ FiltersPanel.defaultProps = {
707511
};
708512

709513
FiltersPanel.propTypes = {
710-
communityFilters: PT.arrayOf(PT.shape({
711-
communityId: PT.string.isRequired,
712-
communityName: PT.string.isRequired,
713-
})).isRequired,
714514
defaultCommunityId: PT.string.isRequired,
715515
activeBucket: PT.string.isRequired,
716516
filterState: PT.shape().isRequired,

0 commit comments

Comments
 (0)