Skip to content
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 frontend/web/components/PageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const PageTitle: FC<PageTitleType> = ({ children, className, cta, title }) => {
</Row>
)}
</div>
{!!cta && <div className='float-end ms-lg-2'>{cta}</div>}
{!!cta && <div className='float-end'>{cta}</div>}
</div>
<hr className='mb-0 mt-3' />
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FC, useMemo } from 'react'
import { FC, useMemo, useState } from 'react'
import CreatableSelect from 'react-select/creatable'
import { InputActionMeta } from 'react-select'
import {
useGetWarehouseConnectionEventsQuery,
useGetWarehouseConnectionsQuery,
Expand Down Expand Up @@ -33,6 +34,22 @@ const EventNameSelect: FC<EventNameSelectProps> = ({ onChange, value }) => {
)
const options = useMemo(() => buildEventOptions(data?.events), [data?.events])
const showWarning = isSuccess && isUnknownEvent(value, data?.events)
const [inputValue, setInputValue] = useState('')

// Keep the typed text on blur (react-select discards it by default) so
// clicking outside commits the value instead of clearing it.
const handleInputChange = (val: string, meta: InputActionMeta) => {
if (meta.action === 'input-change') setInputValue(val)
}
const handleChange = (option: EventOption | null) => {
setInputValue('')
onChange(option?.value ?? '')
}
const handleBlur = () => {
if (!inputValue) return
onChange(inputValue)
setInputValue('')
}
Comment thread
Zaimwa9 marked this conversation as resolved.

return (
<div className='event-name-select'>
Expand All @@ -42,11 +59,14 @@ const EventNameSelect: FC<EventNameSelectProps> = ({ onChange, value }) => {
classNamePrefix='react-select'
isClearable
isLoading={isLoading}
inputValue={inputValue}
onInputChange={handleInputChange}
onBlur={handleBlur}
maxMenuHeight={200}
menuPlacement='auto'
options={options}
value={value ? { label: value, value } : null}
onChange={(option: EventOption | null) => onChange(option?.value ?? '')}
onChange={handleChange}
placeholder='e.g. checkout_completed'
formatCreateLabel={(input: string) => `Use "${input}"`}
noOptionsMessage={() => 'Type to add a new event'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,12 @@ const ExperimentSummaryScorecard: FC<ExperimentSummaryScorecardProps> = ({
loading={!hasResults}
value={
summary?.winnerName ? (
<span
className={summary.controlWins ? undefined : 'text-success'}
>
<VariantName
fit
colour={summary.winnerColour}
fontSize={24}
name={summary.winnerName}
/>
</span>
<VariantName
fit
colour={summary.winnerColour}
fontSize={24}
name={summary.winnerName}
/>
) : undefined
}
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/web/components/experiments/steps/SetupStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const SetupStep: FC<SetupStepProps> = ({
search: search || undefined,
type: 'MULTIVARIATE',
},
{ skip: !numericEnvId },
{ refetchOnMountOrArgChange: true, skip: !numericEnvId },
)

const multivariateFeatures = featureList?.results ?? []
Expand Down
Loading