OpenEnergyDashboard / OED

Open Energy Dashboard (OED)
Mozilla Public License 2.0
75 stars 271 forks source link

show routed messages to user #869

Open huss opened 1 year ago

huss commented 1 year ago

Is your feature request related to a problem? Please describe.

PR #857 sends back messages from the conversion and unit routes in the desired way (code in src/server/routes/conversions.js or units.js). The API returns what is routed (e.g., src/client/app/utils/api/ConversionsApi.ts). The action that dispatches the code ignores the returned values (e.g., src/client/app/actions/conversions.ts) and just puts up generic messages. It would be nice to display the returned messages. Note it is often only done for failures as success does not return a value.

Examples of code already doing this are:

Describe the solution you'd like

The message returned from the route should be passed up the client call chain to an appropriate point to display. Note some code uses a window alert but the showSuccessNotification/showErrorNotification now have a time argument to control how long it stays up so that would probably be better. For some error messages where the user needs lots of time to read or wants to copy, then getting it to stay up until closed would be nice. I also have not checked how easy it is to copy the displayed text on these messages.

Additional context

There are other places with notices that could be investigated for similar changes.

ArtP1 commented 1 year ago

I'm working on this