Scaffolding

Summary:
Scaffolding connectivity hub. The final place may be different though.

But at least for now whilst we iterate on the solution, this should be enough.

Reviewed By: passy

Differential Revision: D47230905

fbshipit-source-id: e3b3f7d773e1bf8b0dd9821cf25c6fa8e77669f4
This commit is contained in:
Lorenzo Blasa
2023-07-06 06:57:53 -07:00
committed by Facebook GitHub Bot
parent 9810edcdfb
commit 87c5296cd8
3 changed files with 44 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import {Layout} from '../ui';
import React from 'react';
export function ConnectionTroubleshootTools() {
return <Layout.Container grow>Connection Troubleshoot</Layout.Container>;
}

View File

@@ -29,6 +29,7 @@ import {
RocketOutlined, RocketOutlined,
BugOutlined, BugOutlined,
WarningOutlined, WarningOutlined,
ApiOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import {SidebarLeft, SidebarRight} from './SandyIcons'; import {SidebarLeft, SidebarRight} from './SandyIcons';
import {useDispatch, useStore} from '../utils/useStore'; import {useDispatch, useStore} from '../utils/useStore';
@@ -184,6 +185,12 @@ export const LeftRail = withTrackingScope(function LeftRail({
toplevelSelection={toplevelSelection} toplevelSelection={toplevelSelection}
setToplevelSelection={setToplevelSelection} setToplevelSelection={setToplevelSelection}
/> />
{getRenderHostInstance().GK('flipper_connection_troubleshoot') && (
<ConnectionTroubleshootButton
toplevelSelection={toplevelSelection}
setToplevelSelection={setToplevelSelection}
/>
)}
<LeftRailDivider /> <LeftRailDivider />
<DebugLogsButton <DebugLogsButton
toplevelSelection={toplevelSelection} toplevelSelection={toplevelSelection}
@@ -415,6 +422,22 @@ function DebugLogsButton({
); );
} }
function ConnectionTroubleshootButton({
toplevelSelection,
setToplevelSelection,
}: ToplevelProps) {
return (
<LeftRailButton
icon={<ApiOutlined />}
title="Connection Troubleshoot"
selected={toplevelSelection === 'connectivity'}
onClick={() => {
setToplevelSelection('connectivity');
}}
/>
);
}
function ExportEverythingEverywhereAllAtOnceStatusModal({ function ExportEverythingEverywhereAllAtOnceStatusModal({
status, status,
setStatus, setStatus,

View File

@@ -44,11 +44,13 @@ import {isFBEmployee} from '../utils/fbEmployee';
import {notification} from 'antd'; import {notification} from 'antd';
import isProduction from '../utils/isProduction'; import isProduction from '../utils/isProduction';
import {getRenderHostInstance} from 'flipper-frontend-core'; import {getRenderHostInstance} from 'flipper-frontend-core';
import {ConnectionTroubleshootTools} from '../chrome/ConnectionTroubleshootTools';
export type ToplevelNavItem = export type ToplevelNavItem =
| 'appinspect' | 'appinspect'
| 'flipperlogs' | 'flipperlogs'
| 'notification' | 'notification'
| 'connectivity'
| undefined; | undefined;
export type ToplevelProps = { export type ToplevelProps = {
toplevelSelection: ToplevelNavItem; toplevelSelection: ToplevelNavItem;
@@ -64,7 +66,7 @@ export function SandyApp() {
const staticView = useStore((state) => state.connections.staticView); const staticView = useStore((state) => state.connections.staticView);
/** /**
* top level navigation uses two pieces of state, selection stored here, and selection that is based on what is stored in the reducer (which might be influenced by redux action dispatches to different means). * Top level navigation uses two pieces of state, selection stored here, and selection that is based on what is stored in the reducer (which might be influenced by redux action dispatches to different means).
* The logic here is to sync both, but without modifying the navigation related reducers to not break classic Flipper. * The logic here is to sync both, but without modifying the navigation related reducers to not break classic Flipper.
* It is possible to simplify this in the future. * It is possible to simplify this in the future.
*/ */
@@ -88,6 +90,9 @@ export function SandyApp() {
case 'flipperlogs': case 'flipperlogs':
dispatch(setStaticView(FlipperDevTools)); dispatch(setStaticView(FlipperDevTools));
break; break;
case 'connectivity':
dispatch(setStaticView(ConnectionTroubleshootTools));
break;
default: default:
} }
setStoredToplevelSelection(newSelection); setStoredToplevelSelection(newSelection);