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:
committed by
Facebook GitHub Bot
parent
45f3222b87
commit
3ffb25e672
@@ -39,6 +39,7 @@ export type Settings = {
|
||||
darkMode: 'dark' | 'light' | 'system';
|
||||
showWelcomeAtStartup: boolean;
|
||||
suppressPluginErrors: boolean;
|
||||
persistDeviceData: boolean;
|
||||
/**
|
||||
* Plugin marketplace - allow internal plugin distribution
|
||||
*/
|
||||
|
||||
@@ -66,6 +66,7 @@ function getDefaultSettings(): Settings {
|
||||
darkMode: 'light',
|
||||
showWelcomeAtStartup: true,
|
||||
suppressPluginErrors: false,
|
||||
persistDeviceData: false,
|
||||
enablePluginMarketplace: false,
|
||||
marketplaceURL: '',
|
||||
enablePluginMarketplaceAutoUpdate: true,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -151,6 +151,7 @@ function createStubRenderHost(): RenderHost {
|
||||
},
|
||||
showWelcomeAtStartup: false,
|
||||
suppressPluginErrors: false,
|
||||
persistDeviceData: false,
|
||||
enablePluginMarketplace: false,
|
||||
marketplaceURL: '',
|
||||
enablePluginMarketplaceAutoUpdate: true,
|
||||
|
||||
Reference in New Issue
Block a user