Skip to content

Commit

Permalink
migrate to plain shiny
Browse files Browse the repository at this point in the history
closes #269 closes #272 opens #271
  • Loading branch information
maxheld83 committed Sep 9, 2021
1 parent 1a0f948 commit 25f0982
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 7,072 deletions.
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Imports:
stringi,
lubridate,
shiny,
flexdashboard,
shinyvalidate,
biblids,
magrittr,
Expand All @@ -81,7 +80,8 @@ Imports:
gert,
keyring,
shinytest,
shiny.i18n
shiny.i18n,
bslib
Suggests:
testthat,
subugoetheme,
Expand All @@ -97,7 +97,6 @@ Remotes:
subugoe/[email protected],
subugoe/rcrossref@158d6d35091b75fcf1cd4271ecf585b2a6c56006,
subugoe/biblids@3ffa325c12fc49766d93f472ab903a6ee39a6379,
rstudio/flexdashboard@42d732959ea6664c7642eaeffdcf297ab6a6648a,
appsilon/shiny.i18n@efb0bc0dd5412d35e6747f10f24b1ea48201f886
Config/testthat/edition: 3
Config/testthat/parallel: true
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export(is_doi_cr_type)
export(is_in_limit)
export(is_metacheckable)
export(license_check)
export(mcApp)
export(mcControlsApp)
export(mcControlsServer)
export(mcControlsUI)
Expand Down
57 changes: 51 additions & 6 deletions R/communicate.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,57 @@
#' Start web application
#' @inheritDotParams rmarkdown::run
#' @inherit rmarkdown::run
#' @inheritDotParams shiny::runApp
#' @family communicate
#' @export
runMetacheck <- function(...) {
rmarkdown::run(
file = system.file("app", "index.Rmd", package = "metacheck"),
...
runMetacheck <- function(...) shiny::runApp(appDir = mcApp(), ...)

#' Shiny webapp for metacheck
#' @family communicate
#' @export
mcApp <- function() {
future::plan(future::multicore, workers = 20L)
shiny::shinyApp(
ui = mcAppUI(),
server = mcAppServer
)
}

#' @describeIn mcApp UI
#' @noRd
mcAppUI <- function() {
shiny::fillPage(
theme = mc_theme(),
shiny::sidebarLayout(
shiny::sidebarPanel(
mcControlsUI(id = "webapp")
),
shiny::mainPanel(
shiny::p("foo")
)
)
)
}

#' @describeIn mcApp Server
#' @noRd
mcAppServer <- function(input, output, session) {
mcControlsServer(id = "webapp")
}

# TODO move to subugoetheme https://github.com/subugoe/metacheck/issues/271
mc_theme <- function() {
bslib::bs_theme(
version = 4,
bootswatch = "cosmo",
bg = subugoetheme::ugoe_pal()$primary["Weiss"],
fg = subugoetheme::ugoe_pal()$primary["Schwarz"],
primary = subugoetheme::ugoe_pal()$primary["Uni-Blau (HKS 41)"],
secondary = subugoetheme::ugoe_pal()$primary["Schwarz"],
success = subugoetheme::ugoe_pal()$faculty["Agrarwissenschaften"],
# this is not one of the ugoe pal, but was used in the past
# as per less in subugoetheme
info = "#45195c",
warning = subugoetheme::ugoe_pal()$faculty["Biologie und Psychologie"],
danger = subugoetheme::ugoe_pal()$faculty["Jura"]
)
}

Expand Down
1 change: 0 additions & 1 deletion inst/app/.gitignore

This file was deleted.

Loading

0 comments on commit 25f0982

Please sign in to comment.