Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: direct after start time default for new wizard #256

Merged
merged 4 commits into from Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down
10 changes: 10 additions & 0 deletions test/javascripts/acceptance/admin-wizards-unsuscribed-test.js
Expand Up @@ -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",
Expand Down