mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 18:54:03 +08:00
feat: fix empty custom CSS for new rows in signin items table (#2897)
This commit is contained in:
parent
af2d26daf2
commit
8dbb041a34
@ -209,7 +209,7 @@ func extendApplicationWithSigninItems(application *Application) (err error) {
|
|||||||
signinItem := &SigninItem{
|
signinItem := &SigninItem{
|
||||||
Name: "Back button",
|
Name: "Back button",
|
||||||
Visible: true,
|
Visible: true,
|
||||||
Label: ".back-button {\n top: 65px;\n left: 15px;\n position: absolute;\n}",
|
Label: ".back-button {\n top: 65px;\n left: 15px;\n position: absolute;\n}\n.back-inner-button{}",
|
||||||
Placeholder: "",
|
Placeholder: "",
|
||||||
Rule: "None",
|
Rule: "None",
|
||||||
}
|
}
|
||||||
|
@ -543,7 +543,7 @@ class LoginPage extends React.Component {
|
|||||||
);
|
);
|
||||||
} else if (signinItem.name === "Back button") {
|
} else if (signinItem.name === "Back button") {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="back-button">
|
||||||
<div dangerouslySetInnerHTML={{__html: ("<style>" + signinItem.label?.replaceAll("<style>", "").replaceAll("</style>", "") + "</style>")}} />
|
<div dangerouslySetInnerHTML={{__html: ("<style>" + signinItem.label?.replaceAll("<style>", "").replaceAll("</style>", "") + "</style>")}} />
|
||||||
{
|
{
|
||||||
this.renderBackButton()
|
this.renderBackButton()
|
||||||
@ -1199,8 +1199,7 @@ class LoginPage extends React.Component {
|
|||||||
renderBackButton() {
|
renderBackButton() {
|
||||||
if (this.state.orgChoiceMode === "None" || this.props.preview === "auto") {
|
if (this.state.orgChoiceMode === "None" || this.props.preview === "auto") {
|
||||||
return (
|
return (
|
||||||
<Button type="text" size="large" icon={<ArrowLeftOutlined />}
|
<Button className="back-inner-button" type="text" size="large" icon={<ArrowLeftOutlined />}
|
||||||
className="back-button"
|
|
||||||
onClick={() => history.back()}>
|
onClick={() => history.back()}>
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
@ -26,6 +26,20 @@ require("codemirror/mode/htmlmixed/htmlmixed");
|
|||||||
|
|
||||||
const {Option} = Select;
|
const {Option} = Select;
|
||||||
|
|
||||||
|
export const SigninTableDefaultCssMap = {
|
||||||
|
"Back button": ".back-button {\n top: 65px;\n left: 15px;\n position: absolute;\n}\n.back-inner-button{}",
|
||||||
|
"Languages": ".login-languages {\n top: 55px;\n right: 5px;\n position: absolute;\n}",
|
||||||
|
"Logo": ".login-logo-box {}",
|
||||||
|
"Signin methods": ".signin-methods {}",
|
||||||
|
"Username": ".login-username {}\n.login-username-input{}",
|
||||||
|
"Password": ".login-password {}\n.login-password-input{}",
|
||||||
|
"Agreement": ".login-agreement {}",
|
||||||
|
"Forgot password?": ".login-forget-password {\n display: inline-flex;\n justify-content: space-between;\n width: 320px;\n margin-bottom: 25px;\n}",
|
||||||
|
"Login button": ".login-button-box {\n margin-bottom: 5px;\n}\n.login-button {\n width: 100%;\n}",
|
||||||
|
"Signup link": ".login-signup-link {\n margin-bottom: 24px;\n display: flex;\n justify-content: end;\n}",
|
||||||
|
"Providers": ".provider-img {\n width: 30px;\n margin: 5px;\n}\n.provider-big-img {\n margin-bottom: 10px;\n}",
|
||||||
|
};
|
||||||
|
|
||||||
class SigninTable extends React.Component {
|
class SigninTable extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -120,6 +134,7 @@ class SigninTable extends React.Component {
|
|||||||
value={getItemDisplayName(text)}
|
value={getItemDisplayName(text)}
|
||||||
onChange={value => {
|
onChange={value => {
|
||||||
this.updateField(table, index, "name", value);
|
this.updateField(table, index, "name", value);
|
||||||
|
this.updateField(table, index, "label", SigninTableDefaultCssMap[value]);
|
||||||
}} >
|
}} >
|
||||||
{
|
{
|
||||||
Setting.getDeduplicatedArray(items, table, "name").map((item, index) => <Option key={index} value={item.name}>{item.displayName}</Option>)
|
Setting.getDeduplicatedArray(items, table, "name").map((item, index) => <Option key={index} value={item.name}>{item.displayName}</Option>)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user