mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 17:43:50 +08:00
fix: fix the web compiled warnings (#778)
* fix: fix the web compiled warnings Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com> * fix: disable changeMomentLanguage Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com> * Update SyncerEditPage.js * Update UserEditPage.js * Update ResourceListPage.js * Update ProviderEditPage.js * Update ProductBuyPage.js Co-authored-by: Yang Luo <hsluoyz@qq.com>
This commit is contained in:
@ -206,7 +206,7 @@ class ProductBuyPage extends React.Component {
|
|||||||
<Descriptions.Item label={i18next.t("product:Tag")}><span style={{fontSize: 16}}>{product?.tag}</span></Descriptions.Item>
|
<Descriptions.Item label={i18next.t("product:Tag")}><span style={{fontSize: 16}}>{product?.tag}</span></Descriptions.Item>
|
||||||
<Descriptions.Item label={i18next.t("product:SKU")}><span style={{fontSize: 16}}>{product?.name}</span></Descriptions.Item>
|
<Descriptions.Item label={i18next.t("product:SKU")}><span style={{fontSize: 16}}>{product?.name}</span></Descriptions.Item>
|
||||||
<Descriptions.Item label={i18next.t("product:Image")} span={3}>
|
<Descriptions.Item label={i18next.t("product:Image")} span={3}>
|
||||||
<img src={product?.image} alt={product?.image} height={90} style={{marginBottom: '20px'}}/>
|
<img src={product?.image} alt={product?.name} height={90} style={{marginBottom: '20px'}}/>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item label={i18next.t("product:Price")}>
|
<Descriptions.Item label={i18next.t("product:Price")}>
|
||||||
<span style={{fontSize: 28, color: "red", fontWeight: "bold"}}>
|
<span style={{fontSize: 28, color: "red", fontWeight: "bold"}}>
|
||||||
|
@ -70,10 +70,13 @@ class ProviderEditPage extends React.Component {
|
|||||||
case "Email":
|
case "Email":
|
||||||
return Setting.getLabel(i18next.t("signup:Username"), i18next.t("signup:Username - Tooltip"));
|
return Setting.getLabel(i18next.t("signup:Username"), i18next.t("signup:Username - Tooltip"));
|
||||||
case "SMS":
|
case "SMS":
|
||||||
if (this.state.provider.type === "Volc Engine SMS")
|
if (this.state.provider.type === "Volc Engine SMS") {
|
||||||
return Setting.getLabel(i18next.t("provider:Access key"), i18next.t("provider:Access key - Tooltip"));
|
return Setting.getLabel(i18next.t("provider:Access key"), i18next.t("provider:Access key - Tooltip"));
|
||||||
if (this.state.provider.type === "Huawei Cloud SMS")
|
} else if (this.state.provider.type === "Huawei Cloud SMS") {
|
||||||
return Setting.getLabel(i18next.t("provider:App key"), i18next.t("provider:App key - Tooltip"));
|
return Setting.getLabel(i18next.t("provider:App key"), i18next.t("provider:App key - Tooltip"));
|
||||||
|
} else {
|
||||||
|
return Setting.getLabel(i18next.t("provider:Client ID"), i18next.t("provider:Client ID - Tooltip"));
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return Setting.getLabel(i18next.t("provider:Client ID"), i18next.t("provider:Client ID - Tooltip"));
|
return Setting.getLabel(i18next.t("provider:Client ID"), i18next.t("provider:Client ID - Tooltip"));
|
||||||
}
|
}
|
||||||
@ -84,10 +87,13 @@ class ProviderEditPage extends React.Component {
|
|||||||
case "Email":
|
case "Email":
|
||||||
return Setting.getLabel(i18next.t("login:Password"), i18next.t("login:Password - Tooltip"));
|
return Setting.getLabel(i18next.t("login:Password"), i18next.t("login:Password - Tooltip"));
|
||||||
case "SMS":
|
case "SMS":
|
||||||
if (this.state.provider.type === "Volc Engine SMS")
|
if (this.state.provider.type === "Volc Engine SMS") {
|
||||||
return Setting.getLabel(i18next.t("provider:Secret access key"), i18next.t("provider:SecretAccessKey - Tooltip"));
|
return Setting.getLabel(i18next.t("provider:Secret access key"), i18next.t("provider:SecretAccessKey - Tooltip"));
|
||||||
if (this.state.provider.type === "Huawei Cloud SMS")
|
} else if (this.state.provider.type === "Huawei Cloud SMS") {
|
||||||
return Setting.getLabel(i18next.t("provider:App secret"), i18next.t("provider:AppSecret - Tooltip"));
|
return Setting.getLabel(i18next.t("provider:App secret"), i18next.t("provider:AppSecret - Tooltip"));
|
||||||
|
} else {
|
||||||
|
return Setting.getLabel(i18next.t("provider:Client secret"), i18next.t("provider:Client secret - Tooltip"));
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return Setting.getLabel(i18next.t("provider:Client secret"), i18next.t("provider:Client secret - Tooltip"));
|
return Setting.getLabel(i18next.t("provider:Client secret"), i18next.t("provider:Client secret - Tooltip"));
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ class ResourceListPage extends BaseListPage {
|
|||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
if (record.fileType === "image") {
|
if (record.fileType === "image") {
|
||||||
return (
|
return (
|
||||||
<a target="_blank" href={record.url}>
|
<a target="_blank" rel="noreferrer" href={record.url}>
|
||||||
<img src={record.url} alt={record.name} width={100} />
|
<img src={record.url} alt={record.name} width={100} />
|
||||||
</a>
|
</a>
|
||||||
)
|
)
|
||||||
|
@ -21,7 +21,6 @@ import i18next from "i18next";
|
|||||||
import copy from "copy-to-clipboard";
|
import copy from "copy-to-clipboard";
|
||||||
import {authConfig} from "./auth/Auth";
|
import {authConfig} from "./auth/Auth";
|
||||||
import {Helmet} from "react-helmet";
|
import {Helmet} from "react-helmet";
|
||||||
import moment from "moment";
|
|
||||||
import * as Conf from "./Conf";
|
import * as Conf from "./Conf";
|
||||||
|
|
||||||
export let ServerUrl = "";
|
export let ServerUrl = "";
|
||||||
@ -225,7 +224,7 @@ export function isValidInvoiceTitle(invoiceTitle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// https://blog.css8.cn/post/14210975.html
|
// https://blog.css8.cn/post/14210975.html
|
||||||
const invoiceTitleRegex = /^[\(\)\(\)\u4e00-\u9fa5]{0,50}$/;
|
const invoiceTitleRegex = /^[()()\u4e00-\u9fa5]{0,50}$/;
|
||||||
return invoiceTitleRegex.test(invoiceTitle);
|
return invoiceTitleRegex.test(invoiceTitle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,27 +473,26 @@ export function changeLanguage(language) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function changeMomentLanguage(language) {
|
export function changeMomentLanguage(language) {
|
||||||
return;
|
// if (language === "zh") {
|
||||||
if (language === "zh") {
|
// moment.locale("zh", {
|
||||||
moment.locale("zh", {
|
// relativeTime: {
|
||||||
relativeTime: {
|
// future: "%s内",
|
||||||
future: "%s内",
|
// past: "%s前",
|
||||||
past: "%s前",
|
// s: "几秒",
|
||||||
s: "几秒",
|
// ss: "%d秒",
|
||||||
ss: "%d秒",
|
// m: "1分钟",
|
||||||
m: "1分钟",
|
// mm: "%d分钟",
|
||||||
mm: "%d分钟",
|
// h: "1小时",
|
||||||
h: "1小时",
|
// hh: "%d小时",
|
||||||
hh: "%d小时",
|
// d: "1天",
|
||||||
d: "1天",
|
// dd: "%d天",
|
||||||
dd: "%d天",
|
// M: "1个月",
|
||||||
M: "1个月",
|
// MM: "%d个月",
|
||||||
MM: "%d个月",
|
// y: "1年",
|
||||||
y: "1年",
|
// yy: "%d年",
|
||||||
yy: "%d年",
|
// },
|
||||||
},
|
// });
|
||||||
});
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getClickable(text) {
|
export function getClickable(text) {
|
||||||
|
@ -119,8 +119,12 @@ class SyncerEditPage extends React.Component {
|
|||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} style={{width: '100%'}} value={this.state.syncer.type} onChange={(value => {
|
<Select virtual={false} style={{width: '100%'}} value={this.state.syncer.type} onChange={(value => {
|
||||||
this.updateSyncerField('type', value);
|
this.updateSyncerField('type', value);
|
||||||
this.state.syncer["tableColumns"] = Setting.getSyncerTableColumns(this.state.syncer);
|
let syncer = this.state.syncer;
|
||||||
this.state.syncer.table = value === "Keycloak" ? "user_entity" : this.state.syncer.table;
|
syncer["tableColumns"] = Setting.getSyncerTableColumns(this.state.syncer);
|
||||||
|
syncer.table = (value === "Keycloak") ? "user_entity" : this.state.syncer.table;
|
||||||
|
this.setState({
|
||||||
|
syncer: syncer,
|
||||||
|
});
|
||||||
})}>
|
})}>
|
||||||
{
|
{
|
||||||
['Database', 'LDAP', 'Keycloak']
|
['Database', 'LDAP', 'Keycloak']
|
||||||
|
@ -28,10 +28,10 @@ import OAuthWidget from "./common/OAuthWidget";
|
|||||||
import SamlWidget from "./common/SamlWidget";
|
import SamlWidget from "./common/SamlWidget";
|
||||||
import SelectRegionBox from "./SelectRegionBox";
|
import SelectRegionBox from "./SelectRegionBox";
|
||||||
|
|
||||||
import {Controlled as CodeMirror} from 'react-codemirror2';
|
// import {Controlled as CodeMirror} from 'react-codemirror2';
|
||||||
import "codemirror/lib/codemirror.css";
|
// import "codemirror/lib/codemirror.css";
|
||||||
require('codemirror/theme/material-darker.css');
|
// require('codemirror/theme/material-darker.css');
|
||||||
require("codemirror/mode/javascript/javascript");
|
// require("codemirror/mode/javascript/javascript");
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|
||||||
|
@ -319,7 +319,7 @@ class LoginPage extends React.Component {
|
|||||||
)
|
)
|
||||||
} else if (provider.category === "SAML") {
|
} else if (provider.category === "SAML") {
|
||||||
return (
|
return (
|
||||||
<a key={provider.displayName} onClick={this.getSamlUrl.bind(this, provider)}>
|
<a href="/#" key={provider.displayName} onClick={this.getSamlUrl.bind(this, provider)}>
|
||||||
<img width={width} height={width} src={Setting.getProviderLogoURL(provider)} alt={provider.displayName} style={{margin: margin}} />
|
<img width={width} height={width} src={Setting.getProviderLogoURL(provider)} alt={provider.displayName} style={{margin: margin}} />
|
||||||
</a>
|
</a>
|
||||||
)
|
)
|
||||||
@ -475,7 +475,7 @@ class LoginPage extends React.Component {
|
|||||||
{i18next.t("login:Auto sign in")}
|
{i18next.t("login:Auto sign in")}
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<a style={{float: "right"}} onClick={() => {
|
<a href="/#" style={{float: "right"}} onClick={() => {
|
||||||
Setting.goToForget(this, application);
|
Setting.goToForget(this, application);
|
||||||
}}>
|
}}>
|
||||||
{i18next.t("login:Forgot password?")}
|
{i18next.t("login:Forgot password?")}
|
||||||
@ -554,7 +554,7 @@ class LoginPage extends React.Component {
|
|||||||
<span style={{float: "left"}}>
|
<span style={{float: "left"}}>
|
||||||
{
|
{
|
||||||
!application.enableCodeSignin ? null : (
|
!application.enableCodeSignin ? null : (
|
||||||
<a onClick={() => {
|
<a href="/#" onClick={() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isCodeSignin: !this.state.isCodeSignin,
|
isCodeSignin: !this.state.isCodeSignin,
|
||||||
});
|
});
|
||||||
@ -566,7 +566,7 @@ class LoginPage extends React.Component {
|
|||||||
</span>
|
</span>
|
||||||
<span style={{float: "right"}}>
|
<span style={{float: "right"}}>
|
||||||
{i18next.t("login:No account?")}
|
{i18next.t("login:No account?")}
|
||||||
<a onClick={() => {
|
<a href="/#" onClick={() => {
|
||||||
sessionStorage.setItem("loginURL", window.location.href)
|
sessionStorage.setItem("loginURL", window.location.href)
|
||||||
Setting.goToSignup(this, application);
|
Setting.goToSignup(this, application);
|
||||||
}}>
|
}}>
|
||||||
|
@ -559,7 +559,7 @@ class SignupPage extends React.Component {
|
|||||||
{i18next.t("account:Sign Up")}
|
{i18next.t("account:Sign Up")}
|
||||||
</Button>
|
</Button>
|
||||||
{i18next.t("signup:Have account?")}
|
{i18next.t("signup:Have account?")}
|
||||||
<a onClick={() => {
|
<a href="/#" onClick={() => {
|
||||||
let linkInStorage = sessionStorage.getItem("loginURL")
|
let linkInStorage = sessionStorage.getItem("loginURL")
|
||||||
if(linkInStorage != null){
|
if(linkInStorage != null){
|
||||||
Setting.goToLink(linkInStorage)
|
Setting.goToLink(linkInStorage)
|
||||||
|
Reference in New Issue
Block a user