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

Using a BS theme breaks some functionality in admin mode #137

Open
Jeff-Thompson12 opened this issue Mar 11, 2022 · 0 comments
Open

Using a BS theme breaks some functionality in admin mode #137

Jeff-Thompson12 opened this issue Mar 11, 2022 · 0 comments

Comments

@Jeff-Thompson12
Copy link

We are working on an app and were using a bootstrap theme using library bslib. This has caused a few bugs when accessing the administrative mode.

  1. The floating action button jumps from the bottom right to the bottom left.
  2. Some buttons no longer dismiss the modal. For instance, if you edit a user and click "CONFIRM CHANGE", the modal does not close.
  3. Some buttons break the overflow of the page. For instance, if you add a new user, the vertical scroll bar disappears and the overflow attribute of the html body is set at hidden.

Reproducible example is below.

library(shiny)
library(shinymanager)
library(bslib)

credentials <- data.frame(
  user = c("shiny", "shinymanager"),
  password = c("azerty", "12345"),
  start = c("2019-04-15"),
  expire = c(NA, NA),
  admin = c(FALSE, TRUE),
  comment = "Simple and secure authentification mechanism 
  for single ‘Shiny’ applications.",
  stringsAsFactors = FALSE
)

create_db(credentials, file.path('credentials.sqlite'))

theme <- bs_theme(
  bootswatch = "lux",
  version = 5,
  primary = "#24305E",
  secondary = "#F76C6C",
)

ui <- fluidPage(
  tags$h2("My secure application"),
  verbatimTextOutput("auth_output"),
  theme = theme
)

# Wrap your UI with secure_app
ui <- secure_app(ui,
                 theme = theme,
                 enable_admin = TRUE)


server <- function(input, output, session) {
  
  res_auth <- secure_server(
    check_credentials = check_credentials('credentials.sqlite')
  )
  
  output$auth_output <- renderPrint({
    reactiveValuesToList(res_auth)
  })
  
}

shinyApp(ui, server)
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

No branches or pull requests

1 participant