From bd010779387a4344518081b8d50cbb51446b0a2c Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 19 Dec 2025 13:35:30 -0500 Subject: [PATCH 1/3] cleanup console logs --- .../CippStandards/CippStandardsSideBar.jsx | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/src/components/CippStandards/CippStandardsSideBar.jsx b/src/components/CippStandards/CippStandardsSideBar.jsx index 53a6d571b8a8..7e2ccdcb6647 100644 --- a/src/components/CippStandards/CippStandardsSideBar.jsx +++ b/src/components/CippStandards/CippStandardsSideBar.jsx @@ -144,34 +144,12 @@ const CippStandardsSideBar = ({ } // Filter out current template if editing - console.log("Duplicate detection debug:", { - edit, - currentGUID: watchForm.GUID, - allTemplates: driftValidationApi.data?.map((t) => ({ - GUID: t.GUID, - standardId: t.standardId, - standardName: t.standardName, - })), - }); - const existingTemplates = driftValidationApi.data.filter((template) => { const shouldInclude = edit && watchForm.GUID ? template.standardId !== watchForm.GUID : true; - console.log( - `Template ${template.standardId} (${template.standardName}): shouldInclude=${shouldInclude}, currentGUID=${watchForm.GUID}` - ); return shouldInclude; }); - console.log( - "Filtered templates:", - existingTemplates?.map((t) => ({ - GUID: t.GUID, - standardId: t.standardId, - standardName: t.standardName, - })) - ); - // Get tenant groups data const groups = tenantGroupsApi.data?.Results || []; @@ -198,45 +176,27 @@ const CippStandardsSideBar = ({ }); // Check for conflicts with unique templates - console.log("Checking conflicts with unique templates:", uniqueTemplates); - console.log("Selected tenant list:", selectedTenantList); - for (const templateId in uniqueTemplates) { const template = uniqueTemplates[templateId]; const templateTenants = template.tenants; - console.log( - `Checking template ${templateId} (${template.standardName}) with tenants:`, - templateTenants - ); - const hasConflict = selectedTenantList.some((selectedTenant) => { // Check if any template tenant matches the selected tenant const conflict = templateTenants.some((templateTenant) => { if (selectedTenant === "AllTenants" || templateTenant === "AllTenants") { - console.log( - `Conflict found: ${selectedTenant} vs ${templateTenant} (AllTenants match)` - ); return true; } const match = selectedTenant === templateTenant; - if (match) { - console.log(`Conflict found: ${selectedTenant} vs ${templateTenant} (exact match)`); - } return match; }); return conflict; }); - console.log(`Template ${templateId} has conflict: ${hasConflict}`); - if (hasConflict) { conflicts.push(template.standardName || "Unknown Template"); } } - console.log("Final conflicts:", conflicts); - if (conflicts.length > 0) { setDriftError( `This template has tenants that are assigned to another Drift Template. You can only assign one Drift Template to each tenant. Please check the ${conflicts.join( From b0c87ea670f0ba2ec4a82288ecfdec5ebf76ec29 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 19 Dec 2025 14:01:53 -0500 Subject: [PATCH 2/3] Improve 'hasValue' condition logic in CippFormCondition Refines the 'hasValue' comparison to better handle arrays and falsy values, ensuring more accurate condition evaluation. Also updates the prop validation to allow undefined compareValue only for 'hasValue' type. --- .../CippComponents/CippFormCondition.jsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/CippComponents/CippFormCondition.jsx b/src/components/CippComponents/CippFormCondition.jsx index 9ec49a57ef5c..dd9a48cbf95d 100644 --- a/src/components/CippComponents/CippFormCondition.jsx +++ b/src/components/CippComponents/CippFormCondition.jsx @@ -18,7 +18,7 @@ export const CippFormCondition = (props) => { if ( field === undefined || - compareValue === undefined || + (compareValue === undefined && compareType !== "hasValue") || children === undefined || formControl === undefined ) { @@ -148,10 +148,18 @@ export const CippFormCondition = (props) => { watcher.length >= compareValue ); case "hasValue": - return ( - (watcher !== undefined && watcher !== null && watcher !== "") || - (watcher?.value !== undefined && watcher?.value !== null && watcher?.value !== "") - ); + // Check watchedValue (the extracted value based on propertyName) + // For simple values (strings, numbers) + if (watchedValue === undefined || watchedValue === null || watchedValue === "") { + return false; + } + // If it's an array, check if it has elements + if (Array.isArray(watchedValue)) { + return watchedValue.length > 0; + } + console.log("watched value:", watchedValue); + // For any other truthy value (objects, numbers, strings), consider it as having a value + return true; case "labelEq": return Array.isArray(watcher) && watcher.some((item) => item?.label === compareValue); case "labelContains": From 600ef52e29a9f487aa21024b70f965096f904fd1 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Fri, 19 Dec 2025 14:02:27 -0500 Subject: [PATCH 3/3] Remove unused addedField from Intune templates config Deleted the 'addedField' property from the ListIntuneTemplates-tag-autcomplete API config in standards.json to clean up unused configuration. --- src/data/standards.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/data/standards.json b/src/data/standards.json index 2d6ffb3f010a..92d605cf2036 100644 --- a/src/data/standards.json +++ b/src/data/standards.json @@ -5056,10 +5056,7 @@ "queryKey": "ListIntuneTemplates-tag-autcomplete", "url": "/api/ListIntuneTemplates?mode=Tag", "labelField": "label", - "valueField": "value", - "addedField": { - "templates": "templates" - } + "valueField": "value" } }, {