diff options
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/layout/AppLayoutContainer.js | 16 | ||||
-rw-r--r-- | src/containers/settings/EditServiceScreen.js | 15 |
2 files changed, 24 insertions, 7 deletions
diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index cd3251082..1b0f4d495 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js | |||
@@ -7,7 +7,7 @@ import RecipesStore from '../../stores/RecipesStore'; | |||
7 | import ServicesStore from '../../stores/ServicesStore'; | 7 | import ServicesStore from '../../stores/ServicesStore'; |
8 | import UIStore from '../../stores/UIStore'; | 8 | import UIStore from '../../stores/UIStore'; |
9 | import NewsStore from '../../stores/NewsStore'; | 9 | import NewsStore from '../../stores/NewsStore'; |
10 | import UserStore from '../../stores/UserStore'; | 10 | import SettingsStore from '../../stores/SettingsStore'; |
11 | import RequestStore from '../../stores/RequestStore'; | 11 | import RequestStore from '../../stores/RequestStore'; |
12 | import GlobalErrorStore from '../../stores/GlobalErrorStore'; | 12 | import GlobalErrorStore from '../../stores/GlobalErrorStore'; |
13 | 13 | ||
@@ -29,8 +29,8 @@ export default class AppLayoutContainer extends Component { | |||
29 | services, | 29 | services, |
30 | ui, | 30 | ui, |
31 | news, | 31 | news, |
32 | settings, | ||
32 | globalError, | 33 | globalError, |
33 | user, | ||
34 | requests, | 34 | requests, |
35 | } = this.props.stores; | 35 | } = this.props.stores; |
36 | 36 | ||
@@ -43,6 +43,7 @@ export default class AppLayoutContainer extends Component { | |||
43 | reorder, | 43 | reorder, |
44 | reload, | 44 | reload, |
45 | toggleNotifications, | 45 | toggleNotifications, |
46 | toggleAudio, | ||
46 | deleteService, | 47 | deleteService, |
47 | updateService, | 48 | updateService, |
48 | } = this.props.actions.service; | 49 | } = this.props.actions.service; |
@@ -53,6 +54,7 @@ export default class AppLayoutContainer extends Component { | |||
53 | 54 | ||
54 | const { | 55 | const { |
55 | installUpdate, | 56 | installUpdate, |
57 | toggleMuteApp, | ||
56 | } = this.props.actions.app; | 58 | } = this.props.actions.app; |
57 | 59 | ||
58 | const { | 60 | const { |
@@ -78,14 +80,16 @@ export default class AppLayoutContainer extends Component { | |||
78 | <Sidebar | 80 | <Sidebar |
79 | services={services.allDisplayed} | 81 | services={services.allDisplayed} |
80 | setActive={setActive} | 82 | setActive={setActive} |
83 | isAppMuted={app.isSystemMuted || settings.all.isMuted} | ||
81 | openSettings={openSettings} | 84 | openSettings={openSettings} |
82 | closeSettings={closeSettings} | 85 | closeSettings={closeSettings} |
83 | reorder={reorder} | 86 | reorder={reorder} |
84 | reload={reload} | 87 | reload={reload} |
85 | toggleNotifications={toggleNotifications} | 88 | toggleNotifications={toggleNotifications} |
89 | toggleAudio={toggleAudio} | ||
86 | deleteService={deleteService} | 90 | deleteService={deleteService} |
87 | updateService={updateService} | 91 | updateService={updateService} |
88 | isPremiumUser={user.data.isPremium} | 92 | toggleMuteApp={toggleMuteApp} |
89 | /> | 93 | /> |
90 | ); | 94 | ); |
91 | 95 | ||
@@ -96,6 +100,7 @@ export default class AppLayoutContainer extends Component { | |||
96 | setWebviewReference={setWebviewReference} | 100 | setWebviewReference={setWebviewReference} |
97 | openWindow={openWindow} | 101 | openWindow={openWindow} |
98 | reload={reload} | 102 | reload={reload} |
103 | isAppMuted={settings.all.isMuted} | ||
99 | update={updateService} | 104 | update={updateService} |
100 | /> | 105 | /> |
101 | ); | 106 | ); |
@@ -130,7 +135,7 @@ AppLayoutContainer.wrappedComponent.propTypes = { | |||
130 | app: PropTypes.instanceOf(AppStore).isRequired, | 135 | app: PropTypes.instanceOf(AppStore).isRequired, |
131 | ui: PropTypes.instanceOf(UIStore).isRequired, | 136 | ui: PropTypes.instanceOf(UIStore).isRequired, |
132 | news: PropTypes.instanceOf(NewsStore).isRequired, | 137 | news: PropTypes.instanceOf(NewsStore).isRequired, |
133 | user: PropTypes.instanceOf(UserStore).isRequired, | 138 | settings: PropTypes.instanceOf(SettingsStore).isRequired, |
134 | requests: PropTypes.instanceOf(RequestStore).isRequired, | 139 | requests: PropTypes.instanceOf(RequestStore).isRequired, |
135 | globalError: PropTypes.instanceOf(GlobalErrorStore).isRequired, | 140 | globalError: PropTypes.instanceOf(GlobalErrorStore).isRequired, |
136 | }).isRequired, | 141 | }).isRequired, |
@@ -139,6 +144,7 @@ AppLayoutContainer.wrappedComponent.propTypes = { | |||
139 | setActive: PropTypes.func.isRequired, | 144 | setActive: PropTypes.func.isRequired, |
140 | reload: PropTypes.func.isRequired, | 145 | reload: PropTypes.func.isRequired, |
141 | toggleNotifications: PropTypes.func.isRequired, | 146 | toggleNotifications: PropTypes.func.isRequired, |
147 | toggleAudio: PropTypes.func.isRequired, | ||
142 | handleIPCMessage: PropTypes.func.isRequired, | 148 | handleIPCMessage: PropTypes.func.isRequired, |
143 | setWebviewReference: PropTypes.func.isRequired, | 149 | setWebviewReference: PropTypes.func.isRequired, |
144 | openWindow: PropTypes.func.isRequired, | 150 | openWindow: PropTypes.func.isRequired, |
@@ -156,7 +162,7 @@ AppLayoutContainer.wrappedComponent.propTypes = { | |||
156 | }).isRequired, | 162 | }).isRequired, |
157 | app: PropTypes.shape({ | 163 | app: PropTypes.shape({ |
158 | installUpdate: PropTypes.func.isRequired, | 164 | installUpdate: PropTypes.func.isRequired, |
159 | healthCheck: PropTypes.func.isRequired, | 165 | toggleMuteApp: PropTypes.func.isRequired, |
160 | }).isRequired, | 166 | }).isRequired, |
161 | requests: PropTypes.shape({ | 167 | requests: PropTypes.shape({ |
162 | retryRequiredRequests: PropTypes.func.isRequired, | 168 | retryRequiredRequests: PropTypes.func.isRequired, |
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index 6c614b941..191ef447b 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -9,7 +9,6 @@ import ServicesStore from '../../stores/ServicesStore'; | |||
9 | import Form from '../../lib/Form'; | 9 | import Form from '../../lib/Form'; |
10 | import { gaPage } from '../../lib/analytics'; | 10 | import { gaPage } from '../../lib/analytics'; |
11 | 11 | ||
12 | |||
13 | import ServiceError from '../../components/settings/services/ServiceError'; | 12 | import ServiceError from '../../components/settings/services/ServiceError'; |
14 | import EditServiceForm from '../../components/settings/services/EditServiceForm'; | 13 | import EditServiceForm from '../../components/settings/services/EditServiceForm'; |
15 | import { required, url, oneRequired } from '../../helpers/validation-helpers'; | 14 | import { required, url, oneRequired } from '../../helpers/validation-helpers'; |
@@ -27,6 +26,10 @@ const messages = defineMessages({ | |||
27 | id: 'settings.service.form.enableNotification', | 26 | id: 'settings.service.form.enableNotification', |
28 | defaultMessage: '!!!Enable Notifications', | 27 | defaultMessage: '!!!Enable Notifications', |
29 | }, | 28 | }, |
29 | enableAudio: { | ||
30 | id: 'settings.service.form.enableAudio', | ||
31 | defaultMessage: '!!!Enable audio', | ||
32 | }, | ||
30 | team: { | 33 | team: { |
31 | id: 'settings.service.form.team', | 34 | id: 'settings.service.form.team', |
32 | defaultMessage: '!!!Team', | 35 | defaultMessage: '!!!Team', |
@@ -51,11 +54,14 @@ export default class EditServiceScreen extends Component { | |||
51 | gaPage('Settings/Service/Edit'); | 54 | gaPage('Settings/Service/Edit'); |
52 | } | 55 | } |
53 | 56 | ||
54 | onSubmit(serviceData) { | 57 | onSubmit(data) { |
55 | const { action } = this.props.router.params; | 58 | const { action } = this.props.router.params; |
56 | const { recipes, services } = this.props.stores; | 59 | const { recipes, services } = this.props.stores; |
57 | const { createService, updateService } = this.props.actions.service; | 60 | const { createService, updateService } = this.props.actions.service; |
58 | 61 | ||
62 | const serviceData = data; | ||
63 | serviceData.isMuted = !serviceData.isMuted; | ||
64 | |||
59 | if (action === 'edit') { | 65 | if (action === 'edit') { |
60 | updateService({ serviceId: services.activeSettings.id, serviceData }); | 66 | updateService({ serviceId: services.activeSettings.id, serviceData }); |
61 | } else { | 67 | } else { |
@@ -82,6 +88,11 @@ export default class EditServiceScreen extends Component { | |||
82 | value: service.isNotificationEnabled, | 88 | value: service.isNotificationEnabled, |
83 | default: true, | 89 | default: true, |
84 | }, | 90 | }, |
91 | isMuted: { | ||
92 | label: intl.formatMessage(messages.enableAudio), | ||
93 | value: !service.isMuted, | ||
94 | default: true, | ||
95 | }, | ||
85 | }, | 96 | }, |
86 | }; | 97 | }; |
87 | 98 | ||