Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prod relese - May end #6985

Merged
merged 11 commits into from
May 30, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -171,46 +171,6 @@ exports[`Matches shallow shapshot 2`] = `
/>
</div>
</div>
<div
className="src-shared-components-challenge-listing-Filters-FiltersPanel-___style__filter-row___2Vfd_"
>
<div
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"
>
<label
className="src-shared-components-challenge-listing-Filters-FiltersPanel-___style__label___3W9TU"
htmlFor="community-select"
>
Sub communities
<input
type="hidden"
/>
</label>
<Select
arrowRenderer={[Function]}
autoBlur={true}
clearable={false}
id="community-select"
onChange={[Function]}
options={
Array [
Object {
"data": <div>
Sample community
</div>,
"label": "Sample community",
"name": "Sample community",
"value": "123",
},
]
}
selectRef={[Function]}
simpleValue={true}
value=""
valueRenderer={[Function]}
/>
</div>
</div>
</div>
<div
className="src-shared-components-challenge-listing-Filters-FiltersPanel-___style__buttons___2r3xW"
Expand Down
33 changes: 0 additions & 33 deletions src/shared/components/challenge-detail/Specification/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export default function ChallengeDetailsView(props) {
reviewScorecardId,
screeningScorecardId,
forumId,
selfService,
} = legacy;

let stockArtValue = '';
Expand Down Expand Up @@ -231,38 +230,6 @@ export default function ChallengeDetailsView(props) {
description
&& (
<article>
{
selfService && (
<p styleName="note">
<strong>
On Demand Challenges are customer-initiated single round design challenges.
</strong>
<br />
Please note the following important information for Topcoder competitors who participate in this challenge:
<ul>
<li>Any communication needed, should be done directly with the customer in the Challenge Forum.</li>
<li>In order to pass challenge screening and review, all challenge requirements and requested screens must be completed as described below.</li>
<li>Submission source files must be created with the application(s) listed in the requirements.</li>
<li>There will be no appeals or final fixes.</li>
<li>The challenge winner selections will be based upon completed requirements and associated Topcoder review scoring.</li>
</ul>
<br />
<strong>
REQUEST MARVEL PROTOTYPES HERE:
</strong>
<br />
<a href="https://discussions.topcoder.com/discussion/15528/request-marvel-access-for-on-demand-challenges">
Request Marvel for On Demand Challenges
</a>
<br />
<strong>
DO NOT request Marvel access in the challenge forum with the customer.
</strong>
<br />
Figma or XD Prototypes are acceptable for submissions created with those applications.
</p>
)
}
<h2>
Challenge Summary
</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ a[href*="/talent-routes/details"] {
border-radius: 3px;
font-weight: 500;
text-decoration: none;
display: flex;
gap: 8px;

&:hover {
text-decoration: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export default function ChallengeStatus(props) {
newChallengeDetails,
selectChallengeDetailsTab,
openChallengesInNewTabs,
userId,
isLoggedIn,
} = props;

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

const users = challenge.users || {};
const showRegisterInfo = false;

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

return (
<div styleName={showRegisterInfo ? 'challenge-progress with-register-button' : 'challenge-progress'}>
Expand Down Expand Up @@ -316,7 +319,6 @@ ChallengeStatus.defaultProps = {
detailLink: '',
openChallengesInNewTabs: false,
className: '',
userId: '',
};

ChallengeStatus.propTypes = {
Expand All @@ -327,6 +329,5 @@ ChallengeStatus.propTypes = {
openChallengesInNewTabs: PT.bool, // eslint-disable-line react/no-unused-prop-types
selectChallengeDetailsTab: PT.func.isRequired,
className: PT.string,
userId: PT.number,
isLoggedIn: PT.bool.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,26 @@
import _ from 'lodash';
import React, { useState, useEffect } from 'react';
import PT from 'prop-types';
import Select from 'components/Select';
import DateRangePicker from 'components/DateRangePicker';
import moment from 'moment';
import Tooltip from 'components/Tooltip';
import { config, Link } from 'topcoder-react-utils';
import { config } from 'topcoder-react-utils';
import { COMPOSE, PRIORITY } from 'react-css-super-themr';
import { REVIEW_OPPORTUNITY_TYPES } from 'utils/tc';
import { isFilterEmpty, isPastBucket, BUCKETS } from 'utils/challenge-listing/buckets';
import SwitchWithLabel from 'components/SwitchWithLabel';
import ChallengeSearchBar from 'containers/challenge-listing/ChallengeSearchBar';
import { challenge as challengeUtils } from 'topcoder-react-lib';
import { createStaticRanges } from 'utils/challenge-listing/date-range';
import ArrowIcon from 'assets/images/ico-arrow-down.svg';
import CircleIcon from 'assets/images/icon-circle.svg';
import Button from '../Button';
import UiSimpleRemove from '../../Icons/ui-simple-remove.svg';
import BucketSelector from '../../Sidebar/BucketSelector';
import CheckmarkIcon from './CheckmarkIcon';
import style from './style.scss';

const Filter = challengeUtils.filter;

export default function FiltersPanel({
communityFilters,
defaultCommunityId,
filterState,
// challenges,
Expand Down Expand Up @@ -92,156 +88,10 @@ export default function FiltersPanel({
);
}

const isVisitorRegisteredToCommunity = (visitorGroupIds, communityGroupIds) => Boolean(
_.intersection(visitorGroupIds, communityGroupIds).length,
);

// const isAllBucket = activeBucket === BUCKETS.ALL;

const getLabel = (community) => {
const { communityName } = community;
if (!isAuth) {
return (
<div>
{communityName}
</div>
);
}

// eslint-disable-next-line max-len
const visitorGroupIds = (auth.profile && auth.profile.groups) ? auth.profile.groups.map(g => g.id) : [];
const visitorRegisteredToCommunity = isVisitorRegisteredToCommunity(
visitorGroupIds,
community.groupIds,
);

const registrationStatus = visitorRegisteredToCommunity
? (
<div>
Registered
</div>
)
: (
<div>
You are
{' '}
<span styleName="bold uppercase">
not
</span>
{' '}
registered.
<Link
onMouseDown={(e) => {
const url = community.mainSubdomain ? (
config.URL.BASE.replace(/www/, community.mainSubdomain)
) : `/community/${community.communityId}`;
window.open(url);
e.stopPropagation();
e.preventDefault();
}}
styleName="learn-more-link"
to=""
openInNewTab
>
Learn more
</Link>
</div>
);

// const filterFunction = Filter.getFilterFunction(community.challengeFilter);
// const challengesInCommunity = challenges.filter(filterFunction).length;

const selectItem = (
<div styleName="community-select-item">
<div>
<div styleName="community-name">
<div>
{communityName}
</div>
{visitorRegisteredToCommunity && (
<div styleName="checkmark-icon-container">
<CheckmarkIcon color="#fff" />
</div>
)}
</div>
<div styleName="registration-status">
{communityName === 'All'
? 'Select to see all challenges'
: registrationStatus}
</div>
</div>
<div>
{/* {challengesInCommunity} */}
</div>
</div>
);

if (communityName === 'All') {
return selectItem;
}

return (
<div>
<Tooltip
position="bottom"
trigger={['hover']}
content={(
<div style={{ padding: '15px', fontSize: '13px', borderRadius: '5px' }}>
<p>
You are
{ !visitorRegisteredToCommunity && (
<span styleName="bold">
NOT
</span>
)}
{' '}
registered for this sub community.
</p>
<p>
There are
{/* {challengesInCommunity} */}
{' '}
challenges in this sub community
</p>
</div>
)}
>
{selectItem}
</Tooltip>
</div>
);
};

const mapCommunityOps = (community) => {
if (community.challengeFilter
&& community.challengeFilter.events && community.challengeFilter.events.length) {
return `event_${community.challengeFilter.events[0]}`;
}

return community.communityName === 'All' ? '' : community.groupIds[0];
};

const communityOps = communityFilters.filter(community => (
((!community.hidden && !community.hideFilter) || community.communityName === 'All') && !community.communityName.includes('TCO')
))
.map(community => ({
label: community.communityName,
value: mapCommunityOps(community),
name: community.communityName,
data: getLabel(community),
}));

// const mapOps = item => ({ label: item, value: item });
const mapTypes = item => ({ label: item.name, value: item.abbreviation });
const getCommunityOption = () => {
if (filterState.events && filterState.events.length) {
return `event_${filterState.events[0]}`;
}
if (filterState.groups && filterState.groups.length) {
return filterState.groups[0];
}
return '';
};

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

Expand Down Expand Up @@ -572,52 +422,6 @@ export default function FiltersPanel({
) : null
}

{ !isReviewOpportunitiesBucket && !(recommendedToggle && activeBucket === 'openForRegistration')
&& (
<div styleName="filter-row">
<div styleName="filter filter community">
<label htmlFor="community-select" styleName="label">
Sub communities
<input type="hidden" />
</label>
<Select
autoBlur
clearable={false}
id="community-select"
// onChange={selectCommunity}
onChange={(value) => {
if (value && value.startsWith('event_')) {
const event = value.split('_')[1];
setFilterState({
..._.clone(filterState),
events: event === '' ? [] : [event],
groups: [],
});
} else {
const group = value;
setFilterState({
..._.clone(filterState),
groups: group === '' ? [] : [group],
events: [],
});
}
// setFilterState({ ..._.clone(filterState), groups: [value] });
}}
options={communityOps}
simpleValue
value={getCommunityOption()}
valueRenderer={option => (
<span styleName="active-community">
{option.name}
</span>
)}
arrowRenderer={ArrowIcon}
/>
</div>
</div>
)
}

{
isRecommendedChallengesVisible && _.get(auth, 'user.userId')
&& (
Expand Down Expand Up @@ -707,10 +511,6 @@ FiltersPanel.defaultProps = {
};

FiltersPanel.propTypes = {
communityFilters: PT.arrayOf(PT.shape({
communityId: PT.string.isRequired,
communityName: PT.string.isRequired,
})).isRequired,
defaultCommunityId: PT.string.isRequired,
activeBucket: PT.string.isRequired,
filterState: PT.shape().isRequired,
Expand Down
Loading
Loading