diff --git a/.Rbuildignore b/.Rbuildignore index cbdc157..72c3f0a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,3 +9,4 @@ ^CODE_OF_CONDUCT\.md$ ^data-raw$ ^Dockerfile$ +^dev$ diff --git a/.github/workflows/harbor.yml b/.github/workflows/harbor.yml new file mode 100644 index 0000000..4fb42f2 --- /dev/null +++ b/.github/workflows/harbor.yml @@ -0,0 +1,58 @@ +name: Publish Docker image to Harbor +on: + release: + types: [published] + push: + branches: + - main + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Push Docker image to Harbor + runs-on: ubuntu-latest + env: + IMAGE_NAME: ${{ github.repository }} + steps: + - name: Check out the repo + uses: actions/checkout@v4 + - name: Lint Dockerfile + uses: hadolint/hadolint-action@v3.1.0 + with: + dockerfile: "Dockerfile" + - name: R setup + uses: r-lib/actions/setup-r@v2 + - name: Build package (tarball) + run: R CMD build . + - name: Prepare tags + id: docker_meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE_NAME }} + flavor: | + latest=false + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Harbor + if: github.event_name == 'release' + run: | + echo ${{ secrets.HARBOR_PASSWORD }} | docker login --username ${{ secrets.HARBOR_USERNAME }} --password-stdin ${{ secrets.HARBOR_REGISTRY }} + - name: Build image and push to Harbor + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + tags: ${{ secrets.HARBOR_REGISTRY }}/${{ steps.docker_meta.outputs.tags }} + push: ${{ github.event_name == 'release' }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/DESCRIPTION b/DESCRIPTION index 8ea7b85..f4edb9a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: ablanor Title: AblaNor- Rapporteket -Version: 1.3.3 +Version: 2.0.0.9000 Authors@R: c( person(given = "Kristina", family = "Skaare", @@ -14,7 +14,12 @@ Authors@R: c( family = "Edvardsen", role = c("aut"), email = "biorakel@gmail.com", - comment = c(ORCID = "0000-0002-5210-3656"))) + comment = c(ORCID = "0000-0002-5210-3656")), + person(given = "Arnfinn Hykkerud", + family = "Steindal", + role = c("aut"), + email = "arnfinn.hykkerud.steindal@helse-nord.no", + comment = c(ORCID = "0000-0002-4088-7860"))) Description: An implemetation of all R related resources for AblaNor (Nasjonalt register for ablasjonsbehandling og elektrofysiologi i Norge). License: GPL-3 Encoding: UTF-8 @@ -44,7 +49,7 @@ Imports: tidyr, tidyselect Remotes: - Rapporteket/rapbase@*release + Rapporteket/rapbase@main URL: https://github.com/rapporteket/ablanor BugReports: https://github.com/rapporteket/ablanor/issues Depends: diff --git a/Dockerfile b/Dockerfile index ca0dfb2..783076e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,22 @@ -FROM rapporteket/base-r:4.2.1 +FROM rapporteket/base-r:main -LABEL maintainer "Are Edvardsen " +LABEL maintainer="Arnfinn Hykkerud Steindal " LABEL no.rapporteket.cd.enable="true" WORKDIR /app/R -# hadolint ignore=DL3010 COPY *.tar.gz . RUN R -e "remotes::install_local(list.files(pattern = \"*.tar.gz\"))" \ - && rm ./*.tar.gz + && rm ./*.tar.gz \ + && R -e "remotes::install_github(\"Rapporteket/rapbase\", ref = \"main\")" \ + && tlmgr update --self && tlmgr install xkeyval -EXPOSE 3008 +EXPOSE 3838 -CMD ["R", "-e", "options(shiny.port = 3008,shiny.host = \"0.0.0.0\"); ablanor::run_app()"] +RUN adduser --uid "1000" --disabled-password rapporteket && \ + chown -R 1000:1000 /app/R && \ + chmod -R 755 /app/R +USER rapporteket + +CMD ["R", "-e", "options(shiny.port = 3838, shiny.host = \"0.0.0.0\"); ablanor::run_app()"] diff --git a/R/app_server.R b/R/app_server.R index 0d798eb..34cb5e4 100644 --- a/R/app_server.R +++ b/R/app_server.R @@ -9,24 +9,50 @@ app_server <- function(input, output, session) { - rapbase::appLogger(session = session, msg = "Starting AblaNor application") + # Parameters that will remain throughout the session - registryName <- "ablanor" + registryName <- "data" mapOrgId <- ablanor::getNameReshId(registryName) - reshId <- rapbase::getUserReshId(session) - hospitalName <- ablanor::getHospitalName(registryName = registryName, - reshId = reshId, - shortName = FALSE, - newNames = TRUE) - userFullName <- rapbase::getUserFullName(session) - userRole <- rapbase::getUserRole(session) userOperator <- "Test Operatoresen" - author <- userFullName - # userOperator <- ? #@fixme + mapOrgIdMod <- mapOrgId %>% dplyr::rename(UnitId = id, orgname = name) + user <- rapbase::navbarWidgetServer2( + "ablanorWidget", "Ablanor", map_orgname = mapOrgIdMod, caller = packageName() + ) + shiny::observeEvent(user$role(), { + if (user$role() == "LU") { + shiny::showTab(inputId = "tabs", target = "Start") + shiny::hideTab(inputId = "tabs", target = "Utforsker") + shiny::hideTab(inputId = "tabs", target = "Datadump") + shiny::hideTab(inputId = "tabs", target = "Kodebok") + shiny::hideTab(inputId = "tabs", target = "Månedsrapporter") + shiny::showTab(inputId = "tabs", target = "Abonnement") + shiny::hideTab(inputId = "tabs", target = "Verktøy") + } + if (user$role() == "LC") { + shiny::showTab(inputId = "tabs", target = "Start") + shiny::showTab(inputId = "tabs", target = "Utforsker") + shiny::showTab(inputId = "tabs", target = "Datadump") + shiny::showTab(inputId = "tabs", target = "Kodebok") + shiny::showTab(inputId = "tabs", target = "Månedsrapporter") + shiny::showTab(inputId = "tabs", target = "Abonnement") + shiny::hideTab(inputId = "tabs", target = "Verktøy") + } + + # Hide tabs when role 'SC' + if (user$role() == "SC") { + shiny::showTab(inputId = "tabs", target = "Start") + shiny::showTab(inputId = "tabs", target = "Utforsker") + shiny::showTab(inputId = "tabs", target = "Datadump") + shiny::showTab(inputId = "tabs", target = "Kodebok") + shiny::hideTab(inputId = "tabs", target = "Månedsrapporter") + shiny::showTab(inputId = "tabs", target = "Abonnement") + shiny::showTab(inputId = "tabs", target = "Verktøy") + } + }) dataSets <- list( `Bruk og valg av data` = "info", @@ -48,37 +74,6 @@ app_server <- function(input, output, session) { `eProm 5 år. Rådata` = "followup5", `GKV (pasienterfaring) basis. Rådata` = "gkv") - if (userRole == "SC") { - dataSets <- c(dataSets, - list(`Proms-status. Rådata` = "proms", - `Patientlist. Rådata`= "patientlist")) - } - - - # Hide all tabs if LU -role - if (userRole == "LU") { - shiny::hideTab(inputId = "tabs", target = "Utforsker") - shiny::hideTab(inputId = "tabs", target = "Datadump") - shiny::hideTab(inputId = "tabs", target = "Kodebok") - shiny::hideTab(inputId = "tabs", target = "Månedsrapporter") - shiny::hideTab(inputId = "tabs", target = "Abonnement") - shiny::hideTab(inputId = "tabs", target = "Verktøy") - } - - - # Hide tabs when not role 'SC' - if (userRole != "SC") { - shiny::hideTab(inputId = "tabs", target = "Verktøy") - } - - # Hide tabs when role 'SC' - if (userRole == "SC") { - shiny::hideTab(inputId = "tabs", target = "Månedsrapporter") - shiny::hideTab(inputId = "tabs", target = "Abonnement") - - } - - contentDump <- function(file, type, userRole, reshId) { d <- ablanor::getDataDump(registryName = registryName, tableName = input$dumpDataSet, @@ -95,38 +90,40 @@ app_server <- function(input, output, session) { } - # widget - output$appUserName <- shiny::renderText(userFullName) - output$appOrgName <- shiny::renderText( - paste(hospitalName, userRole, sep = ", ")) - - # User info in widget - userInfo <- rapbase::howWeDealWithPersonalData(session, - callerPkg = "ablanor") - shiny::observeEvent(input$userInfo, { - shinyalert::shinyalert( - "Dette vet Rapporteket om deg:", userInfo, - type = "", imageUrl = "rap/logo.svg", - closeOnEsc = TRUE, closeOnClickOutside = TRUE, - html = TRUE, confirmButtonText = rapbase::noOptOutOk() - ) - }) - - - - # Start output$veiledning <- shiny::renderUI({ - rapbase::renderRmd( - system.file("veiledning.Rmd", package = "ablanor"), - outputType = "html_fragment", - params = list(title = "empty title", - author = author, - hospitalName = hospitalName, - tableFormat = "html", - reshId = reshId) - ) + if (is.null(user$org())) { + NULL + } else { + rapbase::renderRmd( + system.file("veiledning.Rmd", package = "ablanor"), + outputType = "html_fragment", + params = list(title = "empty title", + author = user$fullName(), + hospitalName = getHospitalName(registryName, user$org()), + tableFormat = "html", + reshId = user$org()) + ) + } }) + output$download_report <- shiny::downloadHandler( + filename = function() { + basename(tempfile(pattern = "veiledning", + fileext = paste0(".", input$format_report))) + }, + content = function(file) { + fn <- rapbase::renderRmd( + system.file("veiledning.Rmd", package = "ablanor"), + outputType = input$format_report, + params = list( + author = user$fullName(), + tableFormat = input$format_report, + reshId = user$org() + ) + ) + file.rename(fn, file) + } + ) # Utforsker @@ -161,8 +158,8 @@ app_server <- function(input, output, session) { ablanor::getPivotDataSet(setId = input$selectedDataSet, registryName = registryName, session = session, - reshId = reshId, - userRole = userRole) + reshId = user$org(), + userRole = user$role()) }) @@ -170,8 +167,8 @@ app_server <- function(input, output, session) { ablanor::getPivotDataSet(setId = input$selectedDataSet, registryName = registryName, session = session, - reshId = reshId, - userRole = userRole, + reshId = user$org(), + userRole = user$role(), singleRow = TRUE) }) @@ -196,7 +193,7 @@ app_server <- function(input, output, session) { if (length(input$isSelectAllVars) == 0) { NULL } else { - if (length(rvals$showPivotTable) == 0 | rvals$showPivotTable) { + if (length(rvals$showPivotTable) == 0 || rvals$showPivotTable) { shiny::h4(paste("Valgt datasett:", names(dataSets)[dataSets == input$selectedDataSet])) } else { @@ -245,8 +242,8 @@ app_server <- function(input, output, session) { ablanor::getPivotDataSet(setId = input$kbdTab, registryName = registryName, session = session, - reshId = reshId, - userRole = userRole, + reshId = user$org(), + userRole = user$role(), singleRow = TRUE) }) @@ -303,6 +300,8 @@ app_server <- function(input, output, session) { # Datadump # Datasets avaliable for download + + output$selectDumpSet <- shiny::renderUI({ dataSetsDump <- c("basereg", "pros", "mce", @@ -313,15 +312,13 @@ app_server <- function(input, output, session) { "gkv", "hendelse", "kodeboken") - if (userRole == "SC") { + if (user$role() == "SC") { dataSetsDump <- c(dataSetsDump, "proms", "patientlist", "friendlycentre", "mce_patient_data") } - - output$selectDumpSet <- shiny::renderUI({ htmltools::tagList( shiny::selectInput(inputId = "dumpDataSet", label = "Velg datasett:", @@ -340,7 +337,9 @@ app_server <- function(input, output, session) { fileext = ".csv")) }, content = function(file) { - contentDump(file, input$dumpFormat, userRole = userRole, reshId = reshId) + contentDump( + file, input$dumpFormat, userRole = user$role(), reshId = user$org() + ) } ) @@ -349,13 +348,15 @@ app_server <- function(input, output, session) { rapbase::renderRmd( system.file("AblaNor_local_monthly.Rmd", package = "ablanor"), outputType = "html_fragment", - params = list(author = author, - hospitalName = hospitalName, - tableFormat = "html", - reshId = reshId, - registryName = registryName, - userRole = userRole, - userOperator = userOperator) + params = list( + author = user$fullName, + hospitalName = ablanor::getHospitalName(registryName, user$org()), + tableFormat = "html", + reshId = user$org(), + registryName = registryName, + userRole = user$role(), + userOperator = userOperator + ) ) }) @@ -368,14 +369,16 @@ app_server <- function(input, output, session) { fn <- rapbase::renderRmd( system.file("AblaNor_local_monthly.Rmd", package = "ablanor"), outputType = input$formatReport, - params = list(author = author, - hospitalName = hospitalName, - tableFormat = input$formatReport, - reshId = reshId, - registryName = registryName, - userFullName = userFullName, - userRole = userRole, - userOperator = userOperator) + params = list( + author = user$fullName(), + hospitalName = getHospitalName(registryName, user$org()), + tableFormat = input$formatReport, + reshId = user$org(), + registryName = registryName, + userFullName = user$fullName(), + userRole = user$role(), + userOperator = userOperator + ) ) file.rename(fn, file) } @@ -389,7 +392,14 @@ app_server <- function(input, output, session) { newNames = TRUE) # Abonnement - subReports <- list( + subReports <- shiny::reactive(list( + "Veiledning" = list( + synopsis = "Veiledningsteksten for testformål", + fun = "reportProcessor", + paramNames = c("report", "outputType", "title", "orgId", "orgName"), + paramValues =c("veiledning", "pdf", "Veiledning", 999999, + "unknownHospital") + ), "Månedlige resultater" = list( synopsis = "Månedlige resultater sykehus/avdeling", fun = "reportProcessor", @@ -403,17 +413,24 @@ app_server <- function(input, output, session) { paramValues = c("local_monthly", "pdf", "Månedsresultater", - reshId, - hospitalName, - userFullName, - userRole) + 999999, + "unknownHospital", + "userFullName", + user$role()) + ) ) ) - rapbase::autoReportServer( - id = "ablanorSubscription", registryName = registryName, - type = "subscription", reports = subReports, orgs = orgs + subParamNames <- shiny::reactive(c("orgId", "orgName")) + subParamValues <- shiny::reactive(c(user$org(), user$orgName())) + + shiny::observe({ + rapbase::autoReportServer2( + id = "ablanorSubscription", registryName = "ablanor", + type = "subscription", paramNames = subParamNames, + paramValues = subParamValues, reports = subReports(), orgs = orgs, user = user ) + }) # Utsendelse disReports <- list( @@ -429,7 +446,7 @@ app_server <- function(input, output, session) { "pdf", "Månedsresultater", 999999, - userFullName) + "userFullName") ) ) @@ -439,21 +456,20 @@ app_server <- function(input, output, session) { disParamNames <- shiny::reactive(c("orgId", "outputType")) disParamValues <- shiny::reactive(c(org$value(), disFormat())) - rapbase::autoReportServer( - id = "ablanorDispatchment", registryName = registryName, + shiny::observe({ + rapbase::autoReportServer2( + id = "ablanorDispatchment", registryName = "ablanor", type = "dispatchment", org = org$value, paramNames = disParamNames, paramValues = disParamValues, reports = disReports, orgs = orgs, - eligible = (userRole == "SC") + user = user ) + }) + # Eksport - ## brukerkontroller - rapbase::exportUCServer("ablanorExport", registryName, - eligible = (userRole == "SC")) - ## veileding + rapbase::exportUCServer("ablanorExport", registryName) rapbase::exportGuideServer("ablanorExportGuide", registryName) # Brukerstatistikk - rapbase::statsServer("ablanorStats", registryName, - eligible = (userRole == "SC")) + rapbase::statsServer("ablanorStats", registryName) } diff --git a/R/app_ui.R b/R/app_ui.R index dd8e96f..c0fc9fb 100644 --- a/R/app_ui.R +++ b/R/app_ui.R @@ -22,18 +22,10 @@ app_ui <- function() { shiny::tabPanel( "Start", - shinyalert::useShinyalert(), - shiny::mainPanel( - width = 12, - shiny::htmlOutput("veiledning", inline = TRUE), - rapbase::appNavbarUserWidget( - user = shiny::uiOutput("appUserName"), - organization = shiny::uiOutput("appOrgName"), - addUserInfo = TRUE), - shiny::tags$head( - shiny::tags$link(rel = "shortcut icon", href = "rap/favicon.ico") + shiny::mainPanel( + shiny::htmlOutput("veiledning", inline = TRUE), + rapbase::navbarWidgetInput("ablanorWidget", selectOrganization = TRUE) ) - ) ), shiny::tabPanel( @@ -110,7 +102,6 @@ app_ui <- function() { shiny::navbarMenu( "Verktøy", - shiny::tabPanel( "Utsending", shiny::sidebarLayout( diff --git a/R/run_app.R b/R/run_app.R index 0f4feb7..bbf09a2 100644 --- a/R/run_app.R +++ b/R/run_app.R @@ -3,6 +3,10 @@ #' @return An object representing the Ablanor app #' @export -run_app <- function() { - shiny::shinyApp(ui = app_ui, server = app_server) +run_app <- function(browser = FALSE, logAsJson = FALSE) { + if (logAsJson) { + rapbase::loggerSetup() + } + + shiny::shinyApp(ui = app_ui, server = app_server, options = list(launch.browser = browser)) } diff --git a/dev/README.md b/dev/README.md new file mode 100644 index 0000000..05cf746 --- /dev/null +++ b/dev/README.md @@ -0,0 +1,3 @@ +# dev-mappa + +Inneholder diverse midlertidig kode for utvikling av applikasjon. diff --git a/dev/config/rapbaseConfig.yml b/dev/config/rapbaseConfig.yml new file mode 100644 index 0000000..0467be5 --- /dev/null +++ b/dev/config/rapbaseConfig.yml @@ -0,0 +1,116 @@ +## Configuration of the R package 'rapbase', yaml formatted +## May contain anything, but try to keep some sensible structure and tidyness + + +## R +r : + + # Dummy library path + libpath : + + # Activity logging + raplog: + archiveDir: logArchive + eolDays: 730 + target: db + key: raplog + + # Automated report data + autoReport: + target: db + key: autoreport + + # Staging data + staging: + target: db + key: staging + + # User data for testing purposes + testUser : + user : ttester + groups : rapbase + role : accessLevel + resh_id : '999999' + email: rapporteket@skde.no + full_name: Tore Tester + phone: '04050607' + + + # Scedule + schedule : + nocturnal : + startHour: 0 + endHour: 8 + funs : + - rapbase::runAutoReport + diurnal: + startHour: 8 + endHour: 24 + funs: + - rapbase::runBulletin + + +## Network +network : + + # Proxy server and port + proxy : + http : + port : + # http : http://dummy_proxy_hostname.no + # port : 8080 + # ip : 192.168.0.100 + + # email + smtp : + server : localhost + port : 2525 + sender : rapporteket@skde.no + +## GitHub +github : + + # Github organization + organization : Rapporteket + + # Dummy gist + gistId : + reportName : reportNameGistId + + # Dummy PAT + PAT : + githubUserName : PAT + + +## Database +db : + # Dummy config entry + nordummy: + host : dummy_db_hostname.no + name : dummy_db_name + user : dummy_db_username + pass : dummy_db_password + disp : dummy_display_name + + # For testing, on localhost + rapbase: + host : 127.0.0.1 + name : rapbase + user : rapbase + pass : rapbase + disp : ForTestingOnly + +## Access tree +accesstree: + file: accesstree.json + list: + unit: AccessUnits.UnitId + resh: AccessUnits.HealthUnitId + role: AccessUnits.ExtraData + parent: AccessUnits.ParentUnitId + database: AccessUnits.HasDatabase + external: AccessUnits.ExternalId + title: AccessUnits.Title + titlewithpath: AccessUnits.TitleWithPath + validfrom: AccessUnits.ValidFrom + validto: AccessUnits.ValidTo diff --git a/dev/dev.R b/dev/dev.R new file mode 100644 index 0000000..7bdf366 --- /dev/null +++ b/dev/dev.R @@ -0,0 +1,14 @@ +# Sys.setenv(R_LIBCURL_SSL_REVOKE_BEST_EFFORT=TRUE) +# dekoding av database-dump +# sship::dec("c://Users/ast046/Downloads/ablanor60c4616c4d0a.sql.gz__20241205_163003.tar.gz", keyfile = "p://.ssh/id_rsa") + +devtools::install("../rapbase/.", upgrade = FALSE) + +devtools::install(upgrade = FALSE) + +Sys.setlocale(locale = 'nb_NO.UTF-8') +source("dev/sysSetenv.R") + +Sys.setenv(MYSQL_HOST="localhost") # for mobilt kontor + +ablanor::run_app(browser = TRUE) diff --git a/dev/sysSetenv.R b/dev/sysSetenv.R new file mode 100644 index 0000000..41555b2 --- /dev/null +++ b/dev/sysSetenv.R @@ -0,0 +1,17 @@ + +Sys.setenv(FALK_EXTENDED_USER_RIGHTS="[{\"A\":80,\"R\":\"LU\",\"U\":4219765},{\"A\":80,\"R\":\"LC\",\"U\":4219765},{\"A\":80,\"R\":\"LC\",\"U\":700328}]") +Sys.setenv(MYSQL_DB_LOG="db_log") +Sys.setenv(MYSQL_DB_AUTOREPORT="db_autoreport") +Sys.setenv(MYSQL_DB_DATA="AblanorRapporteket") +Sys.setenv(MYSQL_HOST="db") +Sys.setenv(MYSQL_USER="root") +Sys.setenv(MYSQL_PASSWORD="root") +Sys.setenv(FALK_APP_ID="80") +Sys.setenv(FALK_USER_EMAIL="jesus@sky.no") +Sys.setenv(FALK_USER_FULLNAME="Arnie") +Sys.setenv(USERORGID="pilot") +Sys.setenv(SHINYPROXY_USERNAME="skkris") +Sys.setenv(SHINYPROXY_USERGROUPS="pilot") +Sys.setenv(SHINYPROXY_APPID="80") +Sys.setenv(R_RAP_INSTANCE="QAC") +Sys.setenv(R_RAP_CONFIG_PATH="dev/config") diff --git a/docker-compose_app.yml b/docker-compose_app.yml index d9d17d5..8c8d9d8 100644 --- a/docker-compose_app.yml +++ b/docker-compose_app.yml @@ -32,15 +32,40 @@ services: app: depends_on: - dev - image: rapporteket/ablanor:main + image: rapporteket/ablanor:poc volumes: - config:/app/R ports: - - "3008:3008" + - "3008:3838" restart: "no" environment: R_RAP_CONFIG_PATH: /app/R - R_RAP_INSTANCE: DEV + R_RAP_INSTANCE: QAC + USERFULLNAME: Tore Tester Container + SHINYPROXY_USERNAME: ttesterc + SHINYPROXY_USERGROUPS: "LC,LC,SC,LC" + USERORGID: "[1, 2, 3, 4]" + USEREMAIL: ttesterc@holigong.no + + rapadm: + depends_on: + - dev + image: rapporteket/rapadm:main + volumes: + - config:/app/R + ports: + - "3088:3838" + restart: "no" + environment: + R_RAP_CONFIG_PATH: /app/R + R_RAP_INSTANCE: QAC + USERFULLNAME: Tore Tester Container + SHINYPROXY_USERNAME: ttesterc + SHINYPROXY_USERGROUPS: "LC,LC,SC,LC,SC,SC" + USERORGID: "[1, 2, 3, 4, 5, 6]" + USEREMAIL: ttesterc@holigong.no + LANG: en_US.UTF-8 + LC_ALL: en_US.UTF-8 adminer: depends_on: diff --git a/inst/veiledning.Rmd b/inst/veiledning.Rmd index 5ddfa12..54c64f4 100644 --- a/inst/veiledning.Rmd +++ b/inst/veiledning.Rmd @@ -12,7 +12,6 @@ params: ## Rapporteket for AblaNor `r params$hospitalName` - ### Utforsker Denne siden inneholder en løsning som benytter R-pakken `rpivotTable`. Logget inn som lokal koordinator (LC-rolle) kan du laste inn datasett med ditt diff --git a/man/run_app.Rd b/man/run_app.Rd index 9543d83..94056ef 100644 --- a/man/run_app.Rd +++ b/man/run_app.Rd @@ -4,7 +4,7 @@ \alias{run_app} \title{Run the Ablanor Shiny Application} \usage{ -run_app() +run_app(browser = FALSE, logAsJson = FALSE) } \value{ An object representing the Ablanor app diff --git a/tests/testthat/test-app_server.R b/tests/testthat/test-app_server.R index 2220168..dd3038e 100644 --- a/tests/testthat/test-app_server.R +++ b/tests/testthat/test-app_server.R @@ -17,7 +17,9 @@ check_db <- function(is_test_that = TRUE) { withr::with_envvar( new = c( - "R_RAP_CONFIG_PATH" = tempdir() + "R_RAP_CONFIG_PATH" = tempdir(), + "FALK_EXTENDED_USER_RIGHTS" = "[{\"A\":80,\"R\":\"LC\",\"U\":1},{\"A\":80,\"R\":\"SC\",\"U\":2},{\"A\":81,\"R\":\"LC\",\"U\":2}]", + "FALK_APP_ID" = "80" ), code = { test_that("env vars needed for testing is present", {