diff options
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/layout/AppLayoutContainer.js | 8 | ||||
-rw-r--r-- | src/containers/settings/AccountScreen.js | 5 | ||||
-rw-r--r-- | src/containers/settings/EditServiceScreen.js | 20 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 10 |
4 files changed, 39 insertions, 4 deletions
diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index 7c6ceccd6..e4a9d60c3 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js | |||
@@ -73,13 +73,11 @@ export default class AppLayoutContainer extends Component { | |||
73 | ); | 73 | ); |
74 | } | 74 | } |
75 | 75 | ||
76 | const isMuted = settings.all.isAppMuted || app.isSystemMuted; | ||
77 | |||
78 | const sidebar = ( | 76 | const sidebar = ( |
79 | <Sidebar | 77 | <Sidebar |
80 | services={services.allDisplayed} | 78 | services={services.allDisplayed} |
81 | setActive={setActive} | 79 | setActive={setActive} |
82 | isAppMuted={isMuted} | 80 | isAppMuted={settings.all.isAppMuted} |
83 | openSettings={openSettings} | 81 | openSettings={openSettings} |
84 | closeSettings={closeSettings} | 82 | closeSettings={closeSettings} |
85 | reorder={reorder} | 83 | reorder={reorder} |
@@ -89,6 +87,8 @@ export default class AppLayoutContainer extends Component { | |||
89 | deleteService={deleteService} | 87 | deleteService={deleteService} |
90 | updateService={updateService} | 88 | updateService={updateService} |
91 | toggleMuteApp={toggleMuteApp} | 89 | toggleMuteApp={toggleMuteApp} |
90 | showMessageBadgeWhenMutedSetting={settings.all.showMessageBadgeWhenMuted} | ||
91 | showMessageBadgesEvenWhenMuted={ui.showMessageBadgesEvenWhenMuted} | ||
92 | /> | 92 | /> |
93 | ); | 93 | ); |
94 | 94 | ||
@@ -99,7 +99,7 @@ export default class AppLayoutContainer extends Component { | |||
99 | setWebviewReference={setWebviewReference} | 99 | setWebviewReference={setWebviewReference} |
100 | openWindow={openWindow} | 100 | openWindow={openWindow} |
101 | reload={reload} | 101 | reload={reload} |
102 | isAppMuted={isMuted} | 102 | isAppMuted={settings.all.isAppMuted} |
103 | update={updateService} | 103 | update={updateService} |
104 | /> | 104 | /> |
105 | ); | 105 | ); |
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js index a1ac8bda3..008c495d4 100644 --- a/src/containers/settings/AccountScreen.js +++ b/src/containers/settings/AccountScreen.js | |||
@@ -69,6 +69,7 @@ export default class AccountScreen extends Component { | |||
69 | render() { | 69 | render() { |
70 | const { user, payment, app } = this.props.stores; | 70 | const { user, payment, app } = this.props.stores; |
71 | const { openExternalUrl } = this.props.actions.app; | 71 | const { openExternalUrl } = this.props.actions.app; |
72 | const { user: userActions } = this.props.actions; | ||
72 | 73 | ||
73 | const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; | 74 | const isLoadingUserInfo = user.getUserInfoRequest.isExecuting; |
74 | const isLoadingOrdersInfo = payment.ordersDataRequest.isExecuting; | 75 | const isLoadingOrdersInfo = payment.ordersDataRequest.isExecuting; |
@@ -89,6 +90,9 @@ export default class AccountScreen extends Component { | |||
89 | openExternalUrl={url => openExternalUrl({ url })} | 90 | openExternalUrl={url => openExternalUrl({ url })} |
90 | onCloseSubscriptionWindow={() => this.onCloseWindow()} | 91 | onCloseSubscriptionWindow={() => this.onCloseWindow()} |
91 | stopMiner={() => this.stopMiner()} | 92 | stopMiner={() => this.stopMiner()} |
93 | deleteAccount={userActions.delete} | ||
94 | isLoadingDeleteAccount={user.deleteAccountRequest.isExecuting} | ||
95 | isDeleteAccountSuccessful={user.deleteAccountRequest.wasExecuted && !user.deleteAccountRequest.isError} | ||
92 | /> | 96 | /> |
93 | ); | 97 | ); |
94 | } | 98 | } |
@@ -109,6 +113,7 @@ AccountScreen.wrappedComponent.propTypes = { | |||
109 | }).isRequired, | 113 | }).isRequired, |
110 | user: PropTypes.shape({ | 114 | user: PropTypes.shape({ |
111 | update: PropTypes.func.isRequired, | 115 | update: PropTypes.func.isRequired, |
116 | delete: PropTypes.func.isRequired, | ||
112 | }).isRequired, | 117 | }).isRequired, |
113 | }).isRequired, | 118 | }).isRequired, |
114 | }; | 119 | }; |
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index 191ef447b..3c52152b1 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -26,6 +26,10 @@ const messages = defineMessages({ | |||
26 | id: 'settings.service.form.enableNotification', | 26 | id: 'settings.service.form.enableNotification', |
27 | defaultMessage: '!!!Enable Notifications', | 27 | defaultMessage: '!!!Enable Notifications', |
28 | }, | 28 | }, |
29 | enableBadge: { | ||
30 | id: 'settings.service.form.enableBadge', | ||
31 | defaultMessage: '!!!Show unread message badges', | ||
32 | }, | ||
29 | enableAudio: { | 33 | enableAudio: { |
30 | id: 'settings.service.form.enableAudio', | 34 | id: 'settings.service.form.enableAudio', |
31 | defaultMessage: '!!!Enable audio', | 35 | defaultMessage: '!!!Enable audio', |
@@ -88,6 +92,11 @@ export default class EditServiceScreen extends Component { | |||
88 | value: service.isNotificationEnabled, | 92 | value: service.isNotificationEnabled, |
89 | default: true, | 93 | default: true, |
90 | }, | 94 | }, |
95 | isBadgeEnabled: { | ||
96 | label: intl.formatMessage(messages.enableBadge), | ||
97 | value: service.isBadgeEnabled, | ||
98 | default: true, | ||
99 | }, | ||
91 | isMuted: { | 100 | isMuted: { |
92 | label: intl.formatMessage(messages.enableAudio), | 101 | label: intl.formatMessage(messages.enableAudio), |
93 | value: !service.isMuted, | 102 | value: !service.isMuted, |
@@ -118,11 +127,22 @@ export default class EditServiceScreen extends Component { | |||
118 | }); | 127 | }); |
119 | } | 128 | } |
120 | 129 | ||
130 | // More fine grained and use case specific validation rules | ||
121 | if (recipe.hasTeamId && recipe.hasCustomUrl) { | 131 | if (recipe.hasTeamId && recipe.hasCustomUrl) { |
122 | config.fields.team.validate = [oneRequired(['team', 'customUrl'])]; | 132 | config.fields.team.validate = [oneRequired(['team', 'customUrl'])]; |
123 | config.fields.customUrl.validate = [url, oneRequired(['team', 'customUrl'])]; | 133 | config.fields.customUrl.validate = [url, oneRequired(['team', 'customUrl'])]; |
124 | } | 134 | } |
125 | 135 | ||
136 | // If a service can be hosted and has a teamId or customUrl | ||
137 | if (recipe.hasHostedOption && (recipe.hasTeamId || recipe.hasCustomUrl)) { | ||
138 | if (config.fields.team) { | ||
139 | config.fields.team.validate = []; | ||
140 | } | ||
141 | if (config.fields.customUrl) { | ||
142 | config.fields.customUrl.validate = [url]; | ||
143 | } | ||
144 | } | ||
145 | |||
126 | if (recipe.hasIndirectMessages) { | 146 | if (recipe.hasIndirectMessages) { |
127 | Object.assign(config.fields, { | 147 | Object.assign(config.fields, { |
128 | isIndirectMessageBadgeEnabled: { | 148 | isIndirectMessageBadgeEnabled: { |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index 62e255dab..45ded9e5c 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -43,6 +43,10 @@ const messages = defineMessages({ | |||
43 | id: 'settings.app.form.showDisabledServices', | 43 | id: 'settings.app.form.showDisabledServices', |
44 | defaultMessage: '!!!Display disabled services tabs', | 44 | defaultMessage: '!!!Display disabled services tabs', |
45 | }, | 45 | }, |
46 | showMessageBadgeWhenMuted: { | ||
47 | id: 'settings.app.form.showMessagesBadgesWhenMuted', | ||
48 | defaultMessage: '!!!Show unread message badge when notifications are disabled', | ||
49 | }, | ||
46 | enableSpellchecking: { | 50 | enableSpellchecking: { |
47 | id: 'settings.app.form.enableSpellchecking', | 51 | id: 'settings.app.form.enableSpellchecking', |
48 | defaultMessage: '!!!Enable spell checking', | 52 | defaultMessage: '!!!Enable spell checking', |
@@ -85,6 +89,7 @@ export default class EditSettingsScreen extends Component { | |||
85 | enableSystemTray: settingsData.enableSystemTray, | 89 | enableSystemTray: settingsData.enableSystemTray, |
86 | minimizeToSystemTray: settingsData.minimizeToSystemTray, | 90 | minimizeToSystemTray: settingsData.minimizeToSystemTray, |
87 | showDisabledServices: settingsData.showDisabledServices, | 91 | showDisabledServices: settingsData.showDisabledServices, |
92 | showMessageBadgeWhenMuted: settingsData.showMessageBadgeWhenMuted, | ||
88 | enableSpellchecking: settingsData.enableSpellchecking, | 93 | enableSpellchecking: settingsData.enableSpellchecking, |
89 | // spellcheckingLanguage: settingsData.spellcheckingLanguage, | 94 | // spellcheckingLanguage: settingsData.spellcheckingLanguage, |
90 | locale: settingsData.locale, | 95 | locale: settingsData.locale, |
@@ -154,6 +159,11 @@ export default class EditSettingsScreen extends Component { | |||
154 | value: settings.all.showDisabledServices, | 159 | value: settings.all.showDisabledServices, |
155 | default: DEFAULT_APP_SETTINGS.showDisabledServices, | 160 | default: DEFAULT_APP_SETTINGS.showDisabledServices, |
156 | }, | 161 | }, |
162 | showMessageBadgeWhenMuted: { | ||
163 | label: intl.formatMessage(messages.showMessageBadgeWhenMuted), | ||
164 | value: settings.all.showMessageBadgeWhenMuted, | ||
165 | default: DEFAULT_APP_SETTINGS.showMessageBadgeWhenMuted, | ||
166 | }, | ||
157 | enableSpellchecking: { | 167 | enableSpellchecking: { |
158 | label: intl.formatMessage(messages.enableSpellchecking), | 168 | label: intl.formatMessage(messages.enableSpellchecking), |
159 | value: settings.all.enableSpellchecking, | 169 | value: settings.all.enableSpellchecking, |