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

Pr checklist #5

Merged
merged 2 commits into from
Dec 6, 2024
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
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
Loading