From 29f7a24fab1a0ef3ab806c210aed241320aa4f6f Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 25 Jul 2024 10:26:21 -0500 Subject: [PATCH] fix: exclusions for preset/variant decomposed --- src/collections/componentSet.ts | 3 ++- src/registry/presets/decomposeWorkflowBeta.json | 7 +++++++ .../sampleProjects/variant-workflow/sfdx-project.json | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/collections/componentSet.ts b/src/collections/componentSet.ts index 8eb39a234f..29eddb7af0 100644 --- a/src/collections/componentSet.ts +++ b/src/collections/componentSet.ts @@ -431,7 +431,8 @@ export class ComponentSet extends LazyCollection { if ( type.strategies?.transformer === 'decomposed' && // exclude (ex: CustomObjectTranslation) where there are no addressable children - Object.values(type.children?.types ?? {}).every((t) => t.unaddressableWithoutParent !== true) + Object.values(type.children?.types ?? {}).some((t) => t.unaddressableWithoutParent !== true) && + Object.values(type.children?.types ?? {}).some((t) => t.isAddressable !== false) ) { const parentComp = [...(cmpMap?.values() ?? [])].find((c) => c.fullName === fullName); if (parentComp?.xml && !objectHasSomeRealValues(type)(parentComp.parseXmlSync())) { diff --git a/src/registry/presets/decomposeWorkflowBeta.json b/src/registry/presets/decomposeWorkflowBeta.json index aac24f61ce..f8afc61f72 100644 --- a/src/registry/presets/decomposeWorkflowBeta.json +++ b/src/registry/presets/decomposeWorkflowBeta.json @@ -41,6 +41,7 @@ "id": "workflowalert", "name": "WorkflowAlert", "suffix": "workflowAlert", + "unaddressableWithoutParent": true, "xmlElementName": "alerts" }, "workflowfieldupdate": { @@ -48,6 +49,7 @@ "id": "workflowfieldupdate", "name": "WorkflowFieldUpdate", "suffix": "workflowFieldUpdate", + "unaddressableWithoutParent": true, "xmlElementName": "fieldUpdates" }, "workflowknowledgepublish": { @@ -55,6 +57,7 @@ "id": "workflowknowledgepublish", "name": "WorkflowKnowledgePublish", "suffix": "workflowKnowledgePublish", + "unaddressableWithoutParent": true, "xmlElementName": "knowledgePublishes" }, "workflowoutboundmessage": { @@ -62,6 +65,7 @@ "id": "workflowoutboundmessage", "name": "WorkflowOutboundMessage", "suffix": "workflowOutboundMessage", + "unaddressableWithoutParent": true, "xmlElementName": "outboundMessages" }, "workflowrule": { @@ -69,6 +73,7 @@ "id": "workflowrule", "name": "WorkflowRule", "suffix": "workflowRule", + "unaddressableWithoutParent": true, "xmlElementName": "rules" }, "workflowsend": { @@ -76,6 +81,7 @@ "id": "workflowsend", "name": "WorkflowSend", "suffix": "workflowSend", + "unaddressableWithoutParent": true, "xmlElementName": "send" }, "workflowtask": { @@ -83,6 +89,7 @@ "id": "workflowtask", "name": "WorkflowTask", "suffix": "workflowTask", + "unaddressableWithoutParent": true, "xmlElementName": "tasks" } } diff --git a/test/snapshot/sampleProjects/variant-workflow/sfdx-project.json b/test/snapshot/sampleProjects/variant-workflow/sfdx-project.json index 7328a055dc..3d80258253 100644 --- a/test/snapshot/sampleProjects/variant-workflow/sfdx-project.json +++ b/test/snapshot/sampleProjects/variant-workflow/sfdx-project.json @@ -47,6 +47,7 @@ "id": "workflowalert", "name": "WorkflowAlert", "suffix": "workflowAlert", + "unaddressableWithoutParent": true, "xmlElementName": "alerts" }, "workflowfieldupdate": { @@ -54,6 +55,7 @@ "id": "workflowfieldupdate", "name": "WorkflowFieldUpdate", "suffix": "workflowFieldUpdate", + "unaddressableWithoutParent": true, "xmlElementName": "fieldUpdates" }, "workflowknowledgepublish": { @@ -61,6 +63,7 @@ "id": "workflowknowledgepublish", "name": "WorkflowKnowledgePublish", "suffix": "workflowKnowledgePublish", + "unaddressableWithoutParent": true, "xmlElementName": "knowledgePublishes" }, "workflowoutboundmessage": { @@ -68,6 +71,7 @@ "id": "workflowoutboundmessage", "name": "WorkflowOutboundMessage", "suffix": "workflowOutboundMessage", + "unaddressableWithoutParent": true, "xmlElementName": "outboundMessages" }, "workflowrule": { @@ -75,6 +79,7 @@ "id": "workflowrule", "name": "WorkflowRule", "suffix": "workflowRule", + "unaddressableWithoutParent": true, "xmlElementName": "rules" }, "workflowsend": { @@ -82,6 +87,7 @@ "id": "workflowsend", "name": "WorkflowSend", "suffix": "workflowSend", + "unaddressableWithoutParent": true, "xmlElementName": "send" }, "workflowtask": { @@ -89,6 +95,7 @@ "id": "workflowtask", "name": "WorkflowTask", "suffix": "workflowTask", + "unaddressableWithoutParent": true, "xmlElementName": "tasks" } }