From fa24007a9ee6d0adf9e1e7b1aebaa8ae0a06f3dc Mon Sep 17 00:00:00 2001 From: Mauro Masiero Date: Fri, 29 Mar 2024 11:50:54 +0100 Subject: [PATCH 1/3] feat: warn user when locked button is clicked via shiny --- inst/app/app-dev.R | 4 ++++ inst/main.js | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/inst/app/app-dev.R b/inst/app/app-dev.R index b3ccd88..d6ab1db 100644 --- a/inst/app/app-dev.R +++ b/inst/app/app-dev.R @@ -108,6 +108,10 @@ server <- function(input, output, session) { wizardR::reset("my_modal") }) + observeEvent(input$my_modal_locked,{ + print("locked button clicked") + }) + observeEvent(input$show_shinyalert, { shinyalert::shinyalert( title = "Hello", diff --git a/inst/main.js b/inst/main.js index 1287b21..e5935d5 100644 --- a/inst/main.js +++ b/inst/main.js @@ -182,6 +182,16 @@ $.extend(wizard, { callback(false); }); + + + // set wz.lock event listener + el.addEventListener("wz.lock", function(e) { + let counter = $(el).data("lockCounter") || 0; + counter++; + $(el).data("lockCounter", counter); + Shiny.setInputValue(el.id + "_locked", counter); + callback(false); + }); }, unsubscribe: function(el) { From dc935517ed31f8f7d6ba9ccacf6cd0c6f396273d Mon Sep 17 00:00:00 2001 From: mauromiguelm Date: Fri, 29 Mar 2024 11:10:29 +0000 Subject: [PATCH 2/3] Style code (GHA) --- R/utils.R | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/R/utils.R b/R/utils.R index 5019293..fdbd7bf 100644 --- a/R/utils.R +++ b/R/utils.R @@ -61,9 +61,8 @@ wizard_show <- function( #' @export reset <- function( id, - session = shiny::getDefaultReactiveDomain() - ){ - if (missing(id)) stop("Missing `id`") - - session$sendInputMessage(id, "reset") -} \ No newline at end of file + session = shiny::getDefaultReactiveDomain()) { + if (missing(id)) stop("Missing `id`") + + session$sendInputMessage(id, "reset") +} From c3aea110617b8fb9358f520874cb8df7cb3e3722 Mon Sep 17 00:00:00 2001 From: Mauro Masiero Date: Fri, 29 Mar 2024 12:15:11 +0100 Subject: [PATCH 3/3] attempt to end action with pass --- .github/workflows/style.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml index e9311bb..1593e57 100644 --- a/.github/workflows/style.yaml +++ b/.github/workflows/style.yaml @@ -69,6 +69,8 @@ jobs: git commit ${FILES_TO_COMMIT[*]} -m "Style code (GHA)" git pull --ff-only git push origin + exit 0 else echo "No changes to commit." + exit 0 fi