@@ -2,11 +2,55 @@ import React, { useEffect, useState } from 'react'
2
2
import { useSelector } from 'react-redux'
3
3
import { CellTip , cellBooleanFormatter } from 'src/components/tables'
4
4
import { CippPageList } from 'src/components/layout'
5
+ import { Link } from 'react-router-dom'
6
+ import { CButton } from '@coreui/react'
7
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
8
+ import { faEdit , faEllipsisV } from '@fortawesome/free-solid-svg-icons'
9
+ import { CippActionsOffcanvas } from 'src/components/utilities'
5
10
6
11
const DevicesList = ( ) => {
7
12
const [ tenantColumnSet , setTenantColumn ] = useState ( true )
8
13
const tenant = useSelector ( ( state ) => state . app . currentTenant )
9
-
14
+ const Offcanvas = ( row , rowIndex , formatExtraData ) => {
15
+ const tenant = useSelector ( ( state ) => state . app . currentTenant )
16
+ const [ ocVisible , setOCVisible ] = useState ( false )
17
+ const editLink = `/identity/administration/groups/edit?groupId=${ row . id } &tenantDomain=${ tenant . defaultDomainName } `
18
+ return (
19
+ < >
20
+ < CButton size = "sm" color = "link" onClick = { ( ) => setOCVisible ( true ) } >
21
+ < FontAwesomeIcon icon = { faEllipsisV } />
22
+ </ CButton >
23
+ < CippActionsOffcanvas
24
+ title = "Group Information"
25
+ extendedInfo = { [
26
+ { label : 'Created Date (UTC)' , value : `${ row . createdDateTime ?? ' ' } ` } ,
27
+ { label : 'Display Name' , value : `${ row . displayName ?? ' ' } ` } ,
28
+ { label : 'Unique ID' , value : `${ row . id ?? ' ' } ` } ,
29
+ ] }
30
+ actions = { [
31
+ {
32
+ label : 'Disable Device' ,
33
+ color : 'info' ,
34
+ modal : true ,
35
+ modalUrl : `/api/ExecDeviceDelete?TenantFilter=${ tenant . defaultDomainName } &ID=${ row . id } &Action=Disable` ,
36
+ modalMessage : 'Are you sure you want to disable this device.' ,
37
+ } ,
38
+ {
39
+ label : 'Delete Device' ,
40
+ color : 'warning' ,
41
+ modal : true ,
42
+ modalUrl : `/api/ExecGroupsDelete?TenantFilter=${ tenant . defaultDomainName } &ID=${ row . id } &Action=Enable` ,
43
+ modalMessage : 'Are you sure you want to delete this device.' ,
44
+ } ,
45
+ ] }
46
+ placement = "end"
47
+ visible = { ocVisible }
48
+ id = { row . id }
49
+ hideFunction = { ( ) => setOCVisible ( false ) }
50
+ />
51
+ </ >
52
+ )
53
+ }
10
54
const columns = [
11
55
{
12
56
name : 'Tenant' ,
@@ -74,6 +118,11 @@ const DevicesList = () => {
74
118
sortable : true ,
75
119
exportSelector : 'profileType' ,
76
120
} ,
121
+ {
122
+ name : 'Actions' ,
123
+ cell : Offcanvas ,
124
+ maxWidth : '20px' ,
125
+ } ,
77
126
]
78
127
useEffect ( ( ) => {
79
128
if ( tenant . defaultDomainName === 'AllTenants' ) {
0 commit comments