Skip to content

Commit

Permalink
fix(comms): support panel value fixes (#25111)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
MarconLP and github-actions[bot] authored Sep 20, 2024
1 parent 423878c commit 47b7d6d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions frontend/src/lib/components/Support/SupportForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonFileInput } from 'lib/lemon-ui/LemonFileInput/LemonFileInput'
import { LemonSelect } from 'lib/lemon-ui/LemonSelect/LemonSelect'
import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea/LemonTextArea'
import { useEffect, useRef } from 'react'
import { useRef } from 'react'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { userLogic } from 'scenes/userLogic'

Expand Down Expand Up @@ -70,13 +70,14 @@ export function SupportForm(): JSX.Element | null {
},
})

useEffect(() => {
if (sendSupportRequest.kind === 'bug') {
const changeKind = (kind: SupportTicketKind): void => {
setSendSupportRequestValue('kind', kind)
if (kind === 'bug') {
setSendSupportRequestValue('severity_level', 'medium')
} else {
setSendSupportRequestValue('severity_level', 'low')
}
}, [sendSupportRequest.kind])
}

return (
<Form
Expand All @@ -97,7 +98,7 @@ export function SupportForm(): JSX.Element | null {
</>
)}
<LemonField name="kind" label="Message type">
<LemonSegmentedButton fullWidth options={SUPPORT_TICKET_OPTIONS} />
<LemonSegmentedButton onChange={changeKind} fullWidth options={SUPPORT_TICKET_OPTIONS} />
</LemonField>
<LemonField name="target_area" label="Topic">
<LemonSelect
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/Support/supportLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ export const supportLogic = kea<supportLogicType>([

actions.openSupportForm({
kind: Object.keys(SUPPORT_KIND_TO_SUBJECT).includes(kind) ? kind : null,
target_area: Object.keys(TARGET_AREA_TO_NAME).includes(area) ? area : null,
target_area: getLabelBasedOnTargetArea(area) ? area : null,
severity_level: Object.keys(SEVERITY_LEVEL_TO_NAME).includes(severity) ? severity : null,
isEmailFormOpen: isEmailFormOpen ?? 'false',
})
Expand Down

0 comments on commit 47b7d6d

Please sign in to comment.