Update UI for enabling persisted logs feature

Summary:
This is the first diff to implement the feature for the Flipper logs plugin to have an option to persist logs in the table between crashes, disconnections, etc.

Since this is not a local change, the UI option for persistence will be located in the settings for the Flipper UI(as seen in the test plan). The setting is associated with the Redux Store `Settings` and is stored globally to be used across all plugins. So the plan is making the persistence pertain to all plugins.

Reviewed By: mweststrate

Differential Revision: D37786988

fbshipit-source-id: 7ffc6077cbca559b3401b16770eda657a6c45620
This commit is contained in:
Feiyu Wong
2022-07-28 13:56:34 -07:00
committed by Facebook GitHub Bot
parent 45f3222b87
commit 3ffb25e672
4 changed files with 16 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ export type Settings = {
darkMode: 'dark' | 'light' | 'system';
showWelcomeAtStartup: boolean;
suppressPluginErrors: boolean;
persistDeviceData: boolean;
/**
* Plugin marketplace - allow internal plugin distribution
*/

View File

@@ -66,6 +66,7 @@ function getDefaultSettings(): Settings {
darkMode: 'light',
showWelcomeAtStartup: true,
suppressPluginErrors: false,
persistDeviceData: false,
enablePluginMarketplace: false,
marketplaceURL: '',
enablePluginMarketplaceAutoUpdate: true,

View File

@@ -127,6 +127,7 @@ class SettingsSheet extends Component<Props, State> {
reactNative,
darkMode,
suppressPluginErrors,
persistDeviceData,
enablePluginMarketplace,
enablePluginMarketplaceAutoUpdate,
marketplaceURL,
@@ -270,6 +271,18 @@ class SettingsSheet extends Component<Props, State> {
}));
}}
/>
<ToggledSection
label="Persist data in plugins after device disconnects"
toggled={persistDeviceData}
onChange={(enabled) => {
this.setState((prevState) => ({
updatedSettings: {
...prevState.updatedSettings,
persistDeviceData: enabled,
},
}));
}}
/>
<Layout.Container style={{paddingLeft: 15, paddingBottom: 10}}>
Theme Selection
<Radio.Group

View File

@@ -151,6 +151,7 @@ function createStubRenderHost(): RenderHost {
},
showWelcomeAtStartup: false,
suppressPluginErrors: false,
persistDeviceData: false,
enablePluginMarketplace: false,
marketplaceURL: '',
enablePluginMarketplaceAutoUpdate: true,