Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export default {
Accounts_PasswordReset: {
type: 'valueAsBoolean'
},
Accounts_ShowFormLogin: {
type: 'valueAsBoolean'
},
CROWD_Enable: {
type: 'valueAsBoolean'
},
Expand Down
39 changes: 26 additions & 13 deletions app/views/LoginSignupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class LoginSignupView extends React.Component {
Site_Name: PropTypes.string,
Gitlab_URL: PropTypes.string,
CAS_enabled: PropTypes.bool,
Accounts_ShowFormLogin: PropTypes.bool,
CAS_login_url: PropTypes.string
}

Expand Down Expand Up @@ -405,25 +406,36 @@ class LoginSignupView extends React.Component {
);
}

renderFormLogin = () => (
<>
<Button
title={<Text>{I18n.t('Login_with')} <Text style={{ ...sharedStyles.textBold }}>{I18n.t('email')}</Text></Text>}
type='primary'
onPress={() => this.login()}
testID='welcome-view-login'
/>
<Button
title={I18n.t('Create_account')}
type='secondary'
onPress={() => this.register()}
testID='welcome-view-register'
/>
</>
)

render() {
const { Accounts_ShowFormLogin } = this.props;
return (
<ScrollView style={[sharedStyles.containerScrollView, sharedStyles.container, styles.container]} {...scrollPersistTaps}>
<StatusBar />
<SafeAreaView testID='welcome-view' forceInset={{ vertical: 'never' }} style={styles.safeArea}>
{this.renderServices()}
{this.renderServicesSeparator()}
<Button
title={<Text>{I18n.t('Login_with')} <Text style={{ ...sharedStyles.textBold }}>{I18n.t('email')}</Text></Text>}
type='primary'
onPress={() => this.login()}
testID='welcome-view-login'
/>
<Button
title={I18n.t('Create_account')}
type='secondary'
onPress={() => this.register()}
testID='welcome-view-register'
/>
{ Accounts_ShowFormLogin ? (
<>
{this.renderServicesSeparator()}
{this.renderFormLogin()}
</>
) : null }
</SafeAreaView>
</ScrollView>
);
Expand All @@ -436,6 +448,7 @@ const mapStateToProps = state => ({
Gitlab_URL: state.settings.API_Gitlab_URL,
CAS_enabled: state.settings.CAS_enabled,
CAS_login_url: state.settings.CAS_login_url,
Accounts_ShowFormLogin: state.settings.Accounts_ShowFormLogin,
services: state.login.services
});

Expand Down