Skip to content

Commit 9f894dd

Browse files
add setting sharepoint owner
1 parent 946a0bd commit 9f894dd

File tree

2 files changed

+129
-57
lines changed

2 files changed

+129
-57
lines changed

src/views/teams-share/onedrive/OneDriveList.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const OneDriveList = () => {
3737
TenantFilter: tenant.defaultDomainName,
3838
RemovePermission: false,
3939
},
40-
modalUrl: `/api/ExecOneDrivePermission`,
40+
modalUrl: `/api/ExecSharePointOwner`,
4141
modalDropdown: {
4242
url: `/api/listUsers?TenantFilter=${tenant.defaultDomainName}`,
4343
labelField: 'displayName',
@@ -55,7 +55,7 @@ const OneDriveList = () => {
5555
TenantFilter: tenant.defaultDomainName,
5656
RemovePermission: true,
5757
},
58-
modalUrl: `/api/ExecOneDrivePermission`,
58+
modalUrl: `/api/ExecSharePointOwner`,
5959
modalDropdown: {
6060
url: `/api/listUsers?TenantFilter=${tenant.defaultDomainName}`,
6161
labelField: 'displayName',

src/views/teams-share/sharepoint/SharepointList.jsx

Lines changed: 127 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,137 @@
1-
import React from 'react'
1+
import { CButton } from '@coreui/react'
2+
import { faEllipsisV } from '@fortawesome/free-solid-svg-icons'
3+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
4+
import React, { useState } from 'react'
25
import { useSelector } from 'react-redux'
36
import { CippPageList } from 'src/components/layout'
47
import { CellTip } from 'src/components/tables'
5-
6-
const columns = [
7-
{
8-
name: 'URL',
9-
selector: (row) => row['URL'],
10-
sortable: true,
11-
cell: (row) => CellTip(row['URL']),
12-
exportSelector: 'URL',
13-
},
14-
{
15-
name: 'Owner',
16-
selector: (row) => row['displayName'],
17-
sortable: true,
18-
cell: (row) => CellTip(row['displayName']),
19-
exportSelector: 'displayName',
20-
maxWidth: '300px',
21-
},
22-
{
23-
name: 'Last Active',
24-
selector: (row) => row['LastActive'],
25-
sortable: true,
26-
exportSelector: 'LastActive',
27-
maxWidth: '120px',
28-
},
29-
{
30-
name: 'File Count (Total)',
31-
selector: (row) => row['FileCount'],
32-
sortable: true,
33-
exportSelector: 'FileCount',
34-
maxWidth: '120px',
35-
},
36-
{
37-
name: 'Used (GB)',
38-
selector: (row) => row['UsedGB'],
39-
sortable: true,
40-
exportSelector: 'UsedGB',
41-
maxWidth: '120px',
42-
},
43-
{
44-
name: 'Allocated (GB)',
45-
selector: (row) => row['Allocated'],
46-
sortable: true,
47-
exportSelector: 'Allocated',
48-
maxWidth: '70px',
49-
},
50-
{
51-
name: 'Root Template',
52-
selector: (row) => row['Template'],
53-
sortable: true,
54-
cell: (row) => CellTip(row['Template']),
55-
exportSelector: 'Template',
56-
maxWidth: '200px',
57-
},
58-
]
8+
import { CippActionsOffcanvas } from 'src/components/utilities'
599

6010
const SharepointList = () => {
6111
const tenant = useSelector((state) => state.app.currentTenant)
12+
const Offcanvas = (row, rowIndex, formatExtraData) => {
13+
const tenant = useSelector((state) => state.app.currentTenant)
14+
const [ocVisible, setOCVisible] = useState(false)
6215

16+
//console.log(row)
17+
return (
18+
<>
19+
<CButton size="sm" color="link" onClick={() => setOCVisible(true)}>
20+
<FontAwesomeIcon icon={faEllipsisV} />
21+
</CButton>
22+
<CippActionsOffcanvas
23+
title="User Information"
24+
extendedInfo={[
25+
{
26+
label: 'Site URL',
27+
value: `${row.URL ?? ' '}`,
28+
},
29+
]}
30+
actions={[
31+
{
32+
label: 'Add Site Admin',
33+
color: 'info',
34+
modal: true,
35+
modalType: 'POST',
36+
modalBody: {
37+
UPN: row.UPN,
38+
TenantFilter: tenant.defaultDomainName,
39+
RemovePermission: false,
40+
URL: row.URL,
41+
},
42+
modalUrl: `/api/ExecSharePointOwner`,
43+
modalDropdown: {
44+
url: `/api/listUsers?TenantFilter=${tenant.defaultDomainName}`,
45+
labelField: 'displayName',
46+
valueField: 'userPrincipalName',
47+
},
48+
modalMessage: 'Select the User to add to the Site Admins permissions',
49+
},
50+
{
51+
label: 'Remove Site Admin',
52+
color: 'info',
53+
modal: true,
54+
modalType: 'POST',
55+
modalBody: {
56+
UPN: row.UPN,
57+
TenantFilter: tenant.defaultDomainName,
58+
RemovePermission: true,
59+
URL: row.URL,
60+
},
61+
modalUrl: `/api/ExecSharePointOwner`,
62+
modalDropdown: {
63+
url: `/api/listUsers?TenantFilter=${tenant.defaultDomainName}`,
64+
labelField: 'displayName',
65+
valueField: 'userPrincipalName',
66+
},
67+
modalMessage: 'Select the User to remove from the Site Admins permission',
68+
},
69+
]}
70+
placement="end"
71+
visible={ocVisible}
72+
id={row.id}
73+
hideFunction={() => setOCVisible(false)}
74+
/>
75+
</>
76+
)
77+
}
78+
const columns = [
79+
{
80+
name: 'URL',
81+
selector: (row) => row['URL'],
82+
sortable: true,
83+
cell: (row) => CellTip(row['URL']),
84+
exportSelector: 'URL',
85+
},
86+
{
87+
name: 'Owner',
88+
selector: (row) => row['displayName'],
89+
sortable: true,
90+
cell: (row) => CellTip(row['displayName']),
91+
exportSelector: 'displayName',
92+
maxWidth: '300px',
93+
},
94+
{
95+
name: 'Last Active',
96+
selector: (row) => row['LastActive'],
97+
sortable: true,
98+
exportSelector: 'LastActive',
99+
maxWidth: '120px',
100+
},
101+
{
102+
name: 'File Count (Total)',
103+
selector: (row) => row['FileCount'],
104+
sortable: true,
105+
exportSelector: 'FileCount',
106+
maxWidth: '120px',
107+
},
108+
{
109+
name: 'Used (GB)',
110+
selector: (row) => row['UsedGB'],
111+
sortable: true,
112+
exportSelector: 'UsedGB',
113+
maxWidth: '120px',
114+
},
115+
{
116+
name: 'Allocated (GB)',
117+
selector: (row) => row['Allocated'],
118+
sortable: true,
119+
exportSelector: 'Allocated',
120+
maxWidth: '70px',
121+
},
122+
{
123+
name: 'Root Template',
124+
selector: (row) => row['Template'],
125+
sortable: true,
126+
cell: (row) => CellTip(row['Template']),
127+
exportSelector: 'Template',
128+
maxWidth: '200px',
129+
},
130+
{
131+
name: 'Actions',
132+
cell: Offcanvas,
133+
},
134+
]
63135
return (
64136
<CippPageList
65137
title="SharePoint List"

0 commit comments

Comments
 (0)