Feature/treat warning messages as warnings#284
Conversation
…arium-website into local-viewer-install
…n-cell-animated/simularium-website into local-viewer-install
…arium-website into local-viewer-install
…ium-website into local-viewer-install
| "react-waypoint": "^9.0.3", | ||
| "redux": "4.0.1", | ||
| "redux-logic": "^2.1.1", | ||
| "redux-logic": "^3.0.3", |
There was a problem hiding this comment.
I updated this to try to fix something I think is a bug with redux -- it didn't fix it, but it didn't break anything else either, so I kept the update
| <NetworkFileFailedText /> | ||
| ) : ( | ||
| checkboxTree | ||
| <NoTypeMappingText /> |
There was a problem hiding this comment.
This is rolling back the temporary fix I put in for #274
jest coverage report 🧪Total coverage
Show files with reduced coverage 🔻Reduced coverage
|
| return { | ||
| ...state, | ||
| status: action.payload.status, | ||
| error: "", // Clear out error |
There was a problem hiding this comment.
You mean (pseudocode) return {...initialState}? I don't think we want to do that because we want to set the status to whatever the payload.status is. (like loading, empty, success -- the ones that aren't error)
There was a problem hiding this comment.
no I meant, error: initialState.error
| dispatch({ | ||
| payload: { newFile: true }, | ||
| type: CLEAR_SIMULARIUM_FILE, | ||
| batch(() => { |
meganrm
left a comment
There was a problem hiding this comment.
I just tested this with a file I have that currently crashes staging, and it works, so thumbs up. I did leave one comment that I think it's best to always be setting things in state to either something coming through the payload or to initialState[key] just so it's clear what's happening, but otherwise, looks good
Problem
Now that we get warning, info, and error messages differentiated from the viewer, we should treat warnings and info messages differently from error messages.
Closes #269
Solution
setStatusaction does 2 things: set the viewer status (empty, loading, error, or success) AND set the error message in state. Setting the viewer status to "error" has effects we don't want with a warning or info (for example clearing out the agent panel), and in fact we don't want to change the viewer status when we get a warning or info at all. So I split upsetStatusintosetStatusandsetError. Now,setStatusonly sets the viewer status (empty, loading, error, or success) andsetErrorputs the error message (with various error levels like warning, info, error) in our state so they can be turned into notifications for the user.ErrorNotificationcomponent so that it displays warning and info icons (instead of a red X) for warnings and infosOther stuff
@aics/simularium-viewerinto src/state/trajectory/logics.ts. This was necessary in this PR because I needed to import simularium-viewer into that logics file! (I'm honestly not sure why this config fixed the problem or why the problem existed in the first place, it was just a lot of trial and error)Type of change
Please delete options that are not relevant.
Steps to Verify:
npm ithennpm startScreenshots (optional):
Keyfiles (delete if not relevant):
setStatusintosetStatusandsetErrorAlmost everything else is just having to update code everywhere
setStatushas been used.