Skip to content

Commit 5c3ed9a

Browse files
committed
adding experimental shiny editor mode in model
1 parent 20b5b0b commit 5c3ed9a

File tree

4 files changed

+97
-3
lines changed

4 files changed

+97
-3
lines changed

R/geoflow_contact.R

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ geoflow_contact <- R6Class("geoflow_contact",
3838
#TODO manage these allowed key values in class definitions (eg. geoflow_format)
3939
allowedKeyValuesFor = list(
4040
identifiers = c("id", "orcid")
41-
)
41+
),
42+
shinyEditorMode = "creation"
4243
),
4344
public = list(
4445
#' @field id contact identifier
@@ -77,6 +78,19 @@ geoflow_contact <- R6Class("geoflow_contact",
7778
#'@description Initializes a \link{geoflow_contact} object
7879
initialize = function(){},
7980

81+
#'@description Set mode for geoflow-shiny
82+
#'@param mode mode
83+
setShinyEditorMode = function(mode = c("creation", "edition")){
84+
mode = match.arg(mode)
85+
private$shinyEditorMode = mode
86+
},
87+
88+
#'@description Get mode for geoflow-shiny
89+
#'@return the shiny editor mode
90+
getShinyEditorMode = function(){
91+
return(private$shinyEditorMode)
92+
},
93+
8094
#'@description Retrieves keys allowed for a given tabular field name. eg. "Identifier"
8195
#'@param field field name
8296
#'@return the list of valid keys for the field considered

R/geoflow_entity.R

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ geoflow_entity <- R6Class("geoflow_entity",
2222
descriptions = c("abstract", "purpose", "credit", "info", "edition", "status", "maintenance"),
2323
spatialCoverage = c("ewkt", "wkt", "srid"),
2424
formats = c("resource","distribution")
25-
)
25+
),
26+
shinyEditorMode = "creation"
2627
),
2728
public = list(
2829
#'@field identifiers entity identifiers
@@ -72,6 +73,19 @@ geoflow_entity <- R6Class("geoflow_entity",
7273
initialize = function(){
7374
},
7475

76+
#'@description Set mode for geoflow-shiny
77+
#'@param mode mode
78+
setShinyEditorMode = function(mode = c("creation", "edition")){
79+
mode = match.arg(mode)
80+
private$shinyEditorMode = mode
81+
},
82+
83+
#'@description Get mode for geoflow-shiny
84+
#'@return the shiny editor mode
85+
getShinyEditorMode = function(){
86+
return(private$shinyEditorMode)
87+
},
88+
7589
#'@description Retrieves keys allowed for a given tabular field name. eg. "Identifier"
7690
#'@param field field name
7791
#'@return the list of valid keys for the field considered

man/geoflow_contact.Rd

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/geoflow_entity.Rd

Lines changed: 35 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)