From 8d32aebf055d61ce21b319b382d9202b300500f1 Mon Sep 17 00:00:00 2001 From: merefield Date: Sun, 16 Jul 2023 11:33:09 +0100 Subject: [PATCH 1/3] FIX: direct after start time default for new wizard --- .../controllers/next-session-scheduled.js.es6 | 5 ++++- .../acceptance/admin-wizards-unsuscribed-test.js | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/discourse/controllers/next-session-scheduled.js.es6 b/assets/javascripts/discourse/controllers/next-session-scheduled.js.es6 index 4ea22d38..b8f51d1f 100644 --- a/assets/javascripts/discourse/controllers/next-session-scheduled.js.es6 +++ b/assets/javascripts/discourse/controllers/next-session-scheduled.js.es6 @@ -5,7 +5,10 @@ export default Controller.extend({ title: "admin.wizard.after_time_modal.title", setup() { - this.set("bufferedDateTime", moment(this.model.dateTime)); + this.set( + "bufferedDateTime", + this.model.dateTime ? moment(this.model.dateTime) : moment(Date.now()) + ); }, @discourseComputed("bufferedDateTime") diff --git a/test/javascripts/acceptance/admin-wizards-unsuscribed-test.js b/test/javascripts/acceptance/admin-wizards-unsuscribed-test.js index dc9bd791..fec9f0f2 100644 --- a/test/javascripts/acceptance/admin-wizards-unsuscribed-test.js +++ b/test/javascripts/acceptance/admin-wizards-unsuscribed-test.js @@ -90,6 +90,16 @@ acceptance("Admin | Custom Wizard Unsuscribed", function (needs) { ); const wizardLink = find("div.wizard-url a"); assert.equal(wizardLink.length, 1, "Wizard link was created"); + await click(".btn-after-time"); + assert.ok( + exists(".d-date-time-input .d-time-input span.name"), + "a time selector is shown" + ) + let timeText = query( + ".d-date-time-input .d-time-input span.name" + ).innerText; + const regex = /\d\d\:\d\d/; + assert.ok(regex.test(timeText)); assert.equal( $.trim($("a[title='Subscribe to use these features']").text()), "Not Subscribed", From 98fe9ce77f4d37fcc77f37396fd19d09163b40d3 Mon Sep 17 00:00:00 2001 From: merefield Date: Mon, 17 Jul 2023 10:36:07 +0100 Subject: [PATCH 2/3] bump patch --- plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index 4b6440de..d6a77bba 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # name: discourse-custom-wizard # about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more. -# version: 2.4.13 +# version: 2.4.14 # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos # url: https://github.com/paviliondev/discourse-custom-wizard # contact_emails: development@pavilion.tech From cc2eb8c7421cbd2acb22d576c2a9abf4c5495479 Mon Sep 17 00:00:00 2001 From: merefield Date: Mon, 17 Jul 2023 10:55:44 +0100 Subject: [PATCH 3/3] linting --- test/javascripts/acceptance/admin-wizards-unsuscribed-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/javascripts/acceptance/admin-wizards-unsuscribed-test.js b/test/javascripts/acceptance/admin-wizards-unsuscribed-test.js index fec9f0f2..9e2b00e7 100644 --- a/test/javascripts/acceptance/admin-wizards-unsuscribed-test.js +++ b/test/javascripts/acceptance/admin-wizards-unsuscribed-test.js @@ -94,7 +94,7 @@ acceptance("Admin | Custom Wizard Unsuscribed", function (needs) { assert.ok( exists(".d-date-time-input .d-time-input span.name"), "a time selector is shown" - ) + ); let timeText = query( ".d-date-time-input .d-time-input span.name" ).innerText;