Skip to content

[pull] dev from KelvinTegelaar:dev #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5560110
added securescore overviews.
KelvinTegelaar Apr 21, 2024
b2c0f67
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP into dev
KelvinTegelaar Apr 21, 2024
aec93f1
remove comments, fixes reload
KelvinTegelaar Apr 21, 2024
e61e475
CippActionsOffcanvas updates
JohnDuprey Apr 22, 2024
a36d67d
Merge remote-tracking branch 'upstream/dev' into dev
JohnDuprey Apr 22, 2024
df43bc2
Merge pull request #2354 from JohnDuprey/dev
JohnDuprey Apr 22, 2024
6f5ab1c
settings menu interface changes
KelvinTegelaar Apr 22, 2024
2e2b521
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP into dev
KelvinTegelaar Apr 22, 2024
38565da
prettification
KelvinTegelaar Apr 22, 2024
6897990
prettification
KelvinTegelaar Apr 22, 2024
ef1c6c7
notification prettification
KelvinTegelaar Apr 22, 2024
f4db140
upgrade extension stuff
KelvinTegelaar Apr 22, 2024
4fb8a49
prettification
KelvinTegelaar Apr 22, 2024
4cd9312
prettification
KelvinTegelaar Apr 22, 2024
66f17f5
add securescore to menu
KelvinTegelaar Apr 22, 2024
2910da6
test in dev
KelvinTegelaar Apr 23, 2024
fa407a3
testing with new layout
KelvinTegelaar Apr 23, 2024
e5116eb
new mapping experience.
KelvinTegelaar Apr 23, 2024
6230078
filter available relationships for onboarding
JohnDuprey Apr 23, 2024
6605f34
text change
KelvinTegelaar Apr 23, 2024
b8fd9bf
switches orders
KelvinTegelaar Apr 23, 2024
e44b89d
auto refresh for recent jobs
JohnDuprey Apr 23, 2024
abbddb8
Merge remote-tracking branch 'upstream/dev' into dev
JohnDuprey Apr 23, 2024
f359a3c
Merge pull request #2356 from JohnDuprey/dev
JohnDuprey Apr 23, 2024
8dd57ad
Ninjaone mapping changes
KelvinTegelaar Apr 23, 2024
e3ebf34
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP into dev
KelvinTegelaar Apr 23, 2024
91d04db
corrected mapping send
KelvinTegelaar Apr 23, 2024
1562bc6
corrected shipped info
KelvinTegelaar Apr 23, 2024
8fdecaf
automapping
KelvinTegelaar Apr 23, 2024
2441b13
automapping fixes
KelvinTegelaar Apr 23, 2024
e0a5fcf
Graph Explorer - Add Reverse Tenant lookups
JohnDuprey Apr 23, 2024
922eb3a
case sensivity is the bane of my existence.
KelvinTegelaar Apr 23, 2024
e30fe0a
cleaned console logs
KelvinTegelaar Apr 23, 2024
c7729b5
Automapping callout
KelvinTegelaar Apr 23, 2024
4d60d60
Add partner relationships page
JohnDuprey Apr 23, 2024
9cb2bbe
moved timing of showing success box.
KelvinTegelaar Apr 23, 2024
f7ea986
whoops
KelvinTegelaar Apr 23, 2024
d3ad2f8
Add API response offcanvas
JohnDuprey Apr 24, 2024
a312094
Merge pull request #164 from KelvinTegelaar/dev
JohnDuprey Apr 24, 2024
6c133af
Merge pull request #2357 from JohnDuprey/dev
JohnDuprey Apr 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/_nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ const _nav = [
name: 'Enterprise Applications',
to: '/tenant/administration/enterprise-apps',
},
{
component: CNavItem,
name: 'Secure Score',
to: '/tenant/administration/securescore',
},
{
component: CNavItem,
name: 'App Consent Requests',
Expand All @@ -157,6 +162,11 @@ const _nav = [
name: 'Tenant Offboarding',
to: '/tenant/administration/tenant-offboarding-wizard',
},
{
component: CNavItem,
name: 'Partner Relationships',
to: '/tenant/administration/partner-relationships',
},
],
},
{
Expand Down
27 changes: 27 additions & 0 deletions src/components/contentcards/CippButtonCard.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { CCard, CCardBody, CCardFooter, CCardHeader, CCardTitle } from '@coreui/react'
import Skeleton from 'react-loading-skeleton'

export default function CippButtonCard({
title,
titleType = 'normal',
CardButton,
children,
isFetching,
}) {
return (
<CCard className="h-100 mb-3">
<CCardHeader>
<CCardTitle>
{titleType === 'big' ? <h3 className="underline mb-3">{title}</h3> : title}
</CCardTitle>
</CCardHeader>
<CCardBody>
{isFetching && <Skeleton />}
{children}
</CCardBody>
<CCardFooter>{CardButton}</CCardFooter>
</CCard>
)
}
10 changes: 8 additions & 2 deletions src/components/forms/RFFComponents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ export const RFFSelectSearch = ({
return (
<Field name={name} validate={validate}>
{({ meta, input }) => {
const handleChange = onChange
? (e) => {
input.onChange(e)
onChange(e)
}
: input.onChange
return (
<div>
<CFormLabel htmlFor={name}>
Expand Down Expand Up @@ -473,7 +479,7 @@ export const RFFSelectSearch = ({
options={selectSearchvalues}
placeholder={placeholder}
isMulti={multi}
onChange={onChange}
onChange={handleChange}
onInputChange={debounceOnInputChange}
inputValue={inputText}
isLoading={isLoading}
Expand Down Expand Up @@ -510,7 +516,7 @@ export const RFFSelectSearch = ({
options={selectSearchvalues}
placeholder={placeholder}
isMulti={multi}
onChange={onChange}
onChange={handleChange}
onInputChange={debounceOnInputChange}
inputValue={inputText}
isLoading={isLoading}
Expand Down
76 changes: 56 additions & 20 deletions src/components/layout/AppHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react'
import React, { useState, useEffect, useRef } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import {
CAlert,
Expand Down Expand Up @@ -72,8 +72,29 @@ const AppHeader = () => {
loadCippQueue()
}

function useInterval(callback, delay, state) {
const savedCallback = useRef()

// Remember the latest callback.
useEffect(() => {
savedCallback.current = callback
})

// Set up the interval.
useEffect(() => {
function tick() {
savedCallback.current()
}

if (delay !== null) {
let id = setInterval(tick, delay)
return () => clearInterval(id)
}
}, [delay, state])
}

useEffect(() => {
if (cippQueueList.isFetching || cippQueueList.isLoading) {
if (cippQueueList.isUninitialized && (cippQueueList.isFetching || cippQueueList.isLoading)) {
setCippQueueExtendedInfo([
{
label: 'Fetching recent jobs',
Expand All @@ -82,26 +103,40 @@ const AppHeader = () => {
link: '#',
},
])
}
if (
cippQueueList.isSuccess &&
Array.isArray(cippQueueList.data) &&
cippQueueList.data.length > 0
) {
setCippQueueExtendedInfo(
cippQueueList.data?.map((job) => ({
label: `${job.Name}`,
value: job.Status,
link: job.Link,
timestamp: job.Timestamp,
})),
)
} else {
setCippQueueExtendedInfo([
{ label: 'No jobs to display', value: '', timpestamp: Date(), link: '#' },
])
if (
cippQueueList.isSuccess &&
Array.isArray(cippQueueList.data) &&
cippQueueList.data.length > 0
) {
setCippQueueExtendedInfo(
cippQueueList.data?.map((job) => ({
label: `${job.Name}`,
value: job.Status,
link: job.Link,
timestamp: job.Timestamp,
percent: job.PercentComplete,
progressText: `${job.PercentComplete}%`,
})),
)
} else {
setCippQueueExtendedInfo([
{ label: 'No jobs to display', value: '', timestamp: Date(), link: '#' },
])
}
}
}, [cippQueueList])
}, [cippQueueList, setCippQueueExtendedInfo])

useInterval(
async () => {
if (cippQueueVisible) {
setCippQueueRefresh((Math.random() + 1).toString(36).substring(7))
getCippQueueList({ path: 'api/ListCippQueue', params: { refresh: cippQueueRefresh } })
}
},
5000,
cippQueueVisible,
)

const SwitchTheme = () => {
let targetTheme = preferredTheme
Expand Down Expand Up @@ -197,6 +232,7 @@ const AppHeader = () => {
extendedInfo={[]}
cards={cippQueueExtendedInfo}
refreshFunction={refreshCippQueue}
isRefreshing={cippQueueList.isFetching || cippQueueList.isLoading}
actions={[
{
label: 'Clear History',
Expand Down
49 changes: 36 additions & 13 deletions src/components/tables/CippTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
CAccordionHeader,
CAccordionBody,
CAccordionItem,
CTooltip,
} from '@coreui/react'
import DataTable, { createTheme } from 'react-data-table-component'
import PropTypes from 'prop-types'
Expand All @@ -31,13 +32,12 @@ import {
faSync,
} from '@fortawesome/free-solid-svg-icons'
import { cellGenericFormatter } from './CellGenericFormat'
import { ModalService } from '../utilities'
import { CippCodeOffCanvas, ModalService } from '../utilities'
import { useLazyGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 'src/store/api/app'
import { debounce } from 'lodash-es'
import { useSearchParams } from 'react-router-dom'
import CopyToClipboard from 'react-copy-to-clipboard'
import { setDefaultColumns } from 'src/store/features/app'
import M365Licenses from 'src/data/M365Licenses'

const FilterComponent = ({ filterText, onFilter, onClear, filterlist, onFilterPreset }) => (
<>
Expand Down Expand Up @@ -155,6 +155,7 @@ export default function CippTable({
const [filterviaURL, setFilterviaURL] = React.useState(false)
const [originalColumns, setOrginalColumns] = React.useState(columns)
const [updatedColumns, setUpdatedColumns] = React.useState(columns)
const [codeOffcanvasVisible, setCodeOffcanvasVisible] = useState(false)
if (defaultColumns && defaultColumnsSet === false && endpointName) {
const defaultColumnsArray = defaultColumns.split(',').filter((item) => item)

Expand Down Expand Up @@ -579,7 +580,6 @@ export default function CippTable({
}

const executeselectedAction = (item) => {
// console.log(item)
setModalContent({
item,
})
Expand All @@ -605,16 +605,18 @@ export default function CippTable({
}
if (refreshFunction) {
defaultActions.push([
<CButton
key={'refresh-action'}
onClick={() => {
refreshFunction((Math.random() + 1).toString(36).substring(7))
}}
className="m-1"
size="sm"
>
<FontAwesomeIcon icon={faSync} />
</CButton>,
<CTooltip key={'refresh-tooltip'} content="Refresh" placement="top">
<CButton
key={'refresh-action'}
onClick={() => {
refreshFunction((Math.random() + 1).toString(36).substring(7))
}}
className="m-1"
size="sm"
>
<FontAwesomeIcon icon={faSync} />
</CButton>
</CTooltip>,
])
}

Expand Down Expand Up @@ -815,6 +817,20 @@ export default function CippTable({
</>,
])
}
defaultActions.push([
<CTooltip key={'code-tooltip'} content="View API Response" placement="top">
<CButton
key={'code-action'}
onClick={() => {
setCodeOffcanvasVisible(true)
}}
className="m-1"
size="sm"
>
<FontAwesomeIcon icon="code" />
</CButton>
</CTooltip>,
])
return (
<>
<div className="w-100 d-flex justify-content-start">
Expand Down Expand Up @@ -982,6 +998,13 @@ export default function CippTable({
{...rest}
/>
{selectedRows.length >= 1 && <CCallout>Selected {selectedRows.length} items</CCallout>}
<CippCodeOffCanvas
row={data}
hideButton={true}
state={codeOffcanvasVisible}
hideFunction={() => setCodeOffcanvasVisible(false)}
title="API Response"
/>
</>
)}
</div>
Expand Down
1 change: 0 additions & 1 deletion src/components/tables/WizardTableField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export default class WizardTableField extends React.Component {
}

handleSelect = ({ selectedRows = [] }) => {
// console.log(selectedRows)
const { fieldProps, keyField } = this.props
if (selectedRows.length > 0) {
fieldProps.input.onChange(selectedRows)
Expand Down
25 changes: 24 additions & 1 deletion src/components/utilities/CippActionsOffcanvas.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ import {
CCallout,
CCard,
CCardBody,
CCardFooter,
CCardHeader,
CCardText,
CCardTitle,
CCol,
CFormInput,
CFormSelect,
CListGroup,
CListGroupItem,
COffcanvasTitle,
CProgress,
CProgressBar,
CProgressStacked,
CRow,
CSpinner,
} from '@coreui/react'
import { CippCodeBlock, CippOffcanvas, ModalService } from 'src/components/utilities'
Expand Down Expand Up @@ -222,8 +228,23 @@ export default function CippActionsOffcanvas(props) {
<CCardText>
{action.value && <Link to={action.link}>Status: {action.value}</Link>}
</CCardText>
<small>{action.timestamp && <ReactTimeAgo date={action.timestamp} />}</small>
</CCardBody>
<CCardFooter className="text-end">
<CRow>
{action?.percent > 0 && (
<CCol xs="8">
<div className="mt-1">
<CProgress>
<CProgressBar value={action.percent}>{action?.progressText}</CProgressBar>
</CProgress>
</div>
</CCol>
)}
<CCol xs={action?.percent ? '4' : '12'}>
<small>{action.timestamp && <ReactTimeAgo date={action.timestamp} />}</small>
</CCol>
</CRow>
</CCardFooter>
</CCard>
</>
))
Expand Down Expand Up @@ -295,6 +316,7 @@ export default function CippActionsOffcanvas(props) {
id={props.id}
hideFunction={props.hideFunction}
refreshFunction={props.refreshFunction}
isRefreshing={props.isRefreshing}
>
{getResults.isFetching && (
<CCallout color="info">
Expand All @@ -310,6 +332,7 @@ export default function CippActionsOffcanvas(props) {
<CippCodeBlock
code={postResults.data?.Results}
callout={true}
dismissable={true}
calloutCopyValue={getResults.data?.Results}
/>
)}
Expand Down
11 changes: 10 additions & 1 deletion src/components/utilities/CippCodeBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function CippCodeBlock({
callout = false,
calloutColour = 'info',
calloutCopyValue = false,
dismissable = false,
}) {
const [codeCopied, setCodeCopied] = useState(false)

Expand All @@ -36,7 +37,11 @@ function CippCodeBlock({
{codeCopied ? <FontAwesomeIcon icon={faClipboard} /> : <FontAwesomeIcon icon={faCopy} />}
</CButton>
</CopyToClipboard>
{callout && <CCallout color={calloutColour}>{code}</CCallout>}
{callout && (
<CCallout color={calloutColour} dismissable={dismissable}>
{code}
</CCallout>
)}
{!callout && (
<SyntaxHighlighter
language={language}
Expand All @@ -62,4 +67,8 @@ CippCodeBlock.propTypes = {
showLineNumbers: PropTypes.bool,
startingLineNumber: PropTypes.number,
wrapLongLines: PropTypes.bool,
callout: PropTypes.bool,
calloutColour: PropTypes.string,
calloutCopyValue: PropTypes.string,
dismissable: PropTypes.bool,
}
Loading