Skip to content

Commit 742bfbe

Browse files
authored
Merge pull request #2500 from JohnDuprey/standards-hotfix
Standards/BPA/Autopilot UI hotfix
2 parents 1c76dec + 22e0be1 commit 742bfbe

File tree

7 files changed

+174
-133
lines changed

7 files changed

+174
-133
lines changed

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.7.0",
3+
"version": "5.7.1",
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.7.0
1+
5.7.1

src/views/cipp/app-settings/SettingsGeneral.jsx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -253,37 +253,37 @@ export function SettingsGeneral() {
253253
</CCallout>
254254
</CCol>
255255
<CCol>
256-
{permissionsResult.data.Results?.ErrorMessages?.length > 0 ||
257-
(permissionsResult.data.Results?.MissingPermissions.length > 0 && (
258-
<CCallout color="danger">
256+
{(permissionsResult.data.Results?.ErrorMessages?.length > 0 ||
257+
permissionsResult.data.Results?.MissingPermissions.length > 0) && (
258+
<CCallout color="danger">
259+
<>
260+
{permissionsResult.data.Results?.ErrorMessages?.map((m, idx) => (
261+
<div key={idx}>{m}</div>
262+
))}
263+
</>
264+
{permissionsResult.data.Results?.MissingPermissions.length > 0 && (
259265
<>
260-
{permissionsResult.data.Results?.ErrorMessages?.map((m, idx) => (
261-
<div key={idx}>{m}</div>
262-
))}
266+
Your Secure Application Model is missing the following permissions. See
267+
the documentation on how to add permissions{' '}
268+
<a
269+
target="_blank"
270+
rel="noreferrer"
271+
href="https://docs.cipp.app/setup/installation/permissions#manual-permissions"
272+
>
273+
here
274+
</a>
275+
.
276+
<CListGroup flush>
277+
{permissionsResult.data.Results?.MissingPermissions?.map(
278+
(r, index) => (
279+
<CListGroupItem key={index}>{r}</CListGroupItem>
280+
),
281+
)}
282+
</CListGroup>
263283
</>
264-
{permissionsResult.data.Results?.MissingPermissions.length > 0 && (
265-
<>
266-
Your Secure Application Model is missing the following permissions.
267-
See the documentation on how to add permissions{' '}
268-
<a
269-
target="_blank"
270-
rel="noreferrer"
271-
href="https://docs.cipp.app/setup/installation/permissions#manual-permissions"
272-
>
273-
here
274-
</a>
275-
.
276-
<CListGroup flush>
277-
{permissionsResult.data.Results?.MissingPermissions?.map(
278-
(r, index) => (
279-
<CListGroupItem key={index}>{r}</CListGroupItem>
280-
),
281-
)}
282-
</CListGroup>
283-
</>
284-
)}
285-
</CCallout>
286-
))}
284+
)}
285+
</CCallout>
286+
)}
287287
</CCol>
288288
</CRow>
289289
</>

src/views/endpoint/autopilot/AutopilotAddDevice.jsx

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,28 @@ Error.propTypes = {
3434
const AddAPDevice = () => {
3535
const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery()
3636
const [autopilotData, setAutopilotdata] = useState([])
37+
const completeColumns = [
38+
{
39+
name: 'Serial Number',
40+
selector: (row) => row['serialNumber'],
41+
sortable: true,
42+
},
43+
{
44+
name: 'Status',
45+
selector: (row) => row['status'],
46+
sortable: true,
47+
},
48+
{
49+
name: 'Error Code',
50+
selector: (row) => row['errorCode'],
51+
sortable: true,
52+
},
53+
{
54+
name: 'Error Description',
55+
selector: (row) => row['errorDescription'],
56+
sortable: true,
57+
},
58+
]
3759
const tableColumns = [
3860
{
3961
name: 'serialNumber',
@@ -267,8 +289,18 @@ const AddAPDevice = () => {
267289
<CSpinner>Loading</CSpinner>
268290
</CCallout>
269291
)}
270-
{postResults.isSuccess && <CCallout color="success">{postResults.data.Results}</CCallout>}
271-
{autopilotData && (
292+
{postResults.isSuccess && (
293+
<>
294+
<CCallout color="success">{postResults.data?.Results?.Status}</CCallout>
295+
<CippTable
296+
reportName="none"
297+
tableProps={{ subheader: false }}
298+
data={postResults.data?.Results?.Devices}
299+
columns={completeColumns}
300+
/>
301+
</>
302+
)}
303+
{autopilotData && !postResults.isSuccess && (
272304
<CippTable
273305
reportName="none"
274306
tableProps={{ subheader: false }}

src/views/tenant/standards/BestPracticeAnalyser.jsx

Lines changed: 107 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -346,99 +346,115 @@ const BestPracticeAnalyser = () => {
346346
refreshFunction={setRefreshValue}
347347
/>
348348
</div>
349-
{graphrequest.data.Columns.map((info, idx) => (
350-
<CCol md={12} xl={4} className="mb-3" key={`${info.name}-${idx}`}>
351-
<CCard className="h-100">
352-
<CCardHeader>
353-
<CCardTitle>{info.name}</CCardTitle>
354-
</CCardHeader>
355-
<CCardBody>
356-
<CCardText>
357-
{info.formatter === 'bool' && (
358-
<CBadge
359-
color={graphrequest.data.Data[0][info.value] ? 'info' : 'danger'}
360-
>
361-
<FontAwesomeIcon
362-
icon={graphrequest.data.Data[0][info.value] ? faCheck : faTimes}
363-
size="lg"
364-
className="me-1"
365-
/>
366-
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
367-
</CBadge>
368-
)}
369-
{info.formatter === 'reverseBool' && (
370-
<CBadge
371-
color={graphrequest.data.Data[0][info.value] ? 'danger' : 'info'}
372-
>
373-
<FontAwesomeIcon
374-
icon={graphrequest.data.Data[0][info.value] ? faTimes : faCheck}
375-
size="lg"
376-
className="me-1"
377-
/>
378-
{graphrequest.data.Data[0][info.value] ? 'No' : 'Yes'}
379-
</CBadge>
380-
)}
381-
{info.formatter === 'warnBool' && (
382-
<CBadge
383-
color={graphrequest.data.Data[0][info.value] ? 'info' : 'warning'}
384-
>
385-
<FontAwesomeIcon
386-
icon={
387-
graphrequest.data.Data[0][info.value] ? faCheck : faExclamation
388-
}
389-
size="lg"
390-
className="me-1"
391-
/>
392-
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
393-
</CBadge>
394-
)}
349+
{graphrequest.data?.Data[0] &&
350+
Object.keys(graphrequest.data.Data[0]).length === 0 ? (
351+
<CCard className="content-card">
352+
<CCardHeader className="d-flex justify-content-between align-items-center">
353+
<CCardTitle>Best Practice Report</CCardTitle>
354+
</CCardHeader>
355+
<CCardBody>
356+
<CCardText>
357+
No Data Found for this tenant. Please refresh the tenant data.
358+
</CCardText>
359+
</CCardBody>
360+
</CCard>
361+
) : (
362+
graphrequest.data.Columns.map((info, idx) => (
363+
<CCol md={12} xl={4} className="mb-3" key={`${info.name}-${idx}`}>
364+
<CCard className="h-100">
365+
<CCardHeader>
366+
<CCardTitle>{info.name}</CCardTitle>
367+
</CCardHeader>
368+
<CCardBody>
369+
<CCardText>
370+
{info.formatter === 'bool' && (
371+
<CBadge
372+
color={graphrequest.data.Data[0][info.value] ? 'info' : 'danger'}
373+
>
374+
<FontAwesomeIcon
375+
icon={graphrequest.data.Data[0][info.value] ? faCheck : faTimes}
376+
size="lg"
377+
className="me-1"
378+
/>
379+
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
380+
</CBadge>
381+
)}
382+
{info.formatter === 'reverseBool' && (
383+
<CBadge
384+
color={graphrequest.data.Data[0][info.value] ? 'danger' : 'info'}
385+
>
386+
<FontAwesomeIcon
387+
icon={graphrequest.data.Data[0][info.value] ? faTimes : faCheck}
388+
size="lg"
389+
className="me-1"
390+
/>
391+
{graphrequest.data.Data[0][info.value] ? 'No' : 'Yes'}
392+
</CBadge>
393+
)}
394+
{info.formatter === 'warnBool' && (
395+
<CBadge
396+
color={graphrequest.data.Data[0][info.value] ? 'info' : 'warning'}
397+
>
398+
<FontAwesomeIcon
399+
icon={
400+
graphrequest.data.Data[0][info.value]
401+
? faCheck
402+
: faExclamation
403+
}
404+
size="lg"
405+
className="me-1"
406+
/>
407+
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
408+
</CBadge>
409+
)}
395410

396-
{info.formatter === 'table' && (
397-
<>
398-
<CippTable
399-
key={QueryColumns.data}
400-
reportName="BestPracticeAnalyser"
401-
dynamicColumns={false}
402-
columns={getsubcolumns(
403-
Array.isArray(graphrequest.data.Data[0][info.value])
404-
? graphrequest.data.Data[0][info.value]
405-
: typeof graphrequest.data.Data[0][info.value] === 'object'
406-
? [graphrequest.data.Data[0][info.value]]
407-
: graphrequest.data.Data[0][info.value] === 'FAILED'
408-
? [{ data: 'Failed to retrieve data' }]
409-
: [graphrequest.data.Data[0][info.value]],
410-
)}
411-
data={
412-
Array.isArray(graphrequest.data.Data[0][info.value])
413-
? graphrequest.data.Data[0][info.value]
414-
: typeof graphrequest.data.Data[0][info.value] === 'object'
415-
? [graphrequest.data.Data[0][info.value]]
416-
: graphrequest.data.Data[0][info.value] === 'FAILED'
417-
? [
418-
{
419-
data: 'Failed to retrieve data - Please check your report settings',
420-
},
421-
]
422-
: [graphrequest.data.Data[0][info.value]]
423-
}
424-
isFetching={graphrequest.isFetching}
425-
/>
426-
</>
427-
)}
411+
{info.formatter === 'table' && (
412+
<>
413+
<CippTable
414+
key={QueryColumns.data}
415+
reportName="BestPracticeAnalyser"
416+
dynamicColumns={false}
417+
columns={getsubcolumns(
418+
Array.isArray(graphrequest.data.Data[0][info.value])
419+
? graphrequest.data.Data[0][info.value]
420+
: typeof graphrequest.data.Data[0][info.value] === 'object'
421+
? [graphrequest.data.Data[0][info.value]]
422+
: graphrequest.data.Data[0][info.value] === 'FAILED'
423+
? [{ data: 'Failed to retrieve data' }]
424+
: [graphrequest.data.Data[0][info.value]],
425+
)}
426+
data={
427+
Array.isArray(graphrequest.data.Data[0][info.value])
428+
? graphrequest.data.Data[0][info.value]
429+
: typeof graphrequest.data.Data[0][info.value] === 'object'
430+
? [graphrequest.data.Data[0][info.value]]
431+
: graphrequest.data.Data[0][info.value] === 'FAILED'
432+
? [
433+
{
434+
data: 'Failed to retrieve data - Please check your report settings',
435+
},
436+
]
437+
: [graphrequest.data.Data[0][info.value]]
438+
}
439+
isFetching={graphrequest.isFetching}
440+
/>
441+
</>
442+
)}
428443

429-
{info.formatter === 'number' && (
430-
<p className="fs-1 text-center">
431-
{getNestedValue(graphrequest.data.Data[0], info.value)}
432-
</p>
433-
)}
434-
</CCardText>
435-
<CCardText>
436-
<small className="text-medium-emphasis">{info.desc}</small>
437-
</CCardText>
438-
</CCardBody>
439-
</CCard>
440-
</CCol>
441-
))}
444+
{info.formatter === 'number' && (
445+
<p className="fs-1 text-center">
446+
{getNestedValue(graphrequest.data.Data[0], info.value)}
447+
</p>
448+
)}
449+
</CCardText>
450+
<CCardText>
451+
<small className="text-medium-emphasis">{info.desc}</small>
452+
</CCardText>
453+
</CCardBody>
454+
</CCard>
455+
</CCol>
456+
))
457+
)}
442458
</CRow>
443459
</>
444460
)}

src/views/tenant/standards/ListAppliedStandards.jsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -634,20 +634,13 @@ const ApplyNewStandard = () => {
634634
<h5>Remediate</h5>
635635
<RFFCFormSwitch
636636
name={`${obj.name}.remediate`}
637-
disabled={
638-
obj.disabledFeatures?.remediate ||
639-
(isAllTenantEnabled(obj, 'remediate') &&
640-
tenantDomain !== 'AllTenants' &&
641-
props.values.standards?.OverrideAllTenants
642-
?.remediate !== true)
643-
}
644637
helpText={'Remediate executes the fix for standard.'}
645638
sublabel={
646639
isAllTenantEnabled(obj, 'remediate') &&
647640
tenantDomain !== 'AllTenants' &&
648641
props.values.standards?.OverrideAllTenants
649642
?.remediate !== true
650-
? '* Enabled via All Tenants'
643+
? '* Enabled via All Tenants, toggle to override input'
651644
: ''
652645
}
653646
/>

version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.7.0
1+
5.7.1

0 commit comments

Comments
 (0)