Skip to content

Commit

Permalink
refactor: applying PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
luis-almeida committed Jan 19, 2024
1 parent 001d708 commit 1fc4c2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions assets/new-request-form.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/modules/new-request-form/NewRequestForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ export function NewRequestForm({
>
{errors && <Alert type="error">{errors}</Alert>}
{parentId && <ParentTicketField field={parent_id_field} />}
{ticket_form_field.options.length > 0 && (
<TicketFormField field={ticket_form_field} />
)}
{email_field && (
<Input
key={email_field.name}
Expand All @@ -110,9 +113,6 @@ export function NewRequestForm({
onChange={(value) => handleChange(organization_field, value)}
/>
)}
{ticket_form_field.options.length > 0 && (
<TicketFormField field={ticket_form_field} />
)}
{visibleFields.map((field) => {
switch (field.type) {
case "subject":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function TicketFormField({ field }: TicketFormFieldProps) {
const ref = createRef<HTMLDivElement>();

const handleChange: IComboboxProps["onChange"] = ({ selectionValue }) => {
if (selectionValue && typeof selectionValue === "string") {
if (selectionValue && typeof selectionValue === "number") {
const url = new URL(window.location.href);
const searchParams = url.searchParams;

Expand Down Expand Up @@ -48,7 +48,7 @@ export function TicketFormField({ field }: TicketFormFieldProps) {
<Combobox isEditable={false} onChange={handleChange} ref={ref}>
{field.options.map((option) => (
<Option
key={option.name}
key={option.value}
value={option.value}
label={option.name}
isSelected={field.value === option.value}
Expand Down

0 comments on commit 1fc4c2b

Please sign in to comment.