Commit Graph

1393 Commits

Author SHA1 Message Date
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
John Knox
44ab23557e Disable settings "Apply" button when no changes have been made
Summary: It's a bit nicer to be able to see if there are any changes made, and save restarting flipper when nothing has changed.

Reviewed By: passy

Differential Revision: D17738036

fbshipit-source-id: 3d7cdc5be1bf948094c3df54439625e5052a9a2f
2019-10-07 08:51:07 -07:00
John Knox
8e5b69164a Grey-out disabled buttons
Summary:
For "primary" and "danger" buttons, you previously couldn't see any difference between disabled and enabled ones.
This fixes that by greying them out when disabled.

Reviewed By: passy

Differential Revision: D17738031

fbshipit-source-id: 82e16b8881f3d404aafae8a7837151090bb6bbee
2019-10-07 08:51:06 -07:00
John Knox
b50aef8f15 Restart after changing settings
Summary:
Gets flipper to restart when settings are updated.

In theory most settings should not need this, but the current only one does (android home) because the path is set at startup only, and this modifies the input to it.
It would be a bit awkward to modify the path more than once, but doable.

Reviewed By: passy

Differential Revision: D17737582

fbshipit-source-id: d4669dcc7acc95469f15783fc6a5ba6794750234
2019-10-07 08:51:06 -07:00
John Knox
729e74f2fc Switch to using settings for android sdk location
Summary: A settings screen has been added where android home can be set. This changes the downstream code to use this value rather than the `env.PATH` variable.

Reviewed By: passy

Differential Revision: D17713288

fbshipit-source-id: 51551652c9c2f468e1117c18785123348e4b4576
2019-10-07 08:51:06 -07:00
John Knox
85c0ec0d13 Persist settings in ${XDG_CONFIG_HOME}/flipper/settings
Summary:
Moves the settings state from electron local storage into a json file in the users configured config location.
Unless modified by the user, this will usually be `~/.config/flipper/settings.json`

Settings will now persist across re-installs, and can now be easily inspected and backed up.

Reviewed By: passy

Differential Revision: D17712687

fbshipit-source-id: 1e778063e41d0a1a86145817b9797bf0458121da
2019-10-07 08:51:05 -07:00
John Knox
7775e82851 Add JsonFileStorage for redux-persist
Summary:
This will be used for the settings file.
It results in normal JSON, as opposed to json where the value of every key is an escaped string.

Reviewed By: passy

Differential Revision: D17712688

fbshipit-source-id: d37ed93707c7352719fa72a05bf51953611f52c0
2019-10-07 08:51:05 -07:00
John Knox
eb64ff0832 Add settings UI
Summary:
Adds a simple UI for editing settings, a reducer and persistance config for the data.
These values aren't yet used for anything.

Reviewed By: passy

Differential Revision: D17684490

fbshipit-source-id: e76ac43ffa17d3606e59f4a1ccb940e8d9fbd9e8
2019-10-07 08:51:05 -07:00
John Knox
8c15547597 Add explicit dismiss button to feedback prompt
Summary:
You can already click the star icon in the title bar to dismiss, but according to feedback this isn't obvious: https://our.intern.facebook.com/intern/itsr?start_date=1561849200&end_date=1570402800&tab=4&all_tools=true

So adding an explicit dismiss button.

Reviewed By: passy

Differential Revision: D17788570

fbshipit-source-id: b0995e5abdaafc5bd6f93edb27dad703c81b8f2b
2019-10-07 08:37:15 -07:00
Pascal Hartig
e074898d46 Basic error handling
Summary:
Adds some very basic error handling. It's not great
because once you hit an error, you're basically stuck
and there's no retry yet, but it's still strictly
an improvement over being stuck with the looping
spinner, so I think it's worth shipping it in this state.

Reviewed By: jknoxville

Differential Revision: D17763467

fbshipit-source-id: b5b7996554dd1dce682fba87f96e3806432a475a
2019-10-07 08:12:10 -07:00
Pritesh Nandgaonkar
d310027d88 Fix toggle switch bug when Flipper's width is small
Summary:
Bug:

{F214979227}

Reviewed By: passy

Differential Revision: D17763781

fbshipit-source-id: 21890caee796ac0df6f39e618a762c44955dd647
2019-10-07 07:43:58 -07:00
Pascal Hartig
ff76b17a5b Add metrics
Summary:
Add some usage and failure rate stats to the PluginInstaller. Small
typo fix and added a helper to the metrics utils to make simple
usage tracking a little more intuitive.

Reviewed By: jknoxville

Differential Revision: D17760511

fbshipit-source-id: 957031d428f3124435925415619b1555a0c2dc2a
2019-10-04 08:26:26 -07:00
Pritesh Nandgaonkar
6e6873a4f6 Pass idler and statusupdate callback as an argument to the export persisted state function
Summary: This diff passes the idler and statusUpdate arguments to the export persisted state, as it is being used in the MobileConfig's export function

Reviewed By: passy

Differential Revision: D17715815

fbshipit-source-id: 98a0f0f5950254de2139c4aaa52cb73401c86c3c
2019-10-04 05:33:44 -07:00
Pascal Hartig
485898f5c7 Set key for SelectPluginSheet row
Summary: Getting a React warning because it previously didn't.

Reviewed By: jknoxville

Differential Revision: D17736486

fbshipit-source-id: 422e023abe0501804d5b447e365ff014969d6286
2019-10-03 09:14:26 -07:00
Pascal Hartig
22f8d26c33 Use explicit cast in plugin.tsx
Summary:
Marginally safer than ignoring the entire line, which
makes type-checking weaker on subsequent references.

Reviewed By: jknoxville

Differential Revision: D17736479

fbshipit-source-id: 13afcb5f08e53016b7a6cdc7ea135e726586a67b
2019-10-03 08:47:26 -07:00
John Knox
957427d740 Fix startup race condition
Summary:
Currently Flipper.init is called as soon as the script loads.
However, if the store takes a bit longer than usual to get rehydrated, then this init call can get called before it has been set.

Fixing it by using a specific event instead of the generic `onload`.

Reviewed By: passy

Differential Revision: D17711399

fbshipit-source-id: fcaf9e5943bfd15359038b8e3722f11d7e06379b
2019-10-03 07:17:49 -07:00
Hilal Alsibai
447e918607 Make copying an element list out its attributes instead of a useless id
Summary: When copying elements from the layout inspector its much more useful to copy all associated attributes rather than just the name and an implementation detail id.

Reviewed By: jknoxville

Differential Revision: D17727520

fbshipit-source-id: 8ac1828059cc10f7f9faf0bdc72eb3d57c881121
2019-10-03 03:40:51 -07:00
Pascal Hartig
1de1bbaf8a Prepare for TypeScript 3.7
Summary:
These are the only four errors currently happening when upgrading to the 3.7 beta.
Luckily, these are all forwards-compatible changes.

Reviewed By: jknoxville

Differential Revision: D17711797

fbshipit-source-id: 429036e90300c81848cc3252b67bb89871ff2e32
2019-10-02 08:35:39 -07:00
Pritesh Nandgaonkar
9bad9ba976 Add status messages for the Support Form
Summary: Shows status messages for the Support Form

Reviewed By: passy

Differential Revision: D17601944

fbshipit-source-id: a2a8ad392dfbaf467625eb809020d687d066da57
2019-10-02 05:48:03 -07:00
Pritesh Nandgaonkar
05328167c6 Add support for status bar
Summary:
This diff adds a status bar, which can be used to show the status messages, for example for Litho Support Form.
The logic for the status bar is as follows:

It maintains the array of the messages. At any point it shows the last pushed message. It will keep showing that message until it is being removed, once removed it will show second last message. The messages will be removed as and when its corresponding task/Promise is fulfilled.

Reviewed By: danielbuechele

Differential Revision: D17551495

fbshipit-source-id: 96b2f401599b9ee8a472607e6a2f027e63b3b807
2019-10-02 05:48:03 -07:00
Pascal Hartig
c6d5b8ccb5 Fix screen recording on Android
Summary:
There were two issues with the previous approach:

1) We didn't block the shell process, so we would immediately
    start pulling the video from the device as soon as we **started**
    recording it. This meant, you'd usually get the previous recording
    or just an empty file.
2) The stop side doesn't know when it's actually safe to start displaying
    the video as pulling takes time. So we need access to the process
    promise there.

Reviewed By: jknoxville

Differential Revision: D17687827

fbshipit-source-id: 6ad5da52442f1888dd491b2a4c7f7a6b5a7885dd
2019-10-01 11:23:30 -07:00
Pascal Hartig
25cdca1d6f Explicit cast instead of ts-ignore
Summary: Slightly safer.

Reviewed By: jknoxville

Differential Revision: D17686947

fbshipit-source-id: 2c478707e20a1475427be4a652283960e4515cf9
2019-10-01 08:48:11 -07:00
John Knox
d6f7d75e83 Remove sheet animation delay
Summary: I noticed every time you open a sheet it feels laggy and unresponsive. This removes the wait time to make it immediate.

Reviewed By: passy

Differential Revision: D17684407

fbshipit-source-id: f918bf8ca3bb0ef68c3fe01991c67d50f3967d68
2019-10-01 03:27:40 -07:00
Pascal Hartig
31f9d865b2 Fix screenshot taking and video recording for Windows
Summary: Turns out Windows really doesn't like colons in filenames. Sigh.

Reviewed By: jknoxville

Differential Revision: D17664236

fbshipit-source-id: 664885308815d862007c8a9a9d1278c426b4e756
2019-09-30 05:24:19 -07:00
Pascal Hartig
0039d5be4a Use 'open' module to open stuff
Summary:
Instead of our ad-hoc mechanism. There's quite a bit
of trickery involved to make this work reliably on Windows
so I'd rather take an off-the-shelf solution than reimplement this
myself.

Reviewed By: jknoxville

Differential Revision: D17628949

fbshipit-source-id: 98806b60a107231d9ee07b721ebb70f2cbd8aec1
2019-09-30 03:49:06 -07:00
Alexander Putilin
dda800c4a3 Initial support for KaiOS device plugins
Summary: Introduces basic KaiOSDevice class. Since kaios phones support adb, it is inherited from AndroidDevice

Reviewed By: jknoxville

Differential Revision: D17608605

fbshipit-source-id: 6b2c5834a1f5862b864c8e76202d0d401e58cbcc
2019-09-27 06:11:18 -07:00
John Knox
1c9fc75457 Add some uncached icons to the preloaded set
Reviewed By: passy

Differential Revision: D17602891

fbshipit-source-id: f06b2de37eec0909dd7098dd0b2ea0f0514c5ab5
2019-09-27 03:36:27 -07:00
John Knox
2bd8548252 Warn when uncached icons are used
Reviewed By: passy

Differential Revision: D17602743

fbshipit-source-id: 8f7dc0cc8d181ad4f7784ed3aafe064d816832c9
2019-09-27 03:36:27 -07:00
John Knox
9d4cc64bc9 Fix outline icon caching
Summary:
The build-release script was using different logic to construct the local url, than the lookup file.
Changed so they both use the same function.
And unit tests added.

Reviewed By: passy

Differential Revision: D17602476

fbshipit-source-id: 6aaedd58eafb2cc59adcdc0ebb4dd329bf99c33a
2019-09-27 03:00:49 -07:00
John Knox
6796a87e76 Enable adbConfig test
Summary:
I noticed this didn't have the node prefix so isn't run during `yarn test`.
Now it runs and passes :)
Also checked `ls **/__tests__/*.js` for any similar files and found none.

Reviewed By: passy

Differential Revision: D17601931

fbshipit-source-id: cf45a0ba578d5d0000ba1d25ae4fb26a4f7fc7af
2019-09-27 02:45:28 -07:00
Daniel Büchele
2c66e3d4d0 install dependencies
Summary:
In the previous implementation plugins were downloaded from npm, but dependencies weren't. This diff uses the `live-plugin-manager` which does mostly what we want. It install a package from NPM with all its dependencies.
live-plugin-manager puts the plugin and its dependencies in the same folder. We expect the plugins to be in `node_modules`. For this reason, we are installing the plugin into `$pluginName/node_modules` and move the plugin after the installation out of the `node_modules` folder.

* Fixed plugin loading path for thirdparty plugins.
* Disabled hot reloading for plugins in the flipper folder to prevent reloads when moving around files and installing dependencies here.
* an empty `.watchmanconfig` is created, because metro requires it
* tsx files are added to the list of supported extensions for metro

Reviewed By: passy

Differential Revision: D17570413

fbshipit-source-id: ecbedc60841b36188fec9c83da41ef1f27e5e155
2019-09-26 07:57:54 -07:00
Pritesh Nandgaonkar
8d4d642330 Attach Flipper Trace in the support form
Summary: This diff sets up Flipper to attach flipper trace to the support form. This diff adds a property named `exportResult` in the redux store. This will hold the export url or the path of the export, depending on the type of the flipper export. Once the exportResult is populated, we listen for this change and update the button style and fill the comment box.

Reviewed By: passy

Differential Revision: D17478491

fbshipit-source-id: 10dd5e130a9e3df5f41afde42b92b08959d9ed9e
2019-09-25 06:09:13 -07:00
Assaf Gelber
34d96fa262 Fix documentation on options property in Select
Summary: Just updating the apparently copy-pasted comment about the `options` prop.

Reviewed By: passy

Differential Revision: D17567256

fbshipit-source-id: ed4ff93ad42ef8bdcadb5371fe11ae90dba47ca3
2019-09-25 01:41:15 -07:00
John Knox
e871822a05 Use API for eligibility check
Summary: Change flipper from using the dodgy webview check that requires auth, to using the interngraph api for eligibility checking.

Reviewed By: passy

Differential Revision: D17498724

fbshipit-source-id: b81fd8b7b0bd36a7fcf73ba05d9885b61e420c61
2019-09-23 06:44:38 -07:00
Daniel Büchele
4e5ede6d37 Allow navigation to URI in Wilde via Flipper
Summary:
Here I add functionality to Wilde that allows navigation to internal deeplinks via Flipper. I beleive this was once a feature by allowing access to non whitelisted URL's but this has since been removed.

The Flipper plugin can now receive a navigate_to command which then emits a url over the navigateTo socket. This is picked up by the FBNavigationFlipperLogger plugin where it gets an instance of the NavigationCoordinator and opens the url.

Reviewed By: kolinkrewinkel

Differential Revision: D17282530

fbshipit-source-id: 0ba29aeac2a32d5464e8fa1dfa4e53af7cf94159
2019-09-23 06:41:32 -07:00
John Knox
976101449d Fix infinite spinner after cert exchange
Summary:
After the '(Outdated SDK)' addition to apps when they need to be updated, the uninitilaized clients weren't matching up with the fully initialized ones, so instead of being replaced by the full client in the side bar, they sit there forever looking like they are loading.

This applies the same name change to both fully and non-initialized clients so they always match up.

Reviewed By: passy

Differential Revision: D17501718

fbshipit-source-id: 6f2090b717a17c16c2cff37701e184363c82d36f
2019-09-23 06:22:01 -07:00
John Knox
1d29120715 Enable sandbox plugin (#554)
Summary:
Removes a gatekeeper that shouldn't be there.
Reported in https://github.com/facebook/flipper/issues/535
Pull Request resolved: https://github.com/facebook/flipper/pull/554

Reviewed By: danielbuechele

Differential Revision: D17502725

Pulled By: jknoxville

fbshipit-source-id: 1865db3f5c8cd81b0ec747687d0a7312e5f2332b
2019-09-23 03:36:05 -07:00
Pritesh Nandgaonkar
84c5067210 Create Support Requests from Flipper
Summary: This diff adds an initial support to prefill the app information and the revision information. This diff also copies the workplace url in the clipboard.

Reviewed By: passy

Differential Revision: D16990925

fbshipit-source-id: 4f354e52de5fea07c2ea36336761d6963c27ef66
2019-09-20 11:39:05 -07:00
John Knox
3b94dfe9c4 Make certificate files world readable
Summary:
This is useful for system apps. The files are owned by root, but they need to be readable by the app. There's nothing secret in these files, so it's not a problem.

This doesn't address all issues with system apps, e.g. https://github.com/facebook/flipper/issues/536 but does go some way towards it.

I was able to get a system app to connect successfully, but there may be different states that they can be in, so I don't think it's a fix all.

Reviewed By: passy

Differential Revision: D17499438

fbshipit-source-id: ab82583b5d607f75ff4578ab9ac2baf9d74241f8
2019-09-20 06:50:52 -07:00
Daniel Büchele
a77faa5318 update PluginManager links
Summary: Adding Plugin Manager to menu bar and update wording in sidebar

Reviewed By: passy

Differential Revision: D17450840

fbshipit-source-id: 9426e6053f454a8e3776e9e0e061cd119f8dc7b5
2019-09-19 02:34:18 -07:00
Daniel Büchele
8c623867bd PluginManager
Summary: Adding the plugin installer to the plugin sheet as a second tab

Reviewed By: passy

Differential Revision: D17450842

fbshipit-source-id: 211c9f15ed2614a1dd46d974b86f50c825f81fb0
2019-09-19 02:34:18 -07:00
Daniel Büchele
039d1cca99 publish example plugin
Summary:
Prepare package.json to publish to NPM.
This should set an example on how plugins can be shared via NPM.

Reviewed By: passy

Differential Revision: D17450841

fbshipit-source-id: 95bfe7331e5a95d4a8d201e5fea148cbdec6859f
2019-09-19 02:34:18 -07:00
Daniel Büchele
735aee7682 Add Tabs container
Summary: Adding an additional style for tabs on top of a container, similar to the ones used in macOS

Reviewed By: passy

Differential Revision: D17450843

fbshipit-source-id: 6b58c2aa290e0221d917e60bb3ac0751f77ea1ce
2019-09-19 02:34:17 -07:00
Daniel Büchele
ada2327520 refactor sidebar styles
Summary: Using styled components rather than class names to follow Flipper's guidelines

Reviewed By: jknoxville

Differential Revision: D17419665

fbshipit-source-id: 17e0a3bd9292327a4b34eb4e87e5271af8fa22c7
2019-09-17 10:18:26 -07:00
Daniel Büchele
108c49f572 Bookmark from TitleBar
Summary: Add action to bookmark current location

Reviewed By: passy

Differential Revision: D17419666

fbshipit-source-id: 69e845e802260c150ae2f17649cea05bea1ae4ec
2019-09-17 10:18:26 -07:00
Daniel Büchele
bd1fc342c8 Keyboard navigation
Summary: Adding keyboard navigation for bookmarks

Reviewed By: jknoxville

Differential Revision: D17419667

fbshipit-source-id: 851f93d662b6071c3478dca5c9d20b9814e15c1b
2019-09-17 10:18:26 -07:00
Daniel Büchele
1666cf5ee5 Background events
Summary:
`this.client.subscribe` was used to listen for navigation events. This means, navigation events are not collected while the plugin is in background.
In this diff, this is changed to a persistedStateReducer, so the events are collected with the plugin not active.

Reviewed By: jknoxville

Differential Revision: D17419668

fbshipit-source-id: 88d9476cb7461ff6774d42a992d32b4c8948ac86
2019-09-17 10:18:26 -07:00
John Knox
1d6fc9e3ac Don't make simultaneous ios device queries
Summary:
Fixes this:
https://fb.workplace.com/groups/967178219989117/permalink/3178405185533065/

Reviewed By: passy

Differential Revision: D17421166

fbshipit-source-id: 6ee14a05d157063d7646076175b6cdaf918a7caa
2019-09-17 09:02:31 -07:00
John Knox
199658aeef Fix ios device certificate exchange
Summary: `idb file pull` no longer accepts a directory name as a destination to pull a file to. This passes the destination file name instead.

Reviewed By: passy

Differential Revision: D17420100

fbshipit-source-id: 9e2f5bfda3733832fc71944f1dbbdb7ac0f08acb
2019-09-17 08:59:21 -07:00