Skip to content

Commit 4727369

Browse files
Merge pull request #80 from HenriKajasilta/icossites
ICOS sites and small fixes
2 parents a0e3ad0 + c34fec6 commit 4727369

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

.RData

-65.9 MB
Binary file not shown.

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Imports:
3333
zip
3434
Encoding: UTF-8
3535
LazyData: true
36-
RoxygenNote: 7.2.0
36+
RoxygenNote: 7.3.3
3737
URL: https://github.com/PecanProject/fieldactivity
3838
BugReports: https://github.com/PecanProject/fieldactivity/issues
3939
Suggests:

R/app_server.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ app_server <- function(input, output, session) {
7474

7575
updateSelectInput(session, "site", choices = site_choices, selected = auth_result$user)
7676

77+
} else if (auth_result$user == "icos_agri_user") {
78+
79+
shinyjs::enable("site")
80+
shinyjs::show("site")
81+
# Subset of site choices for the third user
82+
site_choices <- sites[grepl("icos-agri", sites$site_type),]$site
83+
84+
updateSelectInput(session, "site", choices = site_choices, selected = auth_result$user)
85+
7786
} else {
7887

7988
updateSelectInput(session, "site", selected = auth_result$user)

R/utils_global.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ date_format_display <- "%d/%m/%Y"
1010
# see: “Paths hard-coded in R code”
1111
sites_file_path <- function() system.file("extdata", "FOsites.csv",
1212
package = "fieldactivity")
13-
sites <- read.csv(sites_file_path())
13+
sites <- read.csv(sites_file_path(), na.strings = c("", "NaN", "NULL"))
1414
# converts block info from csv (e.g. "[0;1]") to vectors of strings ("0" "1")
1515
blocks_to_vector <- function(x) strsplit(substr(x, start = 2, stop = nchar(x)-1), ";")
1616
sites$blocks <- sapply(sites$blocks, blocks_to_vector)

dev/database.sqlite

-76 KB
Binary file not shown.

inst/extdata/FOsites.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,8 @@ Hoja,Svensk Kolinlagring Site,[18A;18C;18E;29A]
123123
Otaniemi,CO-CARBON,[Old lawn;New lawn]
124124
Viikki,SMEAR-Agri,[Alaniitty 1;Alaniitty 2;Keski-hakala]
125125
Hauho,Lantmännen Site,[1]
126+
Gebesee,icos-agri,[ec]
127+
Selhausen,icos-agri,[ec]
128+
Lonzee,icos-agri,[ec]
129+
Grignon,icos-agri,[ec]
130+
Cioffi,icos-agri,[ec]

0 commit comments

Comments
 (0)