From eae5fbbbb8ec1a08ac5ffc06534f9957583c2416 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 15 Aug 2022 14:26:36 +0200 Subject: [PATCH 1/4] FIX: try using new component style --- .../discourse/templates/admin-wizards-manager.hbs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/discourse/templates/admin-wizards-manager.hbs b/assets/javascripts/discourse/templates/admin-wizards-manager.hbs index 0cfb8fde..1741f30f 100644 --- a/assets/javascripts/discourse/templates/admin-wizards-manager.hbs +++ b/assets/javascripts/discourse/templates/admin-wizards-manager.hbs @@ -11,11 +11,11 @@ {{/if}} - {{input + {{d-button id="upload-button" label="admin.wizard.manager.upload" From cfe563e515bcb12714bbb34cfd787069d72e794b Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 15 Aug 2022 14:36:42 +0200 Subject: [PATCH 2/4] FIX: use native javascript instead of jquery --- .../discourse/controllers/admin-wizards-manager.js.es6 | 6 +++--- .../discourse/templates/admin-wizards-manager.hbs | 8 ++++---- assets/stylesheets/common/wizard-manager.scss | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 b/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 index 7228d164..719abff0 100644 --- a/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 @@ -68,7 +68,7 @@ export default Controller.extend({ file: null, filename: null, }); - $("#file-upload").val(""); + document.getElementById('custom-wizard-file-upload').value = ''; }, @observes("importing", "destroying") @@ -83,7 +83,7 @@ export default Controller.extend({ actions: { upload() { - $("#file-upload").click(); + document.getElementById('custom-wizard-file-upload').click(); }, clearFile() { @@ -102,7 +102,7 @@ export default Controller.extend({ if (maxFileSize < file.size) { this.setMessage("error", "file_size_error"); this.set("file", null); - $("#file-upload").val(""); + document.getElementById('custom-wizard-file-upload').value = ''; } else { this.setProperties({ file, diff --git a/assets/javascripts/discourse/templates/admin-wizards-manager.hbs b/assets/javascripts/discourse/templates/admin-wizards-manager.hbs index 1741f30f..4b91bd3d 100644 --- a/assets/javascripts/discourse/templates/admin-wizards-manager.hbs +++ b/assets/javascripts/discourse/templates/admin-wizards-manager.hbs @@ -11,11 +11,11 @@ {{/if}} - + input=(action "setFile")}} {{d-button id="upload-button" label="admin.wizard.manager.upload" diff --git a/assets/stylesheets/common/wizard-manager.scss b/assets/stylesheets/common/wizard-manager.scss index a3b30c98..b8df732f 100644 --- a/assets/stylesheets/common/wizard-manager.scss +++ b/assets/stylesheets/common/wizard-manager.scss @@ -26,7 +26,7 @@ } } - #file-upload { + #custom-wizard-file-upload { display: none; } From 1f254732dad7463c216cb6d6e798c7c23df40ce2 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 15 Aug 2022 15:41:01 +0200 Subject: [PATCH 3/4] version bump --- plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index c3efeb7b..a953dc08 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # name: discourse-custom-wizard # about: Create custom wizards -# version: 1.22.4 +# version: 1.22.5 # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George # url: https://github.com/paviliondev/discourse-custom-wizard # contact_emails: development@pavilion.tech From 81680033a7e6b3798f2ea1323f78dd7a2ad57f67 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Mon, 15 Aug 2022 16:16:18 +0200 Subject: [PATCH 4/4] Apply prettier --- .../discourse/controllers/admin-wizards-manager.js.es6 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 b/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 index 719abff0..4565820c 100644 --- a/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 +++ b/assets/javascripts/discourse/controllers/admin-wizards-manager.js.es6 @@ -68,7 +68,7 @@ export default Controller.extend({ file: null, filename: null, }); - document.getElementById('custom-wizard-file-upload').value = ''; + document.getElementById("custom-wizard-file-upload").value = ""; }, @observes("importing", "destroying") @@ -83,7 +83,7 @@ export default Controller.extend({ actions: { upload() { - document.getElementById('custom-wizard-file-upload').click(); + document.getElementById("custom-wizard-file-upload").click(); }, clearFile() { @@ -102,7 +102,7 @@ export default Controller.extend({ if (maxFileSize < file.size) { this.setMessage("error", "file_size_error"); this.set("file", null); - document.getElementById('custom-wizard-file-upload').value = ''; + document.getElementById("custom-wizard-file-upload").value = ""; } else { this.setProperties({ file,