feat: add Organization.HasPrivilegeConsent to block add-user API for the "built-in" org (#3864)

This commit is contained in:
DacongDA
2025-06-06 23:05:01 +08:00
committed by GitHub
parent c6a50349cc
commit 4cb0cd7c5a
61 changed files with 213 additions and 63 deletions

View File

@ -13,7 +13,7 @@
// limitations under the License.
import React from "react";
import {Button, Card, Col, Input, InputNumber, Radio, Row, Select, Switch} from "antd";
import {Button, Card, Col, Input, InputNumber, Popconfirm, Radio, Row, Select, Switch} from "antd";
import * as OrganizationBackend from "./backend/OrganizationBackend";
import * as ApplicationBackend from "./backend/ApplicationBackend";
import * as LdapBackend from "./backend/LdapBackend";
@ -270,6 +270,25 @@ class OrganizationEditPage extends React.Component {
}} />
</Col>
</Row>
{
this.state.organization.name === "built-in" ? (
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 19 : 2}>
{Setting.getLabel(i18next.t("organization:Has privilege consent"), i18next.t("organization:Has privilege consent - Tooltip"))} :
</Col>
<Col span={1} >
<Popconfirm
title={i18next.t("organization:Has privilege consent warning")}
onConfirm={() => {this.updateOrganizationField("hasPrivilegeConsent", !this.state.organization.hasPrivilegeConsent);}}
okText={i18next.t("general:OK")}
cancelText={i18next.t("general:Cancel")}
>
<Switch checked={this.state.organization.hasPrivilegeConsent} />
</Popconfirm>
</Col>
</Row>
) : null
}
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Password type"), i18next.t("general:Password type - Tooltip"))} :