Skip to content

Gig apply fixes #5235

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

Merged
merged 3 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ workflows:
filters:
branches:
only:
- free
- gig-apply-fixes
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
Expand Down
22 changes: 8 additions & 14 deletions src/shared/components/GUIKit/DropdownTerms/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,12 @@ function DropdownTerms({
let inputField;
useEffect(() => {
const selectInput = containerRef.current.getElementsByClassName('Select-input');
const selectMenuOuter = containerRef.current.getElementsByClassName('Select-menu-outer');
if (selectInput && selectInput.length) {
const selectControl = containerRef.current.getElementsByClassName(
'Select-control',
);
const height1 = selectMenuOuter && selectMenuOuter.length
? selectMenuOuter[0].offsetHeight
: 0;
const height2 = selectControl && selectControl.length
? selectControl[0].offsetHeight
: 0;
selectInput[0].style.top = focused ? `${height1 + height2 - 1}px` : '0';
inputField = selectInput[0].getElementsByTagName('input');
inputField[0].placeholder = focused ? addNewOptionPlaceholder : '';
inputField[0].style.border = 'none';
inputField[0].style.boxShadow = 'none';
selectInput[0].style.borderTop = 'none';
}
}, [focused, selectedOption]);

Expand Down Expand Up @@ -145,9 +135,13 @@ function DropdownTerms({
backspaceRemoves={false}
multi
promptTextCreator={() => null}
filterOptions={() => _.filter(
internalTerms, t => !_.find(selectedOption, { label: t.label }),
).map(o => ({ value: o.label, label: o.label }))}
filterOptions={(option, inputValue) => _.filter(
internalTerms,
t => (inputValue && inputValue.length >= 2
? t.label.toLowerCase().includes(inputValue.toLowerCase())
&& !_.find(selectedOption, { label: t.label })
: !_.find(selectedOption, { label: t.label })),
)}
/>
<img width="15" height="9" styleName="iconDropdown" src={iconDown} alt="dropdown-arrow-icon" />
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/shared/containers/Gigs/RecruitCRMJobApply.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ class RecruitCRMJobApplyContainer extends React.Component {
}
// require atleast 1 skill
if (!prop || prop === 'skills') {
if (!_.find(formData.skills, { selected: true })) formErrors.skills = 'Please, add technical skills';
const skills = _.filter(formData.skills, ['selected', true]);
if (!skills.length) formErrors.skills = 'Please, add technical skills';
else if (skills.map(skill => skill.label).join(',').length >= 100) formErrors.skills = 'Sum of all skill characters may not be greater than 100';
else delete formErrors.skills;
}
// have accepted terms
Expand Down