From 1ff23f459090aa9302cddfb4a2de0f801de1c3ba Mon Sep 17 00:00:00 2001 From: jesscall Date: Wed, 5 Jan 2022 16:03:46 -0500 Subject: [PATCH] Amend metadata to include current user as annotation author --- .../src/series/components/AnnotationForm.tsx | 6 ------ modules/electrophysiology_browser/php/annotations.class.inc | 6 +++++- .../php/models/electrophysioannotations.class.inc | 2 +- 3 files changed, 6 insertions(+), 8 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 e457edc11e8..c7f2c2fbd86 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 @@ -104,12 +104,6 @@ const AnnotationForm = ({ channels: 'all', description: comment, }, - // TODO: Figure out data that should go here - metadata: { - description: 'An annotation', - sources: 'LORIS', - author: 'LORIS user', - }, }; const newAnnotation : EpochType = { diff --git a/modules/electrophysiology_browser/php/annotations.class.inc b/modules/electrophysiology_browser/php/annotations.class.inc index d443a063e71..01405032344 100644 --- a/modules/electrophysiology_browser/php/annotations.class.inc +++ b/modules/electrophysiology_browser/php/annotations.class.inc @@ -119,7 +119,11 @@ class Annotations extends \NDB_Page } $instance_data = $parameters['instance']; - $metadata = $parameters['metadata']; + $metadata = [ + 'description' => 'An annotation', + 'sources' => 'EEGNet LORIS', + 'author' => $user->getFullname() + ]; $instance_id = $parameters['instance_id'] ?? null; $parameter_id = $parameters['parameter_id'] ?? null; diff --git a/modules/electrophysiology_browser/php/models/electrophysioannotations.class.inc b/modules/electrophysiology_browser/php/models/electrophysioannotations.class.inc index 8f2d275d6a6..ac47365168f 100644 --- a/modules/electrophysiology_browser/php/models/electrophysioannotations.class.inc +++ b/modules/electrophysiology_browser/php/models/electrophysioannotations.class.inc @@ -292,7 +292,7 @@ class ElectrophysioAnnotations ); $tsv_entries = [ - 'onset', 'duration', 'label', 'channels', 'aboslute_time', 'description' + 'onset', 'duration', 'label', 'channels', 'absolute_time', 'description' ]; $tsv = $db->pselect(