Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove suppressing of lint rules #1946

Merged
merged 2 commits into from
Jan 17, 2025
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: 0 additions & 2 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ export default [
{
rules: {
"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
4 changes: 2 additions & 2 deletions frontend/src/components/Alerts/FailedMissionAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const FailedMission = ({ missions }: MissionsProps) => {

return (
<StyledButton onClick={goToMission} variant="ghost" color="secondary">
<strong>'{mission.name}'</strong> {TranslateText('failed on robot')}{' '}
<strong>'{mission.robot.name}':</strong> {mission.statusReason}
<strong>{`'${mission.name}'`}</strong> {TranslateText('failed on robot')}{' '}
<strong>{`'${mission.robot.name}'`}:</strong> {mission.statusReason}
</StyledButton>
)
}
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
Loading