From 7c788f2f82bfaf02c3103816e8af863eaa322a9b Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Thu, 3 Oct 2024 14:52:37 -0600 Subject: [PATCH 1/2] Improve TargetPacketItemChooser behavior --- .../components/TargetPacketItemChooser.vue | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/TargetPacketItemChooser.vue b/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/TargetPacketItemChooser.vue index 715177b5d9..5b45eecc44 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/TargetPacketItemChooser.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/TargetPacketItemChooser.vue @@ -71,7 +71,7 @@ /> item.value === this.selectedItemName + (item) => item.value === this.selectedItemName, ) if (i === -1) { this.selectedArrayIndex = null @@ -433,7 +441,7 @@ export default { }, arrayIndexes: function () { let i = this.itemNames.findIndex( - (item) => item.value === this.selectedItemName + (item) => item.value === this.selectedItemName, ) let indexes = [...Array(this.itemNames[i].array).keys()] if (this.allowAll) { @@ -480,7 +488,7 @@ export default { (packet) => { this.description = packet.description this.hazardous = packet.hazardous - } + }, ) } } @@ -569,7 +577,7 @@ export default { reducedType: this.selectedReducedType, }) }) - } + }, ) }) }, From 56d5b0c8b085271749f796ba57d9d1b82660e3a9 Mon Sep 17 00:00:00 2001 From: Jason Thomas Date: Thu, 3 Oct 2024 16:18:47 -0600 Subject: [PATCH 2/2] Fix passing selectedTargetName --- .../src/components/TargetPacketItemChooser.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/TargetPacketItemChooser.vue b/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/TargetPacketItemChooser.vue index 5b45eecc44..f999d19382 100644 --- a/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/TargetPacketItemChooser.vue +++ b/openc3-cosmos-init/plugins/packages/openc3-tool-common/src/components/TargetPacketItemChooser.vue @@ -270,10 +270,14 @@ export default { if (this.allowAllTargets) { this.targetNames.unshift(this.ALL) } + // If the initial target name is not set, default to the first target + // which also updates packets and items as needed if (!this.selectedTargetName) { this.selectedTargetName = this.targetNames[0].value - // This also updates packets and items as needed this.targetNameChanged(this.selectedTargetName) + } else { + // Selected target name was set but we still have to update packets + this.updatePackets() } if (this.unknown) { this.targetNames.push(this.UNKNOWN)