-
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.
Merge pull request #35 from Rapporteket/containing
Containing
- Loading branch information
Showing
19 changed files
with
545 additions
and
231 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Publish Docker image | ||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '0 21 * * 6' # run every Saturday at 21 | ||
|
||
jobs: | ||
push_to_registries: | ||
name: Push Docker image to docker hub | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_NAME: ${{ github.repository }} | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
- name: R setup | ||
uses: r-lib/actions/setup-r@v2 | ||
- name: Build package (tarball) | ||
run: R CMD build . | ||
- name: Lint Dockerfile | ||
uses: brpaz/hadolint-action@master | ||
with: | ||
dockerfile: "Dockerfile" | ||
- name: Prepare tags | ||
id: docker_meta | ||
uses: docker/metadata-action@v3.6.2 | ||
with: | ||
images: ${{ env.IMAGE_NAME }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Push to Docker Hub | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM rapporteket/base-r:4.2.1 | ||
|
||
LABEL maintainer "Are Edvardsen <are.edvardsen@helse-nord.no>" | ||
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 | ||
|
||
EXPOSE 3008 | ||
|
||
CMD ["R", "-e", "options(shiny.port = 3008,shiny.host = \"0.0.0.0\"); ablanor::run_app()"] |
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 |
---|---|---|
@@ -0,0 +1,159 @@ | ||
#' Client (ui) for the Ablanor app | ||
#' | ||
#' @return An shiny app ui object | ||
#' @export | ||
|
||
app_ui <- function() { | ||
shiny::addResourcePath("rap", system.file("www", package = "rapbase")) | ||
reg_title <- "AblaNor" | ||
|
||
ui <- shiny::tagList( | ||
shiny::navbarPage( | ||
title = shiny::div( | ||
shiny::a( | ||
shiny::includeHTML( | ||
system.file("www/logo.svg", package = "rapbase") | ||
) | ||
), | ||
reg_title), | ||
windowTitle = reg_title, | ||
theme = "rap/bootstrap.css", | ||
id = "tabs", | ||
|
||
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::tabPanel( | ||
"Utforsker", | ||
shiny::fluidRow( | ||
shiny::column(6, shiny::uiOutput("selectDataSet")), | ||
shiny::column(6, shiny::uiOutput("selectVars")) | ||
), | ||
shiny::fluidRow( | ||
shiny::column(12, shiny::uiOutput("togglePivotSurvey")) | ||
), | ||
shiny::fluidRow( | ||
shiny::column(12, rpivotTable::rpivotTableOutput("pivotSurvey")) | ||
) | ||
), | ||
|
||
shiny::tabPanel( | ||
"Kodebok", | ||
shiny::sidebarLayout( | ||
shiny::sidebarPanel(shiny::uiOutput("kbControl")), | ||
shiny::mainPanel(shiny::htmlOutput("kbdData")) | ||
) | ||
), | ||
|
||
shiny::tabPanel( | ||
"Datadump", | ||
shiny::sidebarLayout( | ||
shiny::sidebarPanel( | ||
width = 4, | ||
shiny::selectInput("dumpDataSet", "Velg datasett:", | ||
c("basereg", | ||
"friendlycentre", | ||
"mce", | ||
"patientlist", | ||
"pros", | ||
"rand12", | ||
"followup", | ||
"pros_patient_followup", | ||
"kodeboken")), | ||
shiny::dateRangeInput( | ||
"dumpDateRange", "Velg periode:", | ||
start = lubridate::ymd(Sys.Date()) - lubridate::years(1), | ||
end = Sys.Date(), separator = "-", | ||
weekstart = 1 | ||
), | ||
shiny::radioButtons("dumpFormat", "Velg filformat:", | ||
choices = c("csv", "xlsx-csv")), | ||
shiny::downloadButton("dumpDownload", "Hent!") | ||
), | ||
shiny::mainPanel( | ||
shiny::htmlOutput("dataDumpInfo") | ||
) | ||
) | ||
), | ||
|
||
shiny::tabPanel( | ||
"Månedsrapporter", | ||
shiny::sidebarLayout( | ||
shiny::sidebarPanel( | ||
shiny::radioButtons("formatReport", | ||
"Format for nedlasting", | ||
list(PDF = "pdf", HTML = "html"), | ||
inline = FALSE), | ||
shiny::downloadButton("downloadReport", "Last ned!"), | ||
width = 2 | ||
), | ||
shiny::mainPanel( | ||
shiny::htmlOutput("maanedligRapport", inline = TRUE) | ||
) | ||
) | ||
), | ||
|
||
shiny::tabPanel( | ||
"Abonnement", | ||
shiny::sidebarPanel( | ||
rapbase::autoReportFormatInput("ablanorSubscription"), | ||
rapbase::autoReportInput("ablanorSubscription") | ||
), | ||
shiny::mainPanel( | ||
rapbase::autoReportUI("ablanorSubscription") | ||
) | ||
), | ||
|
||
shiny::navbarMenu( | ||
"Verktøy", | ||
|
||
shiny::tabPanel( | ||
"Utsending", | ||
shiny::sidebarLayout( | ||
shiny::sidebarPanel( | ||
rapbase::autoReportFormatInput("ablanorDispatchment"), | ||
rapbase::autoReportOrgInput("ablanorDispatchment"), | ||
rapbase::autoReportInput("ablanorDispatchment") | ||
), | ||
shiny::mainPanel( | ||
rapbase::autoReportUI("ablanorDispatchment") | ||
) | ||
) | ||
), | ||
|
||
shiny::tabPanel( | ||
"Eksport", | ||
shiny::sidebarLayout( | ||
shiny::sidebarPanel( | ||
rapbase::exportUCInput("ablanorExport") | ||
), | ||
shiny::mainPanel( | ||
rapbase::exportGuideUI("ablanorExportGuide") | ||
) | ||
) | ||
), | ||
|
||
shiny::tabPanel( | ||
"Bruksstatistikk", | ||
shiny::sidebarLayout( | ||
shiny::sidebarPanel(rapbase::statsInput("ablanorStats")), | ||
shiny::mainPanel(rapbase::statsUI("ablanorStats")) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#' Run the Ablanor Shiny Application | ||
#' | ||
#' @return An object representing the Ablanor app | ||
#' @export | ||
|
||
run_app <- function() { | ||
shiny::shinyApp(ui = app_ui, server = app_server) | ||
} |
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
Oops, something went wrong.