1
0
Fork 0

FIX: better solution for setting a required field for send_message

Dieser Commit ist enthalten in:
Robert Barrow 2019-10-09 16:02:06 +01:00
Ursprung f1ea4159f5
Commit d1b4a96e2c
2 geänderte Dateien mit 14 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -143,6 +143,17 @@
{{/if}}
{{#if sendMessage}}
<div class="setting">
<div class="setting-label">
<h3>{{i18n 'admin.wizard.required'}}</h3>
</div>
<div class="setting-value">
{{combo-box content=availableFields
nameProperty='label'
none='admin.wizard.select_field'
value=action.required}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.send_message.recipient"}}</h3>

Datei anzeigen

@ -423,16 +423,10 @@ class CustomWizard::Builder
def send_message(user, action, data)
empty_data = false
data.each do |k, v|
if v.empty?
empty_data = true
end
if action['required'].present? && data[action['required']].blank?
return
end
# leave if there are any empty fields
return if empty_data
if action['custom_title_enabled']
title = CustomWizard::Builder.fill_placeholders(action['custom_title'], user, data)
else