diff --git a/client/Makefile b/client/Makefile index 3199fc20..07c5b9b8 100644 --- a/client/Makefile +++ b/client/Makefile @@ -77,7 +77,7 @@ smoke-test: .PHONY: smoke-test-annotations smoke-test-annotations: start_server_and_test \ - 'CXG_OPTIONS="--experimental-annotations --experimental-annotations-file $(ANNOTATIONS)" $(MAKE) start-server' \ + 'AUTOSAVE_ENABLED=false CXG_OPTIONS="--experimental-annotations --experimental-annotations-file $(ANNOTATIONS)" $(MAKE) start-server' \ $(CXG_SERVER_PORT) \ '$(MAKE) e2e-annotations' diff --git a/client/src/components/autosave/index.js b/client/src/components/autosave/index.js index 971d04d6..fedf213d 100644 --- a/client/src/components/autosave/index.js +++ b/client/src/components/autosave/index.js @@ -50,7 +50,7 @@ class Autosave extends React.Component { /* return true if we need to save, false if we don't */ const { obsAnnotations, lastSavedObsAnnotations } = this.props; return ( - lastSavedObsAnnotations && obsAnnotations !== lastSavedObsAnnotations + globals.autosaveEnabled && lastSavedObsAnnotations && obsAnnotations !== lastSavedObsAnnotations ); }; diff --git a/client/src/globals.js b/client/src/globals.js index 8e4219b8..ec6a0f7a 100644 --- a/client/src/globals.js +++ b/client/src/globals.js @@ -1,6 +1,9 @@ import { Colors } from "@blueprintjs/core"; import { dispatchNetworkErrorMessageToUser } from "./util/actionHelpers"; +/* flags for testing */ +export const autosaveEnabled = process.env.AUTOSAVE_ENABLED ? process.env.AUTOSAVE_ENABLED === "true" : true; + /* if a categorical metadata field has more options than this, truncate */ export const maxCategoricalOptionsToDisplay = 100;