Commit Graph

58 Commits

Author SHA1 Message Date
Michel Weststrate
60cfcb54a1 Wrap plugin calls into isConnected guards
Summary:
Previously, plugins could relatively safely use `client.call` at any moment in time to fetch some information from / to the client. Except for some raise conditions there was generally speaking a connection available.

With this stack it becomes possible to interact with plugins even after an app (unexpectedly) disconnected, which makes Flipper a lot more versatile, especially when it comes to inspect crashes post mortem. (For more explanation see the second diff in this stack)

However, this means that it is no longer safe to assume there is always a connection available. For that reason `client.isConnected` has been introduced to safeguard against that.

This diff introduces guards on all user interactions that are not super explicitly triggered by the user to avoid a lot of errors being generated. This is mostly in `init()` blocks and implicit user events like selecting or hovering rows.

Explicit user interactions like pressing buttons are not guarded by this diff, as ideally failure to communicate with the client should be communicated back to the user more explicitly rather than failing silently. The next diff will introduce a fallback mechanism where a popup is shown in case those calls aren't guarded.

Fixed a few key warnings while at it.

Reviewed By: nikoant

Differential Revision: D26275604

fbshipit-source-id: 5630066cdd9541e448a6dd1f8a21861b5d751ced
2021-02-09 04:16:26 -08:00
dependabot[bot]
a9ad3d2f1b Bump @testing-library/react from 11.1.0 to 11.2.3 in /desktop (#1868)
Summary:
Bumps [testing-library/react](https://github.com/testing-library/react-testing-library) from 11.1.0 to 11.2.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/testing-library/react-testing-library/releases"><code>testing-library/react's releases</code></a>.</em></p>
<blockquote>
<h2>v11.2.3</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.2.2...v11.2.3">11.2.3</a> (2021-01-07)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Return type of unmount is <code>void</code> (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/857">https://github.com/facebook/flipper/issues/857</a>) (<a href="1389f09474">1389f09</a>)</li>
</ul>
<h2>v11.2.2</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.2.1...v11.2.2">11.2.2</a> (2020-11-20)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>dependencies:</strong> bump dom testing library (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/836">https://github.com/facebook/flipper/issues/836</a>) (<a href="7fcb0f2e93">7fcb0f2</a>)</li>
</ul>
<h2>v11.2.1</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.2.0...v11.2.1">11.2.1</a> (2020-11-19)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>types:</strong> Allow all HTML and SVG elements in render. (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/833">https://github.com/facebook/flipper/issues/833</a>) (<a href="1dc33b23be">1dc33b2</a>)</li>
</ul>
<h2>v11.2.0</h2>
<h1><a href="https://github.com/testing-library/react-testing-library/compare/v11.1.2...v11.2.0">11.2.0</a> (2020-11-18)</h1>
<h3>Features</h3>
<ul>
<li>bump dom testing library (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/831">https://github.com/facebook/flipper/issues/831</a>) (<a href="456424ff33">456424f</a>)</li>
</ul>
<h2>v11.1.2</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.1.1...v11.1.2">11.1.2</a> (2020-11-11)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>import pretty-format from testing-library/dom (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/821">https://github.com/facebook/flipper/issues/821</a>) (<a href="2712dc2da4">2712dc2</a>)</li>
</ul>
<h2>v11.1.1</h2>
<h2><a href="https://github.com/testing-library/react-testing-library/compare/v11.1.0...v11.1.1">11.1.1</a> (2020-11-03)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>upgrade dependencies, typescript, testing-library/dom etc (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/816">https://github.com/facebook/flipper/issues/816</a>) (<a href="e07e6416f2">e07e641</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="deafd51bc2"><code>deafd51</code></a> docs: add sanchit121 as a contributor (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/858">https://github.com/facebook/flipper/issues/858</a>)</li>
<li><a href="1389f09474"><code>1389f09</code></a> fix: Return type of unmount is <code>void</code> (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/857">https://github.com/facebook/flipper/issues/857</a>)</li>
<li><a href="64a8b9c2f3"><code>64a8b9c</code></a> chore: update all deps (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/842">https://github.com/facebook/flipper/issues/842</a>)</li>
<li><a href="03bea9fd76"><code>03bea9f</code></a> chore: Add 'Cancel Previous Runs' step (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/840">https://github.com/facebook/flipper/issues/840</a>)</li>
<li><a href="7fcb0f2e93"><code>7fcb0f2</code></a> fix(dependencies): bump dom testing library (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/836">https://github.com/facebook/flipper/issues/836</a>)</li>
<li><a href="276673ff00"><code>276673f</code></a> chore(types): add test for rendering SVG elements (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/834">https://github.com/facebook/flipper/issues/834</a>)</li>
<li><a href="1dc33b23be"><code>1dc33b2</code></a> fix(types): Allow all HTML and SVG elements in render. (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/833">https://github.com/facebook/flipper/issues/833</a>)</li>
<li><a href="456424ff33"><code>456424f</code></a> feat: bump dom testing library (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/831">https://github.com/facebook/flipper/issues/831</a>)</li>
<li><a href="236ea4962d"><code>236ea49</code></a> chore: remove one temporary fix with a better permenant one</li>
<li><a href="96b9aebe96"><code>96b9aeb</code></a> chore: Update validate.yml (<a href="https://github-redirect.dependabot.com/testing-library/react-testing-library/issues/827">https://github.com/facebook/flipper/issues/827</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/testing-library/react-testing-library/compare/v11.1.0...v11.2.3">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@testing-library/react&package-manager=npm_and_yarn&previous-version=11.1.0&new-version=11.2.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/1868

Reviewed By: mweststrate

Differential Revision: D26149524

Pulled By: passy

fbshipit-source-id: 6cc8159ffdf8e13b7851042e7c25ff058f5c88cb
2021-02-01 09:02:11 -08:00
Anton Nikolaev
dbc888613b Do not bump every package version for every release
Summary:
This diff sets all package version to "0.0.0" except of the root package and changes the bump script to only bump version in the root package. This should reduce possibility of conflicts on release diffs. Anyway we always use the same version for all of our packages, so we can only set it to the root.

Before npm publishing we will set all package versions to the same number as in the root package (we actually already do that) so there will be no differences except we won't need to bump version in  more than 100 packages each release.

Reviewed By: mweststrate

Differential Revision: D25162373

fbshipit-source-id: 02fe401bee72845339c67925c130027bdaee559d
2020-12-02 02:38:47 -08:00
generatedunixname89002005306973
3a733a10df Flipper Release: v0.67.0
Summary: Releasing version 0.67.0

Reviewed By: passy

Differential Revision: D25217536

fbshipit-source-id: 489cba736a847ea9f864b594646014a6d7279161
2020-11-30 10:13:36 -08:00
generatedunixname89002005306973
ad8e8fbb24 Flipper Release: v0.66.0
Summary: Releasing version 0.66.0

Reviewed By: nikoant

Differential Revision: D25052024

fbshipit-source-id: 5ef39431905ca3bc2c4870bff2f8ae917ed1e81e
2020-11-18 03:13:31 -08:00
generatedunixname89002005306973
f04c7a1768 Flipper Release: v0.65.0
Summary: Releasing version 0.65.0

Reviewed By: nikoant

Differential Revision: D24884910

fbshipit-source-id: 6aa59c57c9d372046d71048513db322c03c72b57
2020-11-11 08:17:41 -08:00
Michel Weststrate
670be012b2 Kill Flow support
Summary:
* Removed Flow compilation step
* Removed all `flow` annotations
* Removed all FlowFixMe's
* Removed flow typings for Flipper
* Left flow transpilation (stripping) in babel, in case there is any external user using Flow in his plugin
* Left `eslint-plugin-flowtype` dependencies, as `eslint-config-fbjs` requires it

Reviewed By: passy

Differential Revision: D24755545

fbshipit-source-id: 9c0a7910657fd1cba88294e041bf2bfdf7b565bf
2020-11-09 08:24:28 -08:00
generatedunixname89002005306973
a3bcf6b043 Flipper Release: v0.64.0
Summary: Releasing version 0.64.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D24590607

fbshipit-source-id: 04671a31028a33cf020acd8b83c219608fe38319
2020-10-28 06:06:33 -07:00
Pascal Hartig
f36c3656b5 Upgrade to React 17
Summary:
Doing some oncall upgrades.

Changelog: Upgrade internal React version to v17

Reviewed By: mweststrate

Differential Revision: D24506315

fbshipit-source-id: 911e4f657684b4d98ec3ef91bc8a81c43130da5b
2020-10-27 05:56:34 -07:00
Michel Weststrate
966d748ace Some fixes in rendering legacy plugins
Summary:
Some exploratory testing on all iOS and Android plugins, to see how they behave inside Sandy, and fixed some layout glitches (some were also present without Sandy)

General fixes:
* Introduced some niceties like searchbox resizing properly, and toolbars wrapping automatically in Sandy, rather than buttons becoming invisible
* Containers don't grow anymore by default, but take size of contents
* ScrollContainer child is now a Layout.Vertical. Layout.Vertical should be used as default container everywhere (e.g. Tabs, Panels) in the future
* Fixed layout issue if a split container had only 1 visible child
* DetailsSidebar now scrolls vertically by default
* Details sidebar would sometimes render content in-place rather than in the reserved area
* AppSelector dropdown and Plugin list will now properly ellipse (...) if there is not enough space

Plugin fixes:
* Long database / table names in Database plugin would break layout

Also fixes https://github.com/facebook/flipper/issues/1611

Reviewed By: passy

Differential Revision: D24454188

fbshipit-source-id: c60c867270900a1d4f28587d47067c6ec1072ede
2020-10-22 09:41:11 -07:00
generatedunixname89002005306973
0f23f409ab Flipper Release: v0.63.0
Summary: Releasing version 0.63.0

Reviewed By: nikoant

Differential Revision: D24423408

fbshipit-source-id: 0bc12c49d8bf77d8dbf9688adb07dc176b210548
2020-10-20 11:13:12 -07:00
generatedunixname89002005306973
ca271dd7c3 Flipper Release: v0.62.0
Summary: Releasing version 0.62.0

Reviewed By: nikoant

Differential Revision: D24248944

fbshipit-source-id: 05742031294f6a77c78c0bdccbdffe7d82427f05
2020-10-12 06:03:03 -07:00
Michel Weststrate
3ba8bbf03c Bump dependencies (attempt 2)
Summary: In D24138822 I basically bumped all desktop deps. That was a bit too much as it affected our build infra and broke it. The problem wasn't easy to bisect so choose a smaller set of deps instead to update; everything transpile & lint related + a few well tested runtime deps.

Reviewed By: cekkaewnumchai

Differential Revision: D24161841

fbshipit-source-id: 67162efeccd05a344b229ce976102cfafe6d1099
2020-10-08 01:49:10 -07:00
generatedunixname89002005306973
ad929b23d0 Flipper Release: v0.61.0
Summary: Releasing version 0.61.0

Reviewed By: mweststrate

Differential Revision: D24132584

fbshipit-source-id: 7ae6ad5144561d356effe8eda5eaf472445365e6
2020-10-06 03:43:56 -07:00
generatedunixname89002005306973
8054f6446f Flipper Release: v0.60.0
Summary: Releasing version 0.60.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D24017297

fbshipit-source-id: ff193e95edc7d236c204bddf83aba56a7f009469
2020-09-30 09:28:54 -07:00
generatedunixname89002005306973
c0e8cef466 Flipper Release: v0.59.0
Summary: Releasing version 0.59.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D23985341

fbshipit-source-id: a477f9c05f7a62db3a59758c8c5fe06651ffa6f2
2020-09-29 08:11:39 -07:00
generatedunixname89002005306973
32315c2d97 Flipper Release: v0.58.0
Summary: Releasing version 0.58.0

Reviewed By: cekkaewnumchai

Differential Revision: D23872448

fbshipit-source-id: b74483db292311719a0231f9b2fed78122e9f339
2020-09-23 12:06:38 -07:00
generatedunixname89002005306973
2fcab458bf Flipper Release: v0.57.0
Summary: Releasing version 0.57.0

Reviewed By: passy

Differential Revision: D23729543

fbshipit-source-id: 0156c0214b3665815ca648e995b78bb7cb2eba42
2020-09-16 04:27:08 -07:00
generatedunixname89002005306973
a47ac961f7 Flipper Release: v0.56.0
Summary: Releasing version 0.56.0

Reviewed By: jknoxville

Differential Revision: D23597790

fbshipit-source-id: e0f141eebe81e46619c71c8174fb78b1aaf2c035
2020-09-09 06:46:54 -07:00
root@sandcastle1585.atn1.facebook.com
66692dd722 Flipper Release: v0.55.0
Summary: Releasing version 0.55.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D23444759

fbshipit-source-id: b569ff8e8dce76028e323f906e7415689ae8b1c5
2020-09-01 03:54:11 -07:00
Michel Weststrate
8d4ff8d48e 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
2020-08-25 08:49:24 -07:00
root@sandcastle962.atn2.facebook.com
36825675d1 Flipper Release: v0.54.0
Summary: Releasing version 0.54.0

Reviewed By: mweststrate

Differential Revision: D23314243

fbshipit-source-id: ce2561b356f082613f656fedac9c08b440845bb1
2020-08-25 08:25:04 -07:00
Michel Weststrate
0b528f19ce Escape table names and keys
Summary:
https://github.com/facebook/flipper/issues/1426

Changelog: [Databases] Fixed escaping of column names, see #1426

Reviewed By: jknoxville

Differential Revision: D23293248

fbshipit-source-id: 6acbb87727524ba2bdc7973cad8c124a3ee026e6
2020-08-24 08:08:25 -07:00
root@sandcastle1328.prn2.facebook.com
f1c3bf8697 Flipper Release: v0.53.0
Summary: Releasing version 0.53.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D23213490

fbshipit-source-id: 66dfa59dbae33d372bad9e284f9773e2ab88487b
2020-08-19 08:22:00 -07:00
Anton Nikolaev
4a1c2a9ece Custom eslint rule for disallowing cross-package references
Summary:
Added infra for writing and using custom eslint rules and created a rule for disallowing cross-package file imports. Such imports are anti-pattern and they also break standalone plugin bundling.

We still have a bunch of places where Flipper core references code directly from plugins. I've ignored these places for now and added task T71355623 to revisit them.

Reviewed By: passy

Differential Revision: D22998955

fbshipit-source-id: d04cff8fc115ba1300a7e6830306ec134046e927
2020-08-07 10:22:04 -07:00
generatedunixname89002005306973
d15ae99601 Flipper Release: v0.52.1
Summary: Releasing version 0.52.1

Reviewed By: passy

Differential Revision: D22976342

fbshipit-source-id: a4857df03cd1142615754a52f69d0f1578175f18
2020-08-06 10:14:30 -07:00
generatedunixname89002005306973
f01b84be27 Flipper Release: v0.52.0
Summary: Releasing version 0.52.0

Reviewed By: passy

Differential Revision: D22921075

fbshipit-source-id: 4cab9552dcd5ff1a64d20e1e771a4f5173d54860
2020-08-04 06:15:23 -07:00
generatedunixname89002005306973
5dc98bab9d Flipper Release: v0.51.0
Summary: Releasing version 0.51.0

Reviewed By: nikoant

Differential Revision: D22728768

fbshipit-source-id: 49eabdccc7fd335401618f91b890e94fda11b23f
2020-07-24 10:03:20 -07:00
Pascal Hartig
9d57a667ef Bump @types/testing-library__react from 10.0.0 to 10.2.0 in /desktop (#1366)
Summary:
Created a few breakages. Would appreciate some closer eyes on this.

Pull Request resolved: https://github.com/facebook/flipper/pull/1366

Reviewed By: mweststrate

Differential Revision: D22501454

fbshipit-source-id: 9b882a12aecc65da85f29101bf87bf27519a7d2a
2020-07-14 06:19:16 -07:00
generatedunixname89002005306973
fff723d5ef Flipper Release: v0.50.0
Summary: Releasing version 0.50.0

Reviewed By: passy

Differential Revision: D22501533

fbshipit-source-id: 0896efd4eb2b2bb5f557d573526db91dc5dcd1de
2020-07-13 04:15:23 -07:00
generatedunixname89002005306973
8000090eac Flipper Release: v0.49.0
Summary: Releasing version 0.49.0

Reviewed By: cekkaewnumchai

Differential Revision: D22307632

fbshipit-source-id: 105fc71f07a4827a5d6e54cf3200b22f800a5f1e
2020-06-30 06:33:04 -07:00
Pascal Hartig
011952d73c Flipper Release: v0.48.0
Summary: Releasing version 0.48.0

Reviewed By: mweststrate

Differential Revision: D22207960

fbshipit-source-id: 7f21ff151c4e5750646a6dd3e39690229a2e73a5
2020-06-25 02:32:47 -07:00
Anton Nikolaev
4219df6a93 Remove prepack script from each plugin
Summary: Removed back "prepack" script from every plugin package to keep it simple. Instead we will use `build-plugin` command defined in the root package.json (see next diff in the stack).

Reviewed By: mweststrate

Differential Revision: D22160252

fbshipit-source-id: cffb5df65b89df3fe390c051da0df797b3d16d2d
2020-06-22 08:15:56 -07:00
generatedunixname89002005306973
43b9426ff4 Flipper Release: v0.47.0
Summary: Releasing version 0.47.0

Reviewed By: jknoxville

Differential Revision: D22089288

fbshipit-source-id: 0107d1f17cce8c9adc2b9c26d48a6d80797749be
2020-06-17 09:00:07 -07:00
Anton Nikolaev
f5a8e929c0 Bump plugin versions to match Flipper version (#1267)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/1267

Bumped versions of all plugins to match current Flipper version 0.46.0.

Reviewed By: mweststrate

Differential Revision: D22042959

fbshipit-source-id: 37c169bfd1b90debb8f94c9465a345a015524158
2020-06-15 09:28:23 -07:00
Anton Nikolaev
8003e7eb34 Migrate all plugins to spec v2
Summary: All the plugins migrated to spec v2 to allow packaging/publishing them independently from Flipper releases.

Reviewed By: passy

Differential Revision: D22041384

fbshipit-source-id: 23bfaf724f771a57bd628b9ea1c4d37846534a93
2020-06-15 07:29:34 -07:00
Chaiwat Ekkaewnumchai
525d0e9925 Add Test Case for Single Quote and Fix Logic
Summary: Single quotes need to be double to be correctly recognized in queries. #thanks mweststrate for reminding me

Reviewed By: mweststrate

Differential Revision: D21908315

fbshipit-source-id: 6c13f9ddb527d1144cc3df90ba48bdb5f2ed4952
2020-06-08 09:00:04 -07:00
Chaiwat Ekkaewnumchai
a50c373631 Calculate Editable when Used
Summary:
In D21788243, John suggested the field should be calculated when needed not precomputed. This diff does so by moving calculation logic to the component and removing the field

This also fixes the crashing bug when switching to Structure tab, changing table, and switching back to Data tab.

Reviewed By: mweststrate

Differential Revision: D21906983

fbshipit-source-id: 5a9522a5ba3f504108282fb27deae25b5eadc693
2020-06-08 09:00:03 -07:00
Chaiwat Ekkaewnumchai
53cccdc199 Unit Test of DatabaseDetailSidebar
Summary:
per title.

Also, remove `console.log`

Reviewed By: mweststrate

Differential Revision: D21829809

fbshipit-source-id: cfad4ff50e816153d7370f63052d4dc450464fd5
2020-06-02 08:19:43 -07:00
Chaiwat Ekkaewnumchai
230b9528cf Unit Test for UpdateQueryUtil
Summary:
per title

Also, edit file to match tests

Reviewed By: mweststrate

Differential Revision: D21819748

fbshipit-source-id: b697ae9915c53162624ba90fc867676c9ca8733b
2020-06-02 08:19:42 -07:00
Chaiwat Ekkaewnumchai
54bf6440de Allow to Edit only When There Is Primary Key in Table
Summary: To be able to edit correct cell, identifiers are needed. Assume that the primary key is unique, this should be safe to allow the query to find exactly one row to edit

Reviewed By: jknoxville

Differential Revision: D21788239

fbshipit-source-id: b09d1b6da1b46cbc961f08010467e973546acbef
2020-06-02 01:47:06 -07:00
Chaiwat Ekkaewnumchai
b57612a116 Allow to Edit Cell in Detail Sidebar
Summary: This diff adds edit button to detail sidebar to allow user to edit column he/she wants to

Reviewed By: jknoxville

Differential Revision: D21788243

fbshipit-source-id: 4bdcef62114d5a6282ba85bc2bd1b5d039322e50
2020-06-02 01:47:06 -07:00
Chaiwat Ekkaewnumchai
5a2221e6cd Add Logic to Edit And Update Database on Both Client And Server
Summary:
This logic relies on the logic on client side, specifically `SqliteDatabaseDriver.java` in specifying some keys to retrieve useful data in `currentStructure`. This will be error-prone if developer writes their own data driver which doesn't follow the same naming as the data driver used as model.
Also, this diff adds util file to deal with query for updating database on client side.

I decided to construct query clause on server side so that the client side change is not needed.

Reviewed By: jknoxville

Differential Revision: D21788241

fbshipit-source-id: cf9a920c3e5b7b29f619bc3f00e68616b3445cab
2020-06-02 01:47:06 -07:00
Chaiwat Ekkaewnumchai
fe17ddce1a Change UpdatePage Reducer
Summary: The different is small after the change from storing pre-rendered data to raw data. Hence, the diff changes it to match `currentPage` to ease the assignment (used in next diffs)

Reviewed By: jknoxville

Differential Revision: D21788245

fbshipit-source-id: 87bdbce33f0615bf31878797a74fce5d5969db7b
2020-06-02 01:47:05 -07:00
Chaiwat Ekkaewnumchai
d6b617a952 Change Execute Action Parameter
Summary: `'Execute'` action was previously used only for execute tab which assumed the input will come from the state. This changes so that it can take any input attached to parameters (more explanation about the design in <insert diff number>)

Reviewed By: jknoxville

Differential Revision: D21788244

fbshipit-source-id: 8fb8ecb8f8df84f4854f70432e7a1fdb531403e9
2020-06-02 01:47:05 -07:00
Chaiwat Ekkaewnumchai
741f3591e6 Get Table Structure Even without Accessing The Page
Summary: This diff helps obtaining metadata for using to edit row

Reviewed By: jknoxville

Differential Revision: D21788246

fbshipit-source-id: bf01eff8866c82f001575d59cc2886b6cdd39dc5
2020-06-02 01:47:04 -07:00
Chaiwat Ekkaewnumchai
046b8ceac6 Refactor Structure Page
Summary:
This refactor has the following changes:
- Change way to store data: raw data instead of rendered data
- Move render function to separated function component file
- Remove repetitive pattern

Reviewed By: jknoxville

Differential Revision: D21739468

fbshipit-source-id: 1f7e7ae902c3b55f3863300aaed26c2adda898ac
2020-05-27 07:14:39 -07:00
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