Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
DChorn-ANS committed Apr 29, 2024
2 parents e99747c + 90e6c2d commit eb6f0d5
Show file tree
Hide file tree
Showing 69 changed files with 3,556 additions and 1,661 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cipp",
"version": "5.5.0",
"version": "5.6.1",
"description": "The CyberDrain Improved Partner Portal is a portal to help manage administration for Microsoft Partners.",
"homepage": "https://cipp.app/",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion public/version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.5.0
5.6.1
4 changes: 2 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const App = () => {
{routes.map((route, idx) => {
const allowedRoles = route.allowedRoles
const Routecomponent = dynamicImport(route.path)
console.log('route', route)
console.log('Routecomponent', Routecomponent)
//console.log('route', route)
//console.log('Routecomponent', Routecomponent)
return (
route.component && (
<Route
Expand Down
15 changes: 15 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 Expand Up @@ -603,6 +613,11 @@ const _nav = [
name: 'Quarantine',
to: '/email/administration/quarantine',
},
{
component: CNavItem,
name: 'Tenant Allow/Block Lists',
to: '/email/administration/tenant-allow-block-lists',
},
],
},
{
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>
)
}
1 change: 1 addition & 0 deletions src/components/contentcards/DatatableContentCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function DatatableContentCard({
path={path}
columns={columns}
params={params}
sortable
{...rest}
/>
)}
Expand Down
15 changes: 11 additions & 4 deletions src/components/forms/RFFComponents.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ export const RFFCFormInput = ({
spellCheck = true,
autoFocus = false,
hiddenValue,
defaultValue,
onChange,
}) => {
return (
<Field initialValue={hiddenValue} name={name} validate={validate}>
<Field defaultValue={defaultValue} initialValue={hiddenValue} name={name} validate={validate}>
{({ input, meta }) => {
const handleChange = onChange
? (e) => {
Expand Down Expand Up @@ -193,7 +194,7 @@ export const RFFCFormInput = ({
}
RFFCFormInput.propTypes = {
...sharedPropTypes,
type: PropTypes.oneOf(['color', 'file', 'text', 'password']),
type: PropTypes.oneOf(['color', 'file', 'text', 'password', 'number']),
placeholder: PropTypes.string,
}

Expand Down Expand Up @@ -444,6 +445,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 +480,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 +517,7 @@ export const RFFSelectSearch = ({
options={selectSearchvalues}
placeholder={placeholder}
isMulti={multi}
onChange={onChange}
onChange={handleChange}
onInputChange={debounceOnInputChange}
inputValue={inputText}
isLoading={isLoading}
Expand Down
77 changes: 57 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,41 @@ 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}%`,
detailsObject: job.Tasks,
})),
)
} 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 +233,7 @@ const AppHeader = () => {
extendedInfo={[]}
cards={cippQueueExtendedInfo}
refreshFunction={refreshCippQueue}
isRefreshing={cippQueueList.isFetching || cippQueueList.isLoading}
actions={[
{
label: 'Clear History',
Expand Down
5 changes: 4 additions & 1 deletion src/components/layout/CippContentCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CCard, CCardBody, CCardHeader, CCardTitle } from '@coreui/react'

export default function CippContentCard({
title,
titleType = 'small',
children,
icon,
button,
Expand All @@ -14,7 +15,9 @@ export default function CippContentCard({
return (
<CCard className={`content-card h-100 ${className ?? ''}`}>
<CCardHeader className="d-flex justify-content-between align-items-center">
<CCardTitle>{title}</CCardTitle>
<CCardTitle>
{titleType === 'big' ? <h3 className="underline mb-3">{title}</h3> : title}
</CCardTitle>
{icon ? <FontAwesomeIcon icon={icon} /> : null}
{button ? button : null}
</CCardHeader>
Expand Down
1 change: 0 additions & 1 deletion src/components/tables/CellTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export default function cellTable(

const handleTable = ({ columnProp }) => {
const QueryColumns = []

const columns = Object.keys(columnProp[0]).map((key) => {
QueryColumns.push({
name: key,
Expand Down
Loading

0 comments on commit eb6f0d5

Please sign in to comment.