Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ app_ui <- function(request) {
sidebar = bslib::sidebar(
bslib::accordion(
id = "sidebar_accordion",

open = FALSE,
multiple = TRUE,
bslib::accordion_panel(
Expand All @@ -109,6 +108,11 @@ app_ui <- function(request) {
icon = bsicons::bs_icon("hospital"),
mod_select_strategy_ui("mod_select_strategy")
)
),
shiny::bookmarkButton(
label = "Bookmark",
title = "Bookmark your selections and get a URL for sharing",
icon = bsicons::bs_icon("bookmark"),
)
)
)
Expand Down
9 changes: 9 additions & 0 deletions R/mod_select_provider.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ mod_select_provider_server <- function(id, selected_geography) {
)
})

shiny::onRestored(function(state) {
# Enforce loading of selection when restoring from a bookmark
shiny::updateSelectInput(
session,
"provider_select",
selected = state$input$provider_select
)
})

shiny::reactive(input$provider_select)
})
}
9 changes: 9 additions & 0 deletions R/mod_select_strategy.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ mod_select_strategy_server <- function(id) {
)
})

shiny::onRestored(function(state) {
# Enforce loading of selection when restoring from a bookmark
shiny::updateSelectInput(
session,
"strategy_select",
selected = state$input$strategy_select
)
})

shiny::reactive(input$strategy_select)
})
}
2 changes: 2 additions & 0 deletions inst/app/text/info-interface.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
You can hover over the **information symbol** <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="bi bi-info-circle " style="height:1em;width:1em;fill:currentColor;vertical-align:-0.125em;" aria-hidden="true" role="img" ><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"></path> <path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path></svg> for further details.

Click the <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-bookmark" viewBox="0 0 16 16"><path d="M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v13.5a.5.5 0 0 1-.777.416L8 13.101l-5.223 2.815A.5.5 0 0 1 2 15.5zm2-1a1 1 0 0 0-1 1v12.566l4.723-2.482a.5.5 0 0 1 .554 0L13 14.566V2a1 1 0 0 0-1-1z"/></svg> **Bookmark** button to save your selections and get a shareable URL so you can return to the app with these choices loaded.

To maximise space, you can click the:

* <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-expand" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M3.646 9.146a.5.5 0 0 1 .708 0L8 12.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708m0-2.292a.5.5 0 0 0 .708 0L8 3.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708"/>
Expand Down