Skip to content

Commit 077ba3b

Browse files
authored
Merge pull request #1141 from topcoder-platform/PM-1315
PM-1315 Fix issues on Copilot request form
2 parents 530a90a + 8968136 commit 077ba3b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/apps/copilots/src/pages/copilot-request-form/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ const CopilotRequestForm: FC<{}> = () => {
250250
<h1 className={styles.heading}> Copilot Request </h1>
251251
<p className={styles.subheading}>
252252
Hi,
253-
{profile?.firstName}
254253
{' '}
254+
{profile?.firstName}
255255
!
256256
This form is to request a copilot for your project. Please fill in the details below.
257257
</p>
@@ -273,6 +273,7 @@ const CopilotRequestForm: FC<{}> = () => {
273273
label='Project'
274274
placeholder='Start typing the name of the project'
275275
dirty
276+
isClearable
276277
error={formErrors.projectId}
277278
/>
278279

src/apps/copilots/src/pages/copilot-request-form/styles.module.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ $gradient: linear-gradient(
5050

5151
.skillsWrapper {
5252
border: 1px solid #aaaaaa;
53-
border-radius: 0.375rem;
53+
border-radius: 0.375rem;
54+
}
55+
56+
.skillsWrapper:hover {
57+
border-color: #137D60;
5458
}
5559

5660
.skillsError {

src/libs/ui/lib/components/form/form-groups/form-input/input-select-react/InputSelectReact.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ interface InputSelectReactProps {
4848
readonly async?: boolean
4949
readonly loadOptions?: (inputValue: string, callback: (option: any) => void) => void
5050
readonly filterOption?: (option: InputSelectOption, value: string) => boolean
51+
readonly isClearable?: boolean
5152
}
5253

5354
/**
@@ -105,11 +106,12 @@ const InputSelectReact: FC<InputSelectReactProps> = props => {
105106

106107
// throw the proper event type to the form handler (needs name & form element on target)
107108
function handleSelect(option: unknown): void {
109+
const selectedOption = option as InputSelectOption | null
108110
props.onChange({
109111
target: {
110112
form: findParentFrom(wrapRef.current as HTMLDivElement),
111113
name: props.name,
112-
value: (option as InputSelectOption).value,
114+
value: selectedOption?.value || '',
113115
},
114116
} as ChangeEvent<HTMLInputElement>)
115117
}
@@ -162,6 +164,7 @@ const InputSelectReact: FC<InputSelectReactProps> = props => {
162164
formatCreateLabel={props.createLabel}
163165
onCreateOption={props.onCreateOption}
164166
onBlur={handleBlur}
167+
isClearable={props.isClearable}
165168
backspaceRemovesValue
166169
isDisabled={props.disabled}
167170
filterOption={props.filterOption}

0 commit comments

Comments
 (0)