Skip to content
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

[pull] main from KelvinTegelaar:main #102

Merged
merged 9 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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.9.0",
"version": "5.9.3",
"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.9.0
5.9.3
17 changes: 10 additions & 7 deletions src/components/tables/CippTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ export default function CippTable({

// Define the flatten function
const flatten = (obj, prefix = '') => {
if (obj === null) return {}
return Object.keys(obj).reduce((output, key) => {
const newKey = prefix ? `${prefix}.${key}` : key
const value = obj[key] === null ? '' : obj[key]
Expand All @@ -645,9 +646,13 @@ export default function CippTable({
Object.assign(output, flatten(value, newKey))
} else {
if (Array.isArray(value)) {
value.map((item, idx) => {
Object.assign(output, flatten(item, `${newKey}[${idx}]`))
})
if (typeof value[0] === 'object') {
value.map((item, idx) => {
Object.assign(output, flatten(item, `${newKey}[${idx}]`))
})
} else {
output[newKey] = value
}
} else {
output[newKey] = value
}
Expand Down Expand Up @@ -683,8 +688,7 @@ export default function CippTable({
})
return Array.isArray(exportData) && exportData.length > 0
? exportData.map((obj) => {
const flattenedObj = flatten(obj)
return applyFormatter(flattenedObj)
return flatten(applyFormatter(obj))
})
: []
}
Expand All @@ -695,8 +699,7 @@ export default function CippTable({
// Adjusted dataFlat processing to include formatting
let dataFlat = Array.isArray(data)
? data.map((item) => {
const flattenedItem = flatten(item)
return applyFormatter(flattenedItem)
return flatten(applyFormatter(item))
})
: []
if (!disablePDFExport) {
Expand Down
2 changes: 1 addition & 1 deletion src/views/identity/reports/SignIns.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const SignInsReport = () => {
title="Sign Ins Report"
capabilities={{ allTenants: false, helpContext: 'https://google.com' }}
datatable={{
filterlists: [
filterlist: [
{
filterName: 'Risky sign-ins',
filter: 'Complex: riskState ne none',
Expand Down
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.9.0
5.9.3