# https://www.glyphicons.com/sets/basic/
#General formods (FM) configuration across modules
FM:
  include:
    # This is where you can put files to include files in the working directory
    # of the app. For the files listed below you shouldn't change the 'dest'
    # portion but you can change the source to use custom report templates.
    # If relative paths are used they will be relative to
    # the user directory (either the temp formods directory running in shiny
    # or the top level of the zip file structure when saving the app state).
    files:
    - file:
        source: 'file.path(system.file(package="onbrand"), "templates", "report.docx")'
        dest:   'file.path("config","report.docx")'
    - file:
        source: 'file.path(system.file(package="onbrand"), "templates", "report.pptx")'
        dest:   'file.path("config","report.pptx")'
    - file:
        source: 'file.path(system.file(package="onbrand"), "templates", "report.yaml")'
        dest:   'file.path("config","report.yaml")'
  # Some features (e.g. copy to clipboard) don't work when deployed
  deployed: FALSE
  #General code options for the modules
  code:
    theme:           "vibrant_ink"
    showLineNumbers: TRUE
    # File name of the R script to contain generation code
    gen_file: run_analysis.R
    # This is the preamble used in script generation. It goes on the
    # top. Feel free to add to it if you need to. Note that packages should be
    # listed in the packages section at the same level.
    gen_preamble: |-
      # formods automated output ------------------------------------------------
      # https://formods.ubiquity.tools/
      rm(list=ls())
    # Each module should have a packages section that lists the packages
    # needed for code generated for that module.
    packages: ["onbrand", "writexl"]
  notifications:
    config:
      # You can put any arguments here that would be arguments for
      # config_notify(). See ?shinybusy::config_notify() for more information
      success:
        useFontAwesome: FALSE
        useIcon:        FALSE
        background:     "#5bb85b"
      failure:
        useFontAwesome: FALSE
        useIcon:        FALSE
        background:     "#d9534f"
      info:
        useFontAwesome: FALSE
        useIcon:        FALSE
        background:     "#5bc0de"
      warning:
        useFontAwesome: FALSE
        useIcon:        FALSE
        background:     "#f0ac4d"
  reporting:
    # enabled here controls reporting for the app. Individual modules can be
    # controlled in their respective configuration files
    enabled: TRUE
    # The content_init section is used to initialize reports. You shouldn't
    # change the xlsx rpt but the docx and pptx rpt can be altered to
    # pre-process reports if you need to such as adding default.
    content_init:
      xlsx: |-
           rpt = list(summary = NULL,
                      sheets  = list())
      docx: |-
           rpt  = onbrand::read_template(
             template = file.path("config", "report.docx"),
             mapping  = file.path("config", "report.yaml"))
      pptx: |-
           rpt  = onbrand::read_template(
             template = file.path("config", "report.pptx"),
             mapping  = file.path("config", "report.yaml"))
    # Word template can contain placeholders. This is where you can put the
    # default values for placeholders. There are some nuances associated with
    # creating placeholders and you should see the documentation about them in
    # the onbrand package to better understand that:
    #
    #   https://onbrand.ubiquity.tools/articles/Creating_Templated_Office_Workflows.html#placeholder-text
    #
    # Each element below contains the placeholder used and should contain a
    # location and a value. For example the default document contains a header
    # placeholder in the upper right that looks like:
    #
    #  ===HEADERRIGHT===
    # The placeholder below is HEADERRIGHT, the location is header and by
    # default we will replace it with nothing. Placeholder text can have no
    # spaces.
    #
    # These defaults can be overwritten in the save section. If your template
    # has no placeholders you can comment out the entire phs section.
    #
    phs:
      - name:      "HEADERLEFT"
        location:  "header"
        value:     ""
        tooltip:   "left header text"
      - name:      "HEADERRIGHT"
        location:  "header"
        value:     ""
        tooltip:   "right header text"
      - name:      "FOOTERLEFT"
        location:  "footer"
        value:     ""
        tooltip:   "left footer text"
    phs_formatting:
      width:       "100%"
      tt_position: "left"
      tt_size:     "medium"
  ui:
    # See ?actionBttn for styles
    button_style: "fill"
    # Max size for picker inputs
    select_size:  10
    color_green:  "#00BB8A"
    color_red:    "#FF475E"
    color_blue:   "#0088FF"
    color_purple: "#bd2cf4"
  data_meta:
    # This controls the overall format of headers and the select subtext for
    # data frames with the following placeholders surround by ===:
    # COLOR  - font color
    # NAME   - column name
    # LABEL  - type label
    # RANGE  - this depends on the nature of the data in the column:
    #        - If there are between 1 and 3 values then those values are shown.
    #        - If there are more than 3 values then the min and max are show.
    data_header:  "<span style='color:===COLOR==='><b>===NAME===</b><br/><font size='-3'>===LABEL===</font></span>"
    subtext:      "===LABEL===: ===RANGE==="
    # Separator when showing more than three in a column. For example if you
    # had a dataset with 1,2,3,4,5,6 and many_sep was ",...," then it would
    # appear as "1,...,6"
    many_sep: ",...,"
    # This controls the differences for different data types. Take the output
    # of typeof(df$colname) and put an entry for that output here.
    data_types:
      character:
        color:    "#DD4B39"
        label:    "text"
      double:
        color:    "#3C8DBC"
        label:    "num"
      integer:
        color:    "#3C8DBC"
        label:    "num"
      other:
        color:    "black"
        label:    "other"
  workflows:
    example: 
      group:      "Examples"
      desc:       "Example Workflow"
      # Set to true if the workflow requires a dataset
      require_ds: TRUE
      # this can contain an absolute path as a string or R evaluable code
      preload:    "file.path('.', 'example.yaml')"
  labels:
    # JMH remove this once the dataset stuff has been moved over
    # default_ds:   " Original data set"
    ui_label:      "put labels here"
  user_files:
    use_tmpdir:     TRUE
  logging:
    enabled:        TRUE
    timestamp:      TRUE
    timestamp_fmt: "%Y-%m-%d %H:%M:%S"
    log_file:      "formods_log.txt"
    console:       TRUE
