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
This commit is contained in:
Pritesh Nandgaonkar
2020-02-07 03:43:17 -08:00
committed by Facebook Github Bot
parent b9fafb0e61
commit c52ca255bb
3 changed files with 49 additions and 62 deletions

View File

@@ -215,21 +215,19 @@ function getTemplate(
submenu: exportSubmenu, submenu: exportSubmenu,
}, },
]; ];
if (GK.get('support_requests_v2')) { const supportRequestSubmenu = [
const supportRequestSubmenu = [ {
{ label: 'Create...',
label: 'Create...', click: function() {
click: function() { // Dispatch an action to open the export screen of Support Request form
// Dispatch an action to open the export screen of Support Request form store.dispatch(setStaticView(SupportRequestFormV2));
store.dispatch(setStaticView(SupportRequestFormV2));
},
}, },
]; },
fileSubmenu.push({ ];
label: 'Support Requests', fileSubmenu.push({
submenu: supportRequestSubmenu, label: 'Support Requests',
}); submenu: supportRequestSubmenu,
} });
const template: MenuItemConstructorOptions[] = [ const template: MenuItemConstructorOptions[] = [
{ {

View File

@@ -197,14 +197,12 @@ type DispatchFromProps = {
type Props = OwnProps & StateFromProps & DispatchFromProps; type Props = OwnProps & StateFromProps & DispatchFromProps;
type State = { type State = {
showSupportForm: boolean;
showWatchDebugRoot: boolean; showWatchDebugRoot: boolean;
showAllPlugins: boolean; showAllPlugins: boolean;
}; };
class MainSidebar2 extends PureComponent<Props, State> { class MainSidebar2 extends PureComponent<Props, State> {
state: State = { state: State = {
showSupportForm: GK.get('support_requests_v2'),
showWatchDebugRoot: GK.get('watch_team_flipper_clientless_access'), showWatchDebugRoot: GK.get('watch_team_flipper_clientless_access'),
showAllPlugins: false, showAllPlugins: false,
}; };
@@ -332,21 +330,20 @@ class MainSidebar2 extends PureComponent<Props, State> {
{device.source ? 'Imported device' : 'Archived device'} {device.source ? 'Imported device' : 'Archived device'}
</Info> </Info>
</ListItem> </ListItem>
{this.state.showSupportForm && {(device as ArchivedDevice).supportRequestDetails && (
(device as ArchivedDevice).supportRequestDetails && ( <ListItem
<ListItem active={supportRequestDetailsactive}
active={supportRequestDetailsactive} onClick={() => setStaticView(SupportRequestDetails)}>
onClick={() => setStaticView(SupportRequestDetails)}> <PluginIcon
<PluginIcon color={colors.light50}
color={colors.light50} name={'app-dailies'}
name={'app-dailies'} isActive={supportRequestDetailsactive}
isActive={supportRequestDetailsactive} />
/> <PluginName isActive={supportRequestDetailsactive}>
<PluginName isActive={supportRequestDetailsactive}> Support Request Details
Support Request Details </PluginName>
</PluginName> </ListItem>
</ListItem> )}
)}
</> </>
); );
} }

View File

@@ -52,13 +52,6 @@ function MainSidebarUtilsSection({
}: Props) { }: Props) {
const showWatchDebugRoot = GK.get('watch_team_flipper_clientless_access'); 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 ( return (
<div style={{flexShrink: 0, borderTop: `1px solid ${colors.blackAlpha10}`}}> <div style={{flexShrink: 0, borderTop: `1px solid ${colors.blackAlpha10}`}}>
{showWatchDebugRoot && {showWatchDebugRoot &&
@@ -81,30 +74,29 @@ function MainSidebarUtilsSection({
); );
})()} })()}
<RenderNotificationsEntry /> <RenderNotificationsEntry />
{showSupportForm && {(function() {
(function() { const active = isStaticViewActive(staticView, SupportRequestFormV2);
const active = isStaticViewActive(staticView, SupportRequestFormV2); return (
return ( <ListItem
<ListItem active={active}
active={active} onClick={() => {
onClick={() => { getInstance().track('usage', 'support-form-source', {
getInstance().track('usage', 'support-form-source', { source: 'sidebar',
source: 'sidebar', group: selectedGroup.name,
group: selectedGroup.name, });
}); setStaticView(SupportRequestFormV2);
setStaticView(SupportRequestFormV2); }}>
}}> <PluginIcon
<PluginIcon color={colors.light50}
color={colors.light50} name={'app-dailies'}
name={'app-dailies'} isActive={active}
isActive={active} />
/> <PluginName isActive={active}>
<PluginName isActive={active}> Litho/GraphQL Support Request
Litho/GraphQL Support Request </PluginName>
</PluginName> </ListItem>
</ListItem> );
); })()}
})()}
<ListItem onClick={() => setActiveSheet(ACTIVE_SHEET_PLUGINS)}> <ListItem onClick={() => setActiveSheet(ACTIVE_SHEET_PLUGINS)}>
<PluginIcon <PluginIcon
name="question-circle" name="question-circle"