Improve AlertViewer UI/UX #1939
Conversation
loitly
left a comment
There was a problem hiding this comment.
Please revert customLandingPage changes if my suggested solution works. Thanks.
| landingPage: <AlertViewerLanding/>, | ||
| slotProps: { | ||
| drawer: { drawerWidth:'24rem'}, | ||
| landing: { | ||
| desc: 'Some information about the alert viewer here. This is the landing page. This text will be changed to something more useful in the future.', | ||
| bgImage: null, | ||
| } |
There was a problem hiding this comment.
I don’t think this is necessary. slotProps.landing was created specifically for this use case. If you need a custom component, you can define it like this:
landing: {
component: <AlertViewerLanding/>
}| const hasUrlApi = search.includes('api='); | ||
| if (!hasUrlApi && (path === basename || path === `${basename}/`)) { | ||
| dispatchOnAppReady(() => dispatchShowDropDown({view: 'AlertUpload'})); | ||
| } |
There was a problem hiding this comment.
Is this logic correct? Normally, ?api would show the api help page, but I am not seeing that happen.
Also, using URLSearchParams might help when working with URL parameters.
const { pathname, search } = window.location;
const params = new URLSearchParams(search);
params.has('api');There was a problem hiding this comment.
yes good suggestion, thank you. also fixes the ?api bug, it should now show the api help page (after I push my commit).
The if check here was needed because we want to re-route user to /alertviewer/upload path when they try to access /alertviewer, but if I didn't add the check for !hasUrlApi, it would also re-route you to /upload path for the URL API instead of taking you directly to the results (when, for instance, you try to access somethign like: /alertviewer?api=alert&id=170059278837088375).
open to better suggestions for this re-route logic though.
8572512 to
0c46100
Compare
loitly
left a comment
There was a problem hiding this comment.
Looks good. Thanks for the changes.
0c46100 to
b67ed16
Compare
SUIT PR: lsst/suit#84
/alertvieweris now theAlerttab (/alertviewer/upload) instead of theResultstab.Results(landing page) text forAlertViewerLandingPage, I could have probably done this throughslotProps, but it was proving to be trickier (was affecting Euclid/Spherex) andLandingPageis used in several places so I thought it was best to create a simple custom component instead in this caseLandingPageas well (to have more control over customizing it)Testing:
170112073844916273,170059278837088375)