FIX: better solution for setting a required field for send_message
Dieser Commit ist enthalten in:
Ursprung
f1ea4159f5
Commit
d1b4a96e2c
2 geänderte Dateien mit 14 neuen und 9 gelöschten Zeilen
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Laden …
In neuem Issue referenzieren