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

maps: conditionally display map & warning messages #39

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

codemacabre
Copy link
Collaborator

@codemacabre codemacabre commented Nov 10, 2022

Summary

  • Pass variables any_nodes_with_geometry and any_spans_with_geometry to template
  • Conditionally show/hide map based on data validity
  • Conditional messages based on data validity
  • Conditionally colour 'Visualisation' section header based on data validity

#6

Verify

  1. Upload valid JSON

    • 'Visualisation' section header will be success green and map should display
      image
  2. Upload JSON without valid geometry

    • 'Visualisation' section header will be warning yellow, along with appropriate message, and map will not display
      image
  3. Upload invalid JSON

    • 'Visualisation' section header will be danger red, along with appropriate message, and map will not display
      image

@codemacabre codemacabre self-assigned this Nov 10, 2022
@codemacabre codemacabre marked this pull request as ready for review November 10, 2022 12:29
Copy link
Contributor

@Lathrisk Lathrisk left a comment

Choose a reason for hiding this comment

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

This looks good to me. The linting changes are quite extensive, but also pass our automated linting checks in the repo. I guess we don't want to regularly change code styles if we use different auto-linters, but otherwise looks good. Any thoughts, @odscjames?

@odscjames
Copy link
Collaborator

We don't have auto-linters for HTML and I don't want to get into that now - ideally PR's would have minimal changes. This allows other PR's to be merged in and preserves the history. Can the 3 commits in this PR be squashed?

Also, noting the messages in the template don't match the 3 in #6 (comment) . It's not possible to fully do the red message now, as the {{error details}} template variable isn't available but we could match it as much as possible. That could be in this PR or a new PR after tho.

@codemacabre codemacabre force-pushed the ml/map-error-checking branch from 5265105 to d39e8cf Compare November 10, 2022 14:14
@odscjames odscjames merged commit ec2431d into live Nov 10, 2022
@odscjames odscjames deleted the ml/map-error-checking branch November 10, 2022 14:22
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.

3 participants