Skip to content

Commit

Permalink
Merge branch 'develop' into TSJR-275
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgasper authored Dec 8, 2023
2 parents 20ce353 + 1888ccc commit 4cbbff0
Show file tree
Hide file tree
Showing 25 changed files with 605 additions and 337 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,14 @@ workflows:
- remove_submission_review
- standardised_skills
- TSJR-275
- skills_updates
# This is alternate dev env for parallel testing
- "build-test":
context : org-global
filters:
branches:
only:
- PROD-4251
- IC-13
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
Expand Down
2 changes: 1 addition & 1 deletion config/backup-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ module.exports = {
GUIKIT: {
DEBOUNCE_ON_CHANGE_TIME: 150,
},
ENABLE_RECOMMENDER: true,
ENABLE_RECOMMENDER: false,
OPTIMIZELY: {
SDK_KEY: '7V4CJhurXT3Y3bnzv1hv1',
},
Expand Down
3 changes: 2 additions & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ module.exports = {
GUIKIT: {
DEBOUNCE_ON_CHANGE_TIME: 150,
},
ENABLE_RECOMMENDER: true,
ENABLE_RECOMMENDER: false,
OPTIMIZELY: {
SDK_KEY: '7V4CJhurXT3Y3bnzv1hv1',
},
Expand All @@ -476,4 +476,5 @@ module.exports = {
MEMBER_PROFILE_REDIRECT_URL: 'https://profiles.topcoder-dev.com',
MEMBER_SEARCH_REDIRECT_URL: 'https://talent-search.topcoder-dev.com',
ACCOUNT_SETTINGS_REDIRECT_URL: 'https://account-settings.topcoder-dev.com',
INNOVATION_CHALLENGES_TAG: 'Innovation Challenge',
};
2 changes: 1 addition & 1 deletion config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ module.exports = {
TC_EDU_ARTICLES_PATH: '/articles',
TC_EDU_SEARCH_PATH: '/search',
TC_EDU_SEARCH_BAR_MAX_RESULTS_EACH_GROUP: 3,
ENABLE_RECOMMENDER: true,
ENABLE_RECOMMENDER: false,
PLATFORM_SITE_URL: 'https://platform.topcoder.com',
PLATFORMUI_SITE_URL: 'https://platform-ui.topcoder.com',
DICE_VERIFY_URL: 'https://accounts-auth0.topcoder.com',
Expand Down
16 changes: 12 additions & 4 deletions src/shared/actions/dashboard.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import _ from 'lodash';
import { createActions } from 'redux-actions';
import { getService } from '../services/dashboard';

const service = getService();

function fetchChallenges(query) {
return service.getChallenges(query);
function fetchChallengesInit(title) {
return title;
}

async function fetchChallenges(title, query) {
const challenges = await service.getChallenges(query);

return {
challenges,
title,
};
}

export default createActions({
DASHBOARD: {
FETCH_CHALLENGES_INIT: _.noop,
FETCH_CHALLENGES_INIT: fetchChallengesInit,
FETCH_CHALLENGES_DONE: fetchChallenges,
},
});
17 changes: 12 additions & 5 deletions src/shared/components/Dashboard/Challenges/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import _ from 'lodash';
import LoadingIndicator from 'components/LoadingIndicator';
import PT from 'prop-types';
import React from 'react';
import qs from 'qs';

import { config } from 'topcoder-react-utils';

Expand All @@ -11,22 +12,24 @@ export default function ChallengesFeed({
challenges,
loading,
theme,
title,
challengeListingQuery,
}) {
return (
return challenges && challenges.length ? (
<div styleName={`container ${theme}`}>
<div styleName="header">
<span styleName="title">CHALLENGES</span>
<span styleName="title">{title}</span>
<a
styleName="allLink"
href={`${config.URL.CHALLENGES_URL}`}
href={`${config.URL.CHALLENGES_URL}${challengeListingQuery ? `?${qs.stringify(challengeListingQuery)}` : ''}`}
target="_blank"
rel="noreferrer"
>View all <span>challenges</span>
</a>
</div>
<div styleName="challenges">
{loading ? <div styleName="loading"><LoadingIndicator /></div>
: challenges.map(challenge => (
: (challenges || []).map(challenge => (
<div styleName="row" key={challenge.id}>
<a
href={`/challenges/${challenge.id}`}
Expand All @@ -46,16 +49,20 @@ export default function ChallengesFeed({
))}
</div>
</div>
);
) : null;
}

ChallengesFeed.defaultProps = {
challenges: [],
theme: 'light',
title: 'CHALLENGES',
challengeListingQuery: undefined,
};

ChallengesFeed.propTypes = {
challenges: PT.arrayOf(PT.shape()),
loading: PT.bool.isRequired,
theme: PT.oneOf(['dark', 'light']),
title: PT.string,
challengeListingQuery: PT.shape(),
};
134 changes: 134 additions & 0 deletions src/shared/components/GUIKit/DropdownSingleSkills/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/* eslint-disable jsx-a11y/label-has-for */
/**
* Dropdown terms component.
*/
import React, {
useRef,
useEffect,
} from 'react';
import PT from 'prop-types';
import { AsyncCreatable } from 'react-select';
import './style.scss';

function DropdownSingleSkills({
terms,
placeholder,
label,
required,
onChange,
errorMsg,
cacheOptions,
loadOptions,
createText,
}) {
const containerRef = useRef(null);
useEffect(() => {
const selectInput = containerRef.current.getElementsByClassName('Select-input');
if (selectInput && selectInput.length) {
const inputField = selectInput[0].getElementsByTagName('input');
inputField[0].style.border = 'none';
inputField[0].style.boxShadow = 'none';
selectInput[0].style.borderTop = 'none';
}
}, [terms]);

const CustomReactSelectRow = React.forwardRef(({
className,
option,
children,
onSelect,
}, ref) => (children ? (
<a
ref={ref}
role="button"
className={className}
onMouseDown={(event) => {
event.preventDefault();
event.stopPropagation();
onSelect(option, event);
}}
title={option.title}
tabIndex={-1}
>
{children}
</a>
) : null));

CustomReactSelectRow.defaultProps = {
children: null,
className: '',
onSelect: () => {},
};

CustomReactSelectRow.propTypes = {
children: PT.node,
className: PT.string,
onSelect: PT.func,
option: PT.object.isRequired,
};

return (
<div
ref={containerRef}
className="dropdownContainer"
styleName={`container ${
terms ? 'haveValue' : ''
} ${errorMsg ? 'haveError' : ''}`}
>
<div styleName="relative">
<AsyncCreatable
autosize={false}
optionComponent={CustomReactSelectRow}
value={terms ? {
value: terms,
label: terms,
} : null}
onChange={(value) => {
onChange(value ? (value.value || '') : '');
}}
defaultValue={terms ? {
value: terms,
label: terms,
} : null}
promptTextCreator={value => `${createText} "${value}"`}
placeholder={`${placeholder}${placeholder && required ? ' *' : ''}`}
cacheOptions={cacheOptions}
loadOptions={loadOptions}
/>
</div>
{label ? (
<span styleName="label">
{label}
{required ? <span>&nbsp;*</span> : null}
</span>
) : null}
{errorMsg ? <span styleName="errorMessage">{errorMsg}</span> : null}
</div>
);
}

DropdownSingleSkills.defaultProps = {
terms: '',
placeholder: '',
label: '',
required: false,
cacheOptions: false,
onChange: () => {},
errorMsg: '',
createText: 'Select',
loadOptions: undefined,
};

DropdownSingleSkills.propTypes = {
terms: PT.string,
placeholder: PT.string,
label: PT.string,
required: PT.bool,
cacheOptions: PT.bool,
onChange: PT.func,
errorMsg: PT.string,
createText: PT.string,
loadOptions: PT.func,
};

export default DropdownSingleSkills;
71 changes: 71 additions & 0 deletions src/shared/components/GUIKit/DropdownSingleSkills/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@import '../Dropdown/style.scss';

.label {
z-index: 6;
}

.relative {
position: relative;
}

.errorMessage,
.haveValue,
.haveError {
font-family: Roboto, sans-serif;
}

.container {
font-family: Roboto, sans-serif;

:global {
.Select-control {
min-height: 52px;
height: auto;
display: flex !important;
overflow: visible !important;
}

.Select-clear-zone,
.Select-clear {
font-size: 21px;
line-height: 40px;

&:hover {
color: $dashboard-teal;
}
}

.Select-value {
font-size: 14px !important;
padding-right: 42px !important;
overflow: hidden;

.Select-value-label {
font-size: 14px;
max-width: 100%;
text-overflow: ellipsis;
overflow: hidden;
}
}

.Select-input {
input {
font-size: 14px;

&::-webkit-input-placeholder {
/* Edge */
color: $gui-kit-gray-30;
}

&:-ms-input-placeholder {
/* Internet Explorer 10-11 */
color: $gui-kit-gray-30;
}

&::placeholder {
color: $gui-kit-gray-30;
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/shared/components/GUIKit/JobListCard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function JobListCard({
<IconBlackLocation /> {job.country}
</div>
<div styleName="icon-val">
<IconBlackPayment /> ${job.min_annual_salary} - {job.max_annual_salary} (USD) / {getSalaryType(job.salary_type)}
<IconBlackPayment /> ${job.min_annual_salary} - {job.max_annual_salary} (USD) / {getSalaryType(job.salary_type || {})}
</div>
<div styleName="icon-val">
<IconBlackDuration /> {/^\d+$/.test(duration) ? `${duration} Weeks` : duration}
Expand Down
Loading

0 comments on commit 4cbbff0

Please sign in to comment.