Commit Graph

7 Commits

Author SHA1 Message Date
bizzguy
6a9d06a4ce Misc UI fixes (#1873)
Summary:
Continue with cleanup of Network plugin mock screens.  This mostly consists of replacing FlexColumn, FlexRow and FlexBox with equivalent Sandy components.

Here is the new screen:

- replace text buttons with Button
- add NUX info to "Copy Highlighted Calls" button
- add message when no calls have been highlighted
- in routes list remove padding on line items

![image](https://user-images.githubusercontent.com/337874/106415468-d58f6480-6414-11eb-93a8-498fd81b54d9.png)

Here is the prior screen:

![image](https://user-images.githubusercontent.com/337874/106415499-e8099e00-6414-11eb-8e0e-48875a945621.png)

## Changelog

Network Plugin - Additional cleanup of UI on mock screen

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

Test Plan:
Create and modify mocks
Verify that the functionality has not been affected by UI changes

Reviewed By: passy

Differential Revision: D26172915

Pulled By: mweststrate

fbshipit-source-id: f0af143d8509b53585076737832657fb095e75a6
2021-02-01 03:58:34 -08:00
bizzguy
6df117ba04 Network Plugin - New functions to import, export and clear Routes (#1855)
Summary:
In the network plugin, add features to import and export routes as described in issue https://github.com/facebook/flipper/issues/1651

Primary use case is that external testers (such as QA teams) would be able to create test data, convert it to mocks and save the mocks to make bug fixes easier for devs.

Here is a screenshot showing location of buttons to perform import/export (and clearing) of mock routes:

![image](https://user-images.githubusercontent.com/337874/105658269-cb58ed80-5e8b-11eb-8118-f13efc96bf6d.png)

Here is another screenshot showing export dialog:

![image](https://user-images.githubusercontent.com/337874/105657733-afa11780-5e8a-11eb-9725-120617e1dd71.png)

Changelog: [Network] Mock routes can now be imported and exported. Thanks bizzguy!

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

Test Plan:
Performed manual testing

- create new mocks
- export mocks
- clear mocks
- import mocks
- verify that mocks still work by making GET/POST requests in sample app

Performed various permutations of above manual tests, including restarting Flipper at various points to ensure that test plan still worked.  Also performed visual inspection of exported files to verify correctness.

Would be very interested in learning how to create automated tests for this functionality.

Reviewed By: passy

Differential Revision: D26072928

Pulled By: mweststrate

fbshipit-source-id: 51bd5e19e78d830b94add850d5dc9b9e45fa6fad
2021-01-26 05:34:36 -08:00
bizzguy
1559c1ef2c Network Plugin - Update UI for routes (#1831)
Summary:
The current UI for managing mock network request definitions (routes) has some issues
- too small for the amount of information it displays
- no formatting for JSON response bodies
- uses the older design system (not ant)
- no separation between commands for creating routes and the list of routes

The following screen images show these problems.

![image](https://user-images.githubusercontent.com/337874/104691438-deb9cb00-56cb-11eb-92df-9e2d122f65c2.png)

![image](https://user-images.githubusercontent.com/337874/104691471-eda07d80-56cb-11eb-8f82-444d591ff966.png)

## Changelog

Enhance UI for Mocks dialog in Network Plugin

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

Test Plan:
Ran multiple manual tests using the Android sample app.  Here is a screen image (at 1280 x 720) for the enhanced UI.

![image](https://user-images.githubusercontent.com/337874/104691649-37896380-56cc-11eb-849f-4e470bb7fbc4.png)

Reviewed By: mweststrate

Differential Revision: D25922798

Pulled By: priteshrnandgaonkar

fbshipit-source-id: d27ba30a7eb51105a8d381097ecaafd82624cad5
2021-01-20 15:45:38 -08:00
James Harmon
6989fa608d Add HTTP Status Code to mock response for Route (#1441)
Summary:
Mock requests can currently only return an HTTP Status Code of 200.  This is not sufficient to take full advantage of the mocking feature.  It would be more useful to specify a status code for the response.  Then not only can the original request be tested, but failure of the call could be tested as well.

This is described in Issue https://github.com/facebook/flipper/issues/1423 [https://github.com/facebook/flipper/issues/1423]

Changelog: Allow user to change response code for a mock request

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

Test Plan:
Here is a video demonstrating the change
[Uploading response-status-code.mp4.zip…]

Here is a screenshot showing where the new HTTP status code is entered for the mock request:
![image](https://user-images.githubusercontent.com/337874/89370139-a1c1c500-d6a5-11ea-9a55-e5e99ba37af5.png)

This screenshot shows a mock response with an alternate return code:
![image](https://user-images.githubusercontent.com/337874/89370265-ecdbd800-d6a5-11ea-82e7-10afbd5dd939.png)

Reviewed By: jknoxville

Differential Revision: D22977811

Pulled By: passy

fbshipit-source-id: c1662dd02abeb4546c80a416ed87f8e0dadbf96a
2020-08-07 09:30:10 -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
Chaiwat Ekkaewnumchai
d60125bd5e (Server) Fix Unresponsive Header Input
Summary:
Before this diff, the input bar is unresponsive to the user input; when one typed fast enough the input doesn't reflect that as shown in the before video (the console printed the log directly when `onChange` was fired).

This diff tried to store value locally and use that to render. When the component is closed, the state update will take place. This tried to solve too many state update.

Reviewed By: mweststrate

Differential Revision: D20489142

fbshipit-source-id: c118adc61d9234daec17782e4bbf8e4ea3dd369f
2020-03-19 05:18:25 -07:00
Chaiwat Ekkaewnumchai
95376a17b9 (Server) Add MockResponseDetail and Package Used Inside
Summary:
- Add MockResponseDetail component to show and edit mocked route
- Add `immer` package which will be used for internal state handler

Change from PR
- Change to functional component

Note:
- This is a part of this PR: https://github.com/facebook/flipper/pull/488

Reviewed By: mweststrate

Differential Revision: D20440149

fbshipit-source-id: d7c35600b9a22cb62c2bdae7e19abe5c767e3670
2020-03-17 10:09:12 -07:00