[conda.ui.sections]
order = ["conda_input_box", "conda_output_box_text", "conda_output_box_table"]
[conda.ui.sections.ui_basic]
conda_input_box = "title = 'Input', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
conda_output_box_text = "title = 'Output of conda (Text)', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
conda_output_box_table = "title = 'Output of conda (Table)', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"

[conda.paramters.conda_input_box]
# For reading annovarR shiny APP conda tool input files  
section_type = "input"
rcmd_last = ""
progressbar_message = "Running conda functions."
render_id = "conda_input_box"

#!!!!! input_ui_order required related section
input_ui_order = ["single_input", "start_analysis"]

[conda.paramters.conda_input_box.input.single_input]
title = "Parameters:"
title_control = "class = 'input-section-p'"
varname = ["conda_sub_cmd", "conda_env_name", "conda_params"]
input_id = ["input_conda_1", "input_conda_2", "input_conda_3"]
type = ["shiny::selectInput", "shiny::selectInput", "shiny::textInput"]
label = ["Conda subcommands", "Conda environment", "Conda parameters"]

[conda.paramters.conda_input_box.input.single_input.choices]
conda_sub_cmd = ["clean", "config", "create", "info", "install",
                 "list", "package", "remove", "uninstall",
                 "search", "update", "upgrade"]
conda_env_name = "!!glue {conda_envs <- BioInstaller::conda.env.list(); if (is.data.frame(conda_envs)) conda_envs <- conda_envs[,1]}"
[conda.paramters.conda_input_box.input.single_input.selected]
conda_sub_cmd = "list"
conda_env_name = "base"

[conda.paramters.conda_input_box.input.start_analysis]
input_id = "start_conda_analysis"
type = "shiny::actionButton"
label = "Run"

[conda.paramters.conda_output_box_text]
section_type = "output"
rcmd_last = """
conda_env_cmd <- sprintf("source activate %s;", conda_env_name)
conda_params <- sprintf("%s %s", conda_sub_cmd, conda_params)
cat(conda(conda_params, conda_env_cmd))
"""
render_type = "shiny::renderPrint"
render_id = "conda_output"
output_type = "shiny::verbatimTextOutput"
progressbar_message = "conda ouput_box_text"

[conda.paramters.conda_output_box_table]
section_type = "output"
rcmd_last = """
if (conda_sub_cmd == 'list')
conda.list(conda_env_name)
"""
render_type = "DT::renderDataTable"
render_id = "conda_output_table"
output_type = "DT::dataTableOutput"
progressbar_message = "conda ouput_box_table"
