FIREFLY-1964: Alert Viewer UI Updates and add URL API support#1934
FIREFLY-1964: Alert Viewer UI Updates and add URL API support#1934
Conversation
6d155d4 to
a208732
Compare
robyww
left a comment
There was a problem hiding this comment.
The code mostly looks fine. There are still several things to do the the UI and url api.
| @@ -176,6 +193,10 @@ function loadFromEntries(result) { | |||
|
|
|||
| dispatchPlotImage({plotId, wpRequest, viewerId: ALERT.IMG_VIEWER, setNewPlotAsActive: i === 0}); | |||
There was a problem hiding this comment.
put the title in the wpRequest
|
|
||
| const {hasMainTable, hasDetailTable, hasImages} = useStoreConnector(getAlertData); | ||
| const {source, fileName} = useStoreConnector(() => getComponentState(ALERT.STATE_ID)); | ||
| const alertTitle = fileName || source || 'Alert Viewer'; |
There was a problem hiding this comment.
modify to have a better title.
| ], | ||
| parameters: { | ||
| source: {desc: 'FITS URL or alert id to populate into Alert Viewer', isRequired: true}, | ||
| execute: 'true or false - if true execute the alert load immediately' |
There was a problem hiding this comment.
you don't need execute, it should just always execute.
there should just be an id parameter and it should load the alert.
a208732 to
52b1291
Compare
|
@robyww I addressed the feedback. Can you take a look at the UI again? Didn't do a test build as we need to test this locally anyway. |
|
This url is correct but it does not execute the search. It should. http://localhost:8080/firefly/alertviewer?api=alert&id=170059278837088375 It only goes to the alert panel and shows an empty panel. It need to show an result. |
robyww
left a comment
There was a problem hiding this comment.
I think this is almost done. The overall layout looks good.
Two big things:
- The title
- the URL Api showing results.
| <Typography level='title-md' sx={{fontFamily: 'monospace'}} color='neutral'> | ||
| Alert ID: {id} | ||
| </Typography> |
There was a problem hiding this comment.
you don't need to change the font here. This is a title it should look very clean.
I the text should be 'title-md' and value (id) should be body-md
| return makeError(source, "Unable to retrieve the FITS file for alert ID: " + source); | ||
| } | ||
| final int responseCode = fileInfo.getResponseCode(); | ||
| if (responseCode > 305 || responseCode < 200) { |
There was a problem hiding this comment.
make sure you response code align the the document response codes of the service.
There was a problem hiding this comment.
Good point. This is too generic. I looked at the repsonse codes and messages for GET /api/alerts?ID={alert_id} at https://sqr-114.lsst.io/v/DM-54197/index.html and added the relevant messages for those exact response codes. For any other codes, I'll keep the existing generic message.
| return baseUrl + joiner + | ||
| ALERT_ID + "=" + URLEncoder.encode(alertId, StandardCharsets.UTF_8) + "&" + | ||
| RESPONSEFORMAT + "=" + FITS_RESPONSE_FORMAT; |
There was a problem hiding this comment.
You could you String.format here.
| return [ | ||
| { | ||
| cmd: 'alert', | ||
| validate: validateAlertViewer, | ||
| execute: showAlertViewer, | ||
| ...alertViewerOverview, | ||
| examples: makeExamples('alert', alertViewerExamples), | ||
| }, |
There was a problem hiding this comment.
This is all good but it is not showing an alert result.
There was a problem hiding this comment.
fixed! Took me too long to figure this out - but routed apps don't receive initArgs the same way as the rest of firefly. Just needed to use useContext(InitArgsCtx). We already do this for Euclid & Spherex.
4282437 to
f80d656
Compare
|
@robyww addressed the last few changes and fixed URL API. Can you test once more and let me know if it all looks good? |
f80d656 to
69b483f
Compare

Ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-1964
AppPropertiesso Rubin can configure it, relying on default fallback to work for firefly testing)AppPropertiesfor base URL and just rely on user entered URL to retrieve a FITs file)Testing:
Firefly's AlertViewer: https://fireflydev.ipac.caltech.edu/firefly-1964-alert-viewer/firefly
170059278837088375,170112073844916273Unable to retrieve the FITS file: 401 Unauthorized