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;
|
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 (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="agreement"
|
name="agreement"
|
||||||
@ -544,6 +552,7 @@ export function renderAgreement(required, onClick, noStyle, layout) {
|
|||||||
]}
|
]}
|
||||||
{...layout}
|
{...layout}
|
||||||
noStyle={noStyle}
|
noStyle={noStyle}
|
||||||
|
initialValue={initialValue}
|
||||||
>
|
>
|
||||||
<Checkbox style={{float: "left"}}>
|
<Checkbox style={{float: "left"}}>
|
||||||
{i18next.t("signup:Accept")}
|
{i18next.t("signup:Accept")}
|
||||||
|
@ -190,6 +190,7 @@ class SignupTable extends React.Component {
|
|||||||
options = [
|
options = [
|
||||||
{id: "None", name: "None"},
|
{id: "None", name: "None"},
|
||||||
{id: "Signin", name: "Signin"},
|
{id: "Signin", name: "Signin"},
|
||||||
|
{id: "Signin (Default True)", name: "Signin (Default True)"},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -471,7 +471,7 @@ class LoginPage extends React.Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
isTermsOfUseVisible: true,
|
isTermsOfUseVisible: true,
|
||||||
});
|
});
|
||||||
}, true) : (
|
}, true, {}, Setting.isDefaultTrue(application)) : (
|
||||||
<Form.Item name="autoSignin" valuePropName="checked" noStyle>
|
<Form.Item name="autoSignin" valuePropName="checked" noStyle>
|
||||||
<Checkbox style={{float: "left"}} disabled={!application.enablePassword}>
|
<Checkbox style={{float: "left"}} disabled={!application.enablePassword}>
|
||||||
{i18next.t("login:Auto sign in")}
|
{i18next.t("login:Auto sign in")}
|
||||||
|
@ -479,7 +479,7 @@ class SignupPage extends React.Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
isTermsOfUseVisible: true,
|
isTermsOfUseVisible: true,
|
||||||
});
|
});
|
||||||
}, false, tailFormItemLayout)
|
}, false, tailFormItemLayout, Setting.isDefaultTrue(application))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user