Disable pop-up opening when selecting device

smsoousa9 months ago

Hello everybody! Is there any way to disable the opening of the popup when selecting the device in the "device list"? And allow the opening of the popup only when clicking on the device's avatar on the map.
I tried some changes in
DeviceRow.js

onClick={() => dispatch(devicesActions.select(item.id))}

and
store/devices.js

    select(state, action) {
      state.selectedId = action.payload;
    },

but without effect

Any help or direction is greatly appreciated. Thanks

smsoousa9 months ago

Any help? It's the second POST I've sent to the forum and I haven't even received a response.

Track-trace9 months ago

Hi,

I have no clue but if you select Replay from the popup, then from that route when you click on the blue dot, and then click that gps icon again, then you will get the popup window. So you might look at that code how it is done.

smsoousa9 months ago

Thank you for this direction, but unfortunately this snippet does not solve my problem, what I want is to be able to select the device without having to activate the popup, this interferes a lot when we want to view the real-time route of a device on the map, and when I I close the popup, it loses the device selection.

Cristian9 months ago

smsoousa, StatusCard displays the popup and the condition for that is selectedDeviceId, either if you select the device from the device list or from the map. This is in MainPage.js, in my opinion it is there where you must condition that StatusCard is not shown when selecting the device from the list, but that if it shows it when selecting from the map.

      <EventsDrawer open={eventsOpen} onClose={() => setEventsOpen(false)} />
      {selectedDeviceId && (
        <StatusCard
          deviceId={selectedDeviceId}
          position={selectedPosition}
          onClose={() => dispatch(devicesActions.selectId(null))}
          desktopPadding={theme.dimensions.drawerWidthDesktop}
        />
      )}
smsoousa9 months ago

Thanks for the direction @Cristian, I tried a few ways, I even managed to select the device without opening the popup, however, it was a global rule, when activating the device on the map, it just selected and did not open the popup.