Commit Graph

1291 Commits

Author SHA1 Message Date
Michel Weststrate
3b1429b8b0 Add global error bubble
Summary: Improved the display of error messages. Where previously only one error message could be displayed (quite obtrusively), with this change multiple errors can now be displayed and stack traces and further info can be hidden.

Reviewed By: passy

Differential Revision: D18036569

fbshipit-source-id: 2bc3dfa7a5196f931370a6e6dbf27c55b6cfb2bf
2019-10-22 08:48:16 -07:00
John Knox
d350e1b339 Fix for plugin failures showing up as platform failures
Summary: This got broken during TS migration. Plugin failures were being logged as platform failures, and showing up in the wrong graphs.

Reviewed By: passy

Differential Revision: D18059046

fbshipit-source-id: 8209a0e852f62e221bf64cb5091115e3cac09fd9
2019-10-22 08:45:38 -07:00
Pascal Hartig
a77064ad84 Hook up prefetcher settings
Summary: This makes use of the previously set up new settings. The logic is a tiny bit difficult to follow so I wanted to make sure it's not lost in the noise of the previous diff.

Reviewed By: jknoxville

Differential Revision: D18036538

fbshipit-source-id: db3bbce4361862cee479aed70578a4bcbde2c46d
2019-10-22 08:09:43 -07:00
Pascal Hartig
82a253cf28 Add launcher prefetch setting
Summary: Allows users to override the GK status of prefetching. It is implemented as a Tri-State. "Unset" means that the local Flipper config won't take precedent over the GK setting and will leave it unchanged. If a user interacts with the setting, it gets persisted into the config and will from then-on override the GK, meaning that the user has an opt-in mechanism and if we open the GK to more people, they effectively have an opt-out.

Reviewed By: jknoxville

Differential Revision: D18008259

fbshipit-source-id: bdfde9a8b9acf43aa60c84800a7979a29a4e9364
2019-10-22 08:09:43 -07:00
John Knox
836a065e59 Fix settings sheet tests
Summary:
The config fields do some async validity checking and possibly update their own state after render. So their renders need to be wrapped in `act()` so that it includes their updates too.

This fixes those tests, and also adds mocking for valid and invalid file paths.

Reviewed By: passy

Differential Revision: D18036449

fbshipit-source-id: 7eec2992313c77e539da0c375966c7c65c30732d
2019-10-22 07:37:18 -07:00
John Knox
c63f145ffb Add restartFlipper utility
Summary:
Centralizes the restart logic.
And adds ability for it to work in dev mode as well.

Reviewed By: passy

Differential Revision: D18008197

fbshipit-source-id: b76ac7935d5859dfdbb8cf593462f8ac02348181
2019-10-22 04:21:51 -07:00
greenkeeper[bot]
a3f2a339b5 Update uglify-js in group plugins to the latest version � (#594)
Summary:
## The devDependency [uglify-js](https://github.com/mishoo/UglifyJS2) was updated from `3.6.2` to `3.6.3`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

 ---

**Publisher:** [alexlamsl](https://www.npmjs.com/~alexlamsl)
**License:** BSD-2-Clause

<details>
<summary>Release Notes for v3.6.3</summary>

<p> </p>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 18 commits.</p>
<ul>
<li><a href="6b4886c908"><code>6b4886c</code></a> <code>v3.6.3</code></li>
<li><a href="0201cb4b52"><code>0201cb4</code></a> <code>fix corner case in <code>unused</code> (#3499)</code></li>
<li><a href="cd072317d0"><code>cd07231</code></a> <code>fix corner case in <code>unused</code> (#3496)</code></li>
<li><a href="0785a15ace"><code>0785a15</code></a> <code>fix corner case in <code>dead_code</code> &amp; <code>ie8</code> (#3494)</code></li>
<li><a href="b1279a46d9"><code>b1279a4</code></a> <code>fix corner case in <code>sequences</code> (#3491)</code></li>
<li><a href="b571619d31"><code>b571619</code></a> <code>handle <code>throw</code> of non-<code>Error</code>s gracefully (#3492)</code></li>
<li><a href="7b5350b459"><code>7b5350b</code></a> <code>tweak Travis CI execution environment (#3489)</code></li>
<li><a href="1549db70e6"><code>1549db7</code></a> <code>fix corner case in <code>ie8</code> (#3487)</code></li>
<li><a href="8ff9a3c8fb"><code>8ff9a3c</code></a> <code>fix corner cases in <code>ie8</code> (#3485)</code></li>
<li><a href="91cae51d8f"><code>91cae51</code></a> <code>fix corner case in <code>evaluate</code> &amp; <code>ie8</code> (#3483)</code></li>
<li><a href="8af2f5fbcf"><code>8af2f5f</code></a> <code>fix corner case in <code>rename</code> (#3481)</code></li>
<li><a href="86a8016323"><code>86a8016</code></a> <code>fix corner case in <code>ie8</code> &amp; <code>mangle</code> (#3479)</code></li>
<li><a href="009dcdae01"><code>009dcda</code></a> <code>avoid mangling of <code>MutationObserver</code> properties (#3477)</code></li>
<li><a href="f86f615d83"><code>f86f615</code></a> <code>fix corner case in <code>ie8</code> &amp; <code>mangle</code> (#3476)</code></li>
<li><a href="d3d1d11926"><code>d3d1d11</code></a> <code>fix corner case in <code>ie8</code> &amp; <code>rename</code> (#3474)</code></li>
</ul>
<p>There are 18 commits in total.</p>
<p>See the <a href="c3ca293e6b...6b4886c908">full diff</a></p>
</details>

 ---

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

 ---

Your [Greenkeeper](https://greenkeeper.io) bot 🌴
Pull Request resolved: https://github.com/facebook/flipper/pull/594

Reviewed By: jknoxville

Differential Revision: D18035631

Pulled By: passy

fbshipit-source-id: 0de12654bd434ccf29e67907febeb1aca85558c9
2019-10-21 07:13:17 -07:00
Pascal Hartig
e0b0b30376 Move snapshot test into fb/ folder
Summary:
Planning to add some FB-only modules to it and is the easiest
way to prevent it from breaking in OSS.

Following commit is also already quite large and this makes it a little more manageable.

Reviewed By: priteshrnandgaonkar

Differential Revision: D18009280

fbshipit-source-id: 73f2488c352547b3e489272960efa4d6e017f294
2019-10-21 06:37:45 -07:00
Alexander Putilin
aa721c958a Expose KaiOSDevice
Reviewed By: jknoxville

Differential Revision: D18012875

fbshipit-source-id: 0c91b046f78cfd9f9d633f1a0fa648e8aa40b7dc
2019-10-21 06:31:11 -07:00
John Knox
fdee0ef7b7 Use jest to mock electron in tests
Summary:
Replacing our custom electron-stubs transform with a mocked module.

This will now be the default impl for tests, and we can override it by mocking as needed.

Reviewed By: passy

Differential Revision: D17979659

fbshipit-source-id: a26994158d439fa7dc1ca38225294106fc4e1559
2019-10-18 10:09:02 -07:00
Pritesh Nandgaonkar
65ff3f8ec9 Show support form option for deeplink users
Summary: This diff shows the support form option for the deeplink users too even if they are not part of GK. As I discovered a bug where the user opened the Flipper app thru deeplink and then the screen showed temporarily till the device connected and then the default plugin was displayed. In this case there is no way to navigate back to the form.

Reviewed By: jknoxville

Differential Revision: D17978648

fbshipit-source-id: 23ae3660e499a959733753b49cc987f2e381bf6b
2019-10-18 07:32:33 -07:00
John Knox
781344f7de Fix jest mocking in tests (#592)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/592

Finally we can join the 21st century and use `jest.mock` in tests!

I'm enabling the ts-jest transform to `*/__tests__/*.tsx` files. This takes care of transforming the typescript, and preserves jest mock capabilities.
I have left the existing custom transform on all other files, so they will continue to work as usual.

Caveats:
* Our existing custom transforms will no longer be applied in tests.
  * With our current suite this makes no difference. But bear in mind things like importing directly from 'flipper' instead of the actual files, won't work. However, I don't see this being a problem, as I think they'll only be needed inside the actual product code.

Reviewed By: passy

Differential Revision: D17978753

fbshipit-source-id: df7b312b5dd5592e4aa4f8df605f5952ea3158e9
2019-10-18 07:17:40 -07:00
greenkeeper[bot]
78b093118d Update dependencies to enable Greenkeeper � (#591)
Summary:
Let’s get started with automated dependency management for flipper 💪

🔒 Greenkeeper has found a `yarn.lock` file in this repository. Greenkeeper supports lockfile updates for public packages. If you use private packages in your repository, please use [greenkeeper-lockfile](https://github.com/greenkeeperio/greenkeeper-lockfile) to make sure these can get updated as well.

This pull request **updates all your dependencies to their latest version**. Having them all up to date really is the best starting point for keeping up with new releases. Greenkeeper will look out for further dependency updates and make sure to handle them in isolation and in real-time, but only after **you merge this pull request**.

**Important: Greenkeeper will only start watching this repository’s dependency updates after you merge this initial pull request**.

📦 📦  Greenkeeper has detected multiple `package.json` files. Since this repo already has a `greenkeeper.json` config file with defined groups, Greenkeeper has only checked whether they’re still valid.

 ---
<details>
<summary>🏷 How to check the status of this repository</summary>

Greenkeeper adds a badge to your README which indicates the status of this repository.

This is what your badge looks like right now 👉  ![Greenkeeper badge](https://badges.greenkeeper.io/facebook/flipper.svg)
</details>
<details>
<summary>🙈 How to ignore certain dependencies</summary>

You may have good reasons for not wanting to update to a certain dependency right now. In this case, you can [change the dependency’s version string in the `package.json` file back to whatever you prefer](https://github.com/facebook/flipper/edit/greenkeeper/initial/package.json).

To make sure Greenkeeper doesn’t nag you again on the next update, add a `greenkeeper.ignore` field to your `package.json`, containing a list of dependencies you don’t want to update.

```js
// package.json
{
  …
  "greenkeeper": {
    "ignore": [
      "package-names",
      "you-want-me-to-ignore"
    ]
  }
}
```
</details>
<details>
<summary>👩‍💻 How to update this pull request</summary>

```bash
  # Change into your repository’s directory
  git fetch --all
  git checkout greenkeeper/initial
  npm install-test
  # Adapt your code until everything works again
  git commit -m 'chore: adapt code to updated dependencies'
  git push https://github.com/facebook/flipper.git greenkeeper/initial
```
</details>
<details>
<summary> How do dependency updates work with Greenkeeper?</summary>

After you merge this pull request, **Greenkeeper will create a new branch whenever a  dependency is updated**, with the new version applied. The branch creation should trigger your testing services and check whether your code still works with the new dependency version. Depending on the the results of these tests Greenkeeper will try to open meaningful and helpful pull requests and issues, so your dependencies remain working and up-to-date.

```diff
-  "underscore": "^1.6.0"
+  "underscore": "^1.7.0"
```

The above example shows an in-range update. `1.7.0` is included in the old `^1.6.0` range, because of the [caret `^` character ](https://docs.npmjs.com/misc/semver#ranges).
When the test services report success Greenkeeper will silently delete the branch again, because no action needs to be taken – everything is fine.

However, should the tests fail, Greenkeeper will create an issue to inform you about the problem immediately.

This way, you’ll never be surprised by a dependency breaking your code. As long as everything still works, Greenkeeper will stay out of your way, and as soon as something goes wrong, you’ll be the first to know.

```diff
-  "lodash": "^3.0.0"
+  "lodash": "^4.0.0"
```

In this example, the new version `4.0.0` is _not_ included in the old `^3.0.0` range.
For version updates like these – let’s call them “out of range” updates – you’ll receive a pull request.

This means that **you no longer need to check for new versions manually** – Greenkeeper will keep you up to date automatically.

These pull requests not only serve as reminders to update: If you have solid tests and good coverage, and the pull requests passes those tests, you can very likely just merge it and release a new version of your software straight away :shipit:

To get a better idea of which ranges apply to which releases, check out the extremely useful [semver calculator](https://semver.npmjs.com/) provided by npm.
</details>
<details>
<summary>FAQ and help</summary>

There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

 ---

Good luck with your project and see you soon 

Your [Greenkeeper](https://greenkeeper.io) bot 🌴
Pull Request resolved: https://github.com/facebook/flipper/pull/591

Reviewed By: jknoxville

Differential Revision: D17951583

Pulled By: passy

fbshipit-source-id: 6ad2bfe7d4a9f7ed4920e50af36e194dc5b1cb93
2019-10-16 08:01:03 -07:00
Pascal Hartig
aa1f03a643 Upgrade redux-persist
Summary:
Last one blocking Greenkeeper.

Only change affecting us appears to be where to import from.

Reviewed By: jknoxville

Differential Revision: D17932089

fbshipit-source-id: b913defdabd99721886557d7c92afb8181ca1803
2019-10-16 02:32:31 -07:00
Pritesh Nandgaonkar
5614444380 Track the source of the supportform
Summary: This diff adds the telemetry to track the source of the support form being launched.

Reviewed By: passy

Differential Revision: D17908752

fbshipit-source-id: 275812992884a471844fda40d1f636815a4a2346
2019-10-15 04:13:38 -07:00
Pascal Hartig
b10a67d443 Show potential errors alongside buttons
Summary:
Instead of replacing the buttons, this shows an error next to
them and gives the opportunity to retry.

Reviewed By: jknoxville

Differential Revision: D17907389

fbshipit-source-id: 15b27802671b39c53b32d01f1d2bcf8c67fd2647
2019-10-14 10:08:28 -07:00
Pascal Hartig
4bdccb22fa Enable greenkeeper
Summary:
Close https://github.com/facebook/flipper/pull/580

This enables Greenkeeper with some caveats:

- I disabled a bunch of upgrades we know currently break:
  - React
  - Emotion
  - Electron/Electron-Builder
- The bot isn't CLA-whitelisted yet, so we won't be able to directly import yet.
- It might actually be better to have automatic tasks created for the dependencies above breaking.
- Something changed in the prop types and required `StatusBar` to have its signature changed.

allow-large-files

Reviewed By: jknoxville

Differential Revision: D17906693

fbshipit-source-id: f73fe231518f56a6f6114f761d5e5e5528d0d487
2019-10-14 09:42:56 -07:00
Pritesh Nandgaonkar
de17f3905b Close export dialog autmatically for support form
Summary: This diff adds the support to close the dialog automatically for the support form.

Reviewed By: passy

Differential Revision: D17899862

fbshipit-source-id: 9d9cd14556a4cebe60f8cc1d082be3e439998e9c
2019-10-14 08:07:41 -07:00
John Knox
4a8a4aabb6 Purify Glyph component
Summary: A significant proportion of CPU time when doing a target selection in the layout plugin, was spent rendering Glyphs. They shouldn't really be doing anything expensive in render, but since they already are, this will make sure they don't re-render unnecessarily.

Reviewed By: passy

Differential Revision: D17906723

fbshipit-source-id: ece143f65fd46d8582e21455732049368f301186
2019-10-14 07:49:52 -07:00
Pascal Hartig
874e590b96 Upgrade eslint and prettier
Summary: Not a fan of the long lines, but if that's where prettier is going, let's roll with it.

Reviewed By: jknoxville

Differential Revision: D17905599

fbshipit-source-id: c4232d46d2ec0b7c743f6afd8349106c85f013b9
2019-10-14 05:27:27 -07:00
Andres Suarez
54ebb44dda Tidy up Flipper license headers [2/2]
Reviewed By: passy

Differential Revision: D17863710

fbshipit-source-id: 5b249bdd1c06d3a526b250b035b797d0c8e796eb
2019-10-11 13:46:45 -07:00
Andres Suarez
0675dd924d Tidy up Flipper license headers [1/2]
Reviewed By: passy

Differential Revision: D17863711

fbshipit-source-id: 259dc77826fb803ff1b88c88529d7f679d3b74d8
2019-10-11 13:46:45 -07:00
Pascal Hartig
312fa7ce37 Cache layout icons
Summary: Opened layout, looked at warnings, added icons.

Reviewed By: jknoxville

Differential Revision: D17879910

fbshipit-source-id: 12375173b15c8d2e0b158cae4ded23237ed9c9b6
2019-10-11 10:55:38 -07:00
John Knox
0479309dd1 Don't fail when dir doesn't exist
Summary:
Noticed a bunch of failures [here](https://our.intern.facebook.com/intern/scuba/query/?dataset=flipper_session_event_stats_scuba&drillstate=%7B%22sampleCols%22%3A[%22errors%22%2C%22event%22]%2C%22cols%22%3A[]%2C%22derivedCols%22%3A[%7B%22name%22%3A%22perfect_session%22%2C%22sql%22%3A%22CAST_AS_DOUBLE(no_failures)%22%2C%22type%22%3A%22Numeric%22%7D]%2C%22mappedCols%22%3A[]%2C%22enumCols%22%3A[]%2C%22return_remainder%22%3Afalse%2C%22should_pivot%22%3Afalse%2C%22is_timeseries%22%3Atrue%2C%22hideEmptyColumns%22%3Afalse%2C%22start%22%3A%22-90%20days%22%2C%22samplingRatio%22%3A1%2C%22compare%22%3A%22comparison%22%2C%22axes%22%3A%22linked%22%2C%22bucket%22%3A%221%22%2C%22overlay_types%22%3A[]%2C%22minBucketSamples%22%3A%22%22%2C%22dimensions%22%3A[%22time%22%2C%22event%22]%2C%22scale_type%22%3A%22absolute%22%2C%22num_samples%22%3A%22100%22%2C%22metric%22%3A%22avg%22%2C%22fill_missing_buckets%22%3A%22connect%22%2C%22smoothing_bucket%22%3A%221%22%2C%22top%22%3A20%2C%22markers%22%3A%22%22%2C%22timezone%22%3A%22America%2FLos_Angeles%22%2C%22end%22%3A%22now%22%2C%22time_bucket%22%3A%22604800%22%2C%22compare_mode%22%3A%22normal%22%2C%22aggregateList%22%3A[]%2C%22param_dimensions%22%3A[]%2C%22modifiers%22%3A[]%2C%22order%22%3A%22none%22%2C%22order_desc%22%3Atrue%2C%22filterMode%22%3A%22DEFAULT%22%2C%22constraints%22%3A[[%7B%22column%22%3A%22plugin%22%2C%22op%22%3A%22eq%22%2C%22value%22%3A[%22[%5C%22null%5C%22]%22]%7D%2C%7B%22column%22%3A%22is_headless%22%2C%22op%22%3A%22!substr%22%2C%22value%22%3A[%22[%5C%22true%5C%22]%22]%7D%2C%7B%22column%22%3A%22event%22%2C%22op%22%3A%22substr%22%2C%22value%22%3A[%22[%5C%22getInstalledPlugins%5C%22]%22]%7D]]%2C%22c_constraints%22%3A[[]]%2C%22b_constraints%22%3A[[]]%2C%22metrik_view_params%22%3A%7B%22xaxis_type%22%3A%22auto%22%2C%22should_use_legacy_colors%22%3Afalse%2C%22view%22%3A%22Samples%22%2C%22width%22%3A%222126%22%2C%22height%22%3A%221132%22%2C%22y_max_hint%22%3A%221%22%2C%22yaxis_settings%22%3A[%7B%22yaxis_title%22%3A%22%22%2C%22yaxis_series_name%22%3A%22%22%2C%22yaxis_width%22%3A%220%22%2C%22yaxis_format%22%3A%22%25P%22%7D]%2C%22tooltip_outside%22%3Atrue%2C%22state%22%3A%22published%22%2C%22use_y_axis_hints_as_limits%22%3Atrue%2C%22legend_mode%22%3A%22nongrid%22%2C%22connect_nulls%22%3Atrue%2C%22yaxismin%22%3A0%2C%22title%22%3A%22Operation%20success%20rate%20over%20time%20(human)%22%2C%22tooltip_disabled%22%3Atrue%2C%22timezone_offset%22%3A420%2C%22y_min_hint%22%3A0%2C%22legend_position%22%3A%22none%22%2C%22title_use_v2%22%3Atrue%7D%7D&pool=uber&view=Samples&dashboard_id&tab_id&widget_id&widget_piece_id).

This fixes it.

Reviewed By: passy

Differential Revision: D17877108

fbshipit-source-id: 85586a1ce65033b98d793746c611b44f68e13eff
2019-10-11 06:21:47 -07:00
John Knox
6909a4a315 Add snapshot tests for settings
Summary: Take a snapshot with each field adjusted to prevent accidental changes.

Reviewed By: priteshrnandgaonkar

Differential Revision: D17832181

fbshipit-source-id: 016f99ec032036993a40fea310c6fd9887da6c38
2019-10-10 09:23:47 -07:00
John Knox
ea4c678fac Expose iOS "setting" in settings
Summary:
Adds an iOS "setting" to the settings, but it's automatically set based on xcode-select for minimum required effort.

Helpful text added to tell you how to enable it if it's disabled.

Reviewed By: passy

Differential Revision: D17830940

fbshipit-source-id: 53e1e40c5b96e29b30036259cc774ab14097a1da
2019-10-10 09:23:46 -07:00
John Knox
ea5079ff9c Enable / Disable iOS support depending on xcode-select
Summary:
Queries xcode-select on ios dispatcher startup, to see if it's installed.
If it is, carry on with the ios device tracking, if not, don't bother.

This should stop it from emitting errors trying to track devices when things aren't installed.

I think it should also stop those install prompts from popping up.

Sets it in app state so we can tell the user about it, and maybe gate some other things too.

Reviewed By: passy

Differential Revision: D17830696

fbshipit-source-id: 960d09a9c5267afabf5e5e222379a0a7ed2cc444
2019-10-10 09:23:46 -07:00
John Knox
68881f35fc Use androidEnabled setting in dispatcher
Summary:
Takes the androidEnabled setting and uses it to gate the android dispatcher.
Enables people without android sdk to use flipper (e.g. iOS engineers).

Reviewed By: priteshrnandgaonkar

Differential Revision: D17829810

fbshipit-source-id: 7d25580e65dee93ebfda7c5cc4c4cea03744e2ca
2019-10-10 09:23:46 -07:00
John Knox
16be611792 Add android enable/disable to settings screen
Summary:
The UI could do with a bit more fine tuning, but it's a start.

Fully functional with updating the settings file. But nothing actually uses that setting yet.

Reviewed By: priteshrnandgaonkar

Differential Revision: D17810588

fbshipit-source-id: 791ee60616f3ee73f41813a5a442b08a5e395458
2019-10-10 09:23:45 -07:00
Pritesh Nandgaonkar
e0e0a8f916 Add device argument in the constructor of Client
Summary: Property `device` on Clients for archived device never resolve. As it gets resolved when `addConnection` is called which happens for real non-offline devices. To get around this, I have added an argument to the constructor of the Client, as for offline case we can construct the device before client and can pass it as an argument.

Reviewed By: jknoxville

Differential Revision: D17831261

fbshipit-source-id: a14fb0b65343cccac731077e983026388611d323
2019-10-10 08:22:52 -07:00
Pritesh Nandgaonkar
e31f526618 Send flipper trace as a separate message
Summary:
This diff sends flipper trace as a separate message so that the form can update the state which can be used for validation. If the user doesn't click on "Flipper Trace" then it will show a validation error.

WWW side changes are here D17810526. Merge this diff only when www is landed.

Reviewed By: jknoxville

Differential Revision: D17812023

fbshipit-source-id: 35f17f9e58fc08cde3928072dc66758b1c507bcb
2019-10-10 08:22:52 -07:00
John Knox
7dd6f9a81f ToggleButton: Return component instead of fragment
Summary:
This should be an encapsulated component, not returning the building blocks of one.
So I'm changing the default to return a single component that contains the fragment previously returned.

Now elements appear side by side, are vertically aligned, and onClick works on the label as well, by default. This doesn't break anything in any of the uses inside the flipper code base, because only one used a label (regex search in Searchable.tsx), and these properties are all desirable there.

This could potentially break any plugins that aren't included in the flipper codebase, if they already have a label and don't layout the elements side by side. There are probably no such cases.

Reviewed By: passy

Differential Revision: D17810386

fbshipit-source-id: 588d7ed3243a9f0e5bcad805a3480393c031ff55
2019-10-10 05:21:40 -07:00
Pritesh Nandgaonkar
dfc4f74ed3 Deeplink support
Summary: This diff adds the support to deeplink to the litho form.

Reviewed By: passy

Differential Revision: D17792341

fbshipit-source-id: b146993163b14df000c499236da48b7e8066f457
2019-10-08 12:01:09 -07:00
Pritesh Nandgaonkar
f924b0ae1b Add support manager to display an error screen or litho form
Summary:
This diff shows the error screen when one of the following condition is met:

- Selected device is not android
- No clients are active for selected device
-  At least there is one client which supports inspector plugin.

For this I have added a SupportRequestManager class which loads the error screen or the litho form based on the above condition.

The UI is super basic. Will improve the design based on your feedback in the coming diffs.

Reviewed By: jknoxville

Differential Revision: D17790596

fbshipit-source-id: 2afc917c93c6e7321399633c5bf9d27a703742ee
2019-10-08 12:01:09 -07:00
Pritesh Nandgaonkar
e5ddb5d709 Show support form in all the cases
Summary: Earlier we used to show the support form only when selected device was android. But this won't work because, I am planning to add a deeplink support for the form, so that the user can directly open flipper from workplace. Because of this we will have to show the litho support form always. In case  when the selected device is not android, we will show an error screen with possible solutions to open the litho support form.

Reviewed By: passy

Differential Revision: D17787686

fbshipit-source-id: 13e15041238d8746f947563bb3c2ea3cec205a5e
2019-10-08 12:01:09 -07:00
Pascal Hartig
208752b15e Fix glyph centering
Summary:
Before:

{F216059409}
(info circle!)

After:

{F216059417}

Reviewed By: jknoxville

Differential Revision: D17808879

fbshipit-source-id: 4408ba11919e70958f2d8123f913973d106996a7
2019-10-08 08:45:06 -07:00
Pascal Hartig
04e12a28a0 Refactor PluginInstaller component
Summary:
- Made side-effecting elements injectable via props.
- Added default props so usage doesn't change.
- Added testing-library/react snapshot test that waits for test data to appear in the list.

One slightly annoying part here is that this now that we have an `autoHeight` prop which is only useful for testing it as it prevents a problem with a height-detection in the test runner. We could even change the default as it doesn't affect the display in prod, but this still feels slightly cleaner.

Reviewed By: jknoxville

Differential Revision: D17808510

fbshipit-source-id: 2ae70886c58282d5bdc98ba4215e8248e4c7f159
2019-10-08 08:45:06 -07:00
Pascal Hartig
3730c523ec Add explicit StubLogger option for tests
Summary:
A bit ugly to have test-only code in prod logic,
but we don't need any of the logger logic in tests
and by pulling out the `StubLogger`, we can avoid
loading Electron during tests.

Reviewed By: jknoxville

Differential Revision: D17808479

fbshipit-source-id: d2295d7bbca2f09c3f23389ad9443648757d8d03
2019-10-08 08:45:05 -07:00
John Knox
13ac64e0b9 Sort icons
Summary: You can do this in VSCode by selecting the lines, Cmd-Shift-P, "Sort Lines Ascending".

Reviewed By: passy

Differential Revision: D17710137

fbshipit-source-id: 3cef628b24dd86d4e307bd30761049c30cbc8f68
2019-10-08 06:22:20 -07:00
Pascal Hartig
8f719b17e3 Add instrumentation, fix typo
Summary:
- plugns -> plugins
- Report platform failures from second invocation.

Reviewed By: jknoxville

Differential Revision: D17787179

fbshipit-source-id: 041325f572dd839bd268612269f3774518a409b2
2019-10-08 00:23:29 -07:00
Pascal Hartig
4d1e7dc80f Add comment about error handling
Summary:
Added some notes to T55169042.

Also limited the acceptable result types.

Reviewed By: jknoxville

Differential Revision: D17787130

fbshipit-source-id: 19cefdde5ab195080281e9f2e26f5a236dd59629
2019-10-08 00:23:29 -07:00
Pascal Hartig
ca8df6d680 Remove "no file" error dialog
Summary:
This is a programming error, not something that users
should ever be exposed to. This logs an error instead
and just doesn't show anything.

The big benefit is that the component no longer
needs to deal with `file` potentially being undefined.

Reviewed By: jknoxville

Differential Revision: D17786913

fbshipit-source-id: 32a357381e64cd9237ad4a0112c346d7121634ef
2019-10-08 00:23:28 -07:00
Pascal Hartig
36abf6e38c Add tests for pending dialog
Summary:
The benefits of having things nicely encapsulated.
Not super sophisticated, but better than nothing.

Reviewed By: jknoxville

Differential Revision: D17786832

fbshipit-source-id: 0b321e8a4e56188b0eab86515bd777ed3e3e8cb7
2019-10-08 00:23:28 -07:00
Pascal Hartig
5f5c80bee5 Factor out pending sheet as separate component
Summary: It's copied apart from the status message, so let's centralise it.

Reviewed By: jknoxville

Differential Revision: D17786691

fbshipit-source-id: d5f7a5dccf56b96a58a9c1fc61652d7f9d1786d3
2019-10-08 00:23:27 -07:00
Pascal Hartig
8346cedc77 Rename ShareSheet
Summary:
From the name it's not clear that this is actually a fork off the "Share File"
variant of this. I'm planning to bring the two together as they share most of
the code, but for now this makes it a bit clearer.

Reviewed By: jknoxville

Differential Revision: D17786570

fbshipit-source-id: 8def3301ee4f79741391dc7e0b6a33a5fd7aa2c3
2019-10-08 00:23:27 -07:00
Pascal Hartig
b6df1d1d6d HIG for export share sheet
Summary:
Following https://developer.apple.com/design/human-interface-guidelines/macos/buttons/push-buttons/,
the primary button should be highlighted and the affirmative action be to the right.

Clicked a few times on the wrong one myself.

Reviewed By: priteshrnandgaonkar

Differential Revision: D17762516

fbshipit-source-id: 6be35cfde26ca10142c2c98df30672c0f739c17e
2019-10-08 00:23:27 -07:00
Pascal Hartig
f110ed2db7 Show export numbers
Summary:
As discussed on an earlier diff, the percentage alone
is a confusing indicator as the number of items to be
serialised can grow over time, causing the percentage
to go down.

This shows the raw numbers in addition to the percentage.

Reviewed By: priteshrnandgaonkar

Differential Revision: D17762477

fbshipit-source-id: 8911b520b2ea74542bc64e6a6662bed7d4f81860
2019-10-08 00:23:27 -07:00
Pascal Hartig
1a56371f3f HIG for cancelation buttons
Summary:
- Make sure it's "cancel" in all cases.
- Move cancel buttons to the left.
- Rename the callback to clarify purpose.

Reviewed By: jknoxville

Differential Revision: D17762466

fbshipit-source-id: 0f6a9d83ff0cab139f926fb5a512be4618471ee8
2019-10-08 00:23:26 -07:00
Pascal Hartig
a41625e176 Refactor ShareSheetExportFile
Summary:
Wanted to make a small change and found it a bit difficult to
follow, so I tried to make it a bit more TypeScript-y.

Logic should be unchanged.

Reviewed By: priteshrnandgaonkar

Differential Revision: D17762346

fbshipit-source-id: d0d8b2e25b532b7b10079907d6da86bdd878a75c
2019-10-08 00:23:26 -07:00
Pritesh Nandgaonkar
7f2f2febcf Make MobileConfig plugin exportable
Summary: As per title, this diff makes the Mobile config plugin exportable. This involves moving the important property from `State` to `PersistedState`. Also had to implement the `exportPersistedState` function to fetch the experiments information for the Universes, configs and gatekeeper information.

Reviewed By: danielbuechele

Differential Revision: D17633986

fbshipit-source-id: 604225ba47112620bee0a6c704416b3ac350de9c
2019-10-07 09:57:31 -07:00