@@ -200,7 +201,7 @@ class Pagination extends Component {
value={value}
type="text"
onChange={this.onPageChange}
- /> of { pageCount }
+ /> of {pageCount}
diff --git a/src/components/TowerLogo/TowerLogo.jsx b/src/components/TowerLogo/TowerLogo.jsx
index 10925a3046..402adbaa0e 100644
--- a/src/components/TowerLogo/TowerLogo.jsx
+++ b/src/components/TowerLogo/TowerLogo.jsx
@@ -18,13 +18,11 @@ class TowerLogo extends Component {
}
onClick () {
- const { history, onClick: handleClick } = this.props;
+ const { history, linkTo } = this.props;
- if (!handleClick) return;
+ if (!linkTo) return;
- history.push('/');
-
- handleClick();
+ history.push(linkTo);
}
onHover () {
@@ -35,11 +33,10 @@ class TowerLogo extends Component {
render () {
const { hover } = this.state;
- const { onClick: handleClick } = this.props;
let src = TowerLogoHeader;
- if (hover && handleClick) {
+ if (hover) {
src = TowerLogoHeaderHover;
}
diff --git a/src/index.jsx b/src/index.jsx
index 8f450e9c4a..dfd6b421d9 100644
--- a/src/index.jsx
+++ b/src/index.jsx
@@ -60,21 +60,25 @@ const http = axios.create({ xsrfCookieName: 'csrftoken', xsrfHeaderName: 'X-CSRF
// see: https://developer.mozilla.org/en-US/docs/Web/API/Navigator
//
-const language = (navigator.languages && navigator.languages[0])
- || navigator.language
- || navigator.userLanguage;
-const languageWithoutRegionCode = language.toLowerCase().split(/[_-]+/)[0];
-const catalogs = { en, ja };
+export function getLanguage (nav) {
+ const language = (nav.languages && nav.languages[0]) || nav.language || nav.userLanguage;
+ const languageWithoutRegionCode = language.toLowerCase().split(/[_-]+/)[0];
+
+ return languageWithoutRegionCode;
+};
//
// Function Main
//
export async function main (render, api) {
+ const catalogs = { en, ja };
+ const language = getLanguage(navigator);
+
const el = document.getElementById('app');
- // fetch additional config from server
const { data: { custom_logo, custom_login_info } } = await api.getRoot();
+ const defaultRedirect = () => (
);
const loginRoutes = (
@@ -102,8 +106,8 @@ export async function main (render, api) {
{!api.isAuthenticated() ? loginRoutes : (
- ()} />
- ()} />
+
+
(
1) {
- // Show dropdown if we have more than one ansible environment
- this.setState({ hideAnsibleSelect: !this.state.hideAnsibleSelect });
- }
- } catch (error) {
- this.setState({ error })
- }
- }
-
render() {
const { name } = this.state;
const enabled = name.length > 0; // TODO: add better form validation
+
return (
@@ -128,13 +115,16 @@ class OrganizationAdd extends React.Component {
onChange={this.handleChange}
/>
-
+
+ {({ custom_virtualenvs }) =>
+
+ }
+
@@ -155,4 +145,8 @@ class OrganizationAdd extends React.Component {
}
}
+OrganizationAdd.contextTypes = {
+ custom_virtualenvs: PropTypes.array,
+};
+
export default withRouter(OrganizationAdd);