-
-
-
+
+
+
+
+
+
+
+ {(instanceGroups && instanceGroups.length > 0) && (
+
+
+ {i18n._(t`Instance Groups`)}
+
+
+ {instanceGroupChips}
+ {overflowChip}
- )}
- {error ? 'error!' : ''}
-
+
+ )}
+
+ {summary_fields.user_capabilities.edit && (
+
+
+
+
+
)}
-
+ {error ? 'error!' : ''}
+
);
}
}
-export default withRouter(withNetwork(OrganizationDetail));
+export default withI18n()(withRouter(withNetwork(OrganizationDetail)));
diff --git a/src/pages/Organizations/screens/OrganizationAdd.jsx b/src/pages/Organizations/screens/OrganizationAdd.jsx
index c975ea6bac..abd652d66d 100644
--- a/src/pages/Organizations/screens/OrganizationAdd.jsx
+++ b/src/pages/Organizations/screens/OrganizationAdd.jsx
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router-dom';
-import { I18n } from '@lingui/react';
+import { withI18n } from '@lingui/react';
import { t } from '@lingui/macro';
import {
PageSection,
@@ -57,30 +57,27 @@ class OrganizationAdd extends React.Component {
render () {
const { error } = this.state;
+ const { i18n } = this.props;
return (
-
- {({ i18n }) => (
-
-
-
-
-
-
-
-
- {error ? error
: ''}
-
-
- )}
-
+
+
+
+
+
+
+
+
+ {error ? error
: ''}
+
+
);
}
@@ -95,4 +92,4 @@ OrganizationAdd.contextTypes = {
};
export { OrganizationAdd as _OrganizationAdd };
-export default withNetwork(withRouter(OrganizationAdd));
+export default withI18n()(withNetwork(withRouter(OrganizationAdd)));
diff --git a/src/pages/Organizations/screens/OrganizationsList.jsx b/src/pages/Organizations/screens/OrganizationsList.jsx
index 6465017fd0..393a10d365 100644
--- a/src/pages/Organizations/screens/OrganizationsList.jsx
+++ b/src/pages/Organizations/screens/OrganizationsList.jsx
@@ -1,6 +1,7 @@
import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
-import { i18nMark } from '@lingui/react';
+import { withI18n } from '@lingui/react';
+import { t } from '@lingui/macro';
import {
Card,
PageSection,
@@ -15,12 +16,6 @@ import PaginatedDataList, {
import OrganizationListItem from '../components/OrganizationListItem';
import { getQSConfig, parseNamespacedQueryString } from '../../../util/qs';
-const COLUMNS = [
- { name: i18nMark('Name'), key: 'name', isSortable: true },
- { name: i18nMark('Modified'), key: 'modified', isSortable: true, isNumeric: true },
- { name: i18nMark('Created'), key: 'created', isSortable: true, isNumeric: true },
-];
-
const QS_CONFIG = getQSConfig('organization', {
page: 1,
page_size: 5,
@@ -36,7 +31,7 @@ class OrganizationsList extends Component {
isLoading: true,
isInitialized: false,
organizations: [],
- selected: [],
+ selected: []
};
this.handleSelectAll = this.handleSelectAll.bind(this);
@@ -148,9 +143,9 @@ class OrganizationsList extends Component {
isLoading,
isInitialized,
selected,
- organizations,
+ organizations
} = this.state;
- const { match } = this.props;
+ const { match, i18n } = this.props;
const isAllSelected = selected.length === organizations.length;
@@ -163,7 +158,11 @@ class OrganizationsList extends Component {
itemCount={itemCount}
itemName="organization"
qsConfig={QS_CONFIG}
- toolbarColumns={COLUMNS}
+ toolbarColumns={[
+ { name: i18n._(t`Name`), key: 'name', isSortable: true },
+ { name: i18n._(t`Modified`), key: 'modified', isSortable: true, isNumeric: true },
+ { name: i18n._(t`Created`), key: 'created', isSortable: true, isNumeric: true },
+ ]}
showSelectAll
isAllSelected={isAllSelected}
onSelectAll={this.handleSelectAll}
@@ -198,4 +197,4 @@ class OrganizationsList extends Component {
}
export { OrganizationsList as _OrganizationsList };
-export default withNetwork(withRouter(OrganizationsList));
+export default withI18n()(withNetwork(withRouter(OrganizationsList)));
diff --git a/src/pages/Portal.jsx b/src/pages/Portal.jsx
index 999d895893..2073ebc33a 100644
--- a/src/pages/Portal.jsx
+++ b/src/pages/Portal.jsx
@@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
-import { Trans } from '@lingui/macro';
+import { withI18n } from '@lingui/react';
+import { t } from '@lingui/macro';
import {
PageSection,
PageSectionVariants,
@@ -8,13 +9,14 @@ import {
class Portal extends Component {
render () {
+ const { i18n } = this.props;
const { light, medium } = PageSectionVariants;
return (
- My View
+ {i18n._(t`My View`)}
@@ -23,4 +25,4 @@ class Portal extends Component {
}
}
-export default Portal;
+export default withI18n()(Portal);
diff --git a/src/pages/Projects.jsx b/src/pages/Projects.jsx
index 3646c73756..079cb7fe36 100644
--- a/src/pages/Projects.jsx
+++ b/src/pages/Projects.jsx
@@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
-import { Trans } from '@lingui/macro';
+import { withI18n } from '@lingui/react';
+import { t } from '@lingui/macro';
import {
PageSection,
PageSectionVariants,
@@ -8,13 +9,14 @@ import {
class Projects extends Component {
render () {
+ const { i18n } = this.props;
const { light, medium } = PageSectionVariants;
return (
- Projects
+ {i18n._(t`Projects`)}
@@ -23,4 +25,4 @@ class Projects extends Component {
}
}
-export default Projects;
+export default withI18n()(Projects);
diff --git a/src/pages/Schedules.jsx b/src/pages/Schedules.jsx
index fbada872d5..2d8951685a 100644
--- a/src/pages/Schedules.jsx
+++ b/src/pages/Schedules.jsx
@@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
-import { Trans } from '@lingui/macro';
+import { withI18n } from '@lingui/react';
+import { t } from '@lingui/macro';
import {
PageSection,
PageSectionVariants,
@@ -8,13 +9,14 @@ import {
class Schedules extends Component {
render () {
+ const { i18n } = this.props;
const { light, medium } = PageSectionVariants;
return (
- Schedules
+ {i18n._(t`Schedules`)}
@@ -23,4 +25,4 @@ class Schedules extends Component {
}
}
-export default Schedules;
+export default withI18n()(Schedules);
diff --git a/src/pages/SystemSettings.jsx b/src/pages/SystemSettings.jsx
index 2cc19192a9..ac33293756 100644
--- a/src/pages/SystemSettings.jsx
+++ b/src/pages/SystemSettings.jsx
@@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
-import { Trans } from '@lingui/macro';
+import { withI18n } from '@lingui/react';
+import { t } from '@lingui/macro';
import {
PageSection,
PageSectionVariants,
@@ -8,13 +9,14 @@ import {
class SystemSettings extends Component {
render () {
+ const { i18n } = this.props;
const { light, medium } = PageSectionVariants;
return (
- System Settings
+ {i18n._(t`System Settings`)}
@@ -23,4 +25,4 @@ class SystemSettings extends Component {
}
}
-export default SystemSettings;
+export default withI18n()(SystemSettings);
diff --git a/src/pages/Teams.jsx b/src/pages/Teams.jsx
index e8eb36c2d5..e49bfca702 100644
--- a/src/pages/Teams.jsx
+++ b/src/pages/Teams.jsx
@@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
-import { Trans } from '@lingui/macro';
+import { withI18n } from '@lingui/react';
+import { t } from '@lingui/macro';
import {
PageSection,
PageSectionVariants,
@@ -8,13 +9,14 @@ import {
class Teams extends Component {
render () {
+ const { i18n } = this.props;
const { light, medium } = PageSectionVariants;
return (
- Teams
+ {i18n._(t`Teams`)}
@@ -23,4 +25,4 @@ class Teams extends Component {
}
}
-export default Teams;
+export default withI18n()(Teams);
diff --git a/src/pages/Templates.jsx b/src/pages/Templates.jsx
index 59ed691f8e..f8a5a99a16 100644
--- a/src/pages/Templates.jsx
+++ b/src/pages/Templates.jsx
@@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
-import { Trans } from '@lingui/macro';
+import { withI18n } from '@lingui/react';
+import { t } from '@lingui/macro';
import {
PageSection,
PageSectionVariants,
@@ -8,13 +9,14 @@ import {
class Templates extends Component {
render () {
+ const { i18n } = this.props;
const { light, medium } = PageSectionVariants;
return (
- Templates
+ {i18n._(t`Templates`)}
@@ -23,4 +25,4 @@ class Templates extends Component {
}
}
-export default Templates;
+export default withI18n()(Templates);
diff --git a/src/pages/UISettings.jsx b/src/pages/UISettings.jsx
index c581f6633f..c51d5d0e84 100644
--- a/src/pages/UISettings.jsx
+++ b/src/pages/UISettings.jsx
@@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
-import { Trans } from '@lingui/macro';
+import { withI18n } from '@lingui/react';
+import { t } from '@lingui/macro';
import {
PageSection,
PageSectionVariants,
@@ -8,13 +9,14 @@ import {
class UISettings extends Component {
render () {
+ const { i18n } = this.props;
const { light, medium } = PageSectionVariants;
return (
- User Interface Settings
+ {i18n._(t`User Interface Settings`)}
@@ -23,4 +25,4 @@ class UISettings extends Component {
}
}
-export default UISettings;
+export default withI18n()(UISettings);
diff --git a/src/pages/Users.jsx b/src/pages/Users.jsx
index 5f6f6b2d34..ca2dd09ebd 100644
--- a/src/pages/Users.jsx
+++ b/src/pages/Users.jsx
@@ -1,5 +1,6 @@
import React, { Component, Fragment } from 'react';
-import { Trans } from '@lingui/macro';
+import { withI18n } from '@lingui/react';
+import { t } from '@lingui/macro';
import {
PageSection,
PageSectionVariants,
@@ -8,13 +9,14 @@ import {
class Users extends Component {
render () {
+ const { i18n } = this.props;
const { light, medium } = PageSectionVariants;
return (
- Users
+ {i18n._(t`Users`)}
@@ -23,4 +25,4 @@ class Users extends Component {
}
}
-export default Users;
+export default withI18n()(Users);
diff --git a/src/util/validators.js b/src/util/validators.js
deleted file mode 100644
index 939bb1bdec..0000000000
--- a/src/util/validators.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import { i18nMark } from '@lingui/react';
-
-export function required (message) {
- return value => {
- if (!value.trim()) {
- return message || i18nMark('This field must not be blank');
- }
- return undefined;
- };
-}
-
-export function maxLength (max) {
- return value => {
- if (value.trim().length
- > max) {
- return i18nMark(`This field must not exceed ${max} characters`);
- }
- return undefined;
- };
-}
diff --git a/src/util/validators.jsx b/src/util/validators.jsx
new file mode 100644
index 0000000000..7de0a0a423
--- /dev/null
+++ b/src/util/validators.jsx
@@ -0,0 +1,20 @@
+import { t } from '@lingui/macro';
+
+export function required (message, i18n) {
+ return value => {
+ if (!value.trim()) {
+ return message || i18n._(t`This field must not be blank`);
+ }
+ return undefined;
+ };
+}
+
+export function maxLength (max, i18n) {
+ return value => {
+ if (value.trim().length
+ > max) {
+ return i18n._(t`This field must not exceed ${max} characters`);
+ }
+ return undefined;
+ };
+}