From c52ca255bb61c597319693385b1696be982dc03a Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Fri, 7 Feb 2020 03:43:17 -0800 Subject: [PATCH] Remove the gk Summary: We have already rolled out `support_requests_v2` to 100% of FB employees. Thus removing the unneeded checks for the GK. Reviewed By: jknoxville Differential Revision: D19770930 fbshipit-source-id: 06fcf7b6b7c1305ab1b5b3c8df344e2877251e65 --- src/MenuBar.tsx | 26 +++++---- src/chrome/mainsidebar/MainSidebar2.tsx | 31 +++++------ .../mainsidebar/MainSidebarUtilsSection.tsx | 54 ++++++++----------- 3 files changed, 49 insertions(+), 62 deletions(-) diff --git a/src/MenuBar.tsx b/src/MenuBar.tsx index 2be17a148..b29091eaa 100644 --- a/src/MenuBar.tsx +++ b/src/MenuBar.tsx @@ -215,21 +215,19 @@ function getTemplate( submenu: exportSubmenu, }, ]; - if (GK.get('support_requests_v2')) { - const supportRequestSubmenu = [ - { - label: 'Create...', - click: function() { - // Dispatch an action to open the export screen of Support Request form - store.dispatch(setStaticView(SupportRequestFormV2)); - }, + const supportRequestSubmenu = [ + { + label: 'Create...', + click: function() { + // Dispatch an action to open the export screen of Support Request form + store.dispatch(setStaticView(SupportRequestFormV2)); }, - ]; - fileSubmenu.push({ - label: 'Support Requests', - submenu: supportRequestSubmenu, - }); - } + }, + ]; + fileSubmenu.push({ + label: 'Support Requests', + submenu: supportRequestSubmenu, + }); const template: MenuItemConstructorOptions[] = [ { diff --git a/src/chrome/mainsidebar/MainSidebar2.tsx b/src/chrome/mainsidebar/MainSidebar2.tsx index 0b5660733..75b4c6cf6 100644 --- a/src/chrome/mainsidebar/MainSidebar2.tsx +++ b/src/chrome/mainsidebar/MainSidebar2.tsx @@ -197,14 +197,12 @@ type DispatchFromProps = { type Props = OwnProps & StateFromProps & DispatchFromProps; type State = { - showSupportForm: boolean; showWatchDebugRoot: boolean; showAllPlugins: boolean; }; class MainSidebar2 extends PureComponent { state: State = { - showSupportForm: GK.get('support_requests_v2'), showWatchDebugRoot: GK.get('watch_team_flipper_clientless_access'), showAllPlugins: false, }; @@ -332,21 +330,20 @@ class MainSidebar2 extends PureComponent { {device.source ? 'Imported device' : 'Archived device'} - {this.state.showSupportForm && - (device as ArchivedDevice).supportRequestDetails && ( - setStaticView(SupportRequestDetails)}> - - - Support Request Details - - - )} + {(device as ArchivedDevice).supportRequestDetails && ( + setStaticView(SupportRequestDetails)}> + + + Support Request Details + + + )} ); } diff --git a/src/chrome/mainsidebar/MainSidebarUtilsSection.tsx b/src/chrome/mainsidebar/MainSidebarUtilsSection.tsx index 0348412c6..78f149b65 100644 --- a/src/chrome/mainsidebar/MainSidebarUtilsSection.tsx +++ b/src/chrome/mainsidebar/MainSidebarUtilsSection.tsx @@ -52,13 +52,6 @@ function MainSidebarUtilsSection({ }: Props) { const showWatchDebugRoot = GK.get('watch_team_flipper_clientless_access'); - const hasSeenSupportForm = useRef(false); - const showSupportForm = - GK.get('support_requests_v2') || hasSeenSupportForm.current; - if (showSupportForm) { - hasSeenSupportForm.current = true; - } - return (
{showWatchDebugRoot && @@ -81,30 +74,29 @@ function MainSidebarUtilsSection({ ); })()} - {showSupportForm && - (function() { - const active = isStaticViewActive(staticView, SupportRequestFormV2); - return ( - { - getInstance().track('usage', 'support-form-source', { - source: 'sidebar', - group: selectedGroup.name, - }); - setStaticView(SupportRequestFormV2); - }}> - - - Litho/GraphQL Support Request - - - ); - })()} + {(function() { + const active = isStaticViewActive(staticView, SupportRequestFormV2); + return ( + { + getInstance().track('usage', 'support-form-source', { + source: 'sidebar', + group: selectedGroup.name, + }); + setStaticView(SupportRequestFormV2); + }}> + + + Litho/GraphQL Support Request + + + ); + })()} setActiveSheet(ACTIVE_SHEET_PLUGINS)}>