Skip to content

Commit 4426598

Browse files
authored
Merge pull request #3 from wvictor14/worktree-add-address-maps-link
Add facility address and Google Maps links to dashboard
2 parents 77b92bd + 1251906 commit 4426598

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

dashboard.qmd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,14 @@ tbl_data <- bccc |>
116116
paste0(" (last seen ", format(last_vacancy_gr1_age12, "%Y-%m-%d"), ")"),
117117
""
118118
),
119+
maps_query = paste0(NAME, ", ", ADDRESS_1, ", ", CITY),
120+
maps_url = paste0("https://www.google.com/maps/search/", URLencode(maps_query)),
119121
popup = glue::glue(
120122
"<b>{NAME}</b>",
121123
"{SERVICE_TYPE_CD}",
124+
"{ADDRESS_1}",
122125
"{PHONE}",
126+
"<a href='{maps_url}' target='_blank'>View on Google Maps</a>",
123127
"<br>Vacancy:",
124128
"&nbsp;&nbsp;&nbsp;&nbsp;<36 months: {VACANCY_SRVC_UNDER36}{lbl_under36}",
125129
"&nbsp;&nbsp;&nbsp;&nbsp;30 months - 5 years: {VACANCY_SRVC_30MOS_5YRS}{lbl_30mos}",
@@ -405,6 +409,14 @@ row_details <- function(index, bccc) {
405409
df_field("Address", bccc$ADDRESS_1),
406410
df_field('Address 2', bccc$ADDRESS_2),
407411
df_field('City', bccc$CITY),
412+
df_field(
413+
'Google Maps',
414+
htmltools::a(
415+
"View on Google Maps",
416+
href = paste0("https://www.google.com/maps/search/", URLencode(paste0(bccc$NAME, ", ", bccc$ADDRESS_1, ", ", bccc$CITY))),
417+
target = "_blank"
418+
)
419+
),
408420
df_field('ECE_CERTIFICATION_YN', bccc$ECE_CERTIFICATION_YN),
409421
df_field('ELF', bccc$ELF_PROGRAMMING_YN),
410422
df_field('IS_INCOMPLETE_IND', bccc$IS_INCOMPLETE_IND),
@@ -520,6 +532,8 @@ hide <- tbl_data |>
520532
IS_INCOMPLETE_IND,
521533
IS_CCFRI_AUTH,
522534
popup,
535+
maps_query,
536+
maps_url,
523537
contains('LANG_')
524538
) |>
525539
colnames() %>%

0 commit comments

Comments
 (0)