Commit 73282097 authored by Aqeel Padaria's avatar Aqeel Padaria

disable login button if authget is FALSE

parent c0b6f19f
......@@ -6,7 +6,7 @@
#' @examples
#' forecastUI("./forecastFiles/")
forecastUI <- function(directory = ".", run = TRUE, auth = TRUE, launch.browser = getOption("shiny.launch.browser", interactive()), rmEnv = TRUE)
forecastUI <- function(directory = ".", run = TRUE, authget = TRUE, launch.browser = getOption("shiny.launch.browser", interactive()), rmEnv = TRUE)
{
library(openxlsx)
......@@ -90,11 +90,18 @@ server = shinyServer(
#source(paste0(directory,"/google_auth.R"),local = T)
observe({
if(auth)
output$authenabled <- reactive({
return(authget)
})
outputOptions(output, 'authenabled', suspendWhenHidden=FALSE)
if(authget)
{
user<<-user_details()
}
if(!auth)
if(!authget)
{
user <<- data.frame(auth = "good", displayName = "local", imageurl = "", fullname = "")
}
......@@ -150,6 +157,21 @@ server = shinyServer(
}else{
# if(!authget)
# {
# # # outputOptions(output, 'googleauth', suspendWhenHidden=FALSE)
# # shinyjs::hideElement("googleauth")
# # # shinyjs::disable("googleauth")
# # shinyjs::hideElement("googleauthUi")
# # # shinyjs::disable("googleauthUi")
# # shinyjs::hideElement("googleauth-googleAuthUi")
# # shinyjs::disable("googleauth.googleauthUi")
# # shinyjs::hideElement(shiny::NS("googleauth")("googleAuthUi"))
# # shinyjs::disable(shiny::NS("googleauth")("googleauthUi"))
#
# }
toggle("googleauth-googleAuthUi", condition = authget)
options(spinner.size=1)
......@@ -1154,6 +1176,8 @@ ui = #ui.R
sidebarPanel(
# conditionalPanel(condition = "output.authenabled==TRUE",
# googleAuthUI("googleauth")),
googleAuthUI("googleauth"),
textOutput("profilename"),
uiOutput("datasetsAvailable"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment