Skip to content

Commit

Permalink
Merge pull request #917 from bigomics/new-bc-fix-pgx-overwrite
Browse files Browse the repository at this point in the history
Avoid overwriting existing datasets with the same name
  • Loading branch information
ivokwee authored Apr 19, 2024
2 parents 8d1d942 + bbfc229 commit 335510a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions components/board.upload/R/upload_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,21 @@ UploadBoard <- function(id,
# lock wizard it compute step
observeEvent(
list(input$upload_wizard, upload_name(), upload_datatype(), upload_description(), upload_organism()), {
req(input$upload_wizard == "Step 4: Dataset description")


req(input$upload_wizard == "Step 4: Dataset description", upload_name())

pgx_files <- playbase::pgxinfo.read(auth$user_dir, file = "datasets-info.csv")

if(upload_name() %in% pgx_files$dataset){
shinyalert::shinyalert(
title = "Invalid name",
text = "This dataset name already exists.",
type = "error"
)

upload_name(NULL)

}

if (!is.null(upload_name()) && !isValidFileName(upload_name())) {
message("[ComputePgxServer:input$compute] WARNING:: Invalid name")
shinyalert::shinyalert(
Expand Down

0 comments on commit 335510a

Please sign in to comment.