Skip to content

Commit cc8e6a0

Browse files
committed
Add invite URL to offcanvas
1 parent dba1623 commit cc8e6a0

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

src/views/tenant/administration/ListGDAPRelationships.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { CippActionsOffcanvas } from 'src/components/utilities'
1414
import GDAPRoles from 'src/data/GDAPRoles'
1515
import { useLazyGenericGetRequestQuery } from 'src/store/api/app'
1616
import { ModalService } from 'src/components/utilities'
17+
import { constants } from 'buffer'
18+
import Skeleton from 'react-loading-skeleton'
1719

1820
const RefreshAction = () => {
1921
const [execGdapInviteQueue, { isLoading, isSuccess, error }] = useLazyGenericGetRequestQuery()
@@ -39,10 +41,33 @@ const RefreshAction = () => {
3941

4042
const Actions = (row, rowIndex, formatExtraData) => {
4143
const [ocVisible, setOCVisible] = useState(false)
44+
const [getGdapInvite, gdapInvite] = useLazyGenericGetRequestQuery()
4245

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+
}
4456

57+
function loadOffCanvasDetails(id) {
58+
setOCVisible(true)
59+
getGdapInvite({
60+
path: 'api/ListGDAPInvite',
61+
params: { RelationshipId: id },
62+
})
63+
}
4564
var extendedInfo = []
65+
extendedInfo.push({
66+
label: 'Invite URL',
67+
value: inviteProperty(gdapInvite, 'InviteUrl'),
68+
})
69+
const tenant = useSelector((state) => state.app.currentTenant)
70+
4671
row?.accessDetails.unifiedRoles.map((role) => {
4772
for (var x = 0; x < GDAPRoles.length; x++) {
4873
if (GDAPRoles[x].ObjectId == role.roleDefinitionId) {
@@ -54,9 +79,10 @@ const Actions = (row, rowIndex, formatExtraData) => {
5479
}
5580
}
5681
})
82+
5783
return (
5884
<>
59-
<CButton size="sm" color="link" onClick={() => setOCVisible(true)}>
85+
<CButton size="sm" color="link" onClick={() => loadOffCanvasDetails(row.id)}>
6086
<FontAwesomeIcon icon={faEllipsisV} />
6187
</CButton>
6288
<CippActionsOffcanvas

0 commit comments

Comments
 (0)