mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 06:23:51 +08:00
Fix React warnings.
This commit is contained in:
@ -62,7 +62,7 @@ class App extends Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
Setting.setLanguage();
|
Setting.setLanguage();
|
||||||
this.updateMenuKey();
|
this.updateMenuKey();
|
||||||
this.getAccount();
|
this.getAccount();
|
||||||
@ -165,7 +165,7 @@ class App extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropdown key="200" overlay={menu} >
|
<Dropdown key="200" overlay={menu} >
|
||||||
<a className="ant-dropdown-link" href="#" style={{float: 'right'}}>
|
<div className="ant-dropdown-link" style={{float: 'right', cursor: 'pointer'}}>
|
||||||
<Avatar style={{ backgroundColor: Setting.getAvatarColor(this.state.account.name), verticalAlign: 'middle' }} size="large">
|
<Avatar style={{ backgroundColor: Setting.getAvatarColor(this.state.account.name), verticalAlign: 'middle' }} size="large">
|
||||||
{Setting.getShortName(this.state.account.name)}
|
{Setting.getShortName(this.state.account.name)}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
@ -175,7 +175,7 @@ class App extends Component {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
</a>
|
</div>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -347,7 +347,7 @@ class App extends Component {
|
|||||||
}
|
}
|
||||||
}>
|
}>
|
||||||
<SelectLanguageBox/>
|
<SelectLanguageBox/>
|
||||||
Made with <span style={{color: 'rgb(255, 255, 255)'}}>❤️</span> by <a style={{fontWeight: "bold", color: "black"}} target="_blank" href="https://casbin.org">Casbin</a>
|
Made with <span style={{color: 'rgb(255, 255, 255)'}}>❤️</span> by <a style={{fontWeight: "bold", color: "black"}} target="_blank" href="https://casbin.org" rel="noreferrer">Casbin</a>
|
||||||
</Footer>
|
</Footer>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ class ApplicationEditPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getApplication();
|
this.getApplication();
|
||||||
this.getOrganizations();
|
this.getOrganizations();
|
||||||
this.getProviders();
|
this.getProviders();
|
||||||
@ -135,7 +135,7 @@ class ApplicationEditPage extends React.Component {
|
|||||||
{i18next.t("general:Preview")}:
|
{i18next.t("general:Preview")}:
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={23} >
|
<Col span={23} >
|
||||||
<a target="_blank" href={this.state.application.logo}>
|
<a target="_blank" rel="noreferrer" href={this.state.application.logo}>
|
||||||
<img src={this.state.application.logo} alt={this.state.application.logo} height={90} style={{marginBottom: '20px'}}/>
|
<img src={this.state.application.logo} alt={this.state.application.logo} height={90} style={{marginBottom: '20px'}}/>
|
||||||
</a>
|
</a>
|
||||||
</Col>
|
</Col>
|
||||||
@ -257,7 +257,7 @@ class ApplicationEditPage extends React.Component {
|
|||||||
{i18next.t("application:Login Page Preview")}:
|
{i18next.t("application:Login Page Preview")}:
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<a style={{marginBottom: '10px'}} target="_blank" href={`/login/oauth/authorize?client_id=${this.state.application.clientId}&response_type=code&redirect_uri=${this.state.application.redirectUris[0]}&scope=read&state=casdoor`}>
|
<a style={{marginBottom: '10px'}} target="_blank" rel="noreferrer" href={`/login/oauth/authorize?client_id=${this.state.application.clientId}&response_type=code&redirect_uri=${this.state.application.redirectUris[0]}&scope=read&state=casdoor`}>
|
||||||
{
|
{
|
||||||
`${window.location.host}/login/oauth/authorize?client_id=${this.state.application.clientId}&response_type=code&redirect_uri=${this.state.application.redirectUris[0]}&scope=read&state=casdoor`
|
`${window.location.host}/login/oauth/authorize?client_id=${this.state.application.clientId}&response_type=code&redirect_uri=${this.state.application.redirectUris[0]}&scope=read&state=casdoor`
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ class ApplicationListPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getApplications();
|
this.getApplications();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ class ApplicationListPage extends React.Component {
|
|||||||
width: '250px',
|
width: '250px',
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
return (
|
return (
|
||||||
<a target="_blank" href={text}>
|
<a target="_blank" rel="noreferrer" href={text}>
|
||||||
<img src={text} alt={text} width={150} />
|
<img src={text} alt={text} width={150} />
|
||||||
</a>
|
</a>
|
||||||
)
|
)
|
||||||
|
@ -28,7 +28,7 @@ class OrganizationEditPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getOrganization();
|
this.getOrganization();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class OrganizationEditPage extends React.Component {
|
|||||||
} style={{marginLeft: '5px'}} type="inner">
|
} style={{marginLeft: '5px'}} type="inner">
|
||||||
<Row style={{marginTop: '10px'}} >
|
<Row style={{marginTop: '10px'}} >
|
||||||
<Col style={{marginTop: '5px'}} span={2}>
|
<Col style={{marginTop: '5px'}} span={2}>
|
||||||
{i18next.t("general:Name")}:
|
{i18next.t("general:Name")}:
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Input value={this.state.organization.name} onChange={e => {
|
<Input value={this.state.organization.name} onChange={e => {
|
||||||
|
@ -29,7 +29,7 @@ class OrganizationListPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getOrganizations();
|
this.getOrganizations();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ class OrganizationListPage extends React.Component {
|
|||||||
sorter: (a, b) => a.websiteUrl.localeCompare(b.websiteUrl),
|
sorter: (a, b) => a.websiteUrl.localeCompare(b.websiteUrl),
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
return (
|
return (
|
||||||
<a target="_blank" href={text}>
|
<a target="_blank" rel="noreferrer" href={text}>
|
||||||
{text}
|
{text}
|
||||||
</a>
|
</a>
|
||||||
)
|
)
|
||||||
|
@ -30,7 +30,7 @@ class ProviderEditPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getProvider();
|
this.getProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class ProviderListPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getProviders();
|
this.getProviders();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ class ProviderListPage extends React.Component {
|
|||||||
sorter: (a, b) => a.providerUrl.localeCompare(b.providerUrl),
|
sorter: (a, b) => a.providerUrl.localeCompare(b.providerUrl),
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
return (
|
return (
|
||||||
<a target="_blank" href={text}>
|
<a target="_blank" rel="noreferrer" href={text}>
|
||||||
{
|
{
|
||||||
Setting.getShortText(text)
|
Setting.getShortText(text)
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,12 @@ class SelectLanguageBox extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<div className="box" style={{width: "600px"}}>
|
<div className="box" style={{width: "600px"}}>
|
||||||
|
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
||||||
<a onClick={() => Setting.changeLanguage("en")} className="lang-selector">
|
<a onClick={() => Setting.changeLanguage("en")} className="lang-selector">
|
||||||
English
|
English
|
||||||
</a>
|
</a>
|
||||||
/
|
/
|
||||||
|
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
||||||
<a onClick={() => Setting.changeLanguage("zh")} className="lang-selector">
|
<a onClick={() => Setting.changeLanguage("zh")} className="lang-selector">
|
||||||
简体中文
|
简体中文
|
||||||
</a>
|
</a>
|
||||||
|
@ -162,6 +162,7 @@ export function changeLanguage(language) {
|
|||||||
|
|
||||||
export function getClickable(text) {
|
export function getClickable(text) {
|
||||||
return (
|
return (
|
||||||
|
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
||||||
<a onClick={() => {
|
<a onClick={() => {
|
||||||
copy(text);
|
copy(text);
|
||||||
showMessage("success", `Copied to clipboard`);
|
showMessage("success", `Copied to clipboard`);
|
||||||
|
@ -13,13 +13,11 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {Button, Card, Col, Input, Row, Select} from 'antd';
|
import {Button, Card, Col, Input, Row} from 'antd';
|
||||||
import * as TokenBackend from "./backend/TokenBackend";
|
import * as TokenBackend from "./backend/TokenBackend";
|
||||||
import * as Setting from "./Setting";
|
import * as Setting from "./Setting";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
const { Option } = Select;
|
|
||||||
|
|
||||||
class TokenEditPage extends React.Component {
|
class TokenEditPage extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
@ -30,7 +28,7 @@ class TokenEditPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getToken();
|
this.getToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class TokenListPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getTokens();
|
this.getTokens();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class UserEditPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getUser();
|
this.getUser();
|
||||||
this.getOrganizations();
|
this.getOrganizations();
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ class UserEditPage extends React.Component {
|
|||||||
{i18next.t("general:Preview")}:
|
{i18next.t("general:Preview")}:
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={23} >
|
<Col span={23} >
|
||||||
<a target="_blank" href={this.state.user.avatar}>
|
<a target="_blank" rel="noreferrer" href={this.state.user.avatar}>
|
||||||
<img src={this.state.user.avatar} alt={this.state.user.avatar} height={90} style={{marginBottom: '20px'}}/>
|
<img src={this.state.user.avatar} alt={this.state.user.avatar} height={90} style={{marginBottom: '20px'}}/>
|
||||||
</a>
|
</a>
|
||||||
</Col>
|
</Col>
|
||||||
|
@ -29,7 +29,7 @@ class UserListPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
this.getUsers();
|
this.getUsers();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ class UserListPage extends React.Component {
|
|||||||
width: '100px',
|
width: '100px',
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
return (
|
return (
|
||||||
<a target="_blank" href={text}>
|
<a target="_blank" rel="noreferrer" href={text}>
|
||||||
<img src={text} alt={text} width={50} />
|
<img src={text} alt={text} width={50} />
|
||||||
</a>
|
</a>
|
||||||
)
|
)
|
||||||
@ -225,7 +225,7 @@ class UserListPage extends React.Component {
|
|||||||
title: i18next.t("general:Action"),
|
title: i18next.t("general:Action"),
|
||||||
dataIndex: '',
|
dataIndex: '',
|
||||||
key: 'op',
|
key: 'op',
|
||||||
width: '170px',
|
width: '190px',
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -53,7 +53,7 @@ class AuthCallback extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
const params = new URLSearchParams(this.props.location.search);
|
const params = new URLSearchParams(this.props.location.search);
|
||||||
const innerParams = this.getInnerParams();
|
const innerParams = this.getInnerParams();
|
||||||
const applicationName = innerParams.get("application");
|
const applicationName = innerParams.get("application");
|
||||||
|
@ -33,7 +33,7 @@ class LoginPage extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
UNSAFE_componentWillMount() {
|
||||||
if (this.state.type === "login") {
|
if (this.state.type === "login") {
|
||||||
this.getApplication();
|
this.getApplication();
|
||||||
} else if (this.state.type === "code") {
|
} else if (this.state.type === "code") {
|
||||||
@ -199,7 +199,7 @@ class LoginPage extends React.Component {
|
|||||||
<div style={{marginTop: "20px"}}>
|
<div style={{marginTop: "20px"}}>
|
||||||
<div style={{fontSize: 20, textAlign: "left"}}>
|
<div style={{fontSize: 20, textAlign: "left"}}>
|
||||||
Please click to login
|
Please click to login
|
||||||
<a target="_blank" href={application.homepageUrl}>
|
<a target="_blank" rel="noreferrer" href={application.homepageUrl}>
|
||||||
{application.displayName}
|
{application.displayName}
|
||||||
</a>
|
</a>
|
||||||
:
|
:
|
||||||
@ -222,7 +222,7 @@ class LoginPage extends React.Component {
|
|||||||
renderLogo(application) {
|
renderLogo(application) {
|
||||||
if (application.homepageUrl !== "") {
|
if (application.homepageUrl !== "") {
|
||||||
return (
|
return (
|
||||||
<a target="_blank" href={application.homepageUrl}>
|
<a target="_blank" rel="noreferrer" href={application.homepageUrl}>
|
||||||
<img width={250} src={application.logo} alt={application.displayName} style={{marginBottom: '30px'}}/>
|
<img width={250} src={application.logo} alt={application.displayName} style={{marginBottom: '30px'}}/>
|
||||||
</a>
|
</a>
|
||||||
)
|
)
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {Card, Col, Row} from "antd";
|
import {Card, Col} from "antd";
|
||||||
import * as Setting from "../Setting";
|
import * as Setting from "../Setting";
|
||||||
import {withRouter} from "react-router-dom";
|
import {withRouter} from "react-router-dom";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user