aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-03-21 16:30:13 +0100
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-03-21 16:30:59 +0100
commitaf55b33800eeed36b50b1967da694acbb3991ecb (patch)
treef82e5d9c8a9343034b20d988760b685780024cac
parentadd tooltip to add workspace button in drawer (diff)
downloadferdium-app-af55b33800eeed36b50b1967da694acbb3991ecb.tar.gz
ferdium-app-af55b33800eeed36b50b1967da694acbb3991ecb.tar.zst
ferdium-app-af55b33800eeed36b50b1967da694acbb3991ecb.zip
add workspaces count badge in settings navigation
-rw-r--r--src/components/settings/navigation/SettingsNavigation.js4
-rw-r--r--src/containers/settings/SettingsWindow.js2
-rw-r--r--src/features/workspaces/components/WorkspaceDrawer.js1
-rw-r--r--src/i18n/locales/defaultMessages.json12
-rw-r--r--src/i18n/locales/en-US.json2
-rw-r--r--src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json12
-rw-r--r--src/styles/settings.scss5
7 files changed, 21 insertions, 17 deletions
diff --git a/src/components/settings/navigation/SettingsNavigation.js b/src/components/settings/navigation/SettingsNavigation.js
index 4a80bb126..3f570f3b6 100644
--- a/src/components/settings/navigation/SettingsNavigation.js
+++ b/src/components/settings/navigation/SettingsNavigation.js
@@ -39,6 +39,7 @@ const messages = defineMessages({
39export default @inject('stores') @observer class SettingsNavigation extends Component { 39export default @inject('stores') @observer class SettingsNavigation extends Component {
40 static propTypes = { 40 static propTypes = {
41 serviceCount: PropTypes.number.isRequired, 41 serviceCount: PropTypes.number.isRequired,
42 workspaceCount: PropTypes.number.isRequired,
42 }; 43 };
43 44
44 static contextTypes = { 45 static contextTypes = {
@@ -46,7 +47,7 @@ export default @inject('stores') @observer class SettingsNavigation extends Comp
46 }; 47 };
47 48
48 render() { 49 render() {
49 const { serviceCount } = this.props; 50 const { serviceCount, workspaceCount } = this.props;
50 const { intl } = this.context; 51 const { intl } = this.context;
51 52
52 return ( 53 return (
@@ -74,6 +75,7 @@ export default @inject('stores') @observer class SettingsNavigation extends Comp
74 > 75 >
75 {intl.formatMessage(messages.yourWorkspaces)} 76 {intl.formatMessage(messages.yourWorkspaces)}
76 {' '} 77 {' '}
78 <span className="badge">{workspaceCount}</span>
77 </Link> 79 </Link>
78 <Link 80 <Link
79 to="/settings/user" 81 to="/settings/user"
diff --git a/src/containers/settings/SettingsWindow.js b/src/containers/settings/SettingsWindow.js
index 6d9e0ee77..8cbde24c1 100644
--- a/src/containers/settings/SettingsWindow.js
+++ b/src/containers/settings/SettingsWindow.js
@@ -7,6 +7,7 @@ import ServicesStore from '../../stores/ServicesStore';
7import Layout from '../../components/settings/SettingsLayout'; 7import Layout from '../../components/settings/SettingsLayout';
8import Navigation from '../../components/settings/navigation/SettingsNavigation'; 8import Navigation from '../../components/settings/navigation/SettingsNavigation';
9import ErrorBoundary from '../../components/util/ErrorBoundary'; 9import ErrorBoundary from '../../components/util/ErrorBoundary';
10import { workspacesState } from '../../features/workspaces/state';
10 11
11export default @inject('stores', 'actions') @observer class SettingsContainer extends Component { 12export default @inject('stores', 'actions') @observer class SettingsContainer extends Component {
12 render() { 13 render() {
@@ -16,6 +17,7 @@ export default @inject('stores', 'actions') @observer class SettingsContainer ex
16 const navigation = ( 17 const navigation = (
17 <Navigation 18 <Navigation
18 serviceCount={stores.services.all.length} 19 serviceCount={stores.services.all.length}
20 workspaceCount={workspacesState.workspaces.length}
19 /> 21 />
20 ); 22 );
21 23
diff --git a/src/features/workspaces/components/WorkspaceDrawer.js b/src/features/workspaces/components/WorkspaceDrawer.js
index 5a8d5d854..c18eb0e11 100644
--- a/src/features/workspaces/components/WorkspaceDrawer.js
+++ b/src/features/workspaces/components/WorkspaceDrawer.js
@@ -9,7 +9,6 @@ import ReactTooltip from 'react-tooltip';
9import { workspacesState } from '../state'; 9import { workspacesState } from '../state';
10import WorkspaceDrawerItem from './WorkspaceDrawerItem'; 10import WorkspaceDrawerItem from './WorkspaceDrawerItem';
11import { workspaceActions } from '../actions'; 11import { workspaceActions } from '../actions';
12import { ctrlKey } from '../../../environment';
13 12
14const messages = defineMessages({ 13const messages = defineMessages({
15 headline: { 14 headline: {
diff --git a/src/i18n/locales/defaultMessages.json b/src/i18n/locales/defaultMessages.json
index d4d2a55cc..480f5c6cb 100644
--- a/src/i18n/locales/defaultMessages.json
+++ b/src/i18n/locales/defaultMessages.json
@@ -3326,39 +3326,39 @@
3326 "defaultMessage": "!!!Workspaces", 3326 "defaultMessage": "!!!Workspaces",
3327 "end": { 3327 "end": {
3328 "column": 3, 3328 "column": 3,
3329 "line": 18 3329 "line": 17
3330 }, 3330 },
3331 "file": "src/features/workspaces/components/WorkspaceDrawer.js", 3331 "file": "src/features/workspaces/components/WorkspaceDrawer.js",
3332 "id": "workspaceDrawer.headline", 3332 "id": "workspaceDrawer.headline",
3333 "start": { 3333 "start": {
3334 "column": 12, 3334 "column": 12,
3335 "line": 15 3335 "line": 14
3336 } 3336 }
3337 }, 3337 },
3338 { 3338 {
3339 "defaultMessage": "!!!All services", 3339 "defaultMessage": "!!!All services",
3340 "end": { 3340 "end": {
3341 "column": 3, 3341 "column": 3,
3342 "line": 22 3342 "line": 21
3343 }, 3343 },
3344 "file": "src/features/workspaces/components/WorkspaceDrawer.js", 3344 "file": "src/features/workspaces/components/WorkspaceDrawer.js",
3345 "id": "workspaceDrawer.allServices", 3345 "id": "workspaceDrawer.allServices",
3346 "start": { 3346 "start": {
3347 "column": 15, 3347 "column": 15,
3348 "line": 19 3348 "line": 18
3349 } 3349 }
3350 }, 3350 },
3351 { 3351 {
3352 "defaultMessage": "!!!Add workspace", 3352 "defaultMessage": "!!!Add workspace",
3353 "end": { 3353 "end": {
3354 "column": 3, 3354 "column": 3,
3355 "line": 26 3355 "line": 25
3356 }, 3356 },
3357 "file": "src/features/workspaces/components/WorkspaceDrawer.js", 3357 "file": "src/features/workspaces/components/WorkspaceDrawer.js",
3358 "id": "workspaceDrawer.addWorkspaceTooltip", 3358 "id": "workspaceDrawer.addWorkspaceTooltip",
3359 "start": { 3359 "start": {
3360 "column": 23, 3360 "column": 23,
3361 "line": 23 3361 "line": 22
3362 } 3362 }
3363 } 3363 }
3364 ], 3364 ],
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json
index f7b5fe2b8..4206d4358 100644
--- a/src/i18n/locales/en-US.json
+++ b/src/i18n/locales/en-US.json
@@ -305,4 +305,4 @@
305 "workspaceDrawer.headline": "Workspaces", 305 "workspaceDrawer.headline": "Workspaces",
306 "workspaceDrawer.item.noServicesAddedYet": "No services added yet", 306 "workspaceDrawer.item.noServicesAddedYet": "No services added yet",
307 "workspaces.switchingIndicator.switchingTo": "Switching to" 307 "workspaces.switchingIndicator.switchingTo": "Switching to"
308} 308} \ No newline at end of file
diff --git a/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json b/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json
index 7026708e2..4e3237164 100644
--- a/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json
+++ b/src/i18n/messages/src/features/workspaces/components/WorkspaceDrawer.json
@@ -4,11 +4,11 @@
4 "defaultMessage": "!!!Workspaces", 4 "defaultMessage": "!!!Workspaces",
5 "file": "src/features/workspaces/components/WorkspaceDrawer.js", 5 "file": "src/features/workspaces/components/WorkspaceDrawer.js",
6 "start": { 6 "start": {
7 "line": 15, 7 "line": 14,
8 "column": 12 8 "column": 12
9 }, 9 },
10 "end": { 10 "end": {
11 "line": 18, 11 "line": 17,
12 "column": 3 12 "column": 3
13 } 13 }
14 }, 14 },
@@ -17,11 +17,11 @@
17 "defaultMessage": "!!!All services", 17 "defaultMessage": "!!!All services",
18 "file": "src/features/workspaces/components/WorkspaceDrawer.js", 18 "file": "src/features/workspaces/components/WorkspaceDrawer.js",
19 "start": { 19 "start": {
20 "line": 19, 20 "line": 18,
21 "column": 15 21 "column": 15
22 }, 22 },
23 "end": { 23 "end": {
24 "line": 22, 24 "line": 21,
25 "column": 3 25 "column": 3
26 } 26 }
27 }, 27 },
@@ -30,11 +30,11 @@
30 "defaultMessage": "!!!Add workspace", 30 "defaultMessage": "!!!Add workspace",
31 "file": "src/features/workspaces/components/WorkspaceDrawer.js", 31 "file": "src/features/workspaces/components/WorkspaceDrawer.js",
32 "start": { 32 "start": {
33 "line": 23, 33 "line": 22,
34 "column": 23 34 "column": 23
35 }, 35 },
36 "end": { 36 "end": {
37 "line": 26, 37 "line": 25,
38 "column": 3 38 "column": 3
39 } 39 }
40 } 40 }
diff --git a/src/styles/settings.scss b/src/styles/settings.scss
index 750b6bedd..9fde9a7bf 100644
--- a/src/styles/settings.scss
+++ b/src/styles/settings.scss
@@ -68,7 +68,7 @@
68 } 68 }
69 } 69 }
70 70
71 .premium-info { 71 .premium-info {
72 background: $dark-theme-gray-darker; 72 background: $dark-theme-gray-darker;
73 border: 2px solid $theme-brand-primary; 73 border: 2px solid $theme-brand-primary;
74 } 74 }
@@ -414,6 +414,7 @@
414 414
415 .settings-navigation__link { 415 .settings-navigation__link {
416 align-items: center; 416 align-items: center;
417 justify-content: space-between;
417 color: $theme-text-color; 418 color: $theme-text-color;
418 display: flex; 419 display: flex;
419 flex-shrink: 0; 420 flex-shrink: 0;
@@ -442,8 +443,8 @@
442 .settings-navigation__expander { flex: 1; } 443 .settings-navigation__expander { flex: 1; }
443 444
444 .badge { 445 .badge {
446
445 display: initial; 447 display: initial;
446 margin-left: 5px;
447 transition: background $theme-transition-time, color $theme-transition-time; 448 transition: background $theme-transition-time, color $theme-transition-time;
448 } 449 }
449 450