Skip to content

Commit 93fa455

Browse files
Merge pull request #2374 from KelvinTegelaar/dev
Dev to release
2 parents 41dfc69 + 33e4346 commit 93fa455

File tree

68 files changed

+3301
-1520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3301
-1520
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cipp",
3-
"version": "5.5.0",
3+
"version": "5.6.0",
44
"description": "The CyberDrain Improved Partner Portal is a portal to help manage administration for Microsoft Partners.",
55
"homepage": "https://cipp.app/",
66
"bugs": {

public/version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.5.0
1+
5.6.0

src/App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const App = () => {
5555
{routes.map((route, idx) => {
5656
const allowedRoles = route.allowedRoles
5757
const Routecomponent = dynamicImport(route.path)
58-
console.log('route', route)
59-
console.log('Routecomponent', Routecomponent)
58+
//console.log('route', route)
59+
//console.log('Routecomponent', Routecomponent)
6060
return (
6161
route.component && (
6262
<Route

src/_nav.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ const _nav = [
142142
name: 'Enterprise Applications',
143143
to: '/tenant/administration/enterprise-apps',
144144
},
145+
{
146+
component: CNavItem,
147+
name: 'Secure Score',
148+
to: '/tenant/administration/securescore',
149+
},
145150
{
146151
component: CNavItem,
147152
name: 'App Consent Requests',
@@ -157,6 +162,11 @@ const _nav = [
157162
name: 'Tenant Offboarding',
158163
to: '/tenant/administration/tenant-offboarding-wizard',
159164
},
165+
{
166+
component: CNavItem,
167+
name: 'Partner Relationships',
168+
to: '/tenant/administration/partner-relationships',
169+
},
160170
],
161171
},
162172
{
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react'
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
3+
import { CCard, CCardBody, CCardFooter, CCardHeader, CCardTitle } from '@coreui/react'
4+
import Skeleton from 'react-loading-skeleton'
5+
6+
export default function CippButtonCard({
7+
title,
8+
titleType = 'normal',
9+
CardButton,
10+
children,
11+
isFetching,
12+
}) {
13+
return (
14+
<CCard className="h-100 mb-3">
15+
<CCardHeader>
16+
<CCardTitle>
17+
{titleType === 'big' ? <h3 className="underline mb-3">{title}</h3> : title}
18+
</CCardTitle>
19+
</CCardHeader>
20+
<CCardBody>
21+
{isFetching && <Skeleton />}
22+
{children}
23+
</CCardBody>
24+
<CCardFooter>{CardButton}</CCardFooter>
25+
</CCard>
26+
)
27+
}

src/components/contentcards/DatatableContentCard.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default function DatatableContentCard({
2727
path={path}
2828
columns={columns}
2929
params={params}
30+
sortable
3031
{...rest}
3132
/>
3233
)}

src/components/forms/RFFComponents.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export const RFFCFormInput = ({
193193
}
194194
RFFCFormInput.propTypes = {
195195
...sharedPropTypes,
196-
type: PropTypes.oneOf(['color', 'file', 'text', 'password']),
196+
type: PropTypes.oneOf(['color', 'file', 'text', 'password', 'number']),
197197
placeholder: PropTypes.string,
198198
}
199199

@@ -444,6 +444,12 @@ export const RFFSelectSearch = ({
444444
return (
445445
<Field name={name} validate={validate}>
446446
{({ meta, input }) => {
447+
const handleChange = onChange
448+
? (e) => {
449+
input.onChange(e)
450+
onChange(e)
451+
}
452+
: input.onChange
447453
return (
448454
<div>
449455
<CFormLabel htmlFor={name}>
@@ -473,7 +479,7 @@ export const RFFSelectSearch = ({
473479
options={selectSearchvalues}
474480
placeholder={placeholder}
475481
isMulti={multi}
476-
onChange={onChange}
482+
onChange={handleChange}
477483
onInputChange={debounceOnInputChange}
478484
inputValue={inputText}
479485
isLoading={isLoading}
@@ -510,7 +516,7 @@ export const RFFSelectSearch = ({
510516
options={selectSearchvalues}
511517
placeholder={placeholder}
512518
isMulti={multi}
513-
onChange={onChange}
519+
onChange={handleChange}
514520
onInputChange={debounceOnInputChange}
515521
inputValue={inputText}
516522
isLoading={isLoading}

src/components/layout/AppHeader.jsx

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect } from 'react'
1+
import React, { useState, useEffect, useRef } from 'react'
22
import { useSelector, useDispatch } from 'react-redux'
33
import {
44
CAlert,
@@ -72,8 +72,29 @@ const AppHeader = () => {
7272
loadCippQueue()
7373
}
7474

75+
function useInterval(callback, delay, state) {
76+
const savedCallback = useRef()
77+
78+
// Remember the latest callback.
79+
useEffect(() => {
80+
savedCallback.current = callback
81+
})
82+
83+
// Set up the interval.
84+
useEffect(() => {
85+
function tick() {
86+
savedCallback.current()
87+
}
88+
89+
if (delay !== null) {
90+
let id = setInterval(tick, delay)
91+
return () => clearInterval(id)
92+
}
93+
}, [delay, state])
94+
}
95+
7596
useEffect(() => {
76-
if (cippQueueList.isFetching || cippQueueList.isLoading) {
97+
if (cippQueueList.isUninitialized && (cippQueueList.isFetching || cippQueueList.isLoading)) {
7798
setCippQueueExtendedInfo([
7899
{
79100
label: 'Fetching recent jobs',
@@ -82,26 +103,41 @@ const AppHeader = () => {
82103
link: '#',
83104
},
84105
])
85-
}
86-
if (
87-
cippQueueList.isSuccess &&
88-
Array.isArray(cippQueueList.data) &&
89-
cippQueueList.data.length > 0
90-
) {
91-
setCippQueueExtendedInfo(
92-
cippQueueList.data?.map((job) => ({
93-
label: `${job.Name}`,
94-
value: job.Status,
95-
link: job.Link,
96-
timestamp: job.Timestamp,
97-
})),
98-
)
99106
} else {
100-
setCippQueueExtendedInfo([
101-
{ label: 'No jobs to display', value: '', timpestamp: Date(), link: '#' },
102-
])
107+
if (
108+
cippQueueList.isSuccess &&
109+
Array.isArray(cippQueueList.data) &&
110+
cippQueueList.data.length > 0
111+
) {
112+
setCippQueueExtendedInfo(
113+
cippQueueList.data?.map((job) => ({
114+
label: `${job.Name}`,
115+
value: job.Status,
116+
link: job.Link,
117+
timestamp: job.Timestamp,
118+
percent: job.PercentComplete,
119+
progressText: `${job.PercentComplete}%`,
120+
detailsObject: job.Tasks,
121+
})),
122+
)
123+
} else {
124+
setCippQueueExtendedInfo([
125+
{ label: 'No jobs to display', value: '', timestamp: Date(), link: '#' },
126+
])
127+
}
103128
}
104-
}, [cippQueueList])
129+
}, [cippQueueList, setCippQueueExtendedInfo])
130+
131+
useInterval(
132+
async () => {
133+
if (cippQueueVisible) {
134+
setCippQueueRefresh((Math.random() + 1).toString(36).substring(7))
135+
getCippQueueList({ path: 'api/ListCippQueue', params: { refresh: cippQueueRefresh } })
136+
}
137+
},
138+
5000,
139+
cippQueueVisible,
140+
)
105141

106142
const SwitchTheme = () => {
107143
let targetTheme = preferredTheme
@@ -197,6 +233,7 @@ const AppHeader = () => {
197233
extendedInfo={[]}
198234
cards={cippQueueExtendedInfo}
199235
refreshFunction={refreshCippQueue}
236+
isRefreshing={cippQueueList.isFetching || cippQueueList.isLoading}
200237
actions={[
201238
{
202239
label: 'Clear History',

src/components/layout/CippContentCard.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { CCard, CCardBody, CCardHeader, CCardTitle } from '@coreui/react'
55

66
export default function CippContentCard({
77
title,
8+
titleType = 'small',
89
children,
910
icon,
1011
button,
@@ -14,7 +15,9 @@ export default function CippContentCard({
1415
return (
1516
<CCard className={`content-card h-100 ${className ?? ''}`}>
1617
<CCardHeader className="d-flex justify-content-between align-items-center">
17-
<CCardTitle>{title}</CCardTitle>
18+
<CCardTitle>
19+
{titleType === 'big' ? <h3 className="underline mb-3">{title}</h3> : title}
20+
</CCardTitle>
1821
{icon ? <FontAwesomeIcon icon={icon} /> : null}
1922
{button ? button : null}
2023
</CCardHeader>

0 commit comments

Comments
 (0)