From 17fe6812d5d3c36f46a05d7722a7764031791edf Mon Sep 17 00:00:00 2001 From: Cody Hansen Date: Wed, 26 Jun 2024 08:48:34 -1000 Subject: [PATCH] Changed parcel to be a prop passed to the ParcelEditor component (#1351) * Added names to sequence adaptations * Fixed some issues with the seq name tests * Changed parcel to be a prop passed to the ParcelEditor component * Set the parcelId inside of ExpansionRuns so the sequence editor preview will lint correctly * Removed store reference from parcel in SequenceEditor --- src/components/expansion/ExpansionRuns.svelte | 5 +++++ src/components/sequencing/SequenceEditor.svelte | 11 ++++++----- src/components/sequencing/SequenceForm.svelte | 1 + src/components/sequencing/Sequences.svelte | 3 ++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/expansion/ExpansionRuns.svelte b/src/components/expansion/ExpansionRuns.svelte index b0e831991a..e0f5f2dabe 100644 --- a/src/components/expansion/ExpansionRuns.svelte +++ b/src/components/expansion/ExpansionRuns.svelte @@ -4,6 +4,7 @@ import { base } from '$app/paths'; import type { ICellRendererParams } from 'ag-grid-community'; import { expansionRunsColumns } from '../../stores/expansion'; + import { parcel, parcelId } from '../../stores/sequencing'; import type { User } from '../../types/app'; import type { DataGridColumnDef, DataGridRowSelection } from '../../types/data-grid'; import type { ActivityInstanceJoin, ExpandedSequence, ExpansionRun } from '../../types/expansion'; @@ -105,8 +106,11 @@ if (isSelected) { selectedExpansionRun = clickedRun; + + $parcelId = selectedExpansionRun.expansion_set.parcel_id; } else if (selectedExpansionRun?.id === clickedRun.id) { selectedExpansionRun = null; + $parcelId = null; } } @@ -173,6 +177,7 @@ cd.id === $parcel?.channel_dictionary_id); - const unparsedCommandDictionary = $commandDictionaries.find(cd => cd.id === $parcel?.command_dictionary_id); + const unparsedChannelDictionary = $channelDictionaries.find(cd => cd.id === parcel?.channel_dictionary_id); + const unparsedCommandDictionary = $commandDictionaries.find(cd => cd.id === parcel?.command_dictionary_id); const unparsedParameterDictionaries = $parameterDictionariesStore.filter(pd => { const parameterDictionary = $parcelToParameterDictionaries.find(p => p.parameter_dictionary_id === pd.id); diff --git a/src/components/sequencing/SequenceForm.svelte b/src/components/sequencing/SequenceForm.svelte index 0e654ffd12..689ed31c68 100644 --- a/src/components/sequencing/SequenceForm.svelte +++ b/src/components/sequencing/SequenceForm.svelte @@ -263,6 +263,7 @@