Commit Graph

27 Commits

Author SHA1 Message Date
Benjamin Elo
cfcd0f060c Migrated components/index to TypeScript
Summary: Migrated components/index.js to components/index.tsx.

Reviewed By: danielbuechele

Differential Revision: D17132215

fbshipit-source-id: 76e03f9b4a509ad9c8faac484dc5b0ba7d1574e1
2019-09-02 04:13:42 -07:00
Benjamin Elo
d3023946da Removed ScollableFlexColumn component
Summary: This functionality already existed in FlexColumn by adding the prop grow.

Reviewed By: danielbuechele

Differential Revision: D17132219

fbshipit-source-id: d284f2c5e219beff743525abd344a8b9d1955d0b
2019-09-02 04:13:41 -07:00
Benjamin Elo
950bbbf97d Migrate util/appMatchPatterns to TypeScript
Summary: Migrated appMatchPatterns.js to appMatchPatterns.tsx

Reviewed By: danielbuechele

Differential Revision: D17133610

fbshipit-source-id: 1a819e2b32a233372e08578352290eff1264ef43
2019-09-02 04:13:38 -07:00
Benjamin Elo
d5d0b0cd49 Migrate util/autoCompleteProvider to TypeScript
Summary: Migrated autoCompleteProvider.js to autoCompleteProvider.tsx

Reviewed By: danielbuechele

Differential Revision: D17133612

fbshipit-source-id: 7d4da17bd639fdd4fc7a79cc931abeab62be2086
2019-09-02 04:13:37 -07:00
Benjamin Elo
8269d128d6 Migrate util/indexedDB to TypeScript
Summary: Migrated indexedDB.js to indexedDB.tsx

Reviewed By: danielbuechele

Differential Revision: D17133611

fbshipit-source-id: 819eccc12c8cbacee5e9cdf8fbfce4f5fbb08813
2019-09-02 04:13:37 -07:00
Benjamin Elo
332821d315 Migrated util/uri to TypeScript
Summary: Migrated uri.js to uri.tsx

Reviewed By: danielbuechele

Differential Revision: D17133606

fbshipit-source-id: d278c293c6040a522f5cc0c5462c6682dc634328
2019-09-02 04:13:37 -07:00
Benjamin Elo
ec47c93ea0 Display class name of view if available
Summary: This commit provides the navigation plugin with more value, showing the ViewController of the rendered view.This allows the user to quickly start working on that view controller once they have the name. This works on nearly all views in the iOS app.

Reviewed By: passy

Differential Revision: D17071558

fbshipit-source-id: 22a22d4a0991e9f20bc85eb106a98a42214d4d0c
2019-08-28 05:05:34 -07:00
Benjamin Elo
d962bbbfb9 Added screenshots to the navigation plugin
Summary:
Here I've attempted to add screenshots to the nav plugin. This isn't the most elegant solution, but it might have to do due to limitations on the event handler for navigation being fired when the navigation occurs, and not when all remote content on the view has loaded. With this in mind, I added a 1 second delay for the screenshot. This has its own issues such as navigating within a second away from the page will display the wrong view.

If anyone has some suggestions I am open.

Another issue faced here was that incoming nav events are now impure as I need to go take a screenshot on each nav event. Therefore, I have removed the the tests which no longer work for the NavPlugin.

Reviewed By: danielbuechele

Differential Revision: D16915859

fbshipit-source-id: 95db0d1ded2084441d49e1f2e4712c55acf9f1b8
2019-08-22 05:28:34 -07:00
Benjamin Elo
c40a88b117 Better form validation for required parameters plus live editing
Summary: Taking on the feedback from the demo yesterday, I've improved the required parameter's dialog by showing where specific errors occur in the form and adding live editing to the URI displayed.

Reviewed By: danielbuechele

Differential Revision: D16802921

fbshipit-source-id: 2e729549306a8efb79ca76d3da6f70632ccd9212
2019-08-14 05:27:44 -07:00
Benjamin Elo
1ae3b90019 Added LocationsButton when Navigation Plugin is active
Summary:
Here I've added the LocationsButton to the TitleBar in Flipper. This allows the user to navigate to saved bookmarks, or display the current page URI without ever opening the Navigation Plugin (Except to add bookmarks). The challenge of this diff was having a TitleBar child be controlled by a plugin.

The LocationsButton pulls bookmarks straight from the database whenever a mouseDown event is called on the button. (The Electron popup menu does not respond to props changes, so the menu is opened on mouse up and getting the bookmarks from the database occurs on mouse down... This seems to work fine).

The nav plugin on the Android side will now also send a welcome message alerting the app to created a persisted state for the navigation plugin, which shows the button in the TitleBar.

Let me know if I can answer any questions.

Reviewed By: danielbuechele

Differential Revision: D16786330

fbshipit-source-id: afc95348d9b7ec4ee041f42bb4d022f58c6bb969
2019-08-14 05:27:43 -07:00
Benjamin Elo
c4a89da960 Automatically filtler out optional parameters from uri
Summary:
When a user enters a uri with optional parameters in the nav bar, I chose to automatically filter these out, yet still show the parameters in the nav bar.

The device receive uri's with no optional parameters, but the user will still see the parameters in the UI.

Reviewed By: danielbuechele

Differential Revision: D16762529

fbshipit-source-id: e3bbdf886dca7fba793b140b5fb303c4a77926ba
2019-08-12 07:17:02 -07:00
Benjamin Elo
0d5850d723 Added URI validation functions and UI for correcting errors
Summary:
Some uris parsed from the device contain required parameters. Here we parse the uri and check if there is a required parameter on navigation. If there is we alert the user to correct the error.

In the next diff, I will strip away non-required parameters if they are present but not filled in.

Reviewed By: danielbuechele

Differential Revision: D16710944

fbshipit-source-id: ea32cfe60e2bb5e4f395caebf585ba1b220dcefe
2019-08-12 03:17:22 -07:00
Benjamin Elo
fe5df63d41 Added AppMatchPatterns provider to nav bar
Summary:
This commit adds the match patterns that were parsed from the app into the nav bar.

Planned for next commit: Alerting the user if they havn't filled in required parameters, and automatically excluding non-required parameters if not filled in.

Reviewed By: danielbuechele

Differential Revision: D16646774

fbshipit-source-id: 0f9130d659b6b635bfa1240dbd05c5956c6756ce
2019-08-06 03:10:47 -07:00
Benjamin Elo
ea8a6546c9 Added providers to the auto complete sheet
Summary:
Okay so the main changes here are integrating the providers into the auto complete sheet and getting the search bar to work with it also.

For instance, in the search bar, I want to update the value string to whatever the user has highlighted in the auto complete sheet, without executing a new query. So thus, I had to create a new state variable in the search bar component for this.

I've also moved the custom hook into its own file to keep the component short in size. It had to be mainly rewritten to support providers instead of only bookmarks. Same goes for the entire AutoCompleteSheet component.

The bookmarksProvider is stored in the persisted state as to not regenerate every-time on render. It is only updated if the bookmarks are updated which are also now stored in the persistedState for the same reason.

Lastly, a DefaultProvider object was also made for the initial persisted state object.

Reviewed By: danielbuechele

Differential Revision: D16581644

fbshipit-source-id: 88723a4081d96250f723a4cd7b1ade101bf3e8f3
2019-08-02 01:58:02 -07:00
Benjamin Elo
fc28b904a0 Added ability to remove bookmarks
Summary: Here I add the ability to remove bookmarks. If a bookmark already exists, a different dialouge menu appears.

Reviewed By: danielbuechele

Differential Revision: D16540394

fbshipit-source-id: 5d6737e1efb1a9663519bf17084ef3b55a6ba28e
2019-07-29 04:29:45 -07:00
Benjamin Elo
292efb0bb3 Moved NavPlugin types into seperate file
Summary: Moved Flow types into their own file. I will be adding more types as part of the auto complete for the navigation bar and this is to keep the code more organized.

Reviewed By: danielbuechele

Differential Revision: D16540279

fbshipit-source-id: d69ac0d05f91e9d92fcda37325c791ddc83a52c9
2019-07-29 03:47:49 -07:00
Benjamin Elo
84f9a1d8b5 Added ability to save bookmarks in Nav Plugin
Summary:
This is a glue commit that glues all the components I've added in the past together.

Favouriting a page (i.e. clicking on the star) adds it as a bookmark.

There's four main parts to make your rreview easier:
1. Add bookmarks and favouriting to all the components that support it, including their parents. (NavigationInfoBox, SearchBar, Timeline)

2. Persist bookmarks using the indexedDB. (index.js)

3. Add saving to db through the SaveBookmarksDialog

4. Various other changes due to a changed architecture. i.e. moving bookmarks from persistedState to state.

Still to come.

1. Removing bookmarks.

2. Pressing enter to save the bookmarks when the SaveBookmarksDialog pops up.

3. Alphabetizing bookmarks? Order seems to jump around.

Reviewed By: jknoxville

Differential Revision: D16518013

fbshipit-source-id: 2e0cef14123c611db43cca360bc66dc4c05b11ed
2019-07-28 12:50:31 -07:00
Benjamin Elo
66bed16333 Added navigation ability to bookmarks sidebar
Summary: I've added the ability to navigate to different pages in the app via the bookmarks sidebar. Still no way to add bookmarks yet.

Reviewed By: jknoxville

Differential Revision: D16438415

fbshipit-source-id: f7dcda1add701eba8655518fba7cb9a82cf49ca1
2019-07-23 09:52:21 -07:00
Benjamin Elo
a262d22399 Added BookmarksSidebar component
Summary:
This is another WIP. Here I construct a skeleton functional component which currently just displays that there is no bookmark information.

I have also placed the component into the layout.

Reviewed By: jknoxville

Differential Revision: D16419794

fbshipit-source-id: fe1722255bde2b8363e5514c284a242f077e5185
2019-07-23 03:35:42 -07:00
Benjamin Elo
eeeb32efa9 Created Timeline component
Summary: This is a WIP component that displays the timeline of nav events to the user.

Reviewed By: jknoxville

Differential Revision: D16417087

fbshipit-source-id: 45a4bcdc271941d413c78fab2424628499c6d5ea
2019-07-23 03:35:41 -07:00
Benjamin Elo
f313d5edcb Added full screen flex column
Summary: The original flex colum that came as standard did not flex to fill the remainder of the screen. Adding this component allows for a full screen flex column so that the scroll bar in the timeline looks correct.

Reviewed By: jknoxville

Differential Revision: D16416933

fbshipit-source-id: bd296aea85730f192778ed0aca4b226893b2829d
2019-07-23 03:35:41 -07:00
Benjamin Elo
aeee96c050 Reversed order of incoming nav events
Summary: Since events will be displayed in a timeline view with a flex-cloumn, it is more efficient to have the events be added to the event array in reverse order; that is the newest events at the front of the array.

Reviewed By: passy

Differential Revision: D16379893

fbshipit-source-id: c85a2cca118e2d4ae990f69134f5d5770c360fbd
2019-07-22 03:07:00 -07:00
Benjamin Elo
df725de674 Added NavigationInfoBox component
Summary:
Here I added an info box to display the info of the incoming navigation events.

The component is currently missing interaction (navigating to uris and favoriting), but I will add that in my next diff.

While I was here, I modified the component file structure a tiny bit to make importing components easier.

Reviewed By: jknoxville

Differential Revision: D16357204

fbshipit-source-id: 70b137e052181559a2fda02b091a71e54cb1ade0
2019-07-18 08:15:03 -07:00
Benjamin Elo
beb656c84e Added Nav Plugin tests
Summary:
Here I added two tests to test the persisted state reducer in the navigation pliugin.

I uncovered that my state reducer is not pure, as it calls the Date constructor, but I will fix this in a future update by passing the date recorded on the Android device when the nav event occurs and sending that via the socket connection.

For now I have modified the state reducer to take a date as part of the payload on a nav_event, or if none exists record the date as before. Also, if a page has no uri, but we want to record a nav event, I send null uri from the Android side. This doesn't send the uri as null to flipper; the uri object property simply doesn't exist. In this case I explicitly cast the undefined value for uri to null.

Reviewed By: jknoxville

Differential Revision: D16330958

fbshipit-source-id: fe338ea3a244df6ef33356bc7fdef8da9291dc68
2019-07-18 02:54:34 -07:00
Benjamin Elo
a9e90aa9b2 Receive navigation events and persist them
Summary: After setting up the navigation event emitter on the android side, we must now receive them on the client side and persist them in the Redux store.

Reviewed By: passy

Differential Revision: D16280944

fbshipit-source-id: 3dc4c5c6add41388469c801700974eb0ccd9a56b
2019-07-17 03:00:50 -07:00
Benjamin Elo
9f1f34bd99 Added search bar to navigation plugin
Summary:
Here I've started work on a search bar for the top of my plugin. Currently it supports navigation in a device by typing in an app uri and pressing the enter key or by pressing the send icon.

More features will be added as other components for this plugin are added. I have added a function stub for the bookmark button for now and the drop down icon is purely cosmetic at the moment.

Reviewed By: jknoxville

Differential Revision: D16183223

fbshipit-source-id: 0313d8c6e3a967c9400b9e9d3f24960e6a021a8c
2019-07-11 07:48:47 -07:00
Benjamin Elo
4d774ba252 Added navigation plugin
Summary: Adding the auto-genrated scarf files from creating the Flipper navigation plugin. GK for this plugin is flipper-navigation.

Reviewed By: jknoxville, danielbuechele

Differential Revision: D16119841

fbshipit-source-id: 74e19c82dc95e73fe2ae06d1eb8cef2456b81931
2019-07-04 05:20:51 -07:00