feat: terms of use auto selected (#1485)

This commit is contained in:
Chell
2023-01-19 13:31:21 +01:00
committed by GitHub
parent d10b1347a8
commit 457e6208ad
4 changed files with 13 additions and 3 deletions

View File

@ -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")}&nbsp;