Azure / pcs-remote-monitoring-webui

Azure IoT PCS Remote Monitoring Web UI
MIT License
54 stars 72 forks source link

Sort Grid, Details Flyout opens wrong item #1181

Closed mechaffin closed 5 years ago

mechaffin commented 5 years ago

Type of issue

Description

When a grid is sorted, the flyouts open the wrong item.

Steps to reproduce

  1. Go to Devices (or Rules)
  2. Sort the grid
  3. Click the soft select link (to open the details flyout)

Expected behavior

Flyout for the item you clicked is opened.

Current behavior

Flyout for the item that was in that position PRIOR to sorting is opened.

Known workarounds

Put the grid back in the original sort order, then open the flyout.

Possible solution

Change the grid's onSoftSelectChange to pass the row data's Id (using its getSoftSelectId method) instead of the rowindex. Prior versions also attempted to send the row data, but it proved to be outdated in cases when that row has been edited within the session. The new change will rely on the Id and then looking up the data in the redux store to ensure the proper row in its most up to date state will be displayed in the flyouts.