fix: fix bug in VerificationListPage

This commit is contained in:
Yang Luo
2024-04-07 15:39:15 +08:00
parent 800f0ed249
commit 2077db9091

View File

@ -35,26 +35,48 @@ class VerificationListPage extends BaseListPage {
renderTable(verifications) { renderTable(verifications) {
const columns = [ const columns = [
{ {
title: i18next.t("general:Name"), title: i18next.t("general:Organization"),
dataIndex: "name", dataIndex: "owner",
key: "name", key: "owner",
width: "150px", width: "120px",
fixed: "left",
sorter: true, sorter: true,
...this.getColumnSearchProps("name"), ...this.getColumnSearchProps("owner"),
render: (text, record, index) => { render: (text, record, index) => {
if (text === "admin") {
return `(${i18next.t("general:empty")})`;
}
return ( return (
<Link to={`/syncers/${text}`}> <Link to={`/organizations/${text}`}>
{text} {text}
</Link> </Link>
); );
}, },
}, },
{
title: i18next.t("general:Name"),
dataIndex: "name",
key: "name",
width: "260px",
fixed: "left",
sorter: true,
...this.getColumnSearchProps("name"),
},
{
title: i18next.t("general:Created time"),
dataIndex: "createdTime",
key: "createdTime",
width: "160px",
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
},
},
{ {
title: i18next.t("provider:Type"), title: i18next.t("provider:Type"),
dataIndex: "type", dataIndex: "type",
key: "type", key: "type",
width: "120px", width: "90px",
sorter: true, sorter: true,
...this.getColumnSearchProps("type"), ...this.getColumnSearchProps("type"),
}, },
@ -67,7 +89,7 @@ class VerificationListPage extends BaseListPage {
...this.getColumnSearchProps("user"), ...this.getColumnSearchProps("user"),
render: (text, record, index) => { render: (text, record, index) => {
return ( return (
<Link to={`/users/${record.owner}/${text}`}> <Link to={`/users/${text}`}>
{text} {text}
</Link> </Link>
); );
@ -100,30 +122,10 @@ class VerificationListPage extends BaseListPage {
title: i18next.t("login:Verification code"), title: i18next.t("login:Verification code"),
dataIndex: "code", dataIndex: "code",
key: "code", key: "code",
width: "120px", width: "150px",
sorter: true, sorter: true,
...this.getColumnSearchProps("code"), ...this.getColumnSearchProps("code"),
}, },
{
title: i18next.t("general:Timestamp"),
dataIndex: "time",
key: "time",
width: "160px",
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text * 1000);
},
},
{
title: i18next.t("general:Created time"),
dataIndex: "createdTime",
key: "createdTime",
width: "160px",
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
},
},
]; ];
const paginationProps = { const paginationProps = {
@ -156,7 +158,7 @@ class VerificationListPage extends BaseListPage {
value = params.type; value = params.type;
} }
this.setState({loading: true}); this.setState({loading: true});
VerificationBackend.getVerifications("admin", Setting.isDefaultOrganizationSelected(this.props.account) ? "" : Setting.getRequestOrganization(this.props.account), params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder) VerificationBackend.getVerifications("", Setting.isDefaultOrganizationSelected(this.props.account) ? "" : Setting.getRequestOrganization(this.props.account), params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
.then((res) => { .then((res) => {
this.setState({ this.setState({
loading: false, loading: false,