Skip to content

Add validation for vector data/field mappings #170

@jwildfire

Description

@jwildfire

Extend validateSettings() to cover field/column mappings where setting_type=="vector" (which are currently being ignored).

Easy enough to brute force it was a loop (like the one below), but maybe there's a more elegant way?

checkMultipleFieldSettings <-  function(fieldKey, settings, data){
  stopifnot(typeof(fieldKey)=="list", typeof(settings)=="list")
  
  allValues <- getSettingValue(key=fieldCheck$key,settings=settings)

  stopifnot(typeof(allValues)=="list")
  
  allKeys<-list()
  
  for(i in 1:length(allValues)){
    newFieldKey<-fieldKey
    newFieldKey[[length(fieldKey)+1]]<-i
    allKeys[[i]]<-newfieldKey
  }
  
  checks <-allKeys %>% purrr::map(checkFieldSettings, settings=settings, data=data)

  return(checks)
  
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions