From 012e55ebf87559f2d782e5400fb885df8b80a445 Mon Sep 17 00:00:00 2001 From: kytwb <412895+kytwb@users.noreply.github.com> Date: Fri, 23 Jul 2021 10:04:43 +0100 Subject: Fix hibernation mode (#1486) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use hibernation strategy from settings instead of hardcoded 5 minutes * Fix conditions with isHibernationEnabled, previously disableHibernation * Make service hibernation obey global setting Also refactors hibernation to move some hibernation enablement logic into the Service model * Remove global hibernation enable switch Implements option 4 from https://github.com/getferdi/ferdi/pull/1486#issuecomment-860290992 according to https://github.com/getferdi/ferdi/pull/1486#issuecomment-876558694 * Implements #865 : Add 'hibernate service' and 'wake up service' in the sidebar context menu. * Removed 'hibernationEnabled' check on main settings screen Since this is an (imo) incongruous behavior for the first time user. They will see a message, but with no ability to choose the hibernation strategy. * Autogenerated files from conflict fixes Co-authored-by: Kristóf Marussy Co-authored-by: Vijay A --- src/containers/settings/EditServiceScreen.js | 3 +-- src/containers/settings/EditSettingsScreen.js | 10 ---------- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'src/containers/settings') diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index e22e91822..0fe84792f 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js @@ -345,7 +345,7 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex render() { const { - recipes, services, user, settings, + recipes, services, user, } = this.props.stores; const { action } = this.props.router.params; @@ -398,7 +398,6 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex onDelete={() => this.deleteService()} openRecipeFile={file => this.openRecipeFile(file)} isProxyFeatureEnabled={proxyFeature.isEnabled} - isHibernationFeatureActive={settings.app.hibernate} /> ); diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 3b8f03ae4..5f29ee385 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js @@ -87,10 +87,6 @@ const messages = defineMessages({ id: 'settings.app.form.sentry', defaultMessage: '!!!Send telemetry data', }, - hibernate: { - id: 'settings.app.form.hibernate', - defaultMessage: '!!!Enable service hibernation', - }, hibernateOnStartup: { id: 'settings.app.form.hibernateOnStartup', defaultMessage: '!!!Keep services in hibernation on startup', @@ -432,11 +428,6 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e value: settings.all.app.sentry, default: DEFAULT_APP_SETTINGS.sentry, }, - hibernate: { - label: intl.formatMessage(messages.hibernate), - value: settings.all.app.hibernate, - default: DEFAULT_APP_SETTINGS.hibernate, - }, hibernateOnStartup: { label: intl.formatMessage(messages.hibernateOnStartup), value: settings.all.app.hibernateOnStartup, @@ -653,7 +644,6 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e isWorkspaceEnabled={workspaces.isFeatureActive} lockingFeatureEnabled={lockingFeatureEnabled} automaticUpdates={this.props.stores.settings.app.automaticUpdates} - hibernationEnabled={this.props.stores.settings.app.hibernate} isDarkmodeEnabled={this.props.stores.settings.app.darkMode} isAdaptableDarkModeEnabled={this.props.stores.settings.app.adaptableDarkMode} isTodosActivated={this.props.stores.todos.isFeatureEnabledByUser} -- cgit v1.2.3-70-g09d2