From 224903b0256d33dc37436b36f9f0d8963f40887a Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 2 Jul 2020 09:33:58 +0000 Subject: [PATCH] Add email_messages_level and email_digests as updatable user fields --- assets/javascripts/discourse/lib/wizard.js.es6 | 6 ++++-- lib/custom_wizard/mapper.rb | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/assets/javascripts/discourse/lib/wizard.js.es6 b/assets/javascripts/discourse/lib/wizard.js.es6 index 852e4fa6..febaa01d 100644 --- a/assets/javascripts/discourse/lib/wizard.js.es6 +++ b/assets/javascripts/discourse/lib/wizard.js.es6 @@ -47,7 +47,9 @@ const userProperties = [ 'website', 'bio_raw', 'trust_level', - 'email_level' + 'email_level', + 'email_messages_level', + 'email_digests' ]; const notificationLevels = [ @@ -117,4 +119,4 @@ export { listProperties, notificationLevels, wizardFieldList -}; \ No newline at end of file +}; diff --git a/lib/custom_wizard/mapper.rb b/lib/custom_wizard/mapper.rb index b1fe585d..44ccf2f5 100644 --- a/lib/custom_wizard/mapper.rb +++ b/lib/custom_wizard/mapper.rb @@ -1,7 +1,19 @@ class CustomWizard::Mapper attr_accessor :inputs, :data, :user - USER_FIELDS = ['name', 'username', 'email', 'date_of_birth', 'title', 'locale', 'trust_level', 'email_level'] + USER_FIELDS = [ + 'name', + 'username', + 'email', + 'date_of_birth', + 'title', + 'locale', + 'trust_level', + 'email_level', + 'email_messages_level', + 'email_digests' + ] + PROFILE_FIELDS = ['location', 'website', 'bio_raw'] def self.user_fields @@ -237,4 +249,4 @@ class CustomWizard::Mapper result = data[k] keys.empty? ? result : self.recurse(result, keys) end -end \ No newline at end of file +end