From 369de36987817f86de7a98729701b15e2aa5b6b9 Mon Sep 17 00:00:00 2001
From: Yaodong Yu <2814461814@qq.com>
Date: Tue, 2 Jan 2024 23:49:04 +0800
Subject: [PATCH] feat: add users with correct application (#2570)
---
web/src/App.js | 2 +-
web/src/BaseListPage.js | 5 +++++
web/src/UserListPage.js | 5 ++---
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/web/src/App.js b/web/src/App.js
index b60fd7ae..94410ad5 100644
--- a/web/src/App.js
+++ b/web/src/App.js
@@ -392,7 +392,7 @@ class App extends Component {
- {Setting.isAdminUser(this.state.account) && !Setting.isMobile() &&
+ {Setting.isAdminUser(this.state.account) && !Setting.isMobile() && (this.state.uri.indexOf("/trees") === -1) &&
{
+ this.setState({
+ organizationName: this.props.match?.params.organizationName || Setting.getRequestOrganization(this.props.account),
+ });
+
const {pagination} = this.state;
this.fetch({pagination});
};
diff --git a/web/src/UserListPage.js b/web/src/UserListPage.js
index c4f8d308..c57d3eb0 100644
--- a/web/src/UserListPage.js
+++ b/web/src/UserListPage.js
@@ -30,7 +30,6 @@ class UserListPage extends BaseListPage {
super(props);
this.state = {
...this.state,
- organizationName: this.props.organizationName ?? this.props.match?.params.organizationName ?? this.props.account.owner,
organization: null,
};
}
@@ -62,7 +61,7 @@ class UserListPage extends BaseListPage {
newUser() {
const randomName = Setting.getRandomName();
- const owner = Setting.isDefaultOrganizationSelected(this.props.account) ? this.state.organizationName : Setting.getRequestOrganization(this.props.account);
+ const owner = (Setting.isDefaultOrganizationSelected(this.props.account) || this.props.groupName) ? this.state.organizationName : Setting.getRequestOrganization(this.props.account);
return {
owner: owner,
name: `user_${randomName}`,
@@ -85,7 +84,7 @@ class UserListPage extends BaseListPage {
score: this.state.organization.initScore,
isDeleted: false,
properties: {},
- signupApplication: "app-built-in",
+ signupApplication: this.state.organization.defaultApplication,
};
}