Skip to content

Instantly share code, notes, and snippets.

@lenards
Created July 20, 2017 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lenards/927c0eb223ba1df8f6b2173e148d1080 to your computer and use it in GitHub Desktop.
Save lenards/927c0eb223ba1df8f6b2173e148d1080 to your computer and use it in GitHub Desktop.
diff --git a/troposphere/static/js/components/login/LoginScreen.jsx b/troposphere/static/js/components/login/LoginScreen.jsx
index a2eac7d..9e74f11 100644
--- a/troposphere/static/js/components/login/LoginScreen.jsx
+++ b/troposphere/static/js/components/login/LoginScreen.jsx
@@ -124,7 +124,8 @@ export default React.createClass({
},
// Rendering
renderLoginMethod: function() {
- let method = this.state.loginProvider.get('method');
+ let method = this.state.loginProvider.get('method'),
+ provider = this.state.loginProvider.get('provider');
if (method == "password-login") {
return (<PasswordLoginForm
attemptLogin={this.attemptPasswordLogin}/>);
@@ -133,7 +134,7 @@ export default React.createClass({
attemptLogin={this.attemptOpenstackLogin}/>);
} else if (method == "oauth-login") {
return (<OAuthLoginForm
- provider={this.state.loginProvider.get('provider')}
+ provider={provider}
attemptLogin={this.attemptOAuthLogin}/>);
}
},
@@ -142,17 +143,20 @@ export default React.createClass({
},
render: function() {
- let mainClassnames = ""
+ let mainClassnames = "",
+ customStyle = {};
if (this.props.login_from == "application") {
mainClassnames = "login-screen-master container"
} else {
//Renders inside a modal
mainClassnames = "login-screen-master"
+ customStyle = {
+ minHeight: "0px"
+ }
}
- const provider = this.state.loginProvider.get('provider');
return (
- <div id="main" className={mainClassnames}>
+ <div id="main-login-modal" className={mainClassnames} style={customStyle}>
<div className="form-group">
<label>Login Method</label>
<SelectMenu id="login-screen-select"
diff --git a/troposphere/static/js/components/modals/PublicLoginModal.jsx b/troposphere/static/js/components/modals/PublicLoginModal.jsx
index c58fa0a..b1dc00c 100644
--- a/troposphere/static/js/components/modals/PublicLoginModal.jsx
+++ b/troposphere/static/js/components/modals/PublicLoginModal.jsx
@@ -1,6 +1,5 @@
import React from "react";
import BootstrapModalMixin from "components/mixins/BootstrapModalMixin";
-import globals from "globals";
import LoginScreen from "components/login/LoginScreen.jsx";
@@ -10,15 +9,6 @@ export default React.createClass({
mixins: [BootstrapModalMixin],
render: function() {
- var buttons = (
- <button key={'Okay'}
- type="button"
- className={'btn btn-primary'}
- onClick={this.confirm}>
- {'Okay'}
- </button>
- );
-
return (
<div className="modal fade">
<div className="modal-dialog">
@@ -27,7 +17,7 @@ export default React.createClass({
{this.renderCloseButton()}
<h1 className="t-title">Login to Atmosphere</h1>
</div>
- <div className="modal-body">
+ <div className="modal-body" style={{paddingBottom: "0px", minHeight: "350px"}}>
<LoginScreen login_from="public_site" />
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment