Skip to content

Dev to hotfix #3965

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

Merged
merged 14 commits into from
Apr 15, 2025
4 changes: 2 additions & 2 deletions public/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "7.5.0"
}
"version": "7.5.1"
}
1 change: 0 additions & 1 deletion src/components/CippCards/CippInfoBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export const CippInfoBar = ({ data, isFetching }) => {
</Grid>
{item.offcanvas && (
<>
{console.log("item.offcanvas", item.offcanvas)}
<CippOffCanvas
title={item?.offcanvas?.title || "Details"}
size="md"
Expand Down
10 changes: 2 additions & 8 deletions src/components/CippComponents/BPASyncDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,16 @@ export const BPASyncDialog = ({ createDialog }) => {
// Use methods for form handling and control
const { handleSubmit, control } = methods;

const [tenantId, setTenantId] = useState("");
const [isSyncing, setIsSyncing] = useState(false);

// Use ApiGetCall instead of useApiCall
const bpaSyncResults = ApiPostCall({
urlfromdata: true,
});

const handleForm = (values) => {
setTenantId(values.tenantFilter || "");
setIsSyncing(true);

bpaSyncResults.mutate({
url: "/api/ExecBPA",
queryKey: `bpa-sync-${tenantId}`,
data: tenantId ? { TenantFilter: tenantId } : {},
queryKey: `bpa-sync-${values.tenantFilter}`,
data: values.tenantFilter ? { TenantFilter: values.tenantFilter } : {},
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/CippComponents/CippAppPermissionBuilder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ const CippAppPermissionBuilder = ({
waiting: true,
});

console.log(spInfo);
//console.log(spInfo);

const currentAppPermission = useWatch({
control: formControl.control,
Expand Down
22 changes: 10 additions & 12 deletions src/components/CippComponents/CippExchangeActions.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
EyeIcon,
TrashIcon,
MagnifyingGlassIcon,
PlayCircleIcon,
} from "@heroicons/react/24/outline";
import { TrashIcon, MagnifyingGlassIcon, PlayCircleIcon } from "@heroicons/react/24/outline";
import {
Archive,
MailOutline,
Expand All @@ -14,8 +9,11 @@ import {
PhonelinkLock,
Key,
PostAdd,
Add,
Gavel,
Language,
Outbox,
NotificationImportant,
DataUsage,
} from "@mui/icons-material";

export const CippExchangeActions = () => {
Expand Down Expand Up @@ -190,12 +188,12 @@ export const CippExchangeActions = () => {
],
},
{
label: "Set mailbox locale",
label: "Set Mailbox Locale",
type: "POST",
url: "/api/ExecSetMailboxLocale",
data: { user: "UPN", ProhibitSendQuota: true },
confirmText: "Enter a locale, e.g. en-US",
icon: <MailOutline />,
icon: <Language />,
fields: [
{
label: "Locale",
Expand All @@ -211,7 +209,7 @@ export const CippExchangeActions = () => {
url: "/api/ExecSetMailboxQuota",
data: { user: "UPN", ProhibitSendQuota: true },
confirmText: "Enter a quota. e.g. 1000MB, 10GB,1TB",
icon: <MailOutline />,
icon: <Outbox />,
fields: [
{
label: "Quota",
Expand All @@ -230,7 +228,7 @@ export const CippExchangeActions = () => {
ProhibitSendReceiveQuota: true,
},
confirmText: "Enter a quota. e.g. 1000MB, 10GB,1TB",
icon: <MailOutline />,
icon: <DataUsage />,
fields: [
{
label: "Quota",
Expand All @@ -246,7 +244,7 @@ export const CippExchangeActions = () => {
url: "/api/ExecSetMailboxQuota",
data: { user: "UPN", IssueWarningQuota: true },
confirmText: "Enter a quota. e.g. 1000MB, 10GB,1TB",
icon: <MailOutline />,
icon: <NotificationImportant />,
fields: [
{
label: "Quota",
Expand Down
4 changes: 2 additions & 2 deletions src/components/CippIntegrations/CippApiClientManagement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,13 @@ const CippApiClientManagement = () => {
showDivider={false}
isFetching={azureConfig.isFetching}
/>
{azureConfig.isSuccess && azureConfig.data?.Results?.ClientIDs && (
{azureConfig.isSuccess && (
<>
{!isEqual(
apiClients.data?.pages?.[0]?.Results?.filter((c) => c.Enabled)
.map((c) => c.ClientId)
.sort(),
azureConfig.data?.Results?.ClientIDs?.sort()
(azureConfig.data?.Results?.ClientIDs || []).sort()
) && (
<Box sx={{ px: 3 }}>
<Alert severity="warning">
Expand Down
2 changes: 1 addition & 1 deletion src/components/CippTable/CippGraphExplorerFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ const CippGraphExplorerFilter = ({
setCardExpanded(false);
};

console.log(cardExpanded);
//console.log(cardExpanded);
const deletePreset = (id) => {
savePresetApi.mutate({
url: "/api/ExecGraphExplorerPreset",
Expand Down
37 changes: 26 additions & 11 deletions src/components/csvExportButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,28 @@ const flattenObject = (obj, parentKey = "") => {
const fullKey = parentKey ? `${parentKey}.${key}` : key;
if (typeof obj[key] === "object" && obj[key] !== null && !Array.isArray(obj[key])) {
Object.assign(flattened, flattenObject(obj[key], fullKey));
} else if (Array.isArray(obj[key]) && typeof obj[key][0] === "string") {
flattened[fullKey] = obj[key];
} else if (Array.isArray(obj[key])) {
// Handle arrays of objects by applying the formatter on each property
flattened[fullKey] = obj[key]
.map((item) =>
typeof item === "object"
? JSON.stringify(
Object.fromEntries(
Object.entries(flattenObject(item)).map(([k, v]) => [k, getCippFormatting(v, k, "text", false)])
let testFormatting = getCippFormatting(obj[key], key, "text", false, false);
if (typeof testFormatting === "string" && !testFormatting.includes("[object Object]")) {
flattened[fullKey] = testFormatting;
} else {
flattened[fullKey] = obj[key]
.map((item) =>
typeof item === "object"
? JSON.stringify(
Object.fromEntries(
Object.entries(flattenObject(item)).map(([k, v]) => [
k,
getCippFormatting(v, k, "text", false),
])
)
)
)
: getCippFormatting(item, fullKey, "text", false)
)
.join(", ");
: getCippFormatting(item, fullKey, "text", false, false)
)
.join(", ");
}
} else {
flattened[fullKey] = obj[key];
}
Expand Down Expand Up @@ -57,6 +66,12 @@ export const CSVExportButton = (props) => {
const formattedRow = {};
columnKeys.forEach((key) => {
const value = row[key];
// check for string and do not format
if (typeof value === "string") {
formattedRow[key] = value;
return;
}

// Pass flattened data to the formatter for CSV export
formattedRow[key] = getCippFormatting(value, key, "text", false);
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/cipp/custom-data/schema-extensions/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Page = () => {
});

const handleAddSchema = (data) => {
console.log(data);
//console.log(data);
if (!data.properties || data.properties.length === 0) {
formControl.setError("properties", {
type: "manual",
Expand Down
9 changes: 6 additions & 3 deletions src/pages/email/administration/quarantine/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ const Page = () => {
const [traceDetails, setTraceDetails] = useState([]);
const [traceMessageId, setTraceMessageId] = useState(null);
const [messageSubject, setMessageSubject] = useState(null);
const [messageContentsWaiting, setMessageContentsWaiting] = useState(false);

const getMessageContents = ApiGetCall({
url: "/api/ListMailQuarantineMessage",
data: {
tenantFilter: tenantFilter,
Identity: messageId,
},
waiting: false,
waiting: messageContentsWaiting,
queryKey: `ListMailQuarantineMessage-${messageId}`,
});

Expand All @@ -61,7 +62,9 @@ const Page = () => {
const viewMessage = (row) => {
const id = row.Identity;
setMessageId(id);
getMessageContents.waiting = true;
if (!messageContentsWaiting) {
setMessageContentsWaiting(true);
}
getMessageContents.refetch();
setDialogOpen(true);
};
Expand All @@ -85,7 +88,7 @@ const Page = () => {
} else {
setDialogContent(<Skeleton variant="rectangular" height={400} />);
}
}, [getMessageContents.isSuccess]);
}, [getMessageContents.isSuccess, getMessageContents.data]);

const actions = [
{
Expand Down
1 change: 0 additions & 1 deletion src/pages/tenant/administration/add-subscription/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const Page = () => {
</Grid>
{selectedSku?.value && (
<Grid size={{ xs: 12 }}>
{console.log(selectedSku)}
<CippPropertyListCard
title="Selected SKU Details"
variant="outlined"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const AlertWizard = () => {
if (alert?.LogType === "Scripted") {
setAlertType("script");

console.log(alert);
//console.log(alert);

// Create formatted excluded tenants array if it exists
const excludedTenantsFormatted = Array.isArray(alert.excludedTenants)
Expand Down
1 change: 0 additions & 1 deletion src/pages/tenant/gdap-management/roles/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ const Page = () => {
The following groups will be created in your partner tenant if they do not already
exist:
</Alert>
{console.log(selectedGdapRoles)}
<CippPropertyList
propertyItems={selectedGdapRoles?.map((role) => ({
label: `M365 GDAP ${role.label}${customSuffix ? ` - ${customSuffix}` : ""}`,
Expand Down
14 changes: 7 additions & 7 deletions src/pages/tenant/standards/compare/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ const Page = () => {
const standardId = `standards.${standardKey}`;
const standardInfo = standards.find((s) => s.name === standardId);
const standardSettings = standardConfig.standards?.[standardKey] || {};
console.log(standardInfo);
//console.log(standardInfo);

// Check if reporting is enabled for this standard by checking the action property
// The standard should be reportable if there's an action with value === 'Report'
const actions = standardConfig.action || [];
const actions = standardConfig?.action ?? [];
const reportingEnabled =
actions.filter((action) => action.value === "Report").length > 0;
actions.filter((action) => action?.value === "Report").length > 0;

// Find the tenant's value for this standard
const currentTenantStandard = currentTenantData.find(
Expand Down Expand Up @@ -221,7 +221,7 @@ const Page = () => {
// Use the direct standard value from the tenant object if it exists
allStandards.push({
standardId,
standardName: standardInfo.label || standardKey,
standardName: standardInfo?.label || standardKey,
currentTenantValue:
directStandardValue !== undefined
? directStandardValue
Expand Down Expand Up @@ -265,7 +265,7 @@ const Page = () => {

comparisonData.forEach((standard) => {
// Find the standard info in the standards.json data
const standardInfo = standards.find((s) => s.name === standard.standardId);
const standardInfo = standards.find((s) => standard.standardId.includes(s.name));

// Use the category from standards.json, or default to "Other Standards"
const category = standardInfo?.cat || "Other Standards";
Expand Down Expand Up @@ -726,7 +726,7 @@ const Page = () => {
</Typography>
<Typography variant="body2">
{typeof value === "object" && value !== null
? value.label || JSON.stringify(value)
? value?.label || JSON.stringify(value)
: value === true
? "Enabled"
: value === false
Expand Down Expand Up @@ -902,7 +902,7 @@ const Page = () => {
{standard.complianceStatus === "Compliant" && value === true
? "Compliant"
: typeof value === "object" && value !== null
? value.label || JSON.stringify(value)
? value?.label || JSON.stringify(value)
: value === true
? "Enabled"
: value === false
Expand Down
3 changes: 2 additions & 1 deletion src/pages/tenant/standards/list-standards/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CopyAll, Delete, PlayArrow, AddBox, Edit, GitHub } from "@mui/icons-mat
import { ApiGetCall, ApiPostCall } from "../../../../api/ApiCall";
import { Grid } from "@mui/system";
import { CippApiResults } from "../../../../components/CippComponents/CippApiResults";
import { EyeIcon } from "@heroicons/react/24/outline";

const Page = () => {
const oldStandards = ApiGetCall({ url: "/api/ListStandards", queryKey: "ListStandards-legacy" });
Expand All @@ -20,7 +21,7 @@ const Page = () => {
{
label: "View Tenant Report",
link: "/tenant/standards/compare?templateId=[GUID]",
icon: <PlayArrow />,
icon: <EyeIcon />,
color: "info",
target: "_self",
},
Expand Down
8 changes: 8 additions & 0 deletions src/utils/get-cipp-filter-variant.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ export const getCippFilterVariant = (providedColumnKeys) => {
case "assignedLicenses":
return {
filterVariant: "multi-select",
sortingFn: "alphanumeric",
filterFn: "arrIncludesSome",
};
case "Tenant":
return {
filterVariant: "multi-select",
sortingFn: "alphanumeric",
filterFn: "arrIncludesSome",
};
case "accountEnabled":
return {
Expand Down
Loading
Loading