Skip to content

Commit

Permalink
Merge pull request #2500 from JohnDuprey/standards-hotfix
Browse files Browse the repository at this point in the history
Standards/BPA/Autopilot UI hotfix
  • Loading branch information
JohnDuprey authored May 31, 2024
2 parents 1c76dec + 22e0be1 commit 742bfbe
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 133 deletions.
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.7.0",
"version": "5.7.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.7.0
5.7.1
58 changes: 29 additions & 29 deletions src/views/cipp/app-settings/SettingsGeneral.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,37 +253,37 @@ export function SettingsGeneral() {
</CCallout>
</CCol>
<CCol>
{permissionsResult.data.Results?.ErrorMessages?.length > 0 ||
(permissionsResult.data.Results?.MissingPermissions.length > 0 && (
<CCallout color="danger">
{(permissionsResult.data.Results?.ErrorMessages?.length > 0 ||
permissionsResult.data.Results?.MissingPermissions.length > 0) && (
<CCallout color="danger">
<>
{permissionsResult.data.Results?.ErrorMessages?.map((m, idx) => (
<div key={idx}>{m}</div>
))}
</>
{permissionsResult.data.Results?.MissingPermissions.length > 0 && (
<>
{permissionsResult.data.Results?.ErrorMessages?.map((m, idx) => (
<div key={idx}>{m}</div>
))}
Your Secure Application Model is missing the following permissions. See
the documentation on how to add permissions{' '}
<a
target="_blank"
rel="noreferrer"
href="https://docs.cipp.app/setup/installation/permissions#manual-permissions"
>
here
</a>
.
<CListGroup flush>
{permissionsResult.data.Results?.MissingPermissions?.map(
(r, index) => (
<CListGroupItem key={index}>{r}</CListGroupItem>
),
)}
</CListGroup>
</>
{permissionsResult.data.Results?.MissingPermissions.length > 0 && (
<>
Your Secure Application Model is missing the following permissions.
See the documentation on how to add permissions{' '}
<a
target="_blank"
rel="noreferrer"
href="https://docs.cipp.app/setup/installation/permissions#manual-permissions"
>
here
</a>
.
<CListGroup flush>
{permissionsResult.data.Results?.MissingPermissions?.map(
(r, index) => (
<CListGroupItem key={index}>{r}</CListGroupItem>
),
)}
</CListGroup>
</>
)}
</CCallout>
))}
)}
</CCallout>
)}
</CCol>
</CRow>
</>
Expand Down
36 changes: 34 additions & 2 deletions src/views/endpoint/autopilot/AutopilotAddDevice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,28 @@ Error.propTypes = {
const AddAPDevice = () => {
const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery()
const [autopilotData, setAutopilotdata] = useState([])
const completeColumns = [
{
name: 'Serial Number',
selector: (row) => row['serialNumber'],
sortable: true,
},
{
name: 'Status',
selector: (row) => row['status'],
sortable: true,
},
{
name: 'Error Code',
selector: (row) => row['errorCode'],
sortable: true,
},
{
name: 'Error Description',
selector: (row) => row['errorDescription'],
sortable: true,
},
]
const tableColumns = [
{
name: 'serialNumber',
Expand Down Expand Up @@ -267,8 +289,18 @@ const AddAPDevice = () => {
<CSpinner>Loading</CSpinner>
</CCallout>
)}
{postResults.isSuccess && <CCallout color="success">{postResults.data.Results}</CCallout>}
{autopilotData && (
{postResults.isSuccess && (
<>
<CCallout color="success">{postResults.data?.Results?.Status}</CCallout>
<CippTable
reportName="none"
tableProps={{ subheader: false }}
data={postResults.data?.Results?.Devices}
columns={completeColumns}
/>
</>
)}
{autopilotData && !postResults.isSuccess && (
<CippTable
reportName="none"
tableProps={{ subheader: false }}
Expand Down
198 changes: 107 additions & 91 deletions src/views/tenant/standards/BestPracticeAnalyser.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,99 +346,115 @@ const BestPracticeAnalyser = () => {
refreshFunction={setRefreshValue}
/>
</div>
{graphrequest.data.Columns.map((info, idx) => (
<CCol md={12} xl={4} className="mb-3" key={`${info.name}-${idx}`}>
<CCard className="h-100">
<CCardHeader>
<CCardTitle>{info.name}</CCardTitle>
</CCardHeader>
<CCardBody>
<CCardText>
{info.formatter === 'bool' && (
<CBadge
color={graphrequest.data.Data[0][info.value] ? 'info' : 'danger'}
>
<FontAwesomeIcon
icon={graphrequest.data.Data[0][info.value] ? faCheck : faTimes}
size="lg"
className="me-1"
/>
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
</CBadge>
)}
{info.formatter === 'reverseBool' && (
<CBadge
color={graphrequest.data.Data[0][info.value] ? 'danger' : 'info'}
>
<FontAwesomeIcon
icon={graphrequest.data.Data[0][info.value] ? faTimes : faCheck}
size="lg"
className="me-1"
/>
{graphrequest.data.Data[0][info.value] ? 'No' : 'Yes'}
</CBadge>
)}
{info.formatter === 'warnBool' && (
<CBadge
color={graphrequest.data.Data[0][info.value] ? 'info' : 'warning'}
>
<FontAwesomeIcon
icon={
graphrequest.data.Data[0][info.value] ? faCheck : faExclamation
}
size="lg"
className="me-1"
/>
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
</CBadge>
)}
{graphrequest.data?.Data[0] &&
Object.keys(graphrequest.data.Data[0]).length === 0 ? (
<CCard className="content-card">
<CCardHeader className="d-flex justify-content-between align-items-center">
<CCardTitle>Best Practice Report</CCardTitle>
</CCardHeader>
<CCardBody>
<CCardText>
No Data Found for this tenant. Please refresh the tenant data.
</CCardText>
</CCardBody>
</CCard>
) : (
graphrequest.data.Columns.map((info, idx) => (
<CCol md={12} xl={4} className="mb-3" key={`${info.name}-${idx}`}>
<CCard className="h-100">
<CCardHeader>
<CCardTitle>{info.name}</CCardTitle>
</CCardHeader>
<CCardBody>
<CCardText>
{info.formatter === 'bool' && (
<CBadge
color={graphrequest.data.Data[0][info.value] ? 'info' : 'danger'}
>
<FontAwesomeIcon
icon={graphrequest.data.Data[0][info.value] ? faCheck : faTimes}
size="lg"
className="me-1"
/>
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
</CBadge>
)}
{info.formatter === 'reverseBool' && (
<CBadge
color={graphrequest.data.Data[0][info.value] ? 'danger' : 'info'}
>
<FontAwesomeIcon
icon={graphrequest.data.Data[0][info.value] ? faTimes : faCheck}
size="lg"
className="me-1"
/>
{graphrequest.data.Data[0][info.value] ? 'No' : 'Yes'}
</CBadge>
)}
{info.formatter === 'warnBool' && (
<CBadge
color={graphrequest.data.Data[0][info.value] ? 'info' : 'warning'}
>
<FontAwesomeIcon
icon={
graphrequest.data.Data[0][info.value]
? faCheck
: faExclamation
}
size="lg"
className="me-1"
/>
{graphrequest.data.Data[0][info.value] ? 'Yes' : 'No'}
</CBadge>
)}

{info.formatter === 'table' && (
<>
<CippTable
key={QueryColumns.data}
reportName="BestPracticeAnalyser"
dynamicColumns={false}
columns={getsubcolumns(
Array.isArray(graphrequest.data.Data[0][info.value])
? graphrequest.data.Data[0][info.value]
: typeof graphrequest.data.Data[0][info.value] === 'object'
? [graphrequest.data.Data[0][info.value]]
: graphrequest.data.Data[0][info.value] === 'FAILED'
? [{ data: 'Failed to retrieve data' }]
: [graphrequest.data.Data[0][info.value]],
)}
data={
Array.isArray(graphrequest.data.Data[0][info.value])
? graphrequest.data.Data[0][info.value]
: typeof graphrequest.data.Data[0][info.value] === 'object'
? [graphrequest.data.Data[0][info.value]]
: graphrequest.data.Data[0][info.value] === 'FAILED'
? [
{
data: 'Failed to retrieve data - Please check your report settings',
},
]
: [graphrequest.data.Data[0][info.value]]
}
isFetching={graphrequest.isFetching}
/>
</>
)}
{info.formatter === 'table' && (
<>
<CippTable
key={QueryColumns.data}
reportName="BestPracticeAnalyser"
dynamicColumns={false}
columns={getsubcolumns(
Array.isArray(graphrequest.data.Data[0][info.value])
? graphrequest.data.Data[0][info.value]
: typeof graphrequest.data.Data[0][info.value] === 'object'
? [graphrequest.data.Data[0][info.value]]
: graphrequest.data.Data[0][info.value] === 'FAILED'
? [{ data: 'Failed to retrieve data' }]
: [graphrequest.data.Data[0][info.value]],
)}
data={
Array.isArray(graphrequest.data.Data[0][info.value])
? graphrequest.data.Data[0][info.value]
: typeof graphrequest.data.Data[0][info.value] === 'object'
? [graphrequest.data.Data[0][info.value]]
: graphrequest.data.Data[0][info.value] === 'FAILED'
? [
{
data: 'Failed to retrieve data - Please check your report settings',
},
]
: [graphrequest.data.Data[0][info.value]]
}
isFetching={graphrequest.isFetching}
/>
</>
)}

{info.formatter === 'number' && (
<p className="fs-1 text-center">
{getNestedValue(graphrequest.data.Data[0], info.value)}
</p>
)}
</CCardText>
<CCardText>
<small className="text-medium-emphasis">{info.desc}</small>
</CCardText>
</CCardBody>
</CCard>
</CCol>
))}
{info.formatter === 'number' && (
<p className="fs-1 text-center">
{getNestedValue(graphrequest.data.Data[0], info.value)}
</p>
)}
</CCardText>
<CCardText>
<small className="text-medium-emphasis">{info.desc}</small>
</CCardText>
</CCardBody>
</CCard>
</CCol>
))
)}
</CRow>
</>
)}
Expand Down
9 changes: 1 addition & 8 deletions src/views/tenant/standards/ListAppliedStandards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -634,20 +634,13 @@ const ApplyNewStandard = () => {
<h5>Remediate</h5>
<RFFCFormSwitch
name={`${obj.name}.remediate`}
disabled={
obj.disabledFeatures?.remediate ||
(isAllTenantEnabled(obj, 'remediate') &&
tenantDomain !== 'AllTenants' &&
props.values.standards?.OverrideAllTenants
?.remediate !== true)
}
helpText={'Remediate executes the fix for standard.'}
sublabel={
isAllTenantEnabled(obj, 'remediate') &&
tenantDomain !== 'AllTenants' &&
props.values.standards?.OverrideAllTenants
?.remediate !== true
? '* Enabled via All Tenants'
? '* Enabled via All Tenants, toggle to override input'
: ''
}
/>
Expand Down
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.7.0
5.7.1

0 comments on commit 742bfbe

Please sign in to comment.