Add user soft deletion.

This commit is contained in:
Gucheng Wang
2021-11-06 15:52:03 +08:00
parent db892333fe
commit 9e920181d2
11 changed files with 72 additions and 19 deletions

View File

@ -14,7 +14,7 @@
import React from "react";
import {Link} from "react-router-dom";
import {Button, Popconfirm, Table} from 'antd';
import {Button, Popconfirm, Switch, Table} from 'antd';
import moment from "moment";
import * as Setting from "./Setting";
import * as OrganizationBackend from "./backend/OrganizationBackend";
@ -59,6 +59,7 @@ class OrganizationListPage extends React.Component {
PasswordSalt: "",
phonePrefix: "86",
defaultAvatar: "https://casbin.org/img/casbin.svg",
enableSoftDeletion: false,
}
}
@ -158,7 +159,7 @@ class OrganizationListPage extends React.Component {
title: i18next.t("general:Password type"),
dataIndex: 'passwordType',
key: 'passwordType',
width: '100px',
width: '150px',
sorter: (a, b) => a.passwordType.localeCompare(b.passwordType),
},
{
@ -172,7 +173,7 @@ class OrganizationListPage extends React.Component {
title: i18next.t("organization:Default avatar"),
dataIndex: 'defaultAvatar',
key: 'defaultAvatar',
width: '50px',
width: '120px',
render: (text, record, index) => {
return (
<a target="_blank" rel="noreferrer" href={text}>
@ -181,6 +182,18 @@ class OrganizationListPage extends React.Component {
)
}
},
{
title: i18next.t("organization:Soft deletion"),
dataIndex: 'enableSoftDeletion',
key: 'enableSoftDeletion',
width: '140px',
sorter: (a, b) => a.enableSoftDeletion - b.enableSoftDeletion,
render: (text, record, index) => {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
)
}
},
{
title: i18next.t("general:Action"),
dataIndex: '',