Summary: Fix problems with row highlighting on mocks route list. When selecting a row, the highlight would sometimes be on the wrong row. Also, when adding routes, the routes would sometimes get added in the middle of the list instead of at the end. These problems were caused by incorrectly referencing route rows in code. Sometimes index was used and other times the key was used. Fixed by consistently using key. This fixes the problem described in issue https://github.com/facebook/flipper/issues/1733 ## Changelog Network Plugin - fix problems with row highlighting on mocks route list Pull Request resolved: https://github.com/facebook/flipper/pull/1917 Test Plan: Start with no mocks | No rows should be shown | TRUE Add a single mock | First (and only row should be highlighted) | TRUE Delete mock | No rows should be shown | TRUE Add single mockAdd another mock | 2nd row should be highlighted | TRUE Add another mock | 3rd row should be highlighted | TRUE Add 2 more mocks and assign number to each row (5 total) | Last row should be highlighted | TRUE Select 1st row | 1st row should be highlighted | TRUE Delete 1st row | 1st row should be highlighed | TRUE Select last row | last row should be highlighted | TRUE Delete last row | last row should be deleted and new last row should be highlighted | TRUE Highlight a middle row (row 3) | middle row should be highlighted | TRUE Delete middle row | middle row should be deleted and last row should be in its place and should be highlighted | TRUE Reviewed By: passy Differential Revision: D26604455 Pulled By: mweststrate fbshipit-source-id: f29690244e32b364983089541718f4bc75154dd1
29 KiB
29 KiB