@@ -7,7 +7,7 @@ import { APComponentHeader } from "../../../components/APComponentHeader/APCompo
7
7
import { ApiCallState , TApiCallState } from "../../../utils/ApiCallState" ;
8
8
import { ApiCallStatusError } from "../../../components/ApiCallStatusError/ApiCallStatusError" ;
9
9
import { E_CALL_STATE_ACTIONS } from "./ManageBusinessGroupsCommon" ;
10
- import APBusinessGroupsDisplayService , { TAPBusinessGroupDisplay } from "../../../displayServices/APBusinessGroupsDisplayService" ;
10
+ import APBusinessGroupsDisplayService , { TAPBusinessGroupAssetReference , TAPBusinessGroupDisplay } from "../../../displayServices/APBusinessGroupsDisplayService" ;
11
11
import APEntityIdsService , { TAPEntityId , TAPEntityIdList } from "../../../utils/APEntityIdsService" ;
12
12
import { APSClientOpenApi } from "../../../utils/APSClientOpenApi" ;
13
13
import APDisplayUtils from "../../../displayServices/APDisplayUtils" ;
@@ -39,7 +39,8 @@ export const ViewBusinessGroup: React.FC<IViewBusinessGroupProps> = (props: IVie
39
39
try {
40
40
const object : TAPBusinessGroupDisplay = await APBusinessGroupsDisplayService . apsGet_ApBusinessGroupDisplay ( {
41
41
organizationId : props . organizationId ,
42
- businessGroupId : props . businessGroupEntityId . id
42
+ businessGroupId : props . businessGroupEntityId . id ,
43
+ fetchAssetReferences : true
43
44
} ) ;
44
45
setManagedObject ( object ) ;
45
46
} catch ( e : any ) {
@@ -95,12 +96,57 @@ export const ViewBusinessGroup: React.FC<IViewBusinessGroupProps> = (props: IVie
95
96
) ;
96
97
}
97
98
const renderMembers = ( apUserEntityIdList : TAPEntityIdList ) : JSX . Element => {
99
+ if ( apUserEntityIdList . length > 0 ) {
100
+ return (
101
+ < React . Fragment >
102
+ < div > < b > Members:</ b > </ div >
103
+ < div className = "p-ml-2" >
104
+ { APDisplayUtils . create_DivList_From_StringList ( APEntityIdsService . create_DisplayNameList ( apUserEntityIdList ) ) }
105
+ </ div >
106
+ </ React . Fragment >
107
+ ) ;
108
+ }
109
+ return (
110
+ < div > < b > Members</ b > : None.</ div >
111
+ ) ;
112
+ }
113
+ const renderAssetReferences = ( apBusinessGroupAssetReference : TAPBusinessGroupAssetReference ) : JSX . Element => {
114
+ const jsxElementList : Array < JSX . Element > = [ ] ;
115
+ if ( apBusinessGroupAssetReference . apApiProductReferenceEntityIdList . length > 0 ) {
116
+ jsxElementList . push (
117
+ < React . Fragment >
118
+ < div className = "p-ml-2 p-mt-2" >
119
+ < b > API Products:</ b >
120
+ < div className = "p-ml-2" >
121
+ { APDisplayUtils . create_DivList_From_StringList ( APEntityIdsService . create_DisplayNameList ( apBusinessGroupAssetReference . apApiProductReferenceEntityIdList ) ) }
122
+ </ div >
123
+ </ div >
124
+ </ React . Fragment >
125
+ ) ;
126
+ }
127
+ if ( apBusinessGroupAssetReference . apBusinessGroupAppReferenceEntityIdList . length > 0 ) {
128
+ jsxElementList . push (
129
+ < React . Fragment >
130
+ < div className = "p-ml-2 p-mt-2" >
131
+ < b > Business Group Apps:</ b >
132
+ < div className = "p-ml-2" >
133
+ { APDisplayUtils . create_DivList_From_StringList ( APEntityIdsService . create_DisplayNameList ( apBusinessGroupAssetReference . apBusinessGroupAppReferenceEntityIdList ) ) }
134
+ </ div >
135
+ </ div >
136
+ </ React . Fragment >
137
+ ) ;
138
+ }
139
+ if ( jsxElementList . length === 0 ) {
140
+ jsxElementList . push (
141
+ < div > None.</ div >
142
+ ) ;
143
+ }
98
144
return (
99
145
< React . Fragment >
100
- < div > < b > Members :</ b > </ div >
101
- < div className = "p-ml-2" >
102
- { APDisplayUtils . create_DivList_From_StringList ( APEntityIdsService . create_DisplayNameList ( apUserEntityIdList ) ) }
103
- </ div >
146
+ < div > < b > Assets :</ b > </ div >
147
+ < div className = "p-ml-2" >
148
+ { jsxElementList }
149
+ </ div >
104
150
</ React . Fragment >
105
151
) ;
106
152
}
@@ -126,6 +172,9 @@ export const ViewBusinessGroup: React.FC<IViewBusinessGroupProps> = (props: IVie
126
172
< Divider />
127
173
{ renderMembers ( managedObject . apMemberUserEntityIdList ) }
128
174
175
+ < Divider />
176
+ { renderAssetReferences ( managedObject . apBusinessGroupAssetReference ) }
177
+
129
178
</ div >
130
179
< div className = "view-detail-right" >
131
180
< div > Id: { managedObject . apEntityId . id } </ div >
0 commit comments