#' get Farm Supply details activity list
#' @param activitySel Crops, Cereals, Activities, anyThing, Oilseeds, Crop aggregates, Aggregates
#' @param dimdef_activity
#' @return supply_activity_list
#'

get_activitySel <- function(activitySel = "Activities", dimdef_activity) {
  supply_activity_list <- dimdef_activity %>% filter(grepl(activitySel, sel))
  return(supply_activity_list)
}


#' get sel
#' @param dimdef_activity values of sel
#'
#' @return vector
#' @export

sel_list <- function(dimdef_activity = dimdef_activity){
  get_sel <- dimdef_activity %>% select(sel) %>% distinct(.keep_all = TRUE)
  #remove square brackets from a string vector
  s <- gsub("\\[|\\]", "",get_sel$sel)
  #remove empty space after comma
  s <- gsub(", ", ",", s, fixed = TRUE)
  #
  s <-unique(unlist(strsplit(as.character(s), ',')))

  return(s)

}