From 812e412f90723766935c5c5839a080a2bf6aff87 Mon Sep 17 00:00:00 2001 From: Jefferson Casimir Date: Wed, 14 Feb 2024 12:09:45 -0500 Subject: [PATCH] Fixed event update --- .../src/series/components/AnnotationForm.tsx | 5 ++++- .../php/models/electrophysioevents.class.inc | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/electrophysiology_browser/jsx/react-series-data-viewer/src/series/components/AnnotationForm.tsx b/modules/electrophysiology_browser/jsx/react-series-data-viewer/src/series/components/AnnotationForm.tsx index 0b59d96acd9..377f06f5160 100644 --- a/modules/electrophysiology_browser/jsx/react-series-data-viewer/src/series/components/AnnotationForm.tsx +++ b/modules/electrophysiology_browser/jsx/react-series-data-viewer/src/series/components/AnnotationForm.tsx @@ -238,11 +238,14 @@ const AnnotationForm = ({ const data = response.instance; + const epochLabel = [null, 'n/a'].includes(data.instance.TrialType) + ? null + : data.instance.TrialType; const newAnnotation : EpochType = { onset: parseFloat(data.instance.Onset), duration: parseFloat(data.instance.Duration), type: 'Event', - label: data.instance.EventValue, // Unused + label: epochLabel ?? data.instance.EventValue, value: data.instance.EventValue, trialType: data.instance.TrialType, properties: data.extraColumns, diff --git a/modules/electrophysiology_browser/php/models/electrophysioevents.class.inc b/modules/electrophysiology_browser/php/models/electrophysioevents.class.inc index 845ee27b9b5..7739f08c630 100644 --- a/modules/electrophysiology_browser/php/models/electrophysioevents.class.inc +++ b/modules/electrophysiology_browser/php/models/electrophysioevents.class.inc @@ -62,8 +62,8 @@ class ElectrophysioEvents ); $this->_data = [ - 'instances' => $taskEvents, - 'extraColumns' => $extraColumns, + 'instances' => $taskEvents, + 'extraColumns' => $extraColumns, ]; } @@ -148,8 +148,8 @@ class ElectrophysioEvents ); return [ - 'instance' => $taskEvent[0], - 'extra_columns' => $extraColumns, + 'instance' => $taskEvent[0], + 'extraColumns' => $extraColumns, ]; } return [];