Clean up old flipper rating system

Summary:
Found some unused code from the rating prototype before switching to itsr.
Deleting it.

Reviewed By: cekkaewnumchai

Differential Revision: D18298155

fbshipit-source-id: 3529db17494f4f5bf7d7841460203d1c3856299a
This commit is contained in:
John Knox
2019-11-04 09:22:18 -08:00
committed by Facebook Github Bot
parent ed2343b3c6
commit 42a77094f4
5 changed files with 6 additions and 48 deletions

View File

@@ -28,10 +28,6 @@ type PropsFromState = {
sessionId: string | null;
};
type OwnProps = {
onRatingChanged: (rating: number) => void;
};
type State = {
promptData: FeedbackPrompt | null;
isShown: boolean;
@@ -287,14 +283,14 @@ class FeedbackComponent extends Component<
}
}
class RatingButton extends Component<PropsFromState & OwnProps, State> {
class RatingButton extends Component<PropsFromState, State> {
state: State = {
promptData: null,
isShown: false,
hasTriggered: false,
};
constructor(props: PropsFromState & OwnProps) {
constructor(props: PropsFromState) {
super(props);
if (GK.get('flipper_rating')) {
UserFeedback.getPrompt().then(prompt => {
@@ -378,6 +374,6 @@ class RatingButton extends Component<PropsFromState & OwnProps, State> {
}
}
export default connect<{sessionId: string | null}, null, OwnProps, Store>(
export default connect<{sessionId: string | null}, null, {}, Store>(
({application: {sessionId}}) => ({sessionId}),
)(RatingButton);

View File

@@ -15,7 +15,6 @@ import {
toggleLeftSidebarVisible,
toggleRightSidebarVisible,
ACTIVE_SHEET_BUG_REPORTER,
setFlipperRating,
ACTIVE_SHEET_SETTINGS,
} from '../reducers/application';
import {
@@ -69,7 +68,6 @@ type DispatchFromProps = {
toggleLeftSidebarVisible: (visible?: boolean) => void;
toggleRightSidebarVisible: (visible?: boolean) => void;
setActiveSheet: (sheet: ActiveSheet) => void;
setFlipperRating: (rating: number) => void;
};
type StateFromProps = {
@@ -79,7 +77,6 @@ type StateFromProps = {
rightSidebarAvailable: boolean;
downloadingImportData: boolean;
launcherMsg: LauncherMsg;
flipperRating: number | null;
share: ShareType | null | undefined;
navPluginIsActive: boolean;
};
@@ -161,9 +158,7 @@ class TitleBar extends React.Component<Props, StateFromProps> {
share != null ? share.statusComponent : undefined,
)}
<Spacer />
{config.showFlipperRating ? (
<RatingButton onRatingChanged={this.props.setFlipperRating} />
) : null}
{config.showFlipperRating ? <RatingButton /> : null}
<Version>{this.props.version + (isProduction() ? '' : '-dev')}</Version>
{isAutoUpdaterEnabled() ? (
@@ -221,7 +216,6 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, State>(
rightSidebarAvailable,
downloadingImportData,
launcherMsg,
flipperRating,
share,
},
pluginStates,
@@ -232,7 +226,6 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, State>(
rightSidebarAvailable,
downloadingImportData,
launcherMsg,
flipperRating,
share,
navPluginIsActive: Object.keys(pluginStates).some(key =>
/#Navigation$/.test(key),
@@ -242,6 +235,5 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, State>(
setActiveSheet,
toggleLeftSidebarVisible,
toggleRightSidebarVisible,
setFlipperRating,
},
)(TitleBar);