@@ -14,6 +14,8 @@ import { CippActionsOffcanvas } from 'src/components/utilities'
14
14
import GDAPRoles from 'src/data/GDAPRoles'
15
15
import { useLazyGenericGetRequestQuery } from 'src/store/api/app'
16
16
import { ModalService } from 'src/components/utilities'
17
+ import { constants } from 'buffer'
18
+ import Skeleton from 'react-loading-skeleton'
17
19
18
20
const RefreshAction = ( ) => {
19
21
const [ execGdapInviteQueue , { isLoading, isSuccess, error } ] = useLazyGenericGetRequestQuery ( )
@@ -39,10 +41,33 @@ const RefreshAction = () => {
39
41
40
42
const Actions = ( row , rowIndex , formatExtraData ) => {
41
43
const [ ocVisible , setOCVisible ] = useState ( false )
44
+ const [ getGdapInvite , gdapInvite ] = useLazyGenericGetRequestQuery ( )
42
45
43
- const tenant = useSelector ( ( state ) => state . app . currentTenant )
46
+ function inviteProperty ( gdapInvite , propertyName ) {
47
+ return (
48
+ < >
49
+ { gdapInvite . isFetching && < Skeleton count = { 1 } width = { 150 } /> }
50
+ { ! gdapInvite . isFetching &&
51
+ gdapInvite . isSuccess &&
52
+ ( gdapInvite . data [ propertyName ] ?. toString ( ) ?? ' ' ) }
53
+ </ >
54
+ )
55
+ }
44
56
57
+ function loadOffCanvasDetails ( id ) {
58
+ setOCVisible ( true )
59
+ getGdapInvite ( {
60
+ path : 'api/ListGDAPInvite' ,
61
+ params : { RelationshipId : id } ,
62
+ } )
63
+ }
45
64
var extendedInfo = [ ]
65
+ extendedInfo . push ( {
66
+ label : 'Invite URL' ,
67
+ value : inviteProperty ( gdapInvite , 'InviteUrl' ) ,
68
+ } )
69
+ const tenant = useSelector ( ( state ) => state . app . currentTenant )
70
+
46
71
row ?. accessDetails . unifiedRoles . map ( ( role ) => {
47
72
for ( var x = 0 ; x < GDAPRoles . length ; x ++ ) {
48
73
if ( GDAPRoles [ x ] . ObjectId == role . roleDefinitionId ) {
@@ -54,9 +79,10 @@ const Actions = (row, rowIndex, formatExtraData) => {
54
79
}
55
80
}
56
81
} )
82
+
57
83
return (
58
84
< >
59
- < CButton size = "sm" color = "link" onClick = { ( ) => setOCVisible ( true ) } >
85
+ < CButton size = "sm" color = "link" onClick = { ( ) => loadOffCanvasDetails ( row . id ) } >
60
86
< FontAwesomeIcon icon = { faEllipsisV } />
61
87
</ CButton >
62
88
< CippActionsOffcanvas
0 commit comments