equinor / flotilla

Flotilla is the main point of access for operators to interact with multiple robots in a facility.
Eclipse Public License 2.0
16 stars 35 forks source link

Battery level is shown as unknown on the front-page when the level is 0% #1525

Closed anetteu closed 5 months ago

anetteu commented 5 months ago

Describe the improvement you would like to see When the battery level is 0%, the battery level is shown as unknown on the mission and robot card on the front page. It should show 0% instead of unknown.

See screenshots from mission page (0%) and robot and mission cards on the front page (unknown)

IMG_0035

IMG_0034

How will this change existing functionality? More accurate information.

How will this improvement affect the current Threat Model? Leave blank for maintainers to fill out if you are uncertain about this.

andchiind commented 5 months ago

This might be the issue, on line 29 in BatteryStatusDisplay.tsx:

Image

We want this to be "case batteryLevel === null" instead of "!batteryLevel" since both a value of zero and a value of null will return true here.

The same is true later in the component:

Image