feat: Add an option to disable endConversation button (#4352)

This commit is contained in:
Pranav Raj S
2022-04-06 13:54:55 +05:30
committed by GitHub
parent 821b953ee9
commit 0b03e4b296
10 changed files with 81 additions and 10 deletions

View File

@@ -0,0 +1,16 @@
class UpdateWebWidgetFeatureFlags < ActiveRecord::Migration[6.1]
def change
change_column_default(:channel_web_widgets, :feature_flags, from: 3, to: 7)
set_end_conversation_to_default
end
def set_end_conversation_to_default
::Channel::WebWidget.find_in_batches do |widget_batch|
widget_batch.each do |widget|
widget.end_conversation = true
widget.save!
end
end
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2022_02_18_120357) do
ActiveRecord::Schema.define(version: 2022_04_05_092033) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
@@ -280,7 +280,7 @@ ActiveRecord::Schema.define(version: 2022_02_18_120357) do
t.string "widget_color", default: "#1f93ff"
t.string "welcome_title"
t.string "welcome_tagline"
t.integer "feature_flags", default: 3, null: false
t.integer "feature_flags", default: 7, null: false
t.integer "reply_time", default: 0
t.string "hmac_token"
t.boolean "pre_chat_form_enabled", default: false