diff --git a/.env.sample b/.env.sample index 03888379e..66af6248e 100644 --- a/.env.sample +++ b/.env.sample @@ -16,6 +16,7 @@ SF_NEXT_VERSION_SERVER=http://localhost:3000 DEV_DEFAULT_SYNC_SERVER=https://sync.standardnotes.org DEV_NEXT_VERSION_SYNC_SERVER=https://api.standardnotes.com DEV_EXTENSIONS_MANAGER_LOCATION=public/extensions/extensions-manager/dist/index.html +ENABLE_UNFINISHED_FEATURES=false # NewRelic (Optional) NEW_RELIC_ENABLED=false diff --git a/app/assets/javascripts/ui_models/app_state/app_state.ts b/app/assets/javascripts/ui_models/app_state/app_state.ts index 55851ede7..396968cf4 100644 --- a/app/assets/javascripts/ui_models/app_state/app_state.ts +++ b/app/assets/javascripts/ui_models/app_state/app_state.ts @@ -1,4 +1,4 @@ -import { isDesktopApplication, isDev } from '@/utils'; +import { isDesktopApplication } from '@/utils'; import pull from 'lodash/pull'; import { ApplicationEvent, @@ -48,8 +48,8 @@ export enum EventSource { type ObserverCallback = (event: AppStateEvent, data?: any) => Promise; export class AppState { - readonly enableUnfinishedFeatures = - isDev || location.host.includes('app-dev.standardnotes.org'); + readonly enableUnfinishedFeatures: boolean = (window as any) + ?._enable_unfinished_features; $rootScope: ng.IRootScopeService; $timeout: ng.ITimeoutService; @@ -98,11 +98,11 @@ export class AppState { this, this.appEventObserverRemovers ); - (this.tags = new TagsState(application, this.appEventObserverRemovers)), - (this.noAccountWarning = new NoAccountWarningState( - application, - this.appEventObserverRemovers - )); + this.tags = new TagsState(application, this.appEventObserverRemovers); + this.noAccountWarning = new NoAccountWarningState( + application, + this.appEventObserverRemovers + ); this.searchOptions = new SearchOptionsState( application, this.appEventObserverRemovers diff --git a/app/assets/javascripts/views/footer/footer-view.pug b/app/assets/javascripts/views/footer/footer-view.pug index a4aa5c293..8abd9c47a 100644 --- a/app/assets/javascripts/views/footer/footer-view.pug +++ b/app/assets/javascripts/views/footer/footer-view.pug @@ -18,6 +18,11 @@ ng-if='ctrl.showAccountMenu', application='ctrl.application' ) + .sk-app-bar-item( + ng-click='ctrl.clickPreferences()' + ng-if='ctrl.appState.enableUnfinishedFeatures' + ) + .sk-label.title Preferences .sk-app-bar-item a.no-decoration.sk-label.title( href='https://standardnotes.com/help', diff --git a/app/views/application/app.html.erb b/app/views/application/app.html.erb index db302df40..d0018ed90 100644 --- a/app/views/application/app.html.erb +++ b/app/views/application/app.html.erb @@ -34,6 +34,7 @@ window._extensions_manager_location = "<%= ENV['EXTENSIONS_MANAGER_LOCATION'] %>"; window._batch_manager_location = "<%= ENV['BATCH_MANAGER_LOCATION'] %>"; window._bugsnag_api_key = "<%= ENV['BUGSNAG_API_KEY'] %>"; + window._enable_unfinished_features = "<%= ENV['ENABLE_UNFINISHED_FEATURES'] %>" <% if Rails.env.development? %> diff --git a/index.html b/index.html index a7cfd5561..c5ff27c9d 100644 --- a/index.html +++ b/index.html @@ -33,12 +33,14 @@ data-next-version-sync-server="<%= env.DEV_NEXT_VERSION_SYNC_SERVER || env.DEV_DEFAULT_SYNC_SERVER %>" data-extensions-manager-location="<%= env.DEV_EXTENSIONS_MANAGER_LOCATION %>" data-bugsnag-api-key="<%= env.DEV_BUGSNAG_API_KEY %>" + data-enable-unfinished-features="<%= env.ENABLE_UNFINISHED_FEATURES %>" >