diff options
author | 2017-11-10 15:40:01 +0100 | |
---|---|---|
committer | 2017-11-10 15:40:01 +0100 | |
commit | f39e31af92f3ae6689697685d008f0487a5be351 (patch) | |
tree | c00654dbb28817cbfdca8223c1f86d38c706e163 /src/components/services/tabs | |
parent | feat(App): Respect System DoNotDisturb mode for service audio (diff) | |
parent | Merge pull request #248 from meetfranz/feature/192-display-disabled-services (diff) | |
download | ferdium-app-f39e31af92f3ae6689697685d008f0487a5be351.tar.gz ferdium-app-f39e31af92f3ae6689697685d008f0487a5be351.tar.zst ferdium-app-f39e31af92f3ae6689697685d008f0487a5be351.zip |
Merge branch 'develop' into feature/mute-service
# Conflicts:
# src/components/services/content/ServiceWebview.js
# src/components/services/content/Services.js
# src/components/services/tabs/TabItem.js
# src/containers/layout/AppLayoutContainer.js
Diffstat (limited to 'src/components/services/tabs')
-rw-r--r-- | src/components/services/tabs/TabBarSortableList.js | 3 | ||||
-rw-r--r-- | src/components/services/tabs/TabItem.js | 7 | ||||
-rw-r--r-- | src/components/services/tabs/Tabbar.js | 15 |
3 files changed, 22 insertions, 3 deletions
diff --git a/src/components/services/tabs/TabBarSortableList.js b/src/components/services/tabs/TabBarSortableList.js index 0146f5b35..2daf55676 100644 --- a/src/components/services/tabs/TabBarSortableList.js +++ b/src/components/services/tabs/TabBarSortableList.js | |||
@@ -16,6 +16,7 @@ class TabBarSortableList extends Component { | |||
16 | toggleAudio: PropTypes.func.isRequired, | 16 | toggleAudio: PropTypes.func.isRequired, |
17 | deleteService: PropTypes.func.isRequired, | 17 | deleteService: PropTypes.func.isRequired, |
18 | disableService: PropTypes.func.isRequired, | 18 | disableService: PropTypes.func.isRequired, |
19 | enableService: PropTypes.func.isRequired, | ||
19 | } | 20 | } |
20 | 21 | ||
21 | render() { | 22 | render() { |
@@ -27,6 +28,7 @@ class TabBarSortableList extends Component { | |||
27 | toggleAudio, | 28 | toggleAudio, |
28 | deleteService, | 29 | deleteService, |
29 | disableService, | 30 | disableService, |
31 | enableService, | ||
30 | openSettings, | 32 | openSettings, |
31 | } = this.props; | 33 | } = this.props; |
32 | 34 | ||
@@ -46,6 +48,7 @@ class TabBarSortableList extends Component { | |||
46 | toggleAudio={() => toggleAudio({ serviceId: service.id })} | 48 | toggleAudio={() => toggleAudio({ serviceId: service.id })} |
47 | deleteService={() => deleteService({ serviceId: service.id })} | 49 | deleteService={() => deleteService({ serviceId: service.id })} |
48 | disableService={() => disableService({ serviceId: service.id })} | 50 | disableService={() => disableService({ serviceId: service.id })} |
51 | enableService={() => enableService({ serviceId: service.id })} | ||
49 | openSettings={openSettings} | 52 | openSettings={openSettings} |
50 | /> | 53 | /> |
51 | ))} | 54 | ))} |
diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js index 7b001f6ee..4a37bad57 100644 --- a/src/components/services/tabs/TabItem.js +++ b/src/components/services/tabs/TabItem.js | |||
@@ -40,6 +40,10 @@ const messages = defineMessages({ | |||
40 | id: 'tabs.item.disableService', | 40 | id: 'tabs.item.disableService', |
41 | defaultMessage: '!!!Disable Service', | 41 | defaultMessage: '!!!Disable Service', |
42 | }, | 42 | }, |
43 | enableService: { | ||
44 | id: 'tabs.item.enableService', | ||
45 | defaultMessage: '!!!Enable Service', | ||
46 | }, | ||
43 | deleteService: { | 47 | deleteService: { |
44 | id: 'tabs.item.deleteService', | 48 | id: 'tabs.item.deleteService', |
45 | defaultMessage: '!!!Delete Service', | 49 | defaultMessage: '!!!Delete Service', |
@@ -58,6 +62,7 @@ class TabItem extends Component { | |||
58 | openSettings: PropTypes.func.isRequired, | 62 | openSettings: PropTypes.func.isRequired, |
59 | deleteService: PropTypes.func.isRequired, | 63 | deleteService: PropTypes.func.isRequired, |
60 | disableService: PropTypes.func.isRequired, | 64 | disableService: PropTypes.func.isRequired, |
65 | enableService: PropTypes.func.isRequired, | ||
61 | }; | 66 | }; |
62 | 67 | ||
63 | static contextTypes = { | 68 | static contextTypes = { |
@@ -74,6 +79,7 @@ class TabItem extends Component { | |||
74 | toggleAudio, | 79 | toggleAudio, |
75 | deleteService, | 80 | deleteService, |
76 | disableService, | 81 | disableService, |
82 | enableService, | ||
77 | openSettings, | 83 | openSettings, |
78 | } = this.props; | 84 | } = this.props; |
79 | const { intl } = this.context; | 85 | const { intl } = this.context; |
@@ -121,6 +127,7 @@ class TabItem extends Component { | |||
121 | 'tab-item': true, | 127 | 'tab-item': true, |
122 | 'is-active': service.isActive, | 128 | 'is-active': service.isActive, |
123 | 'has-custom-icon': service.hasCustomIcon, | 129 | 'has-custom-icon': service.hasCustomIcon, |
130 | 'is-disabled': !service.isEnabled, | ||
124 | })} | 131 | })} |
125 | onClick={clickHandler} | 132 | onClick={clickHandler} |
126 | onContextMenu={() => menu.popup(remote.getCurrentWindow())} | 133 | onContextMenu={() => menu.popup(remote.getCurrentWindow())} |
diff --git a/src/components/services/tabs/Tabbar.js b/src/components/services/tabs/Tabbar.js index e8cd80e33..fd4325107 100644 --- a/src/components/services/tabs/Tabbar.js +++ b/src/components/services/tabs/Tabbar.js | |||
@@ -30,20 +30,28 @@ export default class TabBar extends Component { | |||
30 | reorder({ oldIndex, newIndex }); | 30 | reorder({ oldIndex, newIndex }); |
31 | }; | 31 | }; |
32 | 32 | ||
33 | disableService = ({ serviceId }) => { | 33 | toggleService = ({ serviceId, isEnabled }) => { |
34 | const { updateService } = this.props; | 34 | const { updateService } = this.props; |
35 | 35 | ||
36 | if (serviceId) { | 36 | if (serviceId) { |
37 | updateService({ | 37 | updateService({ |
38 | serviceId, | 38 | serviceId, |
39 | serviceData: { | 39 | serviceData: { |
40 | isEnabled: false, | 40 | isEnabled, |
41 | }, | 41 | }, |
42 | redirect: false, | 42 | redirect: false, |
43 | }); | 43 | }); |
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
47 | disableService({ serviceId }) { | ||
48 | this.toggleService({ serviceId, isEnabled: false }); | ||
49 | } | ||
50 | |||
51 | enableService({ serviceId }) { | ||
52 | this.toggleService({ serviceId, isEnabled: true }); | ||
53 | } | ||
54 | |||
47 | render() { | 55 | render() { |
48 | const { | 56 | const { |
49 | services, | 57 | services, |
@@ -67,7 +75,8 @@ export default class TabBar extends Component { | |||
67 | toggleNotifications={toggleNotifications} | 75 | toggleNotifications={toggleNotifications} |
68 | toggleAudio={toggleAudio} | 76 | toggleAudio={toggleAudio} |
69 | deleteService={deleteService} | 77 | deleteService={deleteService} |
70 | disableService={this.disableService} | 78 | disableService={args => this.disableService(args)} |
79 | enableService={args => this.enableService(args)} | ||
71 | openSettings={openSettings} | 80 | openSettings={openSettings} |
72 | distance={20} | 81 | distance={20} |
73 | axis="y" | 82 | axis="y" |