Skip to content

Commit

Permalink
Merge pull request #5 from Eddasol/pr-checklist
Browse files Browse the repository at this point in the history
Pr checklist
  • Loading branch information
Eddasol authored Dec 6, 2024
2 parents 6198cc7 + ec4d4f6 commit d456f4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Ready for review checklist:
- [ ] I have performed a self-review of my own code
- [ ] All commits run individually
- [ ] All "TODO"s, console.log or other temporary changes has been removed
- [ ] The PR has been tested locally
- [ ] Have a test been written?
> - [ ] This change doesn't need a test
- [ ] Are relevant issues linked
- [ ] If remaining work, is this documented in new issues
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const ScheduleMissionDialog = (props: IProps): JSX.Element => {
const { setLoadingRobotMissionSet } = useMissionsContext()
const { setAlert, setListAlert } = useAlertContext()
const [isLocalizationVerificationDialogOpen, setIsLocalizationVerificationDialog] = useState<boolean>(false)
const [selectedRobot, setSelectedRobot] = useState<Robot>()
const [missionsToSchedule, setMissionsToSchedule] = useState<MissionDefinition[]>()
const filteredRobots = enabledRobots.filter(
(r) =>
Expand All @@ -65,6 +64,9 @@ export const ScheduleMissionDialog = (props: IProps): JSX.Element => {
r.status === RobotStatus.Recharging) &&
r.isarConnected
)
const [selectedRobot, setSelectedRobot] = useState<Robot | undefined>(
filteredRobots.length === 1 ? filteredRobots[0] : undefined
)

const onSelectedRobot = (selectedRobot: Robot) => {
if (filteredRobots) setSelectedRobot(selectedRobot)
Expand Down Expand Up @@ -152,7 +154,7 @@ export const ScheduleMissionDialog = (props: IProps): JSX.Element => {
)}
<StyledAutoComplete>
<Autocomplete
initialSelectedOptions={filteredRobots.length === 1 ? [filteredRobots[0]] : []}
initialSelectedOptions={selectedRobot ? [selectedRobot] : []}
dropdownHeight={200}
optionLabel={(r) => r.name + ' (' + r.model.type + ')'}
options={filteredRobots}
Expand Down

0 comments on commit d456f4a

Please sign in to comment.