Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Fix]: #1900 workspace create / all orgs#1901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -173,6 +173,9 @@ type DataItemInfo = {
logoUrl: string;
createdAt?: number;
updatedAt?: number;
isCurrentOrg?: boolean;
isAdmin: boolean;
userRole: string;
};

function OrganizationSetting() {
Expand All@@ -198,21 +201,29 @@ function OrganizationSetting() {



// Filter to only show orgs where user has admin permissions
const adminOrgs = displayWorkspaces.filter((org: Org) => {
// Show all organizations with role information
const allOrgs = displayWorkspaces;
const adminOrgCount = displayWorkspaces.filter((org: Org) => {
const role = user.orgRoleMap.get(org.id);
return role === ADMIN_ROLE || role === SUPER_ADMIN_ROLE;
});
}).length;

const dataSource = adminOrgs.map((org: Org) => ({
id: org.id,
del: adminOrgs.length > 1,
orgName: org.name,
logoUrl: org.logoUrl || "",
createdAt: org.createdAt,
updatedAt: org.updatedAt,
isCurrentOrg: org.isCurrentOrg,
}));
const dataSource = allOrgs.map((org: Org) => {
const userRole = user.orgRoleMap.get(org.id);
const isAdmin = userRole === ADMIN_ROLE || userRole === SUPER_ADMIN_ROLE;

return {
id: org.id,
del: isAdmin && adminOrgCount > 1,
orgName: org.name,
logoUrl: org.logoUrl || "",
createdAt: org.createdAt,
updatedAt: org.updatedAt,
isCurrentOrg: org.isCurrentOrg,
isAdmin,
userRole,
};
});



Expand DownExpand Up@@ -321,13 +332,15 @@ function OrganizationSetting() {
{trans("profile.switchWorkspace")}
</SwitchBtn>
)}
{item.isAdmin && (
<EditBtn
className={"home-datasource-edit-button"}
buttonType={"primary"}
onClick={() => history.push(buildOrgId(item.id))}
>
{trans("edit")}
</EditBtn>
{trans("edit")}
</EditBtn>
)}
{item.del && (
<EditPopover
del={() => {
Expand Down
9 changes: 6 additions & 3 deletionsclient/packages/lowcoder/src/redux/sagas/orgSagas.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -266,9 +266,12 @@ export function* createOrgSaga(action: ReduxAction<{ orgName: string }>) {
if(isValidResponse){
// update org list
yieldcall(getUserSaga);
yieldput({
type:ReduxActionTypes.CREATE_ORG_SUCCESS,
});
// Refetch workspaces to update the profile dropdown
yieldput(fetchWorkspacesAction(1,10));
yieldput({
type:ReduxActionTypes.CREATE_ORG_SUCCESS,
});

}
}catch(error:any){
yieldput({
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp