Commit Graph

28 Commits

Author SHA1 Message Date
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
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
Michel Weststrate
f07d898a35 Use fragments instead of arrays when returning elements
Summary: Returning arrays from render kills react-reconciliation and produces missing key warnings. Turned all array rendering methods to use Fragments, where I could find them.

Reviewed By: jknoxville

Differential Revision: D21178253

fbshipit-source-id: 85ddf8adfa79732ccbe68409fdcf150399455983
2020-04-23 03:47:32 -07:00
Anton Nikolaev
bcc133026e Add public plugins to the root package.json as workspaces (#969)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/969

Added all public plugins as workspaces to the root package.json. This means all these plugins will use the single root yarn.lock and installation of their dependencies will be faster. This also means that plugins can declare dependencies to other local packages included into workspaces and they will be symlinked automatically.

Changelog: Internals: plugins added as "yarn workspaces" into the root package.json to simplify dependency management between them

Reviewed By: mweststrate

Differential Revision: D20805231

fbshipit-source-id: e85c62d3195d1ea3c5c60def6ca12318a2b53466
2020-04-14 07:20:38 -07:00
Michael Bolin
37f0260116 Back out "Upgrade Prettier from 1.17 to 2.0.2."
Differential Revision: D20639755

fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
2020-03-24 21:48:09 -07:00
Michael Bolin
8658fca4dd Upgrade Prettier from 1.17 to 2.0.2.
Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html

Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.

Reviewed By: zertosh

Differential Revision: D20636268

fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
2020-03-24 20:24:52 -07:00
Pascal Hartig
fc9ed65762 prettier 2
Summary:
Quick notes:

- This looks worse than it is. It adds mandatory parentheses to single argument lambdas. Lots of outrage on Twitter about it, personally I'm {emoji:1f937_200d_2642} about it.
- Space before function, e.g. `a = function ()` is now enforced. I like this because both were fine before.
- I added `eslint-config-prettier` to the config because otherwise a ton of rules conflict with eslint itself.

Close https://github.com/facebook/flipper/pull/915

Reviewed By: jknoxville

Differential Revision: D20594929

fbshipit-source-id: ca1c65376b90e009550dd6d1f4e0831d32cbff03
2020-03-24 09:38:11 -07:00
Anton Nikolaev
10d990c32c Move plugins to "sonar/desktop/plugins"
Summary:
Plugins moved from "sonar/desktop/src/plugins" to "sonar/desktop/plugins".

Fixed all the paths after moving.

New "desktop" folder structure:
- `src` - Flipper desktop app JS code executing in Electron Renderer (Chrome) process.
- `static` - Flipper desktop app JS code executing in Electron Main (Node.js) process.
- `plugins` - Flipper desktop JS plugins.
- `pkg` - Flipper packaging lib and CLI tool.
- `doctor` - Flipper diagnostics lib and CLI tool.
- `scripts` - Build scripts for Flipper desktop app.
- `headless` - Headless version of Flipper desktop app.
- `headless-tests` - Integration tests running agains Flipper headless version.

Reviewed By: mweststrate

Differential Revision: D20344186

fbshipit-source-id: d020da970b2ea1e001f9061a8782bfeb54e31ba0
2020-03-14 14:35:18 -07:00