Fixed several UI issues in Databases plugin

Summary:
This diff improves showing details in the databases plugin in a few ways:

1. if there is large content, it is no longer rendered of screen
1. the section is now scrollable
1. made layout vertical rather than horizontal to have more space vor values
1. show the type of a value
1. better detection of JSON versus non-json values (primitives would be picked up as json, but in contrast binary ascii such as used in instagram wouldn't). This fixes also string to be rendered incorrectly by accidentally parsing them as numbers, such as can be seen in https://fb.workplace.com/groups/flippersupport/permalink/948112715669387/

Changelog: [Databases] Fixed several layout issues when inspecting rows, and added better JSON support and support for larger responses.

Reviewed By: cekkaewnumchai

Differential Revision: D23317689

fbshipit-source-id: 47ab5164e25da003e0d1a4ae7ccb1537b637e572
This commit is contained in:
Michel Weststrate
2020-08-25 08:48:07 -07:00
committed by Facebook GitHub Bot
parent 7f9d4c35a0
commit 8d4ff8d48e
2 changed files with 98 additions and 91 deletions

View File

@@ -134,12 +134,15 @@ test('editing some field after trigger Edit', async () => {
fireEvent.click(res.getByText('Edit'));
// still find all values because it needs to show up
for (const value of values) {
if (value.type === 'blob') {
continue;
}
const searchValue: string =
value.type === 'null' ? 'NULL' : value.value.toString();
expect(res.queryAllByText(searchValue).length).toBeGreaterThan(0);
const searchValue = value.value?.toString();
expect(
(value.type === 'null'
? res.queryAllByPlaceholderText('NULL')
: value.type === 'blob'
? res.queryAllByText(searchValue!)
: res.queryAllByDisplayValue(searchValue!)
).length,
).toBeGreaterThan(0);
}
// expect the last one to contain value of 'db_1_column9_value'