@@ -4,6 +4,7 @@ library(shinyjs)
4
4
library(connectapi )
5
5
library(purrr )
6
6
library(dplyr )
7
+ library(tidyr )
7
8
library(lubridate )
8
9
library(reactable )
9
10
library(ggplot2 )
@@ -44,6 +45,15 @@ bar_chart <- function(value, max_val, height = "1rem", fill = "#00bfc4", backgro
44
45
div(class = " bar-cell" , label , chart )
45
46
}
46
47
48
+ full_url <- function (session ) {
49
+ paste0(
50
+ session $ clientData $ url_protocol , " //" ,
51
+ session $ clientData $ url_hostname ,
52
+ if (nzchar(session $ clientData $ url_port )) paste0(" :" , session $ clientData $ url_port ),
53
+ session $ clientData $ url_pathname
54
+ )
55
+ }
56
+
47
57
ui <- function (request ) {
48
58
page_sidebar(
49
59
useShinyjs(),
@@ -293,14 +303,7 @@ server <- function(input, output, session) {
293
303
session $ sendCustomMessage(" set_input_value" , list (' content_guid' , NULL ))
294
304
updateReactable(" aggregated_visits" , selected = NA )
295
305
296
- full_url <- paste0(
297
- session $ clientData $ url_protocol , " //" ,
298
- session $ clientData $ url_hostname ,
299
- if (nzchar(session $ clientData $ url_port )) paste0(" :" , session $ clientData $ url_port ),
300
- session $ clientData $ url_pathname ,
301
- " ?"
302
- )
303
- updateQueryString(full_url )
306
+ updateQueryString(paste0(full_url(session ), " ?" ))
304
307
})
305
308
306
309
# Cache invalidation button ----
@@ -884,7 +887,7 @@ server <- function(input, output, session) {
884
887
mutate(date = date(timestamp )) | >
885
888
group_by(date ) | >
886
889
summarize(daily_visits = n(), .groups = " drop" ) | >
887
- tidyr :: complete(date = all_dates , fill = list (daily_visits = 0 ))
890
+ complete(date = all_dates , fill = list (daily_visits = 0 ))
888
891
})
889
892
890
893
output $ daily_visits_plot <- renderPlotly({
0 commit comments