diff options
author | Dominik Guzei <dominik.guzei@gmail.com> | 2019-03-21 12:35:56 +0100 |
---|---|---|
committer | Dominik Guzei <dominik.guzei@gmail.com> | 2019-03-21 12:35:56 +0100 |
commit | 489d4cee38daf6177a9a914d3ccb5048c8acd01a (patch) | |
tree | 8f712b9f9ae8249653ad5376c9ce679413206026 /src | |
parent | change workspace switch shortcuts to start with zero (diff) | |
download | ferdium-app-489d4cee38daf6177a9a914d3ccb5048c8acd01a.tar.gz ferdium-app-489d4cee38daf6177a9a914d3ccb5048c8acd01a.tar.zst ferdium-app-489d4cee38daf6177a9a914d3ccb5048c8acd01a.zip |
add workspace drawer toggle menu item and shortcut
Diffstat (limited to 'src')
-rw-r--r-- | src/i18n/locales/defaultMessages.json | 74 | ||||
-rw-r--r-- | src/i18n/locales/en-US.json | 2 | ||||
-rw-r--r-- | src/i18n/messages/src/lib/Menu.json | 50 | ||||
-rw-r--r-- | src/lib/Menu.js | 23 | ||||
-rw-r--r-- | src/stores/UserStore.js | 4 |
5 files changed, 116 insertions, 37 deletions
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json index 4bf9a8c0a..1c6c6c969 100644 --- a/src/i18n/locales/defaultMessages.json +++ b/src/i18n/locales/defaultMessages.json | |||
@@ -625,78 +625,78 @@ | |||
625 | "defaultMessage": "!!!Your services have been updated.", | 625 | "defaultMessage": "!!!Your services have been updated.", |
626 | "end": { | 626 | "end": { |
627 | "column": 3, | 627 | "column": 3, |
628 | "line": 25 | 628 | "line": 27 |
629 | }, | 629 | }, |
630 | "file": "src/components/layout/AppLayout.js", | 630 | "file": "src/components/layout/AppLayout.js", |
631 | "id": "infobar.servicesUpdated", | 631 | "id": "infobar.servicesUpdated", |
632 | "start": { | 632 | "start": { |
633 | "column": 19, | 633 | "column": 19, |
634 | "line": 22 | 634 | "line": 24 |
635 | } | 635 | } |
636 | }, | 636 | }, |
637 | { | 637 | { |
638 | "defaultMessage": "!!!A new update for Franz is available.", | 638 | "defaultMessage": "!!!A new update for Franz is available.", |
639 | "end": { | 639 | "end": { |
640 | "column": 3, | 640 | "column": 3, |
641 | "line": 29 | 641 | "line": 31 |
642 | }, | 642 | }, |
643 | "file": "src/components/layout/AppLayout.js", | 643 | "file": "src/components/layout/AppLayout.js", |
644 | "id": "infobar.updateAvailable", | 644 | "id": "infobar.updateAvailable", |
645 | "start": { | 645 | "start": { |
646 | "column": 19, | 646 | "column": 19, |
647 | "line": 26 | 647 | "line": 28 |
648 | } | 648 | } |
649 | }, | 649 | }, |
650 | { | 650 | { |
651 | "defaultMessage": "!!!Reload services", | 651 | "defaultMessage": "!!!Reload services", |
652 | "end": { | 652 | "end": { |
653 | "column": 3, | 653 | "column": 3, |
654 | "line": 33 | 654 | "line": 35 |
655 | }, | 655 | }, |
656 | "file": "src/components/layout/AppLayout.js", | 656 | "file": "src/components/layout/AppLayout.js", |
657 | "id": "infobar.buttonReloadServices", | 657 | "id": "infobar.buttonReloadServices", |
658 | "start": { | 658 | "start": { |
659 | "column": 24, | 659 | "column": 24, |
660 | "line": 30 | 660 | "line": 32 |
661 | } | 661 | } |
662 | }, | 662 | }, |
663 | { | 663 | { |
664 | "defaultMessage": "!!!Changelog", | 664 | "defaultMessage": "!!!Changelog", |
665 | "end": { | 665 | "end": { |
666 | "column": 3, | 666 | "column": 3, |
667 | "line": 37 | 667 | "line": 39 |
668 | }, | 668 | }, |
669 | "file": "src/components/layout/AppLayout.js", | 669 | "file": "src/components/layout/AppLayout.js", |
670 | "id": "infobar.buttonChangelog", | 670 | "id": "infobar.buttonChangelog", |
671 | "start": { | 671 | "start": { |
672 | "column": 13, | 672 | "column": 13, |
673 | "line": 34 | 673 | "line": 36 |
674 | } | 674 | } |
675 | }, | 675 | }, |
676 | { | 676 | { |
677 | "defaultMessage": "!!!Restart & install update", | 677 | "defaultMessage": "!!!Restart & install update", |
678 | "end": { | 678 | "end": { |
679 | "column": 3, | 679 | "column": 3, |
680 | "line": 41 | 680 | "line": 43 |
681 | }, | 681 | }, |
682 | "file": "src/components/layout/AppLayout.js", | 682 | "file": "src/components/layout/AppLayout.js", |
683 | "id": "infobar.buttonInstallUpdate", | 683 | "id": "infobar.buttonInstallUpdate", |
684 | "start": { | 684 | "start": { |
685 | "column": 23, | 685 | "column": 23, |
686 | "line": 38 | 686 | "line": 40 |
687 | } | 687 | } |
688 | }, | 688 | }, |
689 | { | 689 | { |
690 | "defaultMessage": "!!!Could not load services and user information", | 690 | "defaultMessage": "!!!Could not load services and user information", |
691 | "end": { | 691 | "end": { |
692 | "column": 3, | 692 | "column": 3, |
693 | "line": 45 | 693 | "line": 47 |
694 | }, | 694 | }, |
695 | "file": "src/components/layout/AppLayout.js", | 695 | "file": "src/components/layout/AppLayout.js", |
696 | "id": "infobar.requiredRequestsFailed", | 696 | "id": "infobar.requiredRequestsFailed", |
697 | "start": { | 697 | "start": { |
698 | "column": 26, | 698 | "column": 26, |
699 | "line": 42 | 699 | "line": 44 |
700 | } | 700 | } |
701 | } | 701 | } |
702 | ], | 702 | ], |
@@ -4092,81 +4092,107 @@ | |||
4092 | } | 4092 | } |
4093 | }, | 4093 | }, |
4094 | { | 4094 | { |
4095 | "defaultMessage": "!!!Activate next service...", | 4095 | "defaultMessage": "!!!Open workspace drawer", |
4096 | "end": { | 4096 | "end": { |
4097 | "column": 3, | 4097 | "column": 3, |
4098 | "line": 191 | 4098 | "line": 191 |
4099 | }, | 4099 | }, |
4100 | "file": "src/lib/Menu.js", | 4100 | "file": "src/lib/Menu.js", |
4101 | "id": "menu.services.setNextServiceActive", | 4101 | "id": "menu.workspaces.openWorkspaceDrawer", |
4102 | "start": { | 4102 | "start": { |
4103 | "column": 23, | 4103 | "column": 23, |
4104 | "line": 188 | 4104 | "line": 188 |
4105 | } | 4105 | } |
4106 | }, | 4106 | }, |
4107 | { | 4107 | { |
4108 | "defaultMessage": "!!!Activate previous service...", | 4108 | "defaultMessage": "!!!Close workspace drawer", |
4109 | "end": { | 4109 | "end": { |
4110 | "column": 3, | 4110 | "column": 3, |
4111 | "line": 195 | 4111 | "line": 195 |
4112 | }, | 4112 | }, |
4113 | "file": "src/lib/Menu.js", | 4113 | "file": "src/lib/Menu.js", |
4114 | "id": "menu.workspaces.closeWorkspaceDrawer", | ||
4115 | "start": { | ||
4116 | "column": 24, | ||
4117 | "line": 192 | ||
4118 | } | ||
4119 | }, | ||
4120 | { | ||
4121 | "defaultMessage": "!!!Activate next service...", | ||
4122 | "end": { | ||
4123 | "column": 3, | ||
4124 | "line": 199 | ||
4125 | }, | ||
4126 | "file": "src/lib/Menu.js", | ||
4127 | "id": "menu.services.setNextServiceActive", | ||
4128 | "start": { | ||
4129 | "column": 23, | ||
4130 | "line": 196 | ||
4131 | } | ||
4132 | }, | ||
4133 | { | ||
4134 | "defaultMessage": "!!!Activate previous service...", | ||
4135 | "end": { | ||
4136 | "column": 3, | ||
4137 | "line": 203 | ||
4138 | }, | ||
4139 | "file": "src/lib/Menu.js", | ||
4114 | "id": "menu.services.activatePreviousService", | 4140 | "id": "menu.services.activatePreviousService", |
4115 | "start": { | 4141 | "start": { |
4116 | "column": 27, | 4142 | "column": 27, |
4117 | "line": 192 | 4143 | "line": 200 |
4118 | } | 4144 | } |
4119 | }, | 4145 | }, |
4120 | { | 4146 | { |
4121 | "defaultMessage": "!!!Disable notifications & audio", | 4147 | "defaultMessage": "!!!Disable notifications & audio", |
4122 | "end": { | 4148 | "end": { |
4123 | "column": 3, | 4149 | "column": 3, |
4124 | "line": 199 | 4150 | "line": 207 |
4125 | }, | 4151 | }, |
4126 | "file": "src/lib/Menu.js", | 4152 | "file": "src/lib/Menu.js", |
4127 | "id": "sidebar.muteApp", | 4153 | "id": "sidebar.muteApp", |
4128 | "start": { | 4154 | "start": { |
4129 | "column": 11, | 4155 | "column": 11, |
4130 | "line": 196 | 4156 | "line": 204 |
4131 | } | 4157 | } |
4132 | }, | 4158 | }, |
4133 | { | 4159 | { |
4134 | "defaultMessage": "!!!Enable notifications & audio", | 4160 | "defaultMessage": "!!!Enable notifications & audio", |
4135 | "end": { | 4161 | "end": { |
4136 | "column": 3, | 4162 | "column": 3, |
4137 | "line": 203 | 4163 | "line": 211 |
4138 | }, | 4164 | }, |
4139 | "file": "src/lib/Menu.js", | 4165 | "file": "src/lib/Menu.js", |
4140 | "id": "sidebar.unmuteApp", | 4166 | "id": "sidebar.unmuteApp", |
4141 | "start": { | 4167 | "start": { |
4142 | "column": 13, | 4168 | "column": 13, |
4143 | "line": 200 | 4169 | "line": 208 |
4144 | } | 4170 | } |
4145 | }, | 4171 | }, |
4146 | { | 4172 | { |
4147 | "defaultMessage": "!!!Workspaces", | 4173 | "defaultMessage": "!!!Workspaces", |
4148 | "end": { | 4174 | "end": { |
4149 | "column": 3, | 4175 | "column": 3, |
4150 | "line": 207 | 4176 | "line": 215 |
4151 | }, | 4177 | }, |
4152 | "file": "src/lib/Menu.js", | 4178 | "file": "src/lib/Menu.js", |
4153 | "id": "menu.workspaces", | 4179 | "id": "menu.workspaces", |
4154 | "start": { | 4180 | "start": { |
4155 | "column": 14, | 4181 | "column": 14, |
4156 | "line": 204 | 4182 | "line": 212 |
4157 | } | 4183 | } |
4158 | }, | 4184 | }, |
4159 | { | 4185 | { |
4160 | "defaultMessage": "!!!Default", | 4186 | "defaultMessage": "!!!Default", |
4161 | "end": { | 4187 | "end": { |
4162 | "column": 3, | 4188 | "column": 3, |
4163 | "line": 211 | 4189 | "line": 219 |
4164 | }, | 4190 | }, |
4165 | "file": "src/lib/Menu.js", | 4191 | "file": "src/lib/Menu.js", |
4166 | "id": "menu.workspaces.defaultWorkspace", | 4192 | "id": "menu.workspaces.defaultWorkspace", |
4167 | "start": { | 4193 | "start": { |
4168 | "column": 20, | 4194 | "column": 20, |
4169 | "line": 208 | 4195 | "line": 216 |
4170 | } | 4196 | } |
4171 | } | 4197 | } |
4172 | ], | 4198 | ], |
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 94c6fcf32..9716c3717 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json | |||
@@ -89,7 +89,9 @@ | |||
89 | "menu.window.minimize": "Minimize", | 89 | "menu.window.minimize": "Minimize", |
90 | "menu.workspaces": "Workspaces", | 90 | "menu.workspaces": "Workspaces", |
91 | "menu.workspaces.addNewWorkspace": "Add New Workspace...", | 91 | "menu.workspaces.addNewWorkspace": "Add New Workspace...", |
92 | "menu.workspaces.closeWorkspaceDrawer": "Close workspace drawer", | ||
92 | "menu.workspaces.defaultWorkspace": "All services", | 93 | "menu.workspaces.defaultWorkspace": "All services", |
94 | "menu.workspaces.openWorkspaceDrawer": "Open workspace drawer", | ||
93 | "password.email.label": "Email address", | 95 | "password.email.label": "Email address", |
94 | "password.headline": "Reset password", | 96 | "password.headline": "Reset password", |
95 | "password.link.login": "Sign in to your account", | 97 | "password.link.login": "Sign in to your account", |
diff --git a/src/i18n/messages/src/lib/Menu.json b/src/i18n/messages/src/lib/Menu.json index 53fa038c6..adbbd2638 100644 --- a/src/i18n/messages/src/lib/Menu.json +++ b/src/i18n/messages/src/lib/Menu.json | |||
@@ -572,8 +572,8 @@ | |||
572 | } | 572 | } |
573 | }, | 573 | }, |
574 | { | 574 | { |
575 | "id": "menu.services.setNextServiceActive", | 575 | "id": "menu.workspaces.openWorkspaceDrawer", |
576 | "defaultMessage": "!!!Activate next service...", | 576 | "defaultMessage": "!!!Open workspace drawer", |
577 | "file": "src/lib/Menu.js", | 577 | "file": "src/lib/Menu.js", |
578 | "start": { | 578 | "start": { |
579 | "line": 188, | 579 | "line": 188, |
@@ -585,15 +585,41 @@ | |||
585 | } | 585 | } |
586 | }, | 586 | }, |
587 | { | 587 | { |
588 | "id": "menu.workspaces.closeWorkspaceDrawer", | ||
589 | "defaultMessage": "!!!Close workspace drawer", | ||
590 | "file": "src/lib/Menu.js", | ||
591 | "start": { | ||
592 | "line": 192, | ||
593 | "column": 24 | ||
594 | }, | ||
595 | "end": { | ||
596 | "line": 195, | ||
597 | "column": 3 | ||
598 | } | ||
599 | }, | ||
600 | { | ||
601 | "id": "menu.services.setNextServiceActive", | ||
602 | "defaultMessage": "!!!Activate next service...", | ||
603 | "file": "src/lib/Menu.js", | ||
604 | "start": { | ||
605 | "line": 196, | ||
606 | "column": 23 | ||
607 | }, | ||
608 | "end": { | ||
609 | "line": 199, | ||
610 | "column": 3 | ||
611 | } | ||
612 | }, | ||
613 | { | ||
588 | "id": "menu.services.activatePreviousService", | 614 | "id": "menu.services.activatePreviousService", |
589 | "defaultMessage": "!!!Activate previous service...", | 615 | "defaultMessage": "!!!Activate previous service...", |
590 | "file": "src/lib/Menu.js", | 616 | "file": "src/lib/Menu.js", |
591 | "start": { | 617 | "start": { |
592 | "line": 192, | 618 | "line": 200, |
593 | "column": 27 | 619 | "column": 27 |
594 | }, | 620 | }, |
595 | "end": { | 621 | "end": { |
596 | "line": 195, | 622 | "line": 203, |
597 | "column": 3 | 623 | "column": 3 |
598 | } | 624 | } |
599 | }, | 625 | }, |
@@ -602,11 +628,11 @@ | |||
602 | "defaultMessage": "!!!Disable notifications & audio", | 628 | "defaultMessage": "!!!Disable notifications & audio", |
603 | "file": "src/lib/Menu.js", | 629 | "file": "src/lib/Menu.js", |
604 | "start": { | 630 | "start": { |
605 | "line": 196, | 631 | "line": 204, |
606 | "column": 11 | 632 | "column": 11 |
607 | }, | 633 | }, |
608 | "end": { | 634 | "end": { |
609 | "line": 199, | 635 | "line": 207, |
610 | "column": 3 | 636 | "column": 3 |
611 | } | 637 | } |
612 | }, | 638 | }, |
@@ -615,11 +641,11 @@ | |||
615 | "defaultMessage": "!!!Enable notifications & audio", | 641 | "defaultMessage": "!!!Enable notifications & audio", |
616 | "file": "src/lib/Menu.js", | 642 | "file": "src/lib/Menu.js", |
617 | "start": { | 643 | "start": { |
618 | "line": 200, | 644 | "line": 208, |
619 | "column": 13 | 645 | "column": 13 |
620 | }, | 646 | }, |
621 | "end": { | 647 | "end": { |
622 | "line": 203, | 648 | "line": 211, |
623 | "column": 3 | 649 | "column": 3 |
624 | } | 650 | } |
625 | }, | 651 | }, |
@@ -628,11 +654,11 @@ | |||
628 | "defaultMessage": "!!!Workspaces", | 654 | "defaultMessage": "!!!Workspaces", |
629 | "file": "src/lib/Menu.js", | 655 | "file": "src/lib/Menu.js", |
630 | "start": { | 656 | "start": { |
631 | "line": 204, | 657 | "line": 212, |
632 | "column": 14 | 658 | "column": 14 |
633 | }, | 659 | }, |
634 | "end": { | 660 | "end": { |
635 | "line": 207, | 661 | "line": 215, |
636 | "column": 3 | 662 | "column": 3 |
637 | } | 663 | } |
638 | }, | 664 | }, |
@@ -641,11 +667,11 @@ | |||
641 | "defaultMessage": "!!!Default", | 667 | "defaultMessage": "!!!Default", |
642 | "file": "src/lib/Menu.js", | 668 | "file": "src/lib/Menu.js", |
643 | "start": { | 669 | "start": { |
644 | "line": 208, | 670 | "line": 216, |
645 | "column": 20 | 671 | "column": 20 |
646 | }, | 672 | }, |
647 | "end": { | 673 | "end": { |
648 | "line": 211, | 674 | "line": 219, |
649 | "column": 3 | 675 | "column": 3 |
650 | } | 676 | } |
651 | } | 677 | } |
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 1d4f0e001..2a88515f4 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -185,6 +185,14 @@ const menuItems = defineMessages({ | |||
185 | id: 'menu.workspaces.addNewWorkspace', | 185 | id: 'menu.workspaces.addNewWorkspace', |
186 | defaultMessage: '!!!Add New Workspace...', | 186 | defaultMessage: '!!!Add New Workspace...', |
187 | }, | 187 | }, |
188 | openWorkspaceDrawer: { | ||
189 | id: 'menu.workspaces.openWorkspaceDrawer', | ||
190 | defaultMessage: '!!!Open workspace drawer', | ||
191 | }, | ||
192 | closeWorkspaceDrawer: { | ||
193 | id: 'menu.workspaces.closeWorkspaceDrawer', | ||
194 | defaultMessage: '!!!Close workspace drawer', | ||
195 | }, | ||
188 | activateNextService: { | 196 | activateNextService: { |
189 | id: 'menu.services.setNextServiceActive', | 197 | id: 'menu.services.setNextServiceActive', |
190 | defaultMessage: '!!!Activate next service...', | 198 | defaultMessage: '!!!Activate next service...', |
@@ -788,6 +796,19 @@ export default class FranzMenu { | |||
788 | workspaceActions.openWorkspaceSettings(); | 796 | workspaceActions.openWorkspaceSettings(); |
789 | }, | 797 | }, |
790 | enabled: this.stores.user.isLoggedIn, | 798 | enabled: this.stores.user.isLoggedIn, |
799 | }); | ||
800 | |||
801 | // Open workspace drawer: | ||
802 | const drawerLabel = ( | ||
803 | workspacesState.isWorkspaceDrawerOpen ? menuItems.closeWorkspaceDrawer : menuItems.openWorkspaceDrawer | ||
804 | ); | ||
805 | menu.push({ | ||
806 | label: intl.formatMessage(drawerLabel), | ||
807 | accelerator: `${cmdKey}+D`, | ||
808 | click: () => { | ||
809 | workspaceActions.toggleWorkspaceDrawer(); | ||
810 | }, | ||
811 | enabled: this.stores.user.isLoggedIn, | ||
791 | }, { | 812 | }, { |
792 | type: 'separator', | 813 | type: 'separator', |
793 | }); | 814 | }); |
@@ -804,7 +825,7 @@ export default class FranzMenu { | |||
804 | }); | 825 | }); |
805 | 826 | ||
806 | // Workspace items | 827 | // Workspace items |
807 | if (this.stores.user.isLoggedIn) { | 828 | if (this.stores.user.isPremium) { |
808 | workspaces.forEach((workspace, i) => menu.push({ | 829 | workspaces.forEach((workspace, i) => menu.push({ |
809 | label: workspace.name, | 830 | label: workspace.name, |
810 | accelerator: i < 9 ? `${cmdKey}+Alt+${i + 1}` : null, | 831 | accelerator: i < 9 ? `${cmdKey}+Alt+${i + 1}` : null, |
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js index 77d84afe1..534690fbb 100644 --- a/src/stores/UserStore.js +++ b/src/stores/UserStore.js | |||
@@ -142,6 +142,10 @@ export default class UserStore extends Store { | |||
142 | return this.getUserInfoRequest.execute().result || {}; | 142 | return this.getUserInfoRequest.execute().result || {}; |
143 | } | 143 | } |
144 | 144 | ||
145 | @computed get isPremium() { | ||
146 | return !!this.data.isPremium; | ||
147 | } | ||
148 | |||
145 | @computed get legacyServices() { | 149 | @computed get legacyServices() { |
146 | return this.getLegacyServicesRequest.execute() || {}; | 150 | return this.getLegacyServicesRequest.execute() || {}; |
147 | } | 151 | } |