Skip to content

Commit

Permalink
Merge pull request #337 from BoostV/rename-transfer
Browse files Browse the repository at this point in the history
Rename transfer
  • Loading branch information
j-or authored Nov 8, 2023
2 parents c46794d + d63ac4b commit 4362a44
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-feet-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@boostv/process-optimizer-frontend-ui': minor
---

Change transfer button label on initial interaction
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
selectNextExperimentValues,
selectIsInitializing,
selectActiveVariableNames,
selectDataPoints,
} from '@boostv/process-optimizer-frontend-core'
import {
Tooltip,
Expand Down Expand Up @@ -67,6 +68,7 @@ export const ExperimentationGuide = (props: ResultDataProps) => {
const headers = useSelector(selectActiveVariableNames)
const expectedMinimum = useSelector(selectExpectedMinimum)
const isInitializing = useSelector(selectIsInitializing)
const dataPoints = useSelector(selectDataPoints)

const defaultLoadingView = (
<Stack direction="column" spacing={2} m={2}>
Expand Down Expand Up @@ -186,6 +188,7 @@ export const ExperimentationGuide = (props: ResultDataProps) => {
nextValues[0].length > 0 && (
<Box>
<CopySuggested
isInitialInteraction={dataPoints.length === 0}
onClick={() =>
dispatchExperiment({
type: 'copySuggestedToDataPoints',
Expand Down
10 changes: 8 additions & 2 deletions packages/ui/src/features/result-data/copy-suggested.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import { Button } from '@mui/material'
import { FC } from 'react'

type Props = {
isInitialInteraction: boolean
onClick: () => void
}

export const CopySuggested: FC<Props> = ({ onClick }: Props) => {
export const CopySuggested: FC<Props> = ({
isInitialInteraction,
onClick,
}: Props) => {
return (
<Button size="small" variant="outlined" onClick={onClick}>
Transfer all to data points
{isInitialInteraction
? 'Start experimenting'
: 'Transfer all to data points'}
</Button>
)
}

0 comments on commit 4362a44

Please sign in to comment.