aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-03-21 16:15:43 +0100
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-03-21 16:15:43 +0100
commit860d7d2c9b7816e14a98e6090d090aa339716919 (patch)
treec9f8c0fd50002cb7a4a1d43f2665fd09ea7c607b /src/features
parentadd i18n messages for service loading and workspace switching (diff)
downloadferdium-app-860d7d2c9b7816e14a98e6090d090aa339716919.tar.gz
ferdium-app-860d7d2c9b7816e14a98e6090d090aa339716919.tar.zst
ferdium-app-860d7d2c9b7816e14a98e6090d090aa339716919.zip
small fixes
Diffstat (limited to 'src/features')
-rw-r--r--src/features/workspaces/components/WorkspaceDrawerItem.js15
-rw-r--r--src/features/workspaces/containers/WorkspacesScreen.js2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/features/workspaces/components/WorkspaceDrawerItem.js b/src/features/workspaces/components/WorkspaceDrawerItem.js
index d2cdf1c0a..1e28ebea6 100644
--- a/src/features/workspaces/components/WorkspaceDrawerItem.js
+++ b/src/features/workspaces/components/WorkspaceDrawerItem.js
@@ -3,6 +3,14 @@ import PropTypes from 'prop-types';
3import { observer } from 'mobx-react'; 3import { observer } from 'mobx-react';
4import injectSheet from 'react-jss'; 4import injectSheet from 'react-jss';
5import classnames from 'classnames'; 5import classnames from 'classnames';
6import { defineMessages, intlShape } from 'react-intl';
7
8const messages = defineMessages({
9 noServicesAddedYet: {
10 id: 'workspaceDrawer.item.noServicesAddedYet',
11 defaultMessage: '!!!No services added yet',
12 },
13});
6 14
7const styles = theme => ({ 15const styles = theme => ({
8 item: { 16 item: {
@@ -48,6 +56,10 @@ class WorkspaceDrawerItem extends Component {
48 services: PropTypes.arrayOf(PropTypes.string).isRequired, 56 services: PropTypes.arrayOf(PropTypes.string).isRequired,
49 }; 57 };
50 58
59 static contextTypes = {
60 intl: intlShape,
61 };
62
51 render() { 63 render() {
52 const { 64 const {
53 classes, 65 classes,
@@ -56,6 +68,7 @@ class WorkspaceDrawerItem extends Component {
56 onClick, 68 onClick,
57 services, 69 services,
58 } = this.props; 70 } = this.props;
71 const { intl } = this.context;
59 return ( 72 return (
60 <div 73 <div
61 className={classnames([ 74 className={classnames([
@@ -78,7 +91,7 @@ class WorkspaceDrawerItem extends Component {
78 isActive ? classes.activeServices : null, 91 isActive ? classes.activeServices : null,
79 ])} 92 ])}
80 > 93 >
81 {services.join(', ')} 94 {services.length ? services.join(', ') : intl.formatMessage(messages.noServicesAddedYet)}
82 </span> 95 </span>
83 </div> 96 </div>
84 ); 97 );
diff --git a/src/features/workspaces/containers/WorkspacesScreen.js b/src/features/workspaces/containers/WorkspacesScreen.js
index 99241210e..bd1ddcd43 100644
--- a/src/features/workspaces/containers/WorkspacesScreen.js
+++ b/src/features/workspaces/containers/WorkspacesScreen.js
@@ -21,7 +21,7 @@ class WorkspacesScreen extends Component {
21 <ErrorBoundary> 21 <ErrorBoundary>
22 <WorkspacesDashboard 22 <WorkspacesDashboard
23 workspaces={workspacesState.workspaces} 23 workspaces={workspacesState.workspaces}
24 isLoading={workspacesState.isLoadingWorkspaces} 24 isLoadingWorkspaces={workspacesState.isLoadingWorkspaces}
25 onCreateWorkspaceSubmit={data => actions.workspaces.create(data)} 25 onCreateWorkspaceSubmit={data => actions.workspaces.create(data)}
26 onWorkspaceClick={w => actions.workspaces.edit({ workspace: w })} 26 onWorkspaceClick={w => actions.workspaces.edit({ workspace: w })}
27 /> 27 />