-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add inspections page #982
Add inspections page #982
Conversation
🔔 Changes in database folder detected 🔔 |
7ce93a8
to
af18384
Compare
I see this is linked to #839 which is in review, though this is still as draft. Is it ready for review? |
I think at this point it is ready for review. It is not identical to the figma, but doing so will require more extensive changes, including database changes. |
c940331
to
e426121
Compare
frontend/src/components/Pages/InspectionPage/InspectionSection.tsx
Outdated
Show resolved
Hide resolved
frontend/src/components/Pages/InspectionPage/InspectionSection.tsx
Outdated
Show resolved
Hide resolved
optionLabel={(r) => r.name + ' (' + r.model.type + ')'} | ||
options={robotOptions.filter( | ||
(r) => | ||
r.currentInstallation.toLocaleLowerCase() === installationCode.toLocaleLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest filtering the robots with the installation code on the use effect instead of here so that maybe the autocomplete options load a bit faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried and didn't help much but still think it looks better here than in the autocomplete
useEffect(() => {
const id = setInterval(() => {
BackendAPICaller.getEnabledRobots().then((robots) => robots.filter(robots => robots.currentInstallation.toLowerCase() === installationCode.toLowerCase()))
.then((robots) => {
setRobotOptions(robots)
})
}, props.refreshInterval)
return () => clearInterval(id)
}, [props.refreshInterval])
<StyledMissionDialog> | ||
<StyledDialog open={true}> | ||
<StyledAutoComplete> | ||
<StyledMissionSection> | ||
<Button | ||
onClick={() => { | ||
props.closeDialog() | ||
}} | ||
variant="outlined" | ||
color="primary" | ||
> | ||
{' '} | ||
{TranslateText('Cancel')}{' '} | ||
</Button> | ||
</StyledMissionSection> | ||
</StyledAutoComplete> | ||
</StyledDialog> | ||
</StyledMissionDialog> | ||
|
||
<StyledMissionDialog> | ||
<Dialog open={true}> | ||
<StyledAutoComplete> | ||
<Typography variant="h5">{TranslateText('This installation has no missions')}</Typography> | ||
</StyledAutoComplete> | ||
</Dialog> | ||
</StyledMissionDialog> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this can be deleted
BackendAPICaller.getEnabledRobots().then((robots) => { | ||
setRobotOptions(robots) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of making the API call here, use the props that are used for echoMissions on MissionOverview/ScheduleMissionDialog so that the autocomplete is faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change the refresh interval on this section to refreshInterval instead of slowRefreshInterval, this is no longer necessary
There's a bit of delay when scheduling the missions on the inspection table that also causes the scrollbar to disappear (loading issues) Edit: If you change the refresh interval on this section to refreshInterval instead of slowRefreshInterval, this is no longer necessary |
1045705
to
8a13811
Compare
Discussion continues on #1004 |
Closes #839 #944