Skip to content

Commit

Permalink
Merge pull request #44 from Rapporteket/v1.11.4
Browse files Browse the repository at this point in the history
V1.11.4
  • Loading branch information
areedv authored Oct 8, 2020
2 parents a52492c + ef30de4 commit 3aa3170
Show file tree
Hide file tree
Showing 57 changed files with 646 additions and 491 deletions.
4 changes: 4 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
linters: with_defaults(
object_name_linter(c("camelCase", "snake_case")),
cyclocomp_linter(complexity_limit = 25),
line_length_linter(80))
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: rapbase
Type: Package
Title: Base Functions and Resources for Rapporteket
Version: 1.11.3.9000
Date: 2020-10-06
Version: 1.11.4
Date: 2020-10-08
Authors@R: c(
person(given = "Are",
family = "Edvardsen",
Expand Down Expand Up @@ -34,16 +34,16 @@ Imports:
knitr,
magrittr,
markdown,
purrr,
readr,
remotes,
RMariaDB,
sendmailR,
shiny,
utils,
withr,
yaml,
purrr
RoxygenNote: 7.0.2
yaml
RoxygenNote: 7.1.1
URL: http://github.com/Rapporteket/rapbase
BugReports: http://github.com/Rapporteket/rapbase/issues
Suggests:
Expand Down
9 changes: 6 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

export(.getFun)
export(.testAutoReport)
export(HalloRapporteket)
export(LoadRegData)
export(MakeMessage)
export(PushGist)
export(RunNoweb)
export(appNavbarUserWidget)
export(createAutoReport)
export(deleteAutoReport)
Expand All @@ -26,18 +23,24 @@ export(getUserName)
export(getUserPhone)
export(getUserReshId)
export(getUserRole)
export(halloRapporteket)
export(howWeDealWithPersonalData)
export(installGithubPackage)
export(isPkgRapReg)
export(isRapContext)
export(loadRegData)
export(makeMessage)
export(makeRunDayOfYearSequence)
export(makeUserSubscriptionTab)
export(makeUserSubscriptionTabV2)
export(makeUserSubscriptionTab_v2)
export(noOptOutOk)
export(pushGist)
export(rapCloseDbConnection)
export(rapOpenDbConnection)
export(readAutoReportData)
export(runAutoReport)
export(runNoweb)
export(runShinyApp)
export(selectByOrganization)
export(selectByOwner)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# rapbase 1.11.4

* clean-up code also deprecating some function for v1.12

# rapbase 1.11.3

* Remove rJava dependency
Expand Down
20 changes: 11 additions & 9 deletions R/AppNavbarUserWidget.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#' Create widget for registry apps at Rapporteket
#'
#'
#' Provides a widget-like information and utility block to be applied to all
#' registry apps at Rapporteket. Contains the user name, organization and
#' logout/exit as hyperlinked text.
#'
#'
#' Normally, user information will be be provided through the session parameter
#' and hence this will have to be provided from the server. The "rendering" of
#' this info must hence be done within a layout element at the client such as
Expand All @@ -19,18 +19,19 @@
#' output$appUserOrg <- renderText(getUserReshId(session))
#' ...
#' }
#'
#'
#' ui <- tagList(
#' navbarPage(
#' ...,
#' tabPanel(...,
#' appNavbarUserWidget(user = uiOutput(appUserName), organization = textOutput(appUserOrg))
#' appNavbarUserWidget(user = uiOutput(appUserName),
#' organization = textOutput(appUserOrg))
#' ),
#' ...
#' )
#' )
#' }
#'
#'
#' @param user String providing the name of the user
#' @param organization String providing the organization of the user
#' @param addUserInfo Logical defining wether a user data pop-up is to be part
Expand All @@ -45,7 +46,7 @@
appNavbarUserWidget <- function(user = "Undefined person",
organization = "Undefined organization",
addUserInfo = FALSE) {

if (addUserInfo) {
userInfo <- shiny::tags$a(
id = "userInfo",
Expand All @@ -55,15 +56,16 @@ appNavbarUserWidget <- function(user = "Undefined person",
} else {
userInfo <- character()
}

txtWidget <-
paste0("var header = $('.navbar> .container-fluid');\n",
"header.append('<div class=\"navbar-brand\" style=\"float:right;vertical-align:super;font-size:65%\">",
"header.append('<div class=\"navbar-brand\" ",
"style=\"float:right;vertical-align:super;font-size:65%\">",
userInfo,
user,
organization,
"</div>');\n",
"console.log(header)")

shiny::tags$script(shiny::HTML(txtWidget))
}
Loading

1 comment on commit 3aa3170

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/AutoReportFuns.R:565:1: style: Variable and function name style should be camelCase or snake_case.

makeUserSubscriptionTab_v2 <- function(session, map_resh_name = NULL) {
^~~~~~~~~~~~~~~~~~~~~~~~~~

R/AutoReportFuns.R:608:7: style: Variable and function name style should be camelCase or snake_case.

l$Mottakere <- purrr::map_chr(l$Mottakere, function(x) {
      ^~~~~~~~~

R/AutoReportFuns.R:610:7: style: Variable and function name style should be camelCase or snake_case.

l$Avdeling <- purrr::map_chr(l$Avdeling, function(x) x)
      ^~~~~~~~

R/AutoReportFuns.R:612:9: style: Variable and function name style should be camelCase or snake_case.

l$Avdeling <- map_resh_name$Sykehusnavn[match(as.numeric(l$Avdeling),
        ^~~~~~~~

R/LoadRegData.R:17:1: style: Variable and function name style should be camelCase or snake_case.

LoadRegData <- function(registryName, query, dbType = "mysql") {
^~~~~~~~~~~

R/LoadRegData.R:28:5: warning: local variable ‘tmp’ assigned but may not be used

tmp <- DBI::dbClearResult(res)
    ^~~

R/MakeMessage.R:18:1: style: Variable and function name style should be camelCase or snake_case.

MakeMessage <- function(story, message, newLine = TRUE, newPara = FALSE,
^~~~~~~~~~~

R/RapporteketDbConnection.R:33:5: warning: local variable ‘tmp’ assigned but may not be used

tmp <- DBI::dbExecute(con, "SET NAMES utf8;")
    ^~~

tests/testthat/test-shinySessionInfo.R:14:22: style: Variable and function name style should be camelCase or snake_case.

shinySession$request$HTTP_ROLE <- "LC"
                     ^~~~~~~~~

tests/testthat/test-userInfo-helper-functions.R:40:22: style: Variable and function name style should be camelCase or snake_case.

shinySession$request$HTTP_ROLE <- "LC"
                     ^~~~~~~~~

tests/testthat/test-userInfo-helper-functions.R:41:22: style: Variable and function name style should be camelCase or snake_case.

shinySession$request$HTTP_EMAIL <- "user1@nowhere.no"
                     ^~~~~~~~~~

tests/testthat/test-userInfo-helper-functions.R:42:22: style: Variable and function name style should be camelCase or snake_case.

shinySession$request$HTTP_FULLNAME <- "T Test"
                     ^~~~~~~~~~~~~

tests/testthat/test-userInfo-helper-functions.R:43:22: style: Variable and function name style should be camelCase or snake_case.

shinySession$request$HTTP_PHONE <- "04050607"
                     ^~~~~~~~~~

tests/testthat/test-userInfo.R:63:22: style: Variable and function name style should be camelCase or snake_case.

shinySession$request$HTTP_ROLE <- "LC"
                     ^~~~~~~~~

Please sign in to comment.