diff --git a/.discourse-compatibility b/.discourse-compatibility index cfb01c11..b2f02cc7 100644 --- a/.discourse-compatibility +++ b/.discourse-compatibility @@ -1 +1,2 @@ +2.7.8: e07a57e398b6b1676ab42a7e34467556fca5416b 2.5.1: bb85b3a0d2c0ab6b59bcb405731c39089ec6731c \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/wizard-mapper-selector.hbs b/assets/javascripts/discourse/templates/components/wizard-mapper-selector.hbs index 94870416..60f4c0cf 100644 --- a/assets/javascripts/discourse/templates/components/wizard-mapper-selector.hbs +++ b/assets/javascripts/discourse/templates/components/wizard-mapper-selector.hbs @@ -58,6 +58,7 @@ {{tag-chooser tags=value onChange=(action "changeValue") + everyTag=true options=(hash none=placeholderKey filterable=true diff --git a/assets/javascripts/wizard-custom.js b/assets/javascripts/wizard-custom.js index d0fef99a..768719c9 100644 --- a/assets/javascripts/wizard-custom.js +++ b/assets/javascripts/wizard-custom.js @@ -1,8 +1,11 @@ //= require_tree_discourse discourse/app/lib +//= require_tree_discourse discourse/app/mixins +// //= require discourse/app/mixins/singleton //= require discourse/app/mixins/upload //= require discourse/app/mixins/composer-upload +//= require discourse/app/mixins/textarea-text-manipulation //= require discourse/app/adapters/rest @@ -61,10 +64,10 @@ //= require markdown-it-bundle //= require lodash.js -//= require mousetrap.js //= require template_include.js //= require caret_position.js //= require popper.js +//= require uppy.js //= require bootstrap-modal.js //= require bootbox.js //= require discourse-shims diff --git a/assets/javascripts/wizard/templates/components/wizard-field-tag.hbs b/assets/javascripts/wizard/templates/components/wizard-field-tag.hbs index 5dd81c99..8ebc56eb 100644 --- a/assets/javascripts/wizard/templates/components/wizard-field-tag.hbs +++ b/assets/javascripts/wizard/templates/components/wizard-field-tag.hbs @@ -1 +1 @@ -{{tag-chooser tags=field.value maximum=field.limit tabindex=field.tabindex}} +{{tag-chooser tags=field.value maximum=field.limit tabindex=field.tabindex everyTag=true}} diff --git a/controllers/custom_wizard/admin/manager.rb b/controllers/custom_wizard/admin/manager.rb index 2277de48..7dcc662c 100644 --- a/controllers/custom_wizard/admin/manager.rb +++ b/controllers/custom_wizard/admin/manager.rb @@ -48,20 +48,21 @@ class CustomWizard::AdminManagerController < CustomWizard::AdminController imported = [] failures = [] + templates = template_json.is_a?(Array) ? template_json : [template_json] - template_json.each do |json| - template = CustomWizard::Template.new(json) + templates.each do |raw_template| + template = CustomWizard::Template.new(raw_template) template.save(skip_jobs: true, create: true) if template.errors.any? failures.push( - id: json['id'], + id: template.data['id'], messages: template.errors.full_messages.join(', ') ) else imported.push( - id: json['id'], - name: json['name'] + id: template.data['id'], + name: template.data['name'] ) end end diff --git a/lib/custom_wizard/mapper.rb b/lib/custom_wizard/mapper.rb index 6700e37d..b66c1716 100644 --- a/lib/custom_wizard/mapper.rb +++ b/lib/custom_wizard/mapper.rb @@ -226,7 +226,7 @@ class CustomWizard::Mapper end def interpolate(string, opts = { user: true, wizard: true, value: true, template: false }) - return string if string.blank? + return string if string.blank? || string.frozen? if opts[:user] string.gsub!(/u\{(.*?)\}/) { |match| map_user_field($1) || '' }