# edit_table_modal.R and edit_table_confirmed.R index_subset should match.
index_subset <- timevis_data_cal() |>
mutate(test = (period %in% c("Pre-LMP", "Post-LMP", "Last Week", "Last Two Weeks Before Delivery") & what == "Substance")) |>
pull(test) |>
which()
edited_row <- timevis_data_cal()[index_subset[input$table_substance_period_rows_selected], ] |>
mutate(
start = input$edit_start,
end = input$edit_start,
substance = input$edit_substance,
frequency = input$edit_frequency,
title = glue("{input$edit_frequency} {input$edit_substance}")
)
timevis_data_cal(
bind_rows(
timevis_data_cal()[-index_subset[input$table_substance_period_rows_selected], ],
edited_row
)
)
removeModal()
save_aws(
data = timevis_data_cal(),
data_table_routine = table_substance_routine_data(),
id = tlfb_id(),
v = tlfb_v(),
last_action = "edit_substance",
session = session
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.