diff options
author | 2017-11-09 16:28:03 +0100 | |
---|---|---|
committer | 2017-11-09 16:28:03 +0100 | |
commit | b405ba11aa3c669a21831d016084e0c47bffdebc (patch) | |
tree | 24dbb9ca8ea83e0f2126e6e68c81a9e51eb49b91 /src/components | |
parent | Merge branch 'develop' of github.com:meetfranz/franz into develop (diff) | |
download | ferdium-app-b405ba11aa3c669a21831d016084e0c47bffdebc.tar.gz ferdium-app-b405ba11aa3c669a21831d016084e0c47bffdebc.tar.zst ferdium-app-b405ba11aa3c669a21831d016084e0c47bffdebc.zip |
feat(Service): Add option to mute service
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 6 | ||||
-rw-r--r-- | src/components/settings/services/EditServiceForm.js | 12 | ||||
-rw-r--r-- | src/components/settings/services/ServiceItem.js | 22 |
3 files changed, 26 insertions, 14 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index cd59e0a8a..d7e0a4f38 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -82,21 +82,17 @@ export default class ServiceWebview extends Component { | |||
82 | )} | 82 | )} |
83 | <Webview | 83 | <Webview |
84 | ref={(element) => { this.webview = element; }} | 84 | ref={(element) => { this.webview = element; }} |
85 | |||
86 | autosize | 85 | autosize |
87 | src={service.url} | 86 | src={service.url} |
88 | preload="./webview/plugin.js" | 87 | preload="./webview/plugin.js" |
89 | partition={`persist:service-${service.id}`} | 88 | partition={`persist:service-${service.id}`} |
90 | |||
91 | onDidAttach={() => setWebviewReference({ | 89 | onDidAttach={() => setWebviewReference({ |
92 | serviceId: service.id, | 90 | serviceId: service.id, |
93 | webview: this.webview.view, | 91 | webview: this.webview.view, |
94 | })} | 92 | })} |
95 | |||
96 | onUpdateTargetUrl={this.updateTargetUrl} | 93 | onUpdateTargetUrl={this.updateTargetUrl} |
97 | |||
98 | useragent={service.userAgent} | 94 | useragent={service.userAgent} |
99 | 95 | muted={service.isMuted} | |
100 | disablewebsecurity | 96 | disablewebsecurity |
101 | allowpopups | 97 | allowpopups |
102 | /> | 98 | /> |
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 9b359a78e..753781507 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -61,7 +61,11 @@ const messages = defineMessages({ | |||
61 | }, | 61 | }, |
62 | indirectMessageInfo: { | 62 | indirectMessageInfo: { |
63 | id: 'settings.service.form.indirectMessageInfo', | 63 | id: 'settings.service.form.indirectMessageInfo', |
64 | defaultMessage: '!!!You will be notified about all new messages in a channel, not just @username, @channel, @here, ...', // eslint-disable-line | 64 | defaultMessage: '!!!You will be notified about all new messages in a channel, not just @username, @channel, @here, ...', |
65 | }, | ||
66 | isMutedInfo: { | ||
67 | id: 'settings.service.form.isMutedInfo', | ||
68 | defaultMessage: '!!!When disabled, all notification sounds and audio playback are muted', | ||
65 | }, | 69 | }, |
66 | }); | 70 | }); |
67 | 71 | ||
@@ -231,11 +235,15 @@ export default class EditServiceForm extends Component { | |||
231 | {recipe.hasIndirectMessages && ( | 235 | {recipe.hasIndirectMessages && ( |
232 | <div> | 236 | <div> |
233 | <Toggle field={form.$('isIndirectMessageBadgeEnabled')} /> | 237 | <Toggle field={form.$('isIndirectMessageBadgeEnabled')} /> |
234 | <p className="settings__indirect-message-help"> | 238 | <p className="settings__help"> |
235 | {intl.formatMessage(messages.indirectMessageInfo)} | 239 | {intl.formatMessage(messages.indirectMessageInfo)} |
236 | </p> | 240 | </p> |
237 | </div> | 241 | </div> |
238 | )} | 242 | )} |
243 | <Toggle field={form.$('isMuted')} /> | ||
244 | <p className="settings__help"> | ||
245 | {intl.formatMessage(messages.isMutedInfo)} | ||
246 | </p> | ||
239 | <Toggle field={form.$('isEnabled')} /> | 247 | <Toggle field={form.$('isEnabled')} /> |
240 | </div> | 248 | </div> |
241 | {recipe.message && ( | 249 | {recipe.message && ( |
diff --git a/src/components/settings/services/ServiceItem.js b/src/components/settings/services/ServiceItem.js index 20d8581d0..9743315b0 100644 --- a/src/components/settings/services/ServiceItem.js +++ b/src/components/settings/services/ServiceItem.js | |||
@@ -16,6 +16,10 @@ const messages = defineMessages({ | |||
16 | id: 'settings.services.tooltip.notificationsDisabled', | 16 | id: 'settings.services.tooltip.notificationsDisabled', |
17 | defaultMessage: '!!!Notifications are disabled', | 17 | defaultMessage: '!!!Notifications are disabled', |
18 | }, | 18 | }, |
19 | tooltipIsMuted: { | ||
20 | id: 'settings.services.tooltip.isMuted', | ||
21 | defaultMessage: '!!!All sounds are muted', | ||
22 | }, | ||
19 | }); | 23 | }); |
20 | 24 | ||
21 | @observer | 25 | @observer |
@@ -66,6 +70,17 @@ export default class ServiceItem extends Component { | |||
66 | className="service-table__column-info" | 70 | className="service-table__column-info" |
67 | onClick={goToServiceForm} | 71 | onClick={goToServiceForm} |
68 | > | 72 | > |
73 | {service.isMuted && ( | ||
74 | <span | ||
75 | className="mdi mdi-bell-off" | ||
76 | data-tip={intl.formatMessage(messages.tooltipIsMuted)} | ||
77 | /> | ||
78 | )} | ||
79 | </td> | ||
80 | <td | ||
81 | className="service-table__column-info" | ||
82 | onClick={goToServiceForm} | ||
83 | > | ||
69 | {!service.isEnabled && ( | 84 | {!service.isEnabled && ( |
70 | <span | 85 | <span |
71 | className="mdi mdi-power" | 86 | className="mdi mdi-power" |
@@ -85,13 +100,6 @@ export default class ServiceItem extends Component { | |||
85 | )} | 100 | )} |
86 | <ReactTooltip place="top" type="dark" effect="solid" /> | 101 | <ReactTooltip place="top" type="dark" effect="solid" /> |
87 | </td> | 102 | </td> |
88 | {/* <td className="service-table__column-action"> | ||
89 | <input | ||
90 | type="checkbox" | ||
91 | onChange={toggleAction} | ||
92 | checked={service.isEnabled} | ||
93 | /> | ||
94 | </td> */} | ||
95 | </tr> | 103 | </tr> |
96 | ); | 104 | ); |
97 | } | 105 | } |