diff --git a/src/components/ChallengeEditor/SkillsField/index.js b/src/components/ChallengeEditor/SkillsField/index.js index 8025519a..522fcf24 100644 --- a/src/components/ChallengeEditor/SkillsField/index.js +++ b/src/components/ChallengeEditor/SkillsField/index.js @@ -4,7 +4,7 @@ import Select from '../../Select' import { searchSkills } from '../../../services/skills' import cn from 'classnames' import styles from './styles.module.scss' -import { AUTOCOMPLETE_DEBOUNCE_TIME_MS } from '../../../config/constants' +import { AUTOCOMPLETE_DEBOUNCE_TIME_MS, SKILLS_OPTIONAL_BILLING_ACCOUNT_IDS } from '../../../config/constants' import _ from 'lodash' const fetchSkills = _.debounce((inputValue, callback) => { @@ -27,12 +27,15 @@ const SkillsField = ({ readOnly, challenge, onUpdateSkills }) => { value: skill.id })), [challenge.skills]) const existingSkills = useMemo(() => selectedSkills.map(item => item.label).join(','), [selectedSkills]) + const billingAccountId = _.get(challenge, 'billing.billingAccountId') + const normalizedBillingAccountId = _.isNil(billingAccountId) ? null : String(billingAccountId) + const skillsRequired = normalizedBillingAccountId ? !SKILLS_OPTIONAL_BILLING_ACCOUNT_IDS.includes(normalizedBillingAccountId) : true return ( <>