betterangels / buoy

:sos: A community-based crisis response system. Because friends don't let friends call the cops. :fire::police_car::fire:
https://betterangels.github.io/buoy/
GNU General Public License v3.0
71 stars 23 forks source link

Fix error messaging for schedule alert #201

Closed mcverter closed 7 years ago

mcverter commented 7 years ago

When User Schedules an alert correctly the Error Messages don't appear correctly on the scheduleAlertModal

This is because of a mistake in the javascript.

The JS wants to add an error message here: $('#' + response.data[k].code)

But the "codes" returned by the server error do not correspond to the Elements in the UI, so nothing happens with these error messages

fabacab commented 7 years ago

Is this related to the current released codebase or does this refer to #199?

mcverter commented 7 years ago

It is broken in the current code base. This was code I did not alter.

mcverter commented 7 years ago

It rests on an assumption that the PHP will return a response.data JSON object that has information about the jQuery IDs of the front end divs. So these values need to be synchronized somehow.

fabacab commented 7 years ago

I think this was fixed here. Feel free to reopen if not.

mcverter commented 7 years ago

Let me know what branch or commit I can pull to test whether this is fixed. It was not working in whatever codebase I was using. Thanks

fabacab commented 7 years ago

@mcverter It'll be in Buoy's develop branch, so you probably wanna just update your develop branch to match. If you already have a clone of the Better Angels Buoy repository:

git checkout develop
git pull https://github.com/betterangels/buoy.git develop

It would be useful for you to make sure your local develop branch is tracking the canonical develop branch, anyway. :) By that I mean:

$ git branch # which branch am I on?
* develop
  gh-pages
  master
  new-user-templates
$ git status # show me the status of this branch, notice the "up-to-date with" message in the output
On branch develop
Your branch is up-to-date with 'betterangels/develop'.
nothing to commit, working directory clean
$ git remote show betterangels # what is "betterangels?" It's pointing to the Better Angels repo on GitHub
* remote betterangels
  Fetch URL: git@github.com:betterangels/buoy.git
  Push  URL: git@github.com:betterangels/buoy.git
  HEAD branch: develop
  Remote branches:
    develop  tracked
    gh-pages tracked
    master   tracked
  Local branches configured for 'git pull':
    develop  merges with remote develop
    gh-pages merges with remote gh-pages
  Local refs configured for 'git push':
    develop  pushes to develop  (up to date)
    gh-pages pushes to gh-pages (up to date)
    master   pushes to master   (up to date)

Notice the "Local refs configured for…" stanzas in the output here. That tells me which local branches I'm associating the remote branches with. They have the same names (i.e., my develop branch is tracking the betterangels/develop branch) so it's less confusing for me, but you can name them whatever you want.

Here's what the git config looks like so you know how to set this up yourself if you want to:

$ git config --get-regexp betterangels
remote.betterangels.url git@github.com:betterangels/buoy.git
remote.betterangels.fetch +refs/heads/*:refs/remotes/betterangels/*
$ git config --get-regexp branch.develop
branch.develop.remote betterangels
branch.develop.merge refs/heads/develop

Thanks!

mcverter commented 7 years ago

Looks great. Thanks.