From 78d948997755c9ff1d96de8cfede9b304a82dbf8 Mon Sep 17 00:00:00 2001
From: Tanner Prestegard <tanner.prestegard@ligo.org>
Date: Thu, 7 Jun 2018 15:36:04 -0500
Subject: [PATCH] Fixing submitter in event detail javascript

Changes to the eventlog API caused issues for calls to that resource
from within the javascript which populates the event log on the web
view for an event, since the issuer is no longer a dict containing
'username' and 'display_name' keys, but rather just a string
corresponding to the username.
---
 gracedb/templates/gracedb/event_detail_script.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gracedb/templates/gracedb/event_detail_script.js b/gracedb/templates/gracedb/event_detail_script.js
index 69e22c880..8e7ecaf37 100644
--- a/gracedb/templates/gracedb/event_detail_script.js
+++ b/gracedb/templates/gracedb/event_detail_script.js
@@ -627,7 +627,7 @@ require([
                             return t;                                                       
                         }
                     }, 
-                    { field: 'issuer', label: 'Submitter', get: function(obj) { return obj.issuer.display_name; } },
+                    { field: 'issuer', label: 'Submitter', get: function(obj) { return obj.issuer; } },
                     // Sometimes the comment contains HTML, so we just want to return whatever it has.
                     // This is where the link with the filename goes. Also the view in skymapViewer button
                     { 
@@ -699,7 +699,7 @@ require([
                             var figComment = put(figTabInner, 'tr td');
                             figComment.innerHTML = log.comment;
                             figComment.innerHTML += ' <a href="' + log.file + '">' + log.filename + '.</a> ';
-                            figComment.innerHTML += 'Submitted by ' + log.issuer.display_name + ' on ' + log.created;
+                            figComment.innerHTML += 'Submitted by ' + log.issuer + ' on ' + log.created;
                         }
                         // XXX Have commented out the scroll pane at Patrick's request.
                         // var sp = new dojox.layout.ScrollPane({ orientation: "horizontal", style: "overflow: hidden;" }, figContainerId); 
@@ -787,7 +787,7 @@ require([
                             return t;                                                       
                         }
                     }, 
-{ field: 'issuer', label: 'Submitter', get: function(obj) { return obj.issuer.display_name; } },
+{ field: 'issuer', label: 'Submitter', get: function(obj) { return obj.issuer; } },
                     // Sometimes the comment contains HTML, so we just want to return whatever it has.
                     // This is where the link with the filename goes. Also the view in skymapViewer button
                     { 
@@ -879,7 +879,7 @@ require([
                 var columns = [
                     { field: 'N', label: 'No.' },
                     { field: 'created', label: 'Log Entry Created' }, 
-                    { field: 'issuer', label: 'Submitter', get: function(obj) { return obj.issuer.display_name; } },
+                    { field: 'issuer', label: 'Submitter', get: function(obj) { return obj.issuer; } },
                     // Sometimes the comment contains HTML, so we just want to return whatever it has.
                     // This is where the link with the filename goes. Also the view in skymapViewer button
                     { 
-- 
GitLab