# Data Wrangling (DW) configuration
MC:
  module:
    type: "DW"
    # internal R Object: module ID used in deployment
    depends:
      id_ASM: "ASM"
      id_UD:  "UD"
  # Controls what is shown in the compact ui mode: DW_ui_compact
  compact:
    code:    TRUE
    preview: TRUE
    clip:    TRUE
  reporting:
    enabled: TRUE
    priority: 1
  notifications:
    new_dw_element: "Added element: ===ACTION=== (===DESC===)"
    del_dw_element: "Removed element: ===ACTION=== (===DESC===)"
  tooltips:
    # Set to FALSE to disable tool tips for this module
    include:              TRUE
    show_code:            "Show data wrangling code"
    dw_elements:          "Current wrangling elements"
  labels:
    tab_main:             "Wrangle"
    tab_code:             "Code"
    add_element:          "Add Operation/Action"
    select_dw_views:      "Current data view"
    fds_filter_column:    "Filter by Column"
    fds_filter_operator:  "Condition"
    fds_filter_rhs:       "Matching"
    fds_mutate_column:    "New or current column to alter"
    fds_mutate_rhs:       "New Value"
    fds_rename_column:    "Curret Column"
    fds_rename_rhs:       "New Name"
    fds_group_column:     "Columns to group"
    fds_longer_column:    "Columns to make longer"
    fds_longer_names:     "New column to contain names"
    fds_longer_values:    "New column to contain values"
    fds_wider_names:      "Column with names"
    fds_wider_values:     "Column with values"
    new_dw:               "New"
    del_dw:               "Delete"
    save_dw:              "Save"
    copy_dw:              "Copy"
    clip_dw:              "Code"
    ungroup_data:         "Removing current grouping"
    keep_onerow:          "Keep first row in current grouping"
    no_dataset:           "No dataset available to wrangle. You need to load a dataset to use this module."
    no_dw_elements:       "No data wrangling elements defined yet"
    busy:
      dv_update:  "Updating data views. Please be patient..."
  errors:
    fds_filter_column:    "Filter column not specified."
    fds_filter_operator:  "Filter condition not specified."
    fds_filter_rhs:       "Filter RHS not specified."
    fds_mutate_column:    "Mutate column not specified."
    fds_mutate_rhs:       "Mutate RHS not specified."
    fds_rename_column:    "Column to rename not specified."
    fds_rename_rhs:       "New column name not specified."
    fds_group_column:     "No columns to group specified."
    fds_select_column:    "You must select at least one column to keep."
    fds_longer_column:    "You must select at least one column to make longer."
    fds_longer_names:     "You must supply a column for the names of the new longer dataset"
    fds_longer_values:    "You must supply a column for the values of the new longer dataset"
    fds_wider_names :     "You must select a column with the names."
    fds_wider_value s:    "You must select a column with the values."
    current_key:          "Short description"
    current_key_empty:    "The data view description field cannot be empty"
    unknown_action:       "The selection action is not supported."
    no_rows:              "There are no rows in the data set."
    element_not_added:    "Unable to add the data wrangling element:"
    fix_bad_element:      "There is a bad element in the data wrangling chain,\nyou need to fix that before adding new elements"
  operators:
    # Do not change the type or rop. Only modify the text element
    - type: "factor"
      text: "is one of"
      rop:  "%in%"
    - type: "factor"
      text: "is not"
      rop:  "!%in%"
    - type: "not_factor"
      text: "is within the range"
      rop:  "within"
    - type: "not_factor"
      text: "is equal to"
      rop:  "=="
    - type: "not_factor"
      text: "is not equal to"
      rop:  "!="
  actions:
    filter:
      choice:  "Filter"
      subtext: "Filter data"
    mutate:
      choice:  "Alter"
      subtext: "Create new column or change existing column"
    rename:
      choice:  "Rename"
      subtext: "Rename column"
    group:
      choice:  "Group"
      subtext: "Group subsequent operations by columns"
    ungroup:
      choice:  "Ungroup"
      subtext: "Removing groping"
    longer:
      choice:  "Elongate"
      subtext: "Make Longer: rows to columns"
    wider:
      choice:  "Widen"
      subtext: "Make Wider: columns to rows"
    onerow:
      choice:  "First Row"
      subtext: "Keep only first row of grouped data"
    select:
      choice:  "Select"
      subtext: "Choose columns to keep"
  formatting:
    # dimensions of the table preview in pixels
    preview:
      width:  800
      height: 400
    # Dimensions of the table with the data wrangling elements
    dw_elements:
      width:  600
      height: 200
    current_key:
      width: 300
    code:
      width:  800
      height: 300
    # Button sizes from actionBttn (shinyWidgets)
    # xs,sm, md, lg.
    button_dw_del:
      size: "sm"
      block: TRUE
      tooltip: "Delete the current data view."
      tooltip_position: "right"
    button_dw_clip:
      size: "sm"
      block: TRUE
      tooltip: "Copy code to generate current data view to the clipboard."
      tooltip_position: "right"
    select_dw_views:
      width: 200
    button_dw_save:
      size: "sm"
      block: TRUE
      tooltip: "Save changes to data view name"
      tooltip_position: "right"
    button_dw_copy:
      size: "sm"
      block: TRUE
      tooltip: "Copy current data view to a new data view."
      tooltip_position: "right"
    button_dw_new:
      size: "sm"
      block: TRUE
      tooltip: "Create a new empty data view."
      tooltip_position: "right"
    button_dw_add_element:
      size: "sm"
      block: TRUE
  code: # module specific code options
    readOnly: TRUE
    mode:     r
    packages: ["dplyr", "tidyr"]
    # The preamble goes before the section of generated code for this module
    # in the export script that is generated on save.
    preamble: |-
      # Data wrangling ----------------------------------------------------------
  # Name of the data set after wrangling it should be different than the value
  # in the UD section
  ds_object_name: "DW_myDS"
