Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
[Enhancement] Added default feature flags to disable dropbox (#338)
Giuseppe Macrì2512e2823f25
diff --git a/examples/demo-app/src/app.js b/examples/demo-app/src/app.jsindex 057215fc4..fd2236048 100644--- a/examples/demo-app/src/app.js+++ b/examples/demo-app/src/app.js@@ -246,6 +246,11 @@ class App extends Component {);}+ _isCloudStorageEnabled = () => {+ const {app} = this.props.demo;+ return app.featureFlags.cloudStorage;+ };+_toggleCloudModal = () => {// TODO: this lives only in the demo hence we use the state for now// REFCOTOR using redux@@ -255,7 +260,7 @@ class App extends Component {};_onExportToCloud = () => {- this.props.dispatch(exportFileToCloud())+ this.props.dispatch(exportFileToCloud());};_onCloudLoginSuccess = () => {@@ -282,7 +287,7 @@ class App extends Component {><Announcement onDisable={this._disableBanner}/></Banner>- {rootNode && (+ {this._isCloudStorageEnabled() && rootNode && (<ExportUrlModalsharing={sharing}isOpen={Boolean(this.state.cloudModalOpen)}@@ -312,7 +317,7 @@ class App extends Component {getState={state => state.demo.keplerGl}width={width}height={height - (showBanner ? BannerHeight : 0)}- onSaveMap={this._toggleCloudModal}+ onSaveMap={this._isCloudStorageEnabled() && this._toggleCloudModal}/></div></GlobalStyle>diff --git a/examples/demo-app/src/constants/default-settings.js b/examples/demo-app/src/constants/default-settings.jsindex e0663bd7d..d7cd0b9ce 100644--- a/examples/demo-app/src/constants/default-settings.js+++ b/examples/demo-app/src/constants/default-settings.js@@ -99,3 +99,7 @@ export const KEPLER_DISCLAIMER = '* Kepler.gl will save your map data to your peexport const DEFAULT_LOADING_METHOD = LOADING_METHODS[0];export const DEFAULT_CLOUD_PROVIDER = 'dropbox';++export const DEFAULT_FEATURE_FLAGS = {+ cloudStorage: false+};diff --git a/examples/demo-app/src/reducers/index.js b/examples/demo-app/src/reducers/index.jsindex 373c3174e..8514bd183 100644--- a/examples/demo-app/src/reducers/index.js+++ b/examples/demo-app/src/reducers/index.js@@ -35,8 +35,8 @@ import {SET_SAMPLE_LOADING_STATUS} from '../actions';-import {DEFAULT_LOADING_METHOD, LOADING_METHODS} from '../constants/default-settings';-import { generateHashId } from '../utils/strings';+import {DEFAULT_FEATURE_FLAGS, DEFAULT_LOADING_METHOD, LOADING_METHODS} from '../constants/default-settings';+import {generateHashId} from '../utils/strings';// INITIAL_APP_STATEconst initialAppState = {@@ -47,11 +47,13 @@ const initialAppState = {previousMethod: null,sampleMaps: [], // this is used to store sample maps fetch from a remote json fileisMapLoading: false, // determine whether we are loading a sample map,- error: null // contains error when loading/retrieving data/configuration+ error: null, // contains error when loading/retrieving data/configuration// {// status: null,// message: null// }+ // eventually we may have an async process to fetch these from a remote location+ featureFlags: DEFAULT_FEATURE_FLAGS};// App reducer