From 5063dda1024cc8978a7e04cad83f89d8b2451483 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 fca93fcaf29..37af3a1f6ea 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 e1c60534dbc..decf91e819b 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(