Skip to content

Commit

Permalink
Fix no-unused-expressions eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Jan 17, 2025
1 parent 3fee8e6 commit d4b373e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
1 change: 0 additions & 1 deletion frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export default [
"react/react-in-jsx-scope": "off",
"react/no-unescaped-entities": "off",
"react/display-name": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-explicit-any": "off",
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ export const MissionRestartButton = ({ mission, hasFailedTasks, smallButton }: M
setIsLocationVerificationOpen(false)
}

const selectRerunOption = (rerunOption: ReRunOptions) => {
setSelectedRerunOption(rerunOption)
setIsLocationVerificationOpen(true)
}

return (
<Centered>
<StyledButton
Expand All @@ -76,8 +81,7 @@ export const MissionRestartButton = ({ mission, hasFailedTasks, smallButton }: M
aria-expanded={isOpen}
aria-controls="menu-default"
onClick={() => {
hasFailedTasks ? setIsOpen(!isOpen) : setSelectedRerunOption(ReRunOptions.ReRun)
!hasFailedTasks && setIsLocationVerificationOpen(true)
return hasFailedTasks ? setIsOpen(!isOpen) : selectRerunOption(ReRunOptions.ReRun)
}}
>
<Icon name={smallButton ? Icons.AddOutlined : Icons.Add} size={24} />
Expand All @@ -93,17 +97,15 @@ export const MissionRestartButton = ({ mission, hasFailedTasks, smallButton }: M
>
<Menu.Item
onClick={() => {
setSelectedRerunOption(ReRunOptions.ReRun)
setIsLocationVerificationOpen(true)
selectRerunOption(ReRunOptions.ReRun)
}}
>
{TranslateText('Rerun full mission')}
</Menu.Item>
{hasFailedTasks && (
<Menu.Item
onClick={() => {
setSelectedRerunOption(ReRunOptions.ReRunFailed)
setIsLocationVerificationOpen(true)
selectRerunOption(ReRunOptions.ReRunFailed)
}}
>
{TranslateText('Rerun failed and cancelled tasks in the mission')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,10 @@ const InstallationPicker = () => {
placeholder={TranslateText('Select installation')}
onOptionsChange={({ selectedItems }) => {
const selectedName = selectedItems[0]
validateInstallation(selectedName)
? setSelectedInstallation(selectedName)
: setSelectedInstallation('')
setSelectedInstallation(validateInstallation(selectedName) ? selectedName : '')
}}
onInput={(e: React.ChangeEvent<HTMLInputElement>) => {
validateInstallation(e.target.value)
? setSelectedInstallation(e.target.value)
: setSelectedInstallation('')
setSelectedInstallation(validateInstallation(e.target.value) ? e.target.value : '')
}}
autoWidth={true}
onFocus={(e) => {
Expand Down

0 comments on commit d4b373e

Please sign in to comment.