Skip to content

Commit

Permalink
testing environment variable LOCAL for js
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Dec 18, 2024
1 parent ab1a996 commit 9d239d1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
29 changes: 14 additions & 15 deletions app/MainApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,24 @@ js_scripts <- function() {
}

upload_fct <- function() {
output$conditional_data_ui <- renderUI({
if (Sys.getenv("RUN_MODE") != "SERVER") {
res <- conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
fileInput("file", "Choose CSV File",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
if (Sys.getenv("RUN_MODE") != "SERVER") {
res <- conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
fileInput("file", "Choose CSV File",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
)
return(res)
}
})
)
return(res)
}
}

app <- function() {
js <- js_scripts()
uf <- upload_fct()
ui <- fluidPage(
useShinyjs(),

Expand Down Expand Up @@ -144,7 +143,8 @@ app <- function() {
div(
conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
uiOutput("conditional_data_ui"),
# uiOutput("conditional_data_ui"),
uf,
tags$hr()
),
conditionalPanel(
Expand Down Expand Up @@ -386,7 +386,6 @@ app <- function() {
)
)
)
showNotification(as.character(res))
return(res)
}
})
Expand Down
29 changes: 14 additions & 15 deletions bs/R/MainApp.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,24 @@ js_scripts <- function() {
}

upload_fct <- function() {
output$conditional_data_ui <- renderUI({
if (Sys.getenv("RUN_MODE") != "SERVER") {
res <- conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
fileInput("file", "Choose CSV File",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
if (Sys.getenv("RUN_MODE") != "SERVER") {
res <- conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
fileInput("file", "Choose CSV File",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv"
)
)
return(res)
}
})
)
return(res)
}
}

app <- function() {
js <- js_scripts()
uf <- upload_fct()
ui <- fluidPage(
useShinyjs(),

Expand Down Expand Up @@ -144,7 +143,8 @@ app <- function() {
div(
conditionalPanel(
condition = "input.conditionedPanels == 'Data'",
uiOutput("conditional_data_ui"),
# uiOutput("conditional_data_ui"),
uf,
tags$hr()
),
conditionalPanel(
Expand Down Expand Up @@ -386,7 +386,6 @@ app <- function() {
)
)
)
showNotification(as.character(res))
return(res)
}
})
Expand Down

0 comments on commit 9d239d1

Please sign in to comment.