Conversation
41c2af3 to
cf5a5a3
Compare
loitly
left a comment
There was a problem hiding this comment.
The UI still needs some polishing, which is expected. Moving the logic to the server side is a good improvement. I think we should talk offline to fully flesh out what the new interface should look like.
@robyww should review the multiProduct changes.
| <title>Alert Viewer</title> | ||
|
|
||
| <script> | ||
| var pOpts = window.firefly && window.firefly.options || {}; |
| }}> | ||
|
|
||
| {/* Top: tables */} | ||
| <Box sx={{display: 'flex', flex: '1 1 0%', gap: 1, p: 1, overflow: 'hidden', minHeight: 0, minWidth: 0, |
There was a problem hiding this comment.
Why is Box with display=flex used throughout? Would it be easier to use Stack?
| isFromURL={true} | ||
| canDragDrop={false} | ||
| fileAnalysis={onLoading} | ||
| uploadParams={{analyzerId: 'alert'}} //triggers server alert analyzer |
There was a problem hiding this comment.
Not exactly what I had in mind, but I could be wrong. Let's talk offline.
| onChange: (ev) => onUrlChange(ev, viewProps, fireValueChange), | ||
| value: viewProps.displayValue, | ||
| onUrlAnalysis: (value) => doUrlAnalysis(value, fireValueChange, fileType, viewProps.fileAnalysis) | ||
| onUrlAnalysis: (value) => doUrlAnalysis(value, fireValueChange, fileType, viewProps.fileAnalysis, viewProps.uploadParams) |
There was a problem hiding this comment.
I think it could be done without having to change FileUpload.
ddc105d to
97be20a
Compare
|
@kpuriIpac I brought up the test. The alert tab does not appear to be enabled. |
@robyww can you try again? it's still working for me: https://fireflydev.ipac.caltech.edu/firefly-1935-alert-viewer/firefly/alertviewer |
robyww
left a comment
There was a problem hiding this comment.
(Mostly UI feedback with a couple of code comments. I will look at the code more on Monday.)
UI Feedback:
- I think you should use the DockLayoutPanel for the three views. I think it is pretty each to use since it does layout this way by default. See line 67 of
ResultsPanel.jsx - pad the right side table down so it better aligns with the left side table
- remove
Scroll Images: Create a prompt onMultiViewStandardToolbarto disable this features. The toolbar get all the props passed to MultiImageViewer.
| ? {flex: '1 1 0%', minHeight: 0, height: '100%', maxWidth: '100%', overflow: 'hidden'} | ||
| : {width: '100%', height: '100%'}; |
There was a problem hiding this comment.
I am surprise this change was necessary.
| )} | ||
| </Box> | ||
|
|
||
| <Box sx={{flex: '1 1 0%', overflow: 'hidden', minHeight: 0, minWidth: 0}}> |
There was a problem hiding this comment.
also I wee you adding minHeight:0, minWidth: 0. I don't see why this is necessary.
|
|
||
| return ( | ||
| <Stack width={1} alignItems='center'> | ||
| <Stack ml={0} mt={4} spacing={3} sx={{position: 'relative'}}> |
There was a problem hiding this comment.
why ml=0?
also since youu are declaring a sx you should put the style in there.
| viewerId={ALERT.IMG_VIEWER} | ||
| insideFlex={true} | ||
| forceRowSize={1} | ||
| Toolbar={MultiViewStandardToolbar} |
There was a problem hiding this comment.
add the prop for MultiViewStandardToolbar here
518377d to
0a657fa
Compare
|
@robyww I implemented the feedback, using One UI bug that I tried to fix today but couldn't: When you expand images (full screen) and |
robyww
left a comment
There was a problem hiding this comment.
It looks really good! After you address my comments I think it is ready to merge.
Code
I left several clean up comments. They should be quick to address.
UI
- I think the top right is 1 pixel too high
- The tab should be call
AlertnotUpload - AlertIDDialog.jsx title should be
Recent Alerts - The working mask needs to be cleaned up. It is offset.
| if (!imageViewerId || !dataProductsState) return; | ||
| const pv= getActivePlotView(visRoot()); | ||
| if (!pv || !hasImageCubes(pv) || cubeIdx<0) return; | ||
| showingStatus.oldWhatToShow= whatToShow; | ||
| showingStatus.cubeSet= false; | ||
| }, [whatToShow,cubeIdx]); | ||
| }, [whatToShow,cubeIdx,dataProductsState]); |
There was a problem hiding this comment.
I don't think you need to add dataProductsState here. This effect should be fine if it is undefined.
Also making it dependent on dataProductsState means the effect will run too much in the normal use case.
| const newPrimeIdx= convertHDUIdxToImageIdx(pv,hduIdx,cubeIdx) ?? 0; | ||
| if (primeIdx!==newPrimeIdx) dispatchChangePrimePlot({plotId:pv.plotId,primeIdx:newPrimeIdx}); | ||
| }, [table,primeIdx,cubeIdx]); | ||
| }, [table,primeIdx,cubeIdx,dataProductsState]); |
| } | ||
|
|
||
| return ( | ||
| <Stack direction='row' flexGrow={1} overflow='hidden'> |
There was a problem hiding this comment.
i don't think the overflow is necessary here
| function EmptySlot({label}) { | ||
| return ( | ||
| <Sheet variant='outlined' | ||
| sx={{height: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', gcolor: 'background.level1'}} |
There was a problem hiding this comment.
I have never seen this? should this be here?
There was a problem hiding this comment.
Yes this was a typo, also not needed. Removed.
|
|
||
| return ( | ||
| <Stack width={1} alignItems='center'> | ||
| <Stack spacing={3} sx={{position: 'relative', mt: 4}}> |
There was a problem hiding this comment.
often position: 'relative' is used when there is an absolute inside of it. It does not appear to be necessary.
| File tmpFits = File.createTempFile("alert-", ".fits"); | ||
| FileInfo fileInfo = URLDownload.getDataToFile(serviceUrl, tmpFits); | ||
| */ | ||
| FileInfo fileInfo = LockingRetrieve.downloadWithCacheMsg(source); |
There was a problem hiding this comment.
You should check the status in fileInfo
|
@robyww I added a fix for images not rendering when closing expanded mode:
Test build updated to test this fix: https://fireflydev.ipac.caltech.edu/firefly-1935-alert-viewer/firefly I will address the rest of the feedback now. |
| } | ||
| }, | ||
| menu: [ | ||
| {label:'Upload', action: 'AlertUpload', path:'/upload'}, |
There was a problem hiding this comment.
this line should have primary: true
e2711a3 to
e85ac0d
Compare
|
@robyww I addressed the rest of your feedback (including the one in |
robyww
left a comment
There was a problem hiding this comment.
Looks good. Remove the ExpanededView stuff and it is ready to merge.
| if (expanded !== LO_VIEW.none) { | ||
| return ( | ||
| <ExpandedView expanded={expanded}/> | ||
| ); | ||
| } |
There was a problem hiding this comment.
This needs to be removed. It is not being used
| ); | ||
| } | ||
|
|
||
| function ExpandedView({expanded}) { |
There was a problem hiding this comment.
remove ExpandedView. It is not being used.
| const nState = stateGetter(cState); // if getter returns oldState then no state update | ||
| if (nState===cState || comparator(cState, nState)) return; // comparator might be overridden, use === first for efficiency | ||
| cState = nState; | ||
| if (markAsTransition) { | ||
| startTransition(() =>{ | ||
| setter(cState); | ||
| }); | ||
| } | ||
| else { | ||
| setter(cState); |
81311c4 to
59418f3
Compare
59418f3 to
d77417f
Compare
Ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-1935
AlertAnalyzer, then returns the parts (2 tables and 3 images) back to client as JSONAlertUploadPanelviewerIdand only one call toMultiImageViewerfor images nowtodo) ready to accept Alert IDs as well. This should be pretty easy to enable once we have working examples of Alert IDs (and the service to call with those IDs).Test build: Alert Viewer: https://fireflydev.ipac.caltech.edu/firefly-1935-alert-viewer/firefly/alertviewer