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

Commit4d0d203

Browse files
committed
[Fix]:#1900 workspace create / all orgs
1 parent1b7d4b9 commit4d0d203

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed

‎client/packages/lowcoder/src/pages/setting/organization/orgList.tsx‎

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ type DataItemInfo = {
173173
logoUrl:string;
174174
createdAt?:number;
175175
updatedAt?:number;
176+
isCurrentOrg?:boolean;
177+
isAdmin:boolean;
178+
userRole:string;
176179
};
177180

178181
functionOrganizationSetting(){
@@ -198,21 +201,29 @@ function OrganizationSetting() {
198201

199202

200203

201-
// Filter to only show orgs where user has admin permissions
202-
constadminOrgs=displayWorkspaces.filter((org:Org)=>{
204+
// Show all organizations with role information
205+
constallOrgs=displayWorkspaces;
206+
constadminOrgCount=displayWorkspaces.filter((org:Org)=>{
203207
constrole=user.orgRoleMap.get(org.id);
204208
returnrole===ADMIN_ROLE||role===SUPER_ADMIN_ROLE;
205-
});
209+
}).length;
206210

207-
constdataSource=adminOrgs.map((org:Org)=>({
208-
id:org.id,
209-
del:adminOrgs.length>1,
210-
orgName:org.name,
211-
logoUrl:org.logoUrl||"",
212-
createdAt:org.createdAt,
213-
updatedAt:org.updatedAt,
214-
isCurrentOrg:org.isCurrentOrg,
215-
}));
211+
constdataSource=allOrgs.map((org:Org)=>{
212+
constuserRole=user.orgRoleMap.get(org.id);
213+
constisAdmin=userRole===ADMIN_ROLE||userRole===SUPER_ADMIN_ROLE;
214+
215+
return{
216+
id:org.id,
217+
del:isAdmin&&adminOrgCount>1,
218+
orgName:org.name,
219+
logoUrl:org.logoUrl||"",
220+
createdAt:org.createdAt,
221+
updatedAt:org.updatedAt,
222+
isCurrentOrg:org.isCurrentOrg,
223+
isAdmin,
224+
userRole,
225+
};
226+
});
216227

217228

218229

@@ -321,13 +332,15 @@ function OrganizationSetting() {
321332
{trans("profile.switchWorkspace")}
322333
</SwitchBtn>
323334
)}
335+
{item.isAdmin&&(
324336
<EditBtn
325337
className={"home-datasource-edit-button"}
326338
buttonType={"primary"}
327339
onClick={()=>history.push(buildOrgId(item.id))}
328340
>
329-
{trans("edit")}
330-
</EditBtn>
341+
{trans("edit")}
342+
</EditBtn>
343+
)}
331344
{item.del&&(
332345
<EditPopover
333346
del={()=>{

‎client/packages/lowcoder/src/redux/sagas/orgSagas.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,12 @@ export function* createOrgSaga(action: ReduxAction<{ orgName: string }>) {
266266
if(isValidResponse){
267267
// update org list
268268
yieldcall(getUserSaga);
269-
yieldput({
270-
type:ReduxActionTypes.CREATE_ORG_SUCCESS,
271-
});
269+
// Refetch workspaces to update the profile dropdown
270+
yieldput(fetchWorkspacesAction(1,10));
271+
yieldput({
272+
type:ReduxActionTypes.CREATE_ORG_SUCCESS,
273+
});
274+
272275
}
273276
}catch(error:any){
274277
yieldput({

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp