From 0d66cbc7d871f0828d36813b4dec88fd8bfcd9f6 Mon Sep 17 00:00:00 2001 From: Anish Kr Singh <116036738+anishfyle@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:41:01 +0530 Subject: [PATCH] feat: only show top level when multiple location entity (#1162) * feat: only show top level when multiple location entity * lint fix --- .../intacct-location-entity.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/shared/components/si/core/intacct-location-entity/intacct-location-entity.component.ts b/src/app/shared/components/si/core/intacct-location-entity/intacct-location-entity.component.ts index d5e2aa381..007c47845 100644 --- a/src/app/shared/components/si/core/intacct-location-entity/intacct-location-entity.component.ts +++ b/src/app/shared/components/si/core/intacct-location-entity/intacct-location-entity.component.ts @@ -155,7 +155,12 @@ export class IntacctLocationEntityComponent implements OnInit { workspace: this.workspaceId, detail: {} }; - this.locationEntityOptions = [topLevelOption].concat(locationEntities); + + // Only add top level option if there are multiple location entities + this.locationEntityOptions = locationEntities.length > 1 + ? [topLevelOption].concat(locationEntities) + : locationEntities; + this.setupLocationEntityMapping(); }); }