-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Donation amount component #248
base: 7.x-2.x
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## 7.x-2.x #248 +/- ##
=============================================
+ Coverage 46.58% 46.85% +0.26%
+ Complexity 1827 1823 -4
=============================================
Files 287 285 -2
Lines 10144 10225 +81
Branches 154 154
=============================================
+ Hits 4726 4791 +65
- Misses 5415 5431 +16
Partials 3 3
Continue to review full report at Codecov.
|
31fef67
to
b3af0e6
Compare
$defaults['extra'] += [ | ||
'options' => [], | ||
'other_option' => TRUE, | ||
'other_text' => t('Other'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not "Other amount"? Seems a better fit as it can only be another amount, not another "something".
if ($component['extra']['options']) { | ||
$element['#type'] = 'select_or_other'; | ||
$element['#select_type'] = 'radios'; | ||
$element['#options'] = drupal_map_assoc($component['extra']['options']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great if we can toggle whether the currency symbol gets prepended before the amount. This is a very common use case in rendering. (Just rendering it an hiding via styles would work too)
The currency symbol would be best wrapped in a span with an appropriate class...
$element['#type'] = 'select_or_other'; | ||
$element['#select_type'] = 'radios'; | ||
$element['#options'] = drupal_map_assoc($component['extra']['options']); | ||
$element['#other'] = !empty($component['extra']['other_text']) ? check_plain($component['extra']['other_text']) : t('Other...'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: why not "Other amount"?
435f289
to
6002b28
Compare
6002b28
to
65cf1b9
Compare
Aim is to improve the usability of configuring donation amount components. In order to do this we add a new customized webform component.