diff --git a/src/_nav.js b/src/_nav.js index 0ef539f56cfb..b46f4a3a8dd7 100644 --- a/src/_nav.js +++ b/src/_nav.js @@ -272,7 +272,7 @@ const _nav = [ { component: CNavItem, name: 'Documentation', - href: 'https://github.com/KelvinTegelaar/CIPP', + href: 'https://cipp.app', }, { component: CNavItem, diff --git a/src/routes.js b/src/routes.js index 9039166f5e13..3b4e265864cf 100644 --- a/src/routes.js +++ b/src/routes.js @@ -8,6 +8,7 @@ const AddUser = React.lazy(() => import('./views/identity/administration/AddUser const EditUser = React.lazy(() => import('./views/identity/administration/EditUser')) const ViewUser = React.lazy(() => import('./views/identity/administration/ViewUser')) const Groups = React.lazy(() => import('./views/identity/administration/Groups')) +const EditGroup = React.lazy(() => import('./views/identity/administration/EditGroup')) const Devices = React.lazy(() => import('./views/identity/reports/Devices')) const MFAReport = React.lazy(() => import('./views/identity/reports/MFAReport')) const Tenants = React.lazy(() => import('./views/tenant/administration/Tenants')) @@ -70,6 +71,8 @@ const routes = [ { path: '/identity/administration', name: 'Administration' }, { path: '/identity/administration/users', name: 'Users', component: Users }, { path: '/identity/administration/groups', name: 'Groups', component: Groups }, + { path: '/identity/administration/EditGroup', name: 'Edit Group', component: EditGroup }, + { path: '/identity/administration/offboarding-wizard', name: 'Offboarding Wizard', diff --git a/src/store/modules/identity.js b/src/store/modules/identity.js index f5c0bef65be2..25e761cebfff 100644 --- a/src/store/modules/identity.js +++ b/src/store/modules/identity.js @@ -52,12 +52,21 @@ const initialState = { loading: false, loaded: false, }, + sharepoint: { + list: [], + loading: false, + loaded: false, + }, } const USERS_LOAD = 'users/USERS_LOAD' const USERS_LOAD_SUCCESS = 'users/USERS_LOAD_SUCCESS' const USERS_LOAD_ERROR = 'users/USERS_LOAD_ERROR' +const SHAREPOINT_LOAD = 'sharepoint/SHAREPOINT_LOAD' +const SHAREPOINT_LOAD_SUCCESS = 'sharepoint/SHAREPOINT_LOAD_SUCCESS' +const SHAREPOINT_LOAD_ERROR = 'sharepoint/SHAREPOINT_LOAD_ERROR' + const GROUPS_LOAD = 'groups/GROUPS_LOAD' const GROUPS_LOAD_SUCCESS = 'groups/GROUPS_LOAD_SUCCESS' const GROUPS_LOAD_ERROR = 'groups/GROUPS_LOAD_ERROR' @@ -433,6 +442,35 @@ export default function reducer(state = initialState, action = {}) { error: action.error, }, } + case SHAREPOINT_LOAD: + return { + ...state, + sharepoint: { + ...state.sharepoint, + loading: true, + loaded: false, + }, + } + case SHAREPOINT_LOAD_SUCCESS: + return { + ...state, + sharepoint: { + ...state.sharepoint, + loading: false, + loaded: true, + list: action.result, + }, + } + case SHAREPOINT_LOAD_ERROR: + return { + ...state, + sharepoint: { + ...state.sharepoint, + loading: false, + loaded: false, + error: action.error, + }, + } default: return state } @@ -448,6 +486,16 @@ export function listUsers({ tenant }) { } } +export function listSharepointSites({ tenant }) { + return { + types: [SHAREPOINT_LOAD, SHAREPOINT_LOAD_SUCCESS, SHAREPOINT_LOAD_ERROR], + promise: (client) => + client + .get('/api/ListSites?type=SharePointSiteUsage&Tenantfilter=' + tenant.defaultDomainName) + .then((result) => result.data), + } +} + export function listGroups({ tenant }) { return { types: [GROUPS_LOAD, GROUPS_LOAD_SUCCESS, GROUPS_LOAD_ERROR], diff --git a/src/views/identity/administration/EditGroup.js b/src/views/identity/administration/EditGroup.js new file mode 100644 index 000000000000..f83826faef77 --- /dev/null +++ b/src/views/identity/administration/EditGroup.js @@ -0,0 +1,7 @@ +import React from 'react' + +const EditGroup = () => { + return
Edit Group
+} + +export default EditGroup diff --git a/src/views/teams-share/sharepoint/SharepointList.js b/src/views/teams-share/sharepoint/SharepointList.js index a0910213a645..2dc3029d8a3f 100644 --- a/src/views/teams-share/sharepoint/SharepointList.js +++ b/src/views/teams-share/sharepoint/SharepointList.js @@ -1,9 +1,122 @@ -import React from 'react' +import React, { useEffect } from 'react' +import { CDropdown, CDropdownItem, CDropdownMenu, CDropdownToggle, CSpinner } from '@coreui/react' +import TenantSelector from 'src/components/cipp/TenantSelector' +import BootstrapTable from 'react-bootstrap-table-next' +import ToolkitProvider, { Search } from 'react-bootstrap-table2-toolkit' +import paginationFactory from 'react-bootstrap-table2-paginator' +import { useDispatch, useSelector } from 'react-redux' +import { Link } from 'react-router-dom' +import { cilSettings, cilUser } from '@coreui/icons' +import CIcon from '@coreui/icons-react' +import { listSharepointSites } from '../../../store/modules/identity' + +const { SearchBar } = Search + +const pagination = paginationFactory() + +const dropdown = (cell, row, rowIndex, formatExtraData) => { + return ( + + ... + + + + + Edit Site Members + + + + + ) +} + +const columns = [ + { + text: 'Display Name', + dataField: 'displayName', + sort: true, + }, + { + text: 'UPN', + dataField: 'UPN', + sort: true, + }, + { + text: 'Last Active', + dataField: 'LastActive', + sort: true, + }, + { + text: 'File Count', + dataField: 'FileCount', + sort: true, + }, + { + text: 'Used (GB)', + dataField: 'UsedGB', + sort: true, + }, + { + text: 'Allocated', + dataField: 'Allocated', + }, + { + text: 'URL', + dataField: 'URL', + sort: true, + }, + { + text: 'Action', + formatter: dropdown, + }, +] + +const SharepointList = () => { + const dispatch = useDispatch() + const tenant = useSelector((state) => state.app.currentTenant) + const sharepoint = useSelector((state) => state.identity.sharepoint) + + useEffect(() => { + async function load() { + if (Object.keys(tenant).length !== 0) { + dispatch(listSharepointSites({ tenant: tenant })) + } + } + + load() + }, []) + + const action = (tenant) => { + dispatch(listSharepointSites({ tenant: tenant })) + } -const SharepointList = (props) => { return (
-

SharepointList

+ +
+
+

Sharepoint Site List

+ {Object.keys(tenant).length === 0 && Select a tenant to get started.} + {!sharepoint.loaded && sharepoint.loading && } + {sharepoint.loaded && !sharepoint.loading && Object.keys(tenant).length !== 0 && ( + + {(props) => ( +
+ {/* eslint-disable-next-line react/prop-types */} + +
+ {/*eslint-disable */} + + {/*eslint-enable */} +
+ )} +
+ )} +
) }