From 8c3abf7450f0b655c41f31701770a6d3d75a74ea Mon Sep 17 00:00:00 2001 From: bizzguy Date: Fri, 29 Jan 2021 09:00:44 -0800 Subject: [PATCH] Network Plugin - Minor UI fixes (#1864) Summary: Made UI fixes to Network Plugin (mostly to Route screens) to continue migration to the new design framework. This consisted mostly of replacing FlexColumn and FlexRow with Layout.Container and Layout.Horizontal. Also, contains some cosmetic changes to "Mock Network Response" page. Here is the screenshot with UI changes: ![image](https://user-images.githubusercontent.com/337874/105937062-6d0e4500-601a-11eb-97ce-d9c4ae0c184f.png) This was the old screen for comparison: ![image](https://user-images.githubusercontent.com/337874/105937028-5667ee00-601a-11eb-84a9-a2bd4bb78846.png) ## Changelog Network Plugin - UI changes to continue migration to Sandy design framework Pull Request resolved: https://github.com/facebook/flipper/pull/1864 Test Plan: Manual testing to ensure that all data still displayed with new UI changes (especially the Data and Headers info in the "Route Info" section) Reviewed By: passy Differential Revision: D26125656 Pulled By: mweststrate fbshipit-source-id: a25104274ed25788e5c0738ac0a9609f2cead751 --- .../network/ManageMockResponsePanel.tsx | 156 ++++++++---------- .../plugins/network/MockResponseDialog.tsx | 20 +-- desktop/plugins/network/index.tsx | 13 +- 3 files changed, 82 insertions(+), 107 deletions(-) diff --git a/desktop/plugins/network/ManageMockResponsePanel.tsx b/desktop/plugins/network/ManageMockResponsePanel.tsx index 10c735d20..5f3d902de 100644 --- a/desktop/plugins/network/ManageMockResponsePanel.tsx +++ b/desktop/plugins/network/ManageMockResponsePanel.tsx @@ -13,7 +13,6 @@ import { Text, FlexBox, FlexRow, - FlexColumn, Glyph, styled, colors, @@ -48,24 +47,6 @@ const Button = styled(FlexBox)({ textOverflow: 'ellipsis', }); -const Container = styled(FlexRow)({ - flex: 1, - justifyContent: 'space-around', - alignItems: 'stretch', - height: '100%', - width: '100%', -}); - -const LeftPanel = styled(FlexColumn)({ - height: '100%', - width: '35%', -}); - -const RightPanel = styled(FlexColumn)({ - flex: 2, - height: '100%', -}); - const TextEllipsis = styled(Text)({ overflowX: 'hidden', textOverflow: 'ellipsis', @@ -189,73 +170,74 @@ export function ManageMockResponsePanel(props: Props) { props.routes, ]); return ( - - - - -
- { - networkRouteManager.removeRoute(id); - setSelectedId(null); - })} - stickyBottom={true} - autoHeight={false} - floating={false} - zebra={false} - onRowHighlighted={(selectedIds) => { - const newSelectedId = - selectedIds.length === 1 ? selectedIds[0] : null; - setSelectedId(newSelectedId); - }} - highlightedRows={new Set(selectedId)} - /> -
- - {selectedId && props.routes.hasOwnProperty(selectedId) && ( - - )} - -
+ + + + + + + { + networkRouteManager.removeRoute(id); + setSelectedId(null); + })} + stickyBottom={true} + autoHeight={false} + floating={false} + zebra={false} + onRowHighlighted={(selectedIds) => { + const newSelectedId = + selectedIds.length === 1 ? selectedIds[0] : null; + setSelectedId(newSelectedId); + }} + highlightedRows={new Set(selectedId)} + /> + + + + {selectedId && props.routes.hasOwnProperty(selectedId) && ( + + )} + + + ); } diff --git a/desktop/plugins/network/MockResponseDialog.tsx b/desktop/plugins/network/MockResponseDialog.tsx index 3d7aa10ec..7c7df38ed 100644 --- a/desktop/plugins/network/MockResponseDialog.tsx +++ b/desktop/plugins/network/MockResponseDialog.tsx @@ -7,7 +7,7 @@ * @format */ -import {FlexColumn, Button, styled, Layout, Spacer} from 'flipper'; +import {Button, styled, Layout, Spacer} from 'flipper'; import {ManageMockResponsePanel} from './ManageMockResponsePanel'; import {Route, Request, Response} from './types'; @@ -30,30 +30,24 @@ const Title = styled('div')({ marginTop: 8, }); -const Container = styled(FlexColumn)({ +const StyledContainer = styled(Layout.Container)({ padding: 10, - width: 800, - height: 550, -}); - -const Row = styled(FlexColumn)({ - alignItems: 'flex-end', - marginTop: 16, + width: 1200, }); export function MockResponseDialog(props: Props) { const networkRouteManager = useContext(NetworkRouteContext); return ( - + Mock Network Responses - + - + {this.props.isMockResponseSupported && ( )} - + } />