Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve typesetting, less hyphenation... #126

Merged
merged 6 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')

- name: Install dependencies
run: |
install.packages(c("remotes"))
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install unmet sys deps
run: |
sudo apt update
sudo apt install -y --no-install-recommends libcurl4-openssl-dev libgit2-dev
sudo apt install -y --no-install-recommends libcurl4-openssl-dev libgit2-dev libharfbuzz-dev libfribidi-dev

- uses: r-lib/actions/setup-r@v2

Expand All @@ -39,6 +39,13 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')

- name: Install dependencies
run: |
install.packages(c("remotes", "devtools"))
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# rapbase 1.23.0

* Added latex package microtype to to report template to for better printing and less hyphenation in pdf reports ([#123](https://github.com/Rapporteket/rapbase/pull/123))
* Added database as an optional log backend and function for (scheduled) clean of logs ([#112](https://github.com/Rapporteket/rapbase/pull/112))
* For logging to a database backend format set to json ([#120](https://github.com/Rapporteket/rapbase/pull/120))
* Reorganized and consolidated R files, removed deprecated and unused function and applied minor fixes to function flaws ([#121](https://github.com/Rapporteket/rapbase/pull/121))
Expand Down
2 changes: 1 addition & 1 deletion R/autoReport.R
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ findNextRunDate <- function(runDayOfYear,
}

# special case if out of max range and only one run day defined (yearly)
if (baseDayNum >= max(runDayOfYear) | length(runDayOfYear) == 1) {
if (baseDayNum >= max(runDayOfYear) || length(runDayOfYear) == 1) {
# next run will be first run in day num vector
nextDayNum <- min(runDayOfYear)
} else {
Expand Down
3 changes: 1 addition & 2 deletions R/dbConnection.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ rapOpenDbConnection <- function(registryName, dbType = "mysql") {
)
# ensure utf8 encoding
invisible(DBI::dbExecute(con, "SET NAMES utf8;"))
}
else if (dbType == "mssql") {
} else if (dbType == "mssql") {
stop("Use of MSSQL is no longer supported. Exiting")
}

Expand Down
2 changes: 1 addition & 1 deletion R/fireInTheHole.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fireInTheHole <- function(flipPeriod = FALSE) {
hour <- as.POSIXlt(Sys.time())$hour
conf <- getConfig(fileName = "rapbaseConfig.yml")

if (hour >= conf$r$schedule$nocturnal$startHour &
if (hour >= conf$r$schedule$nocturnal$startHour &&
hour < conf$r$schedule$nocturnal$endHour) {
night <- TRUE
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/userAttribute.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ userInfo <- function(entity, shinySession = NULL, devContexts = c("DEV"),
phone <- d$phone
}

if (context %in% testContexts | context %in% prodContexts) {
if (context %in% testContexts || context %in% prodContexts) {
if (is.null(shinySession)) {
stop("Session information is empty!. Cannot do anything")
}
Expand Down
10 changes: 5 additions & 5 deletions inst/autoReportGuide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ date: '`r format(Sys.time(), "%d. %B %Y")`'

## Veiledning
```{r, echo=FALSE, results='asis'}
if(params$type %in% c("dispatchment", "bulletin")) {
if (params$type %in% c("dispatchment", "bulletin")) {
cat(paste("Her kan det settes opp rutinemessig produksjon og utsending av",
"resultater til én eller flere mottakere per epost."))
} else {
Expand All @@ -25,7 +25,7 @@ Fra menyen til venstre

1. hvis aktuelt, velg filformatet `r shiny::icon("file-pdf")` på rapporten,
```{r, echo=FALSE, results='asis'}
if(params$type %in% c("dispatchment", "bulletin")) {
if (params$type %in% c("dispatchment", "bulletin")) {
t <- shiny::HTML("1. angi datakilden",
as.character(shiny::icon("database")),
"som skal benyttes,")
Expand All @@ -36,7 +36,7 @@ if(params$type %in% c("dispatchment", "bulletin")) {
1. velg hvor hyppig `r shiny::icon("clock")` rapporten skal sendes ut,
1. om nødvendig, endre dato for første utsending `r shiny::icon("calendar")`
```{r, echo=FALSE, results='asis'}
if(params$type %in% c("dispatchment", "bulletin")) {
if (params$type %in% c("dispatchment", "bulletin")) {
t <- shiny::HTML("1. angi epostadresse",
as.character(shiny::icon("at")),
"til mottaker av rapporten og trykk",
Expand All @@ -49,7 +49,7 @@ if(params$type %in% c("dispatchment", "bulletin")) {

Når alt er klart trykk `r shiny::icon("save")` for å aktivere utsendingen. Oppføringen vil da vises i tabellen. Trykk `r shiny::icon("trash")` til høyre i tabellen for å slette en utsending. Aktive utsendinger kan endres ved å trykke på `r shiny::icon("edit")` til høyre i tabellen. Utsendingen vil da slettes og flyttes over i menyen til venstre.
```{r, echo=FALSE, results='asis'}
if(params$type %in% c("dispatchment", "bulletin")) {
if (params$type %in% c("dispatchment", "bulletin")) {
cat(paste("Ved etablering eller endring av en utsending kan mottakere",
"slettes ved å angi aktuell epostadresse og trykke på",
as.character(shiny::icon("minus-square"))))
Expand All @@ -58,7 +58,7 @@ if(params$type %in% c("dispatchment", "bulletin")) {


```{r, echo=FALSE, results='asis'}
if(params$type %in% c("dispatchment", "bulletin")) {
if (params$type %in% c("dispatchment", "bulletin")) {
cat(paste("### Lurt å tenke over\n",
"Alle utsendinger skjer per epost og det betyr at rapportene som",
"sendes ut __ikke__ skal inneholde person- og helseopplysninger.",
Expand Down
2 changes: 1 addition & 1 deletion inst/statsGuide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ Tekst som angir (R) konteksten for _call_. Verdien "R_GlobalEnv" betyr i praksis


## Ytterligerer informasjon
Ved behov for ytterligere informasjon bør man i første omgang ta kontakt med egen statistiker, altså den eller de som er sanvarlig for utvikling av registerets innhold på Rapporteket. [SKDE](mailto:rapporteket@helse-nord.no) kan i mange tilfeller også bistå om nødvendig.
Ved behov for ytterligere informasjon bør man i første omgang ta kontakt med egen statistiker, altså den eller de som er sanvarlig for utvikling av registerets innhold på Rapporteket. [SKDE](mailto:rapporteket@helse-nord.no) kan i mange tilfeller også bistå om nødvendig.
3 changes: 3 additions & 0 deletions inst/template/default.latex
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
marginparsep=2em%
]{geometry}

% Unngå ord-deling
\usepackage{microtype}

% Oppsett av fonter
\usepackage[defaultsans]{lato}
\renewcommand{\familydefault}{\sfdefault}
Expand Down