Commit Graph

5 Commits

Author SHA1 Message Date
Chaiwat Ekkaewnumchai
9ae0511f16 Refactor Data Used And Passed to Detail Sidebar
Summary:
As suggested in the previous diff, I change the way to store row values. Now, (kinda) raw values are stored instead of processed values that can be used directly for `ManagedTable`. This simplifies logic in detail sidebar.

I'm not sure what the effect to performance.

Reviewed By: mweststrate

Differential Revision: D21621896

fbshipit-source-id: 472be3caa955ca32f876f81095af21e9c17cb159
2020-05-19 09:12:56 -07:00
Chaiwat Ekkaewnumchai
11b233b516 Allow Long Text to Be Shown in The Sidebar
Summary:
This allows long text to be seen on the sidebar in database plugin. Also, remove weird padding in the sidebar and separate sidebar component to a new file

Refactoring is in the next diff

Reviewed By: mweststrate

Differential Revision: D21550672

fbshipit-source-id: 3e80be16783719e18392fe3d8f8068caf9283f8f
2020-05-19 09:12:56 -07:00
Chaiwat Ekkaewnumchai
ee2369950f Sort Result From ID instead of Using Directly from Result
Summary:
As mentioned in [the first comment in the Github issue](https://github.com/facebook/flipper/issues/989#issuecomment-616673590), we were mixing database `id` given from client and `index + 1` on server side. After investigating, most are used correctly; it searches `id` from given database `name`. However, there are a few (if not one) that, in my opinion, was used incorrectly. For example, [`tableOption`](https://fburl.com/diffusion/vlo7xbo1) assumed `id - 1` is the index, which is sometime incorrect.

This diff sorts the database listed from client by `id` before storing in the state.

Changelog: Fixed wrong order assumption on server side

Reviewed By: jknoxville

Differential Revision: D21496345

fbshipit-source-id: 5e15f776356b0357ac14fbde6c2a11efd76cd1e1
2020-05-12 04:54:31 -07:00
Chaiwat Ekkaewnumchai
736d681562 Add Detail to Selected Row
Summary:
- Add detail sidebar to data tab. This reuses `renderSidebar` from SQL tab
- `renderTable` function is moved into the component to easier access `renderSidebar`

Reviewed By: mweststrate

Differential Revision: D21406942

fbshipit-source-id: 5c79489a80931b1133c0a28ca5897a27ba9dd6b8
2020-05-07 06:15:51 -07:00
Chaiwat Ekkaewnumchai
7d2101c68f Convert Database Plugin to TypeScript
Summary:
Mainly convert `js` to `tsx`
Additional change:
- Try not to directly change object value in reduce function
- Add emotion styled when there is error using style prop directly

Reviewed By: nikoant

Differential Revision: D21406943

fbshipit-source-id: 30312fa0b0d2d70fa52c5ff9db747e1a83beb270
2020-05-06 07:35:02 -07:00