Revert "fix: fix display bug in SigninTable (#2698)"

This reverts commit d52058d2aebf3fd10a44248de43e5052347dde19.
This commit is contained in:
hsluoyz 2024-02-14 09:43:43 +08:00 committed by GitHub
parent d52058d2ae
commit ac5078fd79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 10 additions and 14 deletions

View File

@ -287,7 +287,7 @@ func extendApplicationWithSigninItems(application *Application) (err error) {
Visible: true, Visible: true,
Label: "\n<style>\n .provider-img {\n width: 30px;\n margin: 5px;\n }\n .provider-big-img {\n margin-bottom: 10px;\n }\n</style>\n", Label: "\n<style>\n .provider-img {\n width: 30px;\n margin: 5px;\n }\n .provider-big-img {\n margin-bottom: 10px;\n }\n</style>\n",
Placeholder: "", Placeholder: "",
Rule: "Default", Rule: "None",
} }
application.SigninItems = append(application.SigninItems, signinItem) application.SigninItems = append(application.SigninItems, signinItem)
} }

View File

@ -655,11 +655,8 @@ class LoginPage extends React.Component {
); );
} else if (signinItem.name === "Providers") { } else if (signinItem.name === "Providers") {
const showForm = Setting.isPasswordEnabled(application) || Setting.isCodeSigninEnabled(application) || Setting.isWebAuthnEnabled(application) || Setting.isLdapEnabled(application); const showForm = Setting.isPasswordEnabled(application) || Setting.isCodeSigninEnabled(application) || Setting.isWebAuthnEnabled(application) || Setting.isLdapEnabled(application);
let rule ; if (signinItem.rule === "None") {
if (signinItem.rule === "Default") { signinItem.rule = showForm ? "small" : "big";
rule = showForm ? "Small icon" : "Big icon";
} else {
rule = signinItem.rule;
} }
return ( return (
@ -668,7 +665,7 @@ class LoginPage extends React.Component {
<Form.Item> <Form.Item>
{ {
application.providers.filter(providerItem => this.isProviderVisible(providerItem)).map(providerItem => { application.providers.filter(providerItem => this.isProviderVisible(providerItem)).map(providerItem => {
return ProviderButton.renderProviderLogo(providerItem.provider, application, null, null, rule, this.props.location); return ProviderButton.renderProviderLogo(providerItem.provider, application, null, null, signinItem.rule, this.props.location);
}) })
} }
{ {
@ -785,7 +782,7 @@ class LoginPage extends React.Component {
: :
</div> </div>
<br /> <br />
{application.signinItems.map(signinItem => signinItem.name === "Providers" || signinItem.name === "Signup link" ? this.renderFormItem(application, signinItem) : null)} {application.signinItems.map(signinItem => signinItem.name === "ThirdParty" || signinItem.name === "Footer" ? this.renderFormItem(application, signinItem) : null)}
</div> </div>
); );
} }

View File

@ -131,7 +131,7 @@ export function goToWeb3Url(application, provider, method) {
} }
export function renderProviderLogo(provider, application, width, margin, size, location) { export function renderProviderLogo(provider, application, width, margin, size, location) {
if (size === "Small icon") { if (size === "small") {
if (provider.category === "OAuth") { if (provider.category === "OAuth") {
if (provider.type === "WeChat" && provider.clientId2 !== "" && provider.clientSecret2 !== "" && provider.disableSsl === true && !navigator.userAgent.includes("MicroMessenger")) { if (provider.type === "WeChat" && provider.clientId2 !== "" && provider.clientSecret2 !== "" && provider.disableSsl === true && !navigator.userAgent.includes("MicroMessenger")) {
const info = async() => { const info = async() => {

View File

@ -649,7 +649,7 @@ class SignupPage extends React.Component {
</Form.Item> </Form.Item>
{ {
application.providers.filter(providerItem => this.isProviderVisible(providerItem)).map(providerItem => { application.providers.filter(providerItem => this.isProviderVisible(providerItem)).map(providerItem => {
return ProviderButton.renderProviderLogo(providerItem.provider, application, 30, 5, "Small icon", this.props.location); return ProviderButton.renderProviderLogo(providerItem.provider, application, 30, 5, "small", this.props.location);
}) })
} }
</Form> </Form>

View File

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