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

Adds fallbacks for resource title display #515

Merged
merged 4 commits into from
Aug 24, 2024

Conversation

ravicodelabs
Copy link
Contributor

@ravicodelabs ravicodelabs commented Aug 8, 2024

Addresses issue #462, where we want to improve the display the resource title/subtitle(s) when there is missing data.

Notes for reviewers:

  • There was one additional case that came up that was not present in the Figma designs. Namely, there are instances in the data where the name and lat/long are present, but the address is missing. I am currently handling this analogously and screenshots are below.
  • I noticed that there are instances where lat/long are present, but name and address are missing. In spot checking one instance, I did not see the corresponding pin on the map. Hence, we may need to update the code to display pins for this case, though that may warrant a separate issue.
  • There may be some minor differences in the current implementation design and the Figma designs. Please let me know what if anything should be changed, as I wasn't sure which would be better in this case.
  • I am assuming that lat/long will always be present, and this matches my inspection of the data (722 resources). If this doesn't hold in general, we would have to add a bit more code to handle the new cases.

Verification

Given four resources, if we assume that lat/long is always present, then there are four possible combinations for available data. Below are examples from the data of each, and screenshots of how they are currently being handled with this PR.

Examples with lat, long provided

  • name, address, and lat/long present
    • example: 39.96225, -75.21102
  • name and lat/long only
    • example: 39.945175, -75.160115
  • address and lat/long only
    • example: 39.9618, -75.1362
  • lat/long only
    • **** not displaying on the map?
    • example: 39.9510869813, -75.1718175251

Examples - screenshots and all the resource details


name, address, and lat/long present

all_present-desktop
all_present-mobile

{
  "address": "4400 Haverford Avenue",
  "city": "Philadelphia",
  "creator": "phlask",
  "date_created": "2024-06-22T17:39:10.895514+00:00",
  "description": "1st floor / Lab area ; 2nd floor / outside employee restroom",
  "entry_type": "UNSURE",
  "last_modified": "2024-06-22T17:39:10.895514+00:00",
  "last_modifier": "phlask",
  "latitude": 39.96225,
  "longitude": -75.21102,
  "name": "Health Center #4",
  "resource_type": "WATER",
  "source": {
    "type": "MIGRATION"
  },
  "state": "PA",
  "status": "OPERATIONAL",
  "verification": {
    "last_modified": "2024-06-22T17:39:10.895514+00:00",
    "last_modifier": "phlask",
    "verified": false
  },
  "version": 1,
  "water": {
    "dispenser_type": [
      "DRINKING_FOUNTAIN"
    ]
  },
  "zip_code": "19104",
  "id": "0"
}

name and lat/long only

address_missing-desktop
address_missing-mobile

{
  "city": "Philadelphia",
  "creator": "phlask",
  "date_created": "2024-06-22T17:39:31.391472+00:00",
  "description": "Dawn to Dusk",
  "entry_type": "UNSURE",
  "gp_id": "ChIJC-YRICTGxokRzSqdkj3Y6JI",
  "last_modified": "2024-06-22T17:39:31.391472+00:00",
  "last_modifier": "phlask",
  "latitude": 39.945175,
  "longitude": -75.160115,
  "name": "Louis Kahn Park",
  "resource_type": "WATER",
  "source": {
    "type": "MIGRATION"
  },
  "state": "PA",
  "status": "OPERATIONAL",
  "verification": {
    "last_modified": "2024-06-22T17:39:31.391472+00:00",
    "last_modifier": "phlask",
    "verified": false
  },
  "version": 1,
  "water": {
    "dispenser_type": [
      "DRINKING_FOUNTAIN"
    ]
  },
  "zip_code": "19107",
  "id": "3"
}

address and lat/long only

name_missing-desktop
name_missing-mobile

{
  "address": "Delaware Av ES 25ft S/O Poplar St F/N - 2",
  "city": "Philadelphia",
  "creator": "phlask",
  "date_created": "2024-06-22T17:39:48.227967+00:00",
  "description": "",
  "entry_type": "UNSURE",
  "last_modified": "2024-06-22T17:39:48.227967+00:00",
  "last_modifier": "phlask",
  "latitude": 39.9618,
  "longitude": -75.1362,
  "name": "",
  "resource_type": "WATER",
  "source": {
    "type": "MIGRATION"
  },
  "state": "PA",
  "status": "OPERATIONAL",
  "verification": {
    "last_modified": "2024-06-22T17:39:48.227967+00:00",
    "last_modifier": "phlask",
    "verified": false
  },
  "version": 1,
  "water": {
    "dispenser_type": [
      "DRINKING_FOUNTAIN"
    ]
  },
  "zip_code": "19123",
  "id": "4"
}

lat/long only

Note that the lat/long only example does not have a screenshot since the pin does not appear to be on the map. This may be a bug and/or need to be handled with some additional code.

{
  "city": "Philadelphia",
  "creator": "phlask",
  "date_created": "2024-06-22T17:41:33.918293+00:00",
  "description": "This is a Ginkgo under the genus \"Ginkgo\" and species \"biloba\". The planting site ID is 368958, and the tree ID is 280906.",
  "entry_type": "UNSURE",
  "last_modified": "2024-06-22T17:41:33.918293+00:00",
  "last_modifier": "phlask",
  "latitude": 39.9510869813,
  "longitude": -75.1718175251,
  "resource_type": "FORAGE",
  "source": {
    "type": "MIGRATION"
  },
  "state": "PA",
  "status": "OPERATIONAL",
  "verification": {
    "last_modified": "2024-06-22T17:41:33.918293+00:00",
    "last_modifier": "phlask",
    "verified": false
  },
  "version": 1,
  "zip_code": "19103",
  "id": "405"
}

attn: @lxh5395, @tomporvaz, @vontell

@ravicodelabs ravicodelabs self-assigned this Aug 9, 2024
Copy link
Contributor

@vontell vontell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Love the super clean code and clear comments.

@tomporvaz tomporvaz linked an issue Aug 20, 2024 that may be closed by this pull request
@gcardonag
Copy link
Contributor

Thank you @vontell for the excellent idea and @ravicodelabs for the solid execution and detailed explanation! 👏

@gcardonag gcardonag merged commit c02a14e into develop Aug 24, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve display of resources with no address or name
3 participants