@@ -4,14 +4,13 @@ import React from "react";
4
4
import { TreeTable } from "primereact/treetable" ;
5
5
import { Column } from "primereact/column" ;
6
6
7
- import APEntityIdsService from "../../../utils/APEntityIdsService" ;
8
7
import { APDisplayOrganizationUserBusinessGroupRoles } from "./APDisplayOrganizationUserBusinessGroupRoles" ;
9
8
import { TAPOrganizationUserDisplay } from "../../../displayServices/APUsersDisplayService/APOrganizationUsersDisplayService" ;
10
9
import APMemberOfService , {
11
10
TAPMemberOfBusinessGroupTreeTableNode ,
12
11
TAPMemberOfBusinessGroupTreeTableNodeList
13
12
} from "../../../displayServices/APUsersDisplayService/APMemberOfService" ;
14
- import { TAPTreeTableExpandedKeysType } from "../../../displayServices/APBusinessGroupsDisplayService" ;
13
+ import APBusinessGroupsDisplayService , { TAPTreeTableExpandedKeysType } from "../../../displayServices/APBusinessGroupsDisplayService" ;
15
14
16
15
import "../../APComponents.css" ;
17
16
@@ -48,14 +47,15 @@ export const APDisplayOrganizationUserBusinessGroups: React.FC<IAPDisplayOrganiz
48
47
const logName = `${ ComponentName } .${ funcName } ()` ;
49
48
50
49
if ( props . apOrganizationUserDisplay . completeOrganizationBusinessGroupDisplayList === undefined ) throw new Error ( `${ logName } : apUserDisplay.completeOrganizationBusinessGroupDisplayList` ) ;
51
- const apMemberOfBusinessGroupTreeTableNodeList : TAPMemberOfBusinessGroupTreeTableNodeList = APMemberOfService . create_ApMemberOfBusinessGroupTreeTableNodeList ( {
50
+ const _apMemberOfBusinessGroupTreeTableNodeList : TAPMemberOfBusinessGroupTreeTableNodeList = APMemberOfService . create_ApMemberOfBusinessGroupTreeTableNodeList ( {
52
51
organizationEntityId : props . apOrganizationUserDisplay . organizationEntityId ,
53
52
apMemberOfBusinessGroupDisplayList : props . apOrganizationUserDisplay . memberOfOrganizationDisplay . apMemberOfBusinessGroupDisplayList ,
54
53
apOrganizationRoleEntityIdList : props . apOrganizationUserDisplay . memberOfOrganizationDisplay . apOrganizationRoleEntityIdList ,
55
54
completeApOrganizationBusinessGroupDisplayList : props . apOrganizationUserDisplay . completeOrganizationBusinessGroupDisplayList ,
56
- pruneBusinessGroupsNotAMemberOf : true
55
+ // pruneBusinessGroupsNotAMemberOf: true
56
+ pruneBusinessGroupsNotAMemberOf : false
57
57
} ) ;
58
- setApMemberOfBusinessGroupTreeTableNodeList ( apMemberOfBusinessGroupTreeTableNodeList ) ;
58
+ setApMemberOfBusinessGroupTreeTableNodeList ( _apMemberOfBusinessGroupTreeTableNodeList ) ;
59
59
} , [ ] ) ; /* eslint-disable-line react-hooks/exhaustive-deps */
60
60
61
61
React . useEffect ( ( ) => {
@@ -77,6 +77,9 @@ export const APDisplayOrganizationUserBusinessGroups: React.FC<IAPDisplayOrganiz
77
77
/>
78
78
) ;
79
79
}
80
+ const sourceByBodyTemplate = ( node : TAPMemberOfBusinessGroupTreeTableNode ) : string => {
81
+ return APBusinessGroupsDisplayService . getSourceDisplayString ( node . data . apBusinessGroupDisplay ) ;
82
+ }
80
83
81
84
// const keyBodyTemplate = (node: TAPMemberOfBusinessGroupTreeTableNode) => {
82
85
// return node.key;
@@ -102,31 +105,34 @@ export const APDisplayOrganizationUserBusinessGroups: React.FC<IAPDisplayOrganiz
102
105
onToggle = { e => setExpandedKeys ( e . value ) }
103
106
>
104
107
< Column header = "Name" field = { field_Name } bodyStyle = { { verticalAlign : 'top' } } sortable expander />
108
+ { /* <Column header="Source" body={sourceByBodyTemplate} bodyStyle={{verticalAlign: 'top'}} field="apExternalReference.externalSystemDisplayName" sortable /> */ }
109
+ < Column header = "Source" body = { sourceByBodyTemplate } bodyStyle = { { verticalAlign : 'top' } } />
105
110
< Column header = "Roles" body = { rolesBodyTemplate } bodyStyle = { { verticalAlign : 'top' } } />
106
111
{ /* <Column header="Key" body={keyBodyTemplate} bodyStyle={{verticalAlign: 'top'}} /> */ }
107
112
</ TreeTable >
108
113
</ div >
109
114
110
115
{ /* DEBUG */ }
111
- { /* <p><b>apMemberOfBusinessGroupTreeNodeDisplayList =</b></p>
116
+ { /* <p><b>treeTableNodeList =</b></p>
112
117
<pre style={ { fontSize: '10px' }} >
113
- {JSON.stringify(apMemberOfBusinessGroupTreeNodeDisplayList , null, 2)}
118
+ {JSON.stringify(treeTableNodeList , null, 2)}
114
119
</pre> */ }
115
120
116
121
</ React . Fragment >
117
122
) ;
118
123
}
119
124
120
- const renderOrganizationRoles = ( ) : JSX . Element => {
121
- const organizationRolesDisplayString = props . apOrganizationUserDisplay . memberOfOrganizationDisplay . apOrganizationRoleEntityIdList . length > 0
122
- ? APEntityIdsService . getSortedDisplayNameList_As_String ( props . apOrganizationUserDisplay . memberOfOrganizationDisplay . apOrganizationRoleEntityIdList )
123
- : 'None.' ;
124
- return (
125
- < React . Fragment >
126
- < div > < b > Organization Roles</ b > : { organizationRolesDisplayString } </ div >
127
- </ React . Fragment >
128
- ) ;
129
- }
125
+ // now the root business group
126
+ // const renderOrganizationRoles = (): JSX.Element => {
127
+ // const organizationRolesDisplayString = props.apOrganizationUserDisplay.memberOfOrganizationDisplay.apOrganizationRoleEntityIdList.length > 0
128
+ // ? APEntityIdsService.getSortedDisplayNameList_As_String(props.apOrganizationUserDisplay.memberOfOrganizationDisplay.apOrganizationRoleEntityIdList)
129
+ // : 'None.';
130
+ // return (
131
+ // <React.Fragment>
132
+ // <div><b>Organization Roles</b>: {organizationRolesDisplayString}</div>
133
+ // </React.Fragment>
134
+ // );
135
+ // }
130
136
131
137
const renderComponent = ( ) : JSX . Element => {
132
138
const funcName = 'renderComponent' ;
@@ -136,9 +142,9 @@ export const APDisplayOrganizationUserBusinessGroups: React.FC<IAPDisplayOrganiz
136
142
137
143
return (
138
144
< React . Fragment >
139
- < div className = "p-mt-2" >
145
+ { /* <div className="p-mt-2">
140
146
{renderOrganizationRoles()}
141
- </ div >
147
+ </div> */ }
142
148
< div className = "p-mt-2" > { renderOrganizationBusinessGroupsTreeTable ( apMemberOfBusinessGroupTreeTableNodeList ) } </ div >
143
149
</ React . Fragment >
144
150
) ;
0 commit comments