-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c94fa3
commit 3e5cff8
Showing
5 changed files
with
28 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,45 @@ | ||
#' Shiny module providing GUI and server logic for the subscription tab | ||
#' Shiny module providing GUI and server logic for the subscription v2 tab | ||
#' | ||
#' @param id Character string module namespace | ||
NULL | ||
|
||
abonnement_ui <- function(id) { | ||
ns <- shiny::NS(id) | ||
|
||
shiny::sidebarLayout( | ||
shiny::sidebarPanel( | ||
width = 3, | ||
shiny::selectInput( | ||
ns("subscriptionRep"), "Rapport:", | ||
c("Samlerapport1", "Samlerapport2") | ||
), | ||
shiny::selectInput( | ||
ns("subscriptionFreq"), "Frekvens:", | ||
list("\u212brlig" = "\u212brlig-year", | ||
Kvartalsvis = "Kvartalsvis-quarter", | ||
"M\u00e5nedlig" = "M\u00e5nedlig-month", | ||
Ukentlig = "Ukentlig-week", | ||
Daglig = "Daglig-DSTday"), | ||
selected = "M\u00e5nedlig-month" | ||
), | ||
shiny::actionButton( | ||
ns("subscribe"), "Bestill", | ||
icon = shiny::icon("paper-plane") | ||
) | ||
rapbase::autoReportInput("testSubscription") | ||
), | ||
shiny::mainPanel( | ||
shiny::uiOutput(ns("subscriptionContent")) | ||
rapbase::autoReportUI("testSubscription") | ||
) | ||
) | ||
} | ||
|
||
abonnement_server <- function(id) { | ||
shiny::moduleServer( | ||
id, | ||
function(input, output, session) { | ||
ns <- session$ns | ||
|
||
# Abonnement | ||
## rekative verdier for aa holde rede paa endringer som skjer mens | ||
## applikasjonen kjorer | ||
subscription <- shiny::reactiveValues( | ||
tab = rapbase::makeAutoReportTab(session, type = "subscription") | ||
) | ||
|
||
|
||
## lag tabell over gjeldende status for abonnement | ||
output$activeSubscriptions <- DT::renderDataTable( | ||
subscription$tab, server = FALSE, escape = FALSE, selection = "none", | ||
options = list(dom = "tp", ordning = FALSE, | ||
columnDefs = list(list(visible = FALSE, targets = 6))), | ||
rownames = FALSE | ||
## nye abonnement | ||
## Objects currently shared among subscription and dispathcment | ||
orgs <- list(Sykehus1 = 1234, | ||
Sykehus2 = 4321) | ||
reports <- list( | ||
Samlerapport1 = list( | ||
synopsis = "Automatisk samlerapport1", | ||
fun = "samlerapport1Fun", | ||
paramNames = c("p1", "p2"), | ||
paramValues = c("Alder", 1) | ||
), | ||
Samlerapport2 = list( | ||
synopsis = "Automatisk samlerapport2", | ||
fun = "samlerapport2Fun", | ||
paramNames = c("p1", "p2"), | ||
paramValues = c("BMI", 1) | ||
) | ||
) | ||
|
||
## lag side som viser status for abonnement, ogsaa naar det ikke finnes noen | ||
output$subscriptionContent <- shiny::renderUI({ | ||
userFullName <- rapbase::getUserFullName(session) | ||
if (length(subscription$tab) == 0) { | ||
shiny::p(paste("Ingen aktive abonnement for", userFullName)) | ||
} else { | ||
shiny::tagList( | ||
shiny::p(paste0("Aktive abonnement som sendes per epost til ", | ||
userFullName, ":")), | ||
DT::dataTableOutput(ns("activeSubscriptions")) | ||
) | ||
} | ||
}) | ||
} | ||
## Subscription | ||
rapbase::autoReportServer( | ||
id = "testSubscription", registryName = "rapRegTemplate", | ||
type = "subscription", reports = reports, orgs = orgs, freq = "quarter" | ||
) | ||
} | ||
This file was deleted.
Oops, something went wrong.