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

Dm 3508 map component #541

Merged
merged 103 commits into from
Oct 12, 2022
Merged

Conversation

bradjohnson92008
Copy link
Contributor

@bradjohnson92008 bradjohnson92008 commented Sep 14, 2022

JIRA issue link

https://agile6.atlassian.net/browse/DM-3508

Description - what does this code do?

Allows users to add and display a google map with selected innovations and statuses on a Page builder page.

Testing done - how did you test it/steps on how can another person can test it

  1. Sign in an admin and go to /admin/pages
  2. Select an existing page or create a new page.
  3. Select "Edit" page.
  4. Scroll down to the "Add Component Button" and click.
  5. In the drop down list select "Google Map"
    image
  6. Enter a title, short_name, and description (***Keep in mind none of the fields are required - it is completely up to the content creator what they want to display on the page/map.)
    image
  7. Select as many innovations from the innovation drop down list (ctrl or shift to select multiple) for whose adoptions you would like to see displayed on the map.
  8. Select which Adoption Status(es) you want to display on the map. (statuses will not display when map is rendered on page. All markers will be the bright blue default marker.)
    image
  9. Select the "Update Page" button when finished.
    image
  10. Ensure the page updates correctly. (green success banner should display at top).
  11. To view the page click on the "COMPLETE URL" link at the top of the page.
    image
  12. Ensure that all adoptions for the selected innovations display in the map and that the Title, Short_name, and description all display correctly if inputted. Also the map should be cenetered on the conus United states. .. (somewhere in Kansas.. lol).
    image
  13. Click on a Marker and ensure the short_name is displayed if inputted. Also ensure the Facility name (and facility short name or accronym displays in parenthesis next to the facility name). Also ensure that the adoptions for the selected facilities display in the body of the map-marker Info-Window. The adoptions should display the Innovation Name and Tagline or short description for each Innovation.
    image

Acceptance criteria

  1. Ability to add a map to a Page Builder page
  2. Title, Short_name and Description
  3. User can enter text
  4. Admin can select which innovations' adoptions are displayed on map
  5. Reuse code from practice list
  6. Admin can select which innovation statuses are displayed on map (Successful, unsuccessful, In progress)
  7. Status display: regarding this PB MAP Component. Do not distinguish adoptions by status within the component. If user wants to see adoption statuses they can click the facility link and view all the Facilities adoptions and statuses on the Facilities Show Page.
  8. Display a marker on the map for every facility that has an XR Innovation adoptions
  9. Each map marker is clickable
  10. Info window that displays when marker is clicked is static size: W: 670px H: 339px
  11. When clicked, map marker modal displays Facility name and the number of XR Innovations at that facility (like Diffusion Map)
  12. When user clicks map, modal with total XR innovations at facility and list of innovations pops up
  13. Markers are all same color and don’t have numbers
  14. Marker pop up contains a link to the facility on the facility name and a list of Innovations display with innovation name and tagline. Adopted Innovations in the info window are clickable and will take user to the innovations show page.
  15. When user clicks map marker, Modal with list of Innovations adopted at that facility displays
  16. Total of Innovation Adoptions- only displayed per Facility in map-marker info window for that Facility.
  17. Map defaults to Continental US (CONUS) when Communities page is loaded
  18. User can zoom in/out on map
  19. Monitor performance
  20. Review map workflow with Research and Design

General Note: List of XR Innovations:

  • Mixed Reality…(MR. MAP)
  • Use of Ket for Treatment Resistant Depression)…
  • Use of XR for wellness...
  • Virtual Reality for CLC…
  • Virtual Reality for Management of pain…
  • Virtual Reality for pain…

Definition of done

  • Unit tests written (if applicable)
  • e2e/accessibility tests written (if applicable)
  • Events are logged appropriately
  • Documentation has been updated, if applicable
  • A link has been provided to the originating JIRA issue
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs

Adding support/dependencies for map component.
Page Builder UI
documenting page_map_components schema
backend and infrastructure for front end.
bus logic: fetching diffusion histories for selected practices.
center map and zoom
styles, zoom level
Fix query for adopting facilities
removed dbg
removed dbgs
marker infowindow
info window
logic for statuses
front end stuff
info window styling text changes.
border radius..
map zoom
border padding for info window card style
use padding shorthand
add margin between description and map bottom.
info window static size.
infowindow styles...
Added in Abbr Short_name for info window content.. i.e., 23 "XR" innovations.. for a specific Facility.
margin above num innovations in infowindow
schema change
added test.
Copy link
Collaborator

@camillevilla camillevilla left a comment

Choose a reason for hiding this comment

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

This is working well for me @bradjohnson92008! I support Josh's refactor suggestion for reducing database queries. Consider my other two comments non-blocking.

app/controllers/page_controller.rb Outdated Show resolved Hide resolved
app/views/page/show.html.erb Outdated Show resolved Hide resolved
app/helpers/page_helper.rb Outdated Show resolved Hide resolved
test not working now...
PR Comments
InfoWindow refactors
Update/Refactor short_name column to map_info_window_text
bradjohnson92008 and others added 5 commits October 11, 2022 10:37
updated page_map_component.short_name field to map_info_window_text.
Update tests for map due to column name change.
update spec for page_map_component field name change.
Copy link
Contributor

@JoshingYou1 JoshingYou1 left a comment

Choose a reason for hiding this comment

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

Great work on those refactors Brad! 😄 I left some small comments. I noticed we're getting a lot of console warnings for google maps. Hopefully this'll be a quick fix. I also noticed that the info window for the map is not centered, and on mobile, the width of it goes past the screen. We may need to ask Nick for a mobile mockup for the info window, so we can use a different, smaller width.

Console warning

Map info window for desktop and mobile


app/admin/pages.rb Outdated Show resolved Hide resolved
app/admin/pages.rb Outdated Show resolved Hide resolved
app/admin/pages.rb Outdated Show resolved Hide resolved
app/models/page_map_component.rb Show resolved Hide resolved
app/views/page/show.html.erb Outdated Show resolved Hide resolved
spec/features/pages/show_page_spec.rb Show resolved Hide resolved
spec/features/pages/show_page_spec.rb Outdated Show resolved Hide resolved
spec/models/page_map_component_spec.rb Show resolved Hide resolved
app/views/page/show.html.erb Outdated Show resolved Hide resolved
app/views/page/show.html.erb Outdated Show resolved Hide resolved
pr comments.
INfo Window styles.
Decrease maxWidth and maxHeight
removed commented code from spec.
@bradjohnson92008
Copy link
Contributor Author

Regarding the InfoWindow positioning. Instead of static width/height.. using maxWidth(400px) and maxHeight(275px) to make this way less noticeable.

adjustedpixel offset for new maxWidth, maxHeight.
Copy link
Contributor

@JoshingYou1 JoshingYou1 left a comment

Choose a reason for hiding this comment

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

Great work Brad! There were a couple of issues marked as resolved, but were left unchanged, so I flagged them. Other than that everything looks great! We may need to add a story for the console warnings, but it might be able to wait for V2.

app/admin/pages.rb Outdated Show resolved Hide resolved
app/views/page/show.html.erb Outdated Show resolved Hide resolved
Fix indent for comment headers.
revert back to "if" instead of "unless"
@bradjohnson92008 bradjohnson92008 merged commit ca728ae into feature/communities Oct 12, 2022
@bradjohnson92008 bradjohnson92008 deleted the dm-3508-map-component branch October 12, 2022 18:41
JoshingYou1 added a commit that referenced this pull request Oct 21, 2022
* Dm 3533 (#543)

* DM-3533: Added new component and component image models

* DM-3533: Started 'Add Image' functionality

* DM-3533: Removed TinyMCE code that was messing with WYSIWYG links

* DM-3533: Fixed TinyMCE issues

* DM-3533: Added more fields and added delete functionality to component images

* DM-3533: Finished all backend functionality

* DM-3533: Added some front end code for compound body component

* DM-3533: Added configurable bottom and top margin. Cleaned up some code

* DM-3533: Added admin panel tests for CompoundBodyComponent

* DM-3533: Added a bunch of tests

* DM-3533: Added unit tests for new models

* DM-3533: Cleaned up some code

* DM-3533: Fixed some failing tests

* DM-3533: Fixed failing tests

* DM-3533: Refactored some code and added another test

* DM-3533: Reverted data type for paperclip attachments

* DM-3533: Added to Pages show page and a few tests

* DM-3533: Added mobile styling and another test

* DM-3533: Cleaned up some code

* DM-3533: Commented out selenium_chrome line from spec_helper

* DM-3533: Added outline to images that belong to a CompoundBodyComponent

* DM-3533: Removed unnecessary 'validate' call

* DM-3533: Added external link styling to WYSIWYG links for compound body component

* DM-3533: Removed some unnecessary code

* DM-3533: Cleaned up some JS code

* DM-3533: Fixed issue with external link styling for PageComponentImages

* DM-3533: Added ':thumb' style to PageComponentImage on Page show page

* Dm 3592 anchor tags (#542)

* dm-3592

add fix for anchor tag/links in chrome.

* dm-3592

build out anchor tags for all Accordions/(FAQs) on a page.

* dm-3592

test to ensure accordion component displays

* dm-3592

spec - add click event to display accordion text.

* dm-3592

spec for accordion

* dm-3592

* dm-3508

moved anchor tag to div container instead of above div container.

* dm-3592

Add test for multiple accordions and anchor tags.

* dm-3508

test

* dm-3508

* dm-3508

PR fixes for anchor tags.

* Dm 3529 (#546)

* DM-3533: Added new component and component image models

* DM-3533: Started 'Add Image' functionality

* DM-3533: Removed TinyMCE code that was messing with WYSIWYG links

* DM-3533: Fixed TinyMCE issues

* DM-3533: Added more fields and added delete functionality to component images

* DM-3533: Finished all backend functionality

* DM-3533: Added some front end code for compound body component

* DM-3533: Added configurable bottom and top margin. Cleaned up some code

* DM-3533: Added admin panel tests for CompoundBodyComponent

* DM-3533: Added a bunch of tests

* DM-3533: Added unit tests for new models

* DM-3533: Cleaned up some code

* DM-3533: Fixed some failing tests

* DM-3533: Fixed failing tests

* DM-3533: Refactored some code and added another test

* DM-3533: Reverted data type for paperclip attachments

* DM-3533: Added to Pages show page and a few tests

* DM-3533: Added mobile styling and another test

* DM-3533: Cleaned up some code

* DM-3533: Commented out selenium_chrome line from spec_helper

* DM-3533: Added outline to images that belong to a CompoundBodyComponent

* DM-3533: Removed unnecessary 'validate' call

* DM-3533: Added external link styling to WYSIWYG links for compound body component

* DM-3533: Removed some unnecessary code

* DM-3533: Cleaned up some JS code

* DM-3529: Added image and image alt text fields to page

* DM-3533: Added ability to add image to a Page in the admin panel

* DM-3533: Fixed issue with external link styling for PageComponentImages

* DM-3533: Added ':thumb' style to PageComponentImage on Page show page

* DM-3529: Working on frontend for header image

* DM-3529: Added mobile styles

* DM-3529: Adjusted styles based on design's feedback

* DM-3529: Finished writing tests and cleaning up styling

* DM-3529: Improved a test

* DM-3529: Fixed failing tests

* DM-3529: Fixed up the schema and uncommented headless chrome

* DM-3529: Removed redundant 'private' call and cleaned up a little bit of code

* DM-3534 DM-3561: Add Events and News Components (#544)

Co-authored-by: Camille Villa <[email protected]>

* Dm 3508 map component (#541)

* dm-3508

Adding support/dependencies for map component.

* dm-3508

Page Builder UI

* dm-3508

* dm-3508

documenting page_map_components schema

* dm-3508

backend and infrastructure for front end.

* dm-3508

* dm-3508

bus logic: fetching diffusion histories for selected practices.

* dm-3508

* dm-3508

center map and zoom

* dm-3508

styles, zoom level

* dm-3508

Fix query for adopting facilities

* dm-3508

removed dbg

* dm-3508

removed dbgs

* dm-3508

marker infowindow

* dm-3508

info window

* dm-3508

logic for statuses

* dm-3508

front end stuff

* dm-3508

info window styling text changes.

* dm-3508

border radius..

* dm-3508

map zoom

* dm-3508

border padding for info window card style

* dm-3508

use padding shorthand

* dm-3508

add margin between description and map bottom.

* dm-3508

info window static size.

* dm-3508

infowindow styles...

* dm-3508

Added in Abbr Short_name for info window content.. i.e., 23 "XR" innovations.. for a specific Facility.

* dm-3508

margin above num innovations in infowindow

* dm-3508

schema change

* dm-3508

added test.

* dm-3508

* dm-3508

fixed issue with text wrapping and ignoring padding.

* dm-3508

info window styles

* dm-3508

make map component mobile friendly.

* dm-3508

more info window and border styles for map component info window.

* dm-3508

* dm-3508

* dm-3508

info window styles

* dm-3508

addressing testing and PR comments.

* dm-3508

refactored some code to use ActiveRecord vs arrays.

* dm-3508

Refactored some code in the controller.

* dm-3508

renamed infowindow partial to _page_map_infowindow

* dm-3508

another slight refactor...

* dm-3508

UPdate based on PR comments.

* dm-3508

Fixed styling for Info Window Facility Link.

* dm-3508

Map and info window styles.. enums for Diffusion History statuses.. etc.

* dm-3508

Addend links for innovations within the map component markers info-window

* dm-3508

forgot to update these changes in schema.rb

* dm-3508

remove commented code and fix margin in info window.

* dm-3508

Added model test.

* dm-3508

more tests for map

* dm-3508

try to fix test.

* dm-3508

Fix test.

* dm-3508

* dm-3508

ok.. lets try different syntax..

* m-3508

display-none?

* dm-3508

forgot the div

* dm-3508

* dm-3508

* dm-3508

* dm-3508

info window styles

* dm-3508

* dm-3508

info window size and positioning

* dm-3508

* dm-3508

* dm-3508

Style changes per design.

* dm-3508

spec for clicking map marker and displaying infowindow

* dm-3508

err in spec.

* dm-3508

Admin Panel test page for creating a map component

* dm-3508

removed debuggers

* dm-3508

Admin panel spec

* dm-3508

Update IDs to match db change for "display_successful_adoptions" for spec.

* Revert "dm-3508"

This reverts commit 8e352bd

* dm-3508

re-factor spec

* dm-3508

more refactor for specs

* dm-3508

* dm-3508

info window spec

* dm-3508

setting ids back to be consistent in map_page_comonent_form.html.arb

* dm-3508

find the map marker...

* dm-3508

Remove other community features from schema that are in other component branches.

* dm-3508

PR updates.

* dm-3508

PR updates

* dm-3508

pr suggestions

* dm-3508

moved helper method to model - refactored method.

* dm-3508

* dm-3508

test not working now...

* dm-3508

PR Comments

* dm-3508

InfoWindow refactors

* dm-3508

Update/Refactor short_name column to map_info_window_text

* dm-3508

updated page_map_component.short_name field to map_info_window_text.

* dm-3508

Update tests for map due to column name change.

* dm-3508

update spec for page_map_component field name change.

* dm-3508

pr comments.

* dm-3508

INfo Window styles.

* dm-3508

Decrease maxWidth and maxHeight

* dm-3508

removed commented code from spec.

* dm-3508

adjustedpixel offset for new maxWidth, maxHeight.

* dm-3508

Fix indent for comment headers.

* dm-3508

revert back to "if" instead of "unless"

* Removed duplicate code in admin/pages.rb

Co-authored-by: Joshua Drumm <[email protected]>

* Community Feature

replace total adoption count with just count of "adopted practices within the community"

* Changed '.count' to '.length' for practice_data array

* DM-3626: Refactored grid column setup for 'CompoundBody' component (#549)

* Dm compound body spacing fix (#550)

* Renamed 'margin' columns to 'padding' and refactored the code to reflect those changes

* Reverted some schema changes

* Fixed a failing test

* Fixed a couple of typos

* DM 3631: Support /communities URL for Community pages (#551)

Co-authored-by: Camille Villa <[email protected]>
Co-authored-by: Joshua Drumm <[email protected]>

* DM-3627: Adjusted styles to align with DM homepage styles (#553)

* Dm 3632 (#552)

* dm-3632

Added XR Network dropdown nav in header.

* dm-3632

highlighting/bolding for currently selected menu item

* dm-3632

add some tests for nav.

* dm-3632

update path info based on community/xr-network routes

* dm-3632

PR comments adjustments

* dm-3632

test for top nav communities.

* dm-3632

test for home page.

* dm-3632

test for communities about page.

* dm-3632

* dm-3632

* dm-3632

* dm-3632

* dm-3632

revert tests - not working.

* dm-3632

this test should work..

* dm-3632

slug needs to be 'home'

* dm-3632

change slug back to home.

* dm-3632

Adding path tests for all xr-network pages.

* dm-3632

adding the pages.

* Communities redirect fix (#555)

* Fixed community redirect issue and added a test

* Improved test scenario description

* Trying to fix test on CI

* Hopefully fixed test on CI

Co-authored-by: Brad Johnson <[email protected]>
Co-authored-by: Camille Villa <[email protected]>
Co-authored-by: Camille Villa <[email protected]>
Co-authored-by: bradjohnson92008 <[email protected]>
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