@@ -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
178181function OrganizationSetting ( ) {
@@ -198,21 +201,29 @@ function OrganizationSetting() {
198201
199202
200203
201- // Filter to only show orgs where user has admin permissions
202- const adminOrgs = displayWorkspaces . filter ( ( org : Org ) => {
204+ // Show all organizations with role information
205+ const allOrgs = displayWorkspaces ;
206+ const adminOrgCount = displayWorkspaces . filter ( ( org : Org ) => {
203207 const role = user . orgRoleMap . get ( org . id ) ;
204208 return role === ADMIN_ROLE || role === SUPER_ADMIN_ROLE ;
205- } ) ;
209+ } ) . length ;
206210
207- const dataSource = 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+ const dataSource = allOrgs . map ( ( org : Org ) => {
212+ const userRole = user . orgRoleMap . get ( org . id ) ;
213+ const isAdmin = 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 = { ( ) => {
0 commit comments