Fix SigninTable issue

This commit is contained in:
Yang Luo 2024-02-14 12:20:03 +08:00
parent 764c64e67c
commit 39e485ae82
3 changed files with 6 additions and 4 deletions

View File

@ -223,7 +223,7 @@ func extendApplicationWithSigninItems(application *Application) (err error) {
Visible: true,
Label: "\n<style>\n .login-logo-box {\n }\n<style>\n",
Placeholder: "",
Rule: "none",
Rule: "None",
}
application.SigninItems = append(application.SigninItems, signinItem)
signinItem = &SigninItem{

View File

@ -655,7 +655,7 @@ class LoginPage extends React.Component {
);
} else if (signinItem.name === "Providers") {
const showForm = Setting.isPasswordEnabled(application) || Setting.isCodeSigninEnabled(application) || Setting.isWebAuthnEnabled(application) || Setting.isLdapEnabled(application);
if (signinItem.rule === "None") {
if (signinItem.rule === "None" || signinItem.rule === "") {
signinItem.rule = showForm ? "small" : "big";
}
@ -782,7 +782,9 @@ class LoginPage extends React.Component {
:
</div>
<br />
{application.signinItems.map(signinItem => signinItem.name === "ThirdParty" || signinItem.name === "Footer" ? this.renderFormItem(application, signinItem) : null)}
{
application?.signinItems.map(signinItem => signinItem.name === "Providers" || signinItem.name === "Signup link" ? this.renderFormItem(application, signinItem) : null)
}
</div>
);
}

View File

@ -229,7 +229,7 @@ class SigninTable extends React.Component {
width: "155px",
render: (text, record, index) => {
let options = [];
if (record.name === "ThirdParty") {
if (record.name === "Providers") {
options = [
{id: "big", name: i18next.t("application:Big icon")},
{id: "small", name: i18next.t("application:Small icon")},