@@ -46,9 +46,6 @@ const PublicationLinkCell = ({ value, aiJSON }) => {
4646 const [ popoverOpen , setPopoverOpen ] = useState ( false ) ;
4747 const [ popoverPosition , setPopoverPosition ] = useState ( { x : 0 , y : 0 } ) ;
4848
49- // const [anchorEl, setAnchorEl] = useState(null);
50- // const spanRef = useRef();
51-
5249 const GPTSummaryButton = withStyles ( ( theme ) => ( {
5350 root : {
5451 marginLeft : 'auto' ,
@@ -64,8 +61,6 @@ const PublicationLinkCell = ({ value, aiJSON }) => {
6461 const publicationsArr = resultsUtils . getPublications ( inJSON . edge ) ;
6562 const sentenceRes = resultsUtils . getSentences ( inJSON . edge ) ;
6663 // setAnchorEl(spanRef.current);
67- console . log ( 'FROM GPT SUMMARY FUNC, publications: ' , publicationsArr ) ;
68- console . log ( 'FROM GPT SUMMARY FUNC, sentence: ' , sentenceRes ) ;
6964 const toSendData = {
7065 edge : {
7166 nodes : inJSON . nodes ,
@@ -85,8 +80,6 @@ const PublicationLinkCell = ({ value, aiJSON }) => {
8580 } ,
8681 } ,
8782 } ;
88- console . log ( 'CLICKED FROM GPU SUMMARY FUNC' ) ;
89- console . log ( JSON . stringify ( toSendData , null , 2 ) ) ;
9083 const options = {
9184 method : 'POST' ,
9285 headers : {
@@ -96,34 +89,24 @@ const PublicationLinkCell = ({ value, aiJSON }) => {
9689 } ;
9790 const kgsummarizerurl = 'https://kg-summarizer.apps.renci.org/summarize/edge' ;
9891 await fetch ( kgsummarizerurl , options )
99- . then ( response => {
92+ . then ( ( response ) => {
10093 if ( ! response . ok ) {
10194 throw new Error ( 'Network response was not ok' ) ;
10295 }
10396 return response . json ( ) ; // Parse the JSON in the response ? Or is it a text?
10497 } )
105- . then ( data => {
106- console . log ( 'KG SUMMARIZER Success:' , data ) ;
98+ . then ( ( data ) => {
10799 setAISummaryData ( data ) ;
108100 setPopoverOpen ( 'aiSummary' ) ;
109101 setPopoverPosition ( { x : event . clientX , y : event . clientY } ) ;
110- console . log ( event . target ) ;
111102 } )
112- . catch ( error => {
113- setAISummaryData ( 'Error getting response from KG-Summarizer' ) ;
103+ . catch ( ( error ) => {
104+ setAISummaryData ( 'Error getting response from KG-Summarizer:: ' , error ) ;
114105 setPopoverOpen ( 'aiSummary' ) ;
115106 setPopoverPosition ( { x : event . clientX , y : event . clientY } ) ;
116- console . error ( 'KG SUMMARIZER Error:' , error ) ;
117107 } ) ;
118108 }
119109
120- // function handlePopoverClose() {
121- // setAnchorEl(null);
122- // setPopoverOpen(null);
123- // }
124- // const open = Boolean(anchorEl);
125- // const id = open ? "simple-popover" : undefined;
126-
127110 return (
128111 < TableCell >
129112 < ul style = { { padding : 0 , margin : 0 , listStyleType : 'none' } } >
@@ -166,7 +149,6 @@ const PublicationLinkCell = ({ value, aiJSON }) => {
166149 onGPTSummary ( event , aiJSON ) ;
167150 } }
168151 variant = "outlined"
169- // aria-describedby={id}
170152 >
171153 Get AI Summary
172154 </ GPTSummaryButton >
@@ -177,7 +159,11 @@ const PublicationLinkCell = ({ value, aiJSON }) => {
177159 anchorPosition = { { top : popoverPosition . y , left : popoverPosition . x } }
178160 above
179161 >
180- < div > { aiSummaryData } </ div >
162+ < p style = { {
163+ margin : '20px' , padding : '10px' , fontStyle : 'italic' , backgroundColor : '#f0f0f0' ,
164+ } }
165+ > { aiSummaryData }
166+ </ p >
181167 </ Popover >
182168 </ TableCell >
183169 ) ;
0 commit comments