mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
feat: terms of use auto selected (#1485)
This commit is contained in:
parent
d10b1347a8
commit
457e6208ad
@ -530,7 +530,15 @@ export function isAgreementRequired(application) {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function renderAgreement(required, onClick, noStyle, layout) {
|
||||
export function isDefaultTrue(application) {
|
||||
const agreementItem = application.signupItems.find(item => item.name === "Agreement");
|
||||
if (isAgreementRequired(application) && agreementItem.rule === "Signin (Default True)") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function renderAgreement(required, onClick, noStyle, layout, initialValue) {
|
||||
return (
|
||||
<Form.Item
|
||||
name="agreement"
|
||||
@ -544,6 +552,7 @@ export function renderAgreement(required, onClick, noStyle, layout) {
|
||||
]}
|
||||
{...layout}
|
||||
noStyle={noStyle}
|
||||
initialValue={initialValue}
|
||||
>
|
||||
<Checkbox style={{float: "left"}}>
|
||||
{i18next.t("signup:Accept")}
|
||||
|
@ -190,6 +190,7 @@ class SignupTable extends React.Component {
|
||||
options = [
|
||||
{id: "None", name: "None"},
|
||||
{id: "Signin", name: "Signin"},
|
||||
{id: "Signin (Default True)", name: "Signin (Default True)"},
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -471,7 +471,7 @@ class LoginPage extends React.Component {
|
||||
this.setState({
|
||||
isTermsOfUseVisible: true,
|
||||
});
|
||||
}, true) : (
|
||||
}, true, {}, Setting.isDefaultTrue(application)) : (
|
||||
<Form.Item name="autoSignin" valuePropName="checked" noStyle>
|
||||
<Checkbox style={{float: "left"}} disabled={!application.enablePassword}>
|
||||
{i18next.t("login:Auto sign in")}
|
||||
|
@ -479,7 +479,7 @@ class SignupPage extends React.Component {
|
||||
this.setState({
|
||||
isTermsOfUseVisible: true,
|
||||
});
|
||||
}, false, tailFormItemLayout)
|
||||
}, false, tailFormItemLayout, Setting.isDefaultTrue(application))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user