This is kind of a wild one. Turns out that the triggers I was using
actually fire before the transaction is closed and I was primarily
getting lucky that the job was present on the other side of the
connection rather than having things built correctly.
I've fixed this by removing the trigger entirely and instead manually
triggering as part of the transaction. This makes the NOTIFY call happen
as soon as the transaction closes, just at the cost of making my
application be in charge of ensuring the NOTIFY gets called. Seems like
a win.
Part of doing this is porting the existing job creation code over to use
Jet. It's something I want to do anyway, so it's a win all around.
The key item here is that comms.phone and comms.email are meant to
represent a real global namespace, but comms.contact is meant to
represent an organization-specific namespace. This means the mapping,
comms.contact_phone and comms.contact_email can't key off the global
namespace. Otherwise the contact namespace would implicitly be global.
- Add ErrorNotification component above the contact form
- Replace console.error with user-visible error messages in
handleSubmit for both HTTP error responses and exceptions
- Add isSubmitting ref with :disabled binding to prevent
double-submission (consistent with Nuisance/Water forms)
- Clear errorMessage on each submission attempt
Issue: #8
ContactSimple is the replacement for ContactReporter, which was the
simplified form of a contact from a report. I made the name more generic
and use it in the general report structures for consistency.
- Add ts/rmo/components/ErrorNotification.vue — reusable error alert
with dismiss support, accessible markup, and configurable message
- Replace inline error div in Nuisance.vue with ErrorNotification
- Add resp.ok check in doSubmit() so HTTP error responses are caught
and the workflow stops instead of proceeding to /submitted
- Fix typo: borwser → browser
Issue: #8
This is a pretty big refactor of how communication works to start moving
us in the direction we want to go long-term. This adds the new
communication row and migrates existing reports to add rows for
communication.
There's also a bunch of automatic fixes from the new linter. I should
have added them separately, but whatever.
This was causing a request to be made to the wrong API endpoint by going
to /api/publicreport instead of /api/rm/publicreport which doesn't work
on RMO's hostname.
This was added to try to fix scrolling passed the map on phones.
Instead, it just confuses click-and-drag. Instead we rely on the
lock/unlock overlay for the map to make scrolling passed work.