Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(frontend): fix automate page to match new run cli command (#2928)
- Loading branch information
Showing
5 changed files
with
64 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 12 additions & 8 deletions
20
web/src/components/RunDetailAutomateMethods/methods/CLICommand/SwitchControl.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
import {Switch} from 'antd'; | ||
import {noop} from 'lodash'; | ||
import {TooltipQuestion} from 'components/TooltipQuestion/TooltipQuestion'; | ||
import * as S from './CliCommand.styled'; | ||
|
||
interface IProps { | ||
text: string; | ||
value?: boolean; | ||
id: string; | ||
disabled?: boolean; | ||
help?: string; | ||
onChange?(value: boolean): void; | ||
} | ||
|
||
const SwitchControl = ({value = false, onChange = noop, text, id}: IProps) => { | ||
return ( | ||
<S.SwitchContainer> | ||
<Switch onChange={onChange} checked={value} id={id} /> | ||
<S.SwitchLabel htmlFor={id}>{text}</S.SwitchLabel> | ||
</S.SwitchContainer> | ||
); | ||
}; | ||
const SwitchControl = ({value = false, onChange = noop, text, id, disabled, help}: IProps) => ( | ||
<S.SwitchContainer> | ||
<Switch onChange={onChange} checked={value} id={id} disabled={disabled} /> | ||
<S.SwitchLabel htmlFor={id} $disabled={disabled}> | ||
{text} | ||
</S.SwitchLabel> | ||
{!!help && <TooltipQuestion title={help} />} | ||
</S.SwitchContainer> | ||
); | ||
|
||
export default SwitchControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters