[IMPROVEMENT] Hide "Forgot password" by server "Accounts_PasswordReset" property (#1117)
This commit is contained in:
parent
6ab5ecdf93
commit
2d3894ccb2
|
@ -11,6 +11,9 @@ export default {
|
||||||
Accounts_PasswordPlaceholder: {
|
Accounts_PasswordPlaceholder: {
|
||||||
type: 'valueAsString'
|
type: 'valueAsString'
|
||||||
},
|
},
|
||||||
|
Accounts_PasswordReset: {
|
||||||
|
type: 'valueAsBoolean'
|
||||||
|
},
|
||||||
CROWD_Enable: {
|
CROWD_Enable: {
|
||||||
type: 'valueAsBoolean'
|
type: 'valueAsBoolean'
|
||||||
},
|
},
|
||||||
|
|
|
@ -57,10 +57,15 @@ class LoginView extends React.Component {
|
||||||
Site_Name: PropTypes.string,
|
Site_Name: PropTypes.string,
|
||||||
Accounts_EmailOrUsernamePlaceholder: PropTypes.string,
|
Accounts_EmailOrUsernamePlaceholder: PropTypes.string,
|
||||||
Accounts_PasswordPlaceholder: PropTypes.string,
|
Accounts_PasswordPlaceholder: PropTypes.string,
|
||||||
|
Accounts_PasswordReset: PropTypes.bool,
|
||||||
isFetching: PropTypes.bool,
|
isFetching: PropTypes.bool,
|
||||||
failure: PropTypes.bool
|
failure: PropTypes.bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
Accounts_PasswordReset: true
|
||||||
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -195,7 +200,7 @@ class LoginView extends React.Component {
|
||||||
|
|
||||||
renderUserForm = () => {
|
renderUserForm = () => {
|
||||||
const {
|
const {
|
||||||
Accounts_EmailOrUsernamePlaceholder, Accounts_PasswordPlaceholder, isFetching
|
Accounts_EmailOrUsernamePlaceholder, Accounts_PasswordPlaceholder, Accounts_PasswordReset, isFetching
|
||||||
} = this.props;
|
} = this.props;
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={sharedStyles.container} testID='login-view' forceInset={{ vertical: 'never' }}>
|
<SafeAreaView style={sharedStyles.container} testID='login-view' forceInset={{ vertical: 'never' }}>
|
||||||
|
@ -229,12 +234,14 @@ class LoginView extends React.Component {
|
||||||
loading={isFetching}
|
loading={isFetching}
|
||||||
disabled={!this.valid()}
|
disabled={!this.valid()}
|
||||||
/>
|
/>
|
||||||
|
{Accounts_PasswordReset && (
|
||||||
<Button
|
<Button
|
||||||
title={I18n.t('Forgot_password')}
|
title={I18n.t('Forgot_password')}
|
||||||
type='secondary'
|
type='secondary'
|
||||||
onPress={this.forgotPassword}
|
onPress={this.forgotPassword}
|
||||||
testID='login-view-forgot-password'
|
testID='login-view-forgot-password'
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<View style={styles.bottomContainer}>
|
<View style={styles.bottomContainer}>
|
||||||
<Text style={styles.dontHaveAccount}>{I18n.t('Dont_Have_An_Account')}</Text>
|
<Text style={styles.dontHaveAccount}>{I18n.t('Dont_Have_An_Account')}</Text>
|
||||||
<Text
|
<Text
|
||||||
|
@ -272,7 +279,8 @@ const mapStateToProps = state => ({
|
||||||
error: state.login.error && state.login.error.data,
|
error: state.login.error && state.login.error.data,
|
||||||
Site_Name: state.settings.Site_Name,
|
Site_Name: state.settings.Site_Name,
|
||||||
Accounts_EmailOrUsernamePlaceholder: state.settings.Accounts_EmailOrUsernamePlaceholder,
|
Accounts_EmailOrUsernamePlaceholder: state.settings.Accounts_EmailOrUsernamePlaceholder,
|
||||||
Accounts_PasswordPlaceholder: state.settings.Accounts_PasswordPlaceholder
|
Accounts_PasswordPlaceholder: state.settings.Accounts_PasswordPlaceholder,
|
||||||
|
Accounts_PasswordReset: state.settings.Accounts_PasswordReset
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => ({
|
const mapDispatchToProps = dispatch => ({
|
||||||
|
|
Loading…
Reference in New Issue