Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update request type strings to match database #428

Closed
jmensch1 opened this issue Mar 15, 2020 · 2 comments · Fixed by #464
Closed

Update request type strings to match database #428

jmensch1 opened this issue Mar 15, 2020 · 2 comments · Fixed by #464
Assignees
Labels
Role: Frontend React front end work v1 The first version of the site

Comments

@jmensch1
Copy link
Contributor

The request type strings we're displaying in the UI don't always match the requesttype field in the database. For example, we're using 'Dead Animal' in the UI, but the actual string in the database is 'Dead Animal Removal'. As a result, when you search for that request type, you don't get back any data.

These are all the cases where the strings are different:

UI string / DB string
Dead Animal / Dead Animal Removal
Single Streetlight / Single Streetlight Issue
Multiple Streetlight / Multiple Streetlight Issue
E-Waste / Electronic Waste
Graffiti / Graffiti Removal
Illegal Dumping / Illegal Dumping Pickup

The easy way to handle this would be just to change the strings we're displaying in the UI to match the DB strings.

But if we want to preserve the different strings in the UI, we could modify the REQUEST_TYPES constant so that it distinguishes between the UI string and the DB string.

export const REQUEST_TYPES = [
  {
     type: 'Dead Animal Removal',   // the DB string 
     display: 'Dead Animal',        // the UI string
     ...
  }
  ...
}

Then we could modify the components that use the request types (the RequestTypeSelector, Legend, and a bunch of the charts) to use the display string for presentation, and the type for requesting data from the backend.

P.S. the database also includes 'Report Water Waste'. Are we using that on the frontend?

@jmensch1 jmensch1 added the Role: Frontend React front end work label Mar 15, 2020
@sellnat77
Copy link
Member

We could serve this blob from the backend too
Or we could also do a one-off select distinct but if we pull it from the backend it will adapt to changes

Reason being....we only have access to 13 types of requests but it rumored that there are a ton of different types we just dont have access to yet

@jmensch1
Copy link
Contributor Author

Oh yeah, that could be good. Like a metadata endpoint we could hit when the app loads up. Could include the list of NCs as well, which are currently hard-coded into the frontend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Role: Frontend React front end work v1 The first version of the site
Projects
Development

Successfully merging a pull request may close this issue.

3 participants