Lowercase value of 'show-now-as-default'

To match the boolean value in JavaScript.
This commit is contained in:
Tom Byers
2020-07-16 19:27:33 +01:00
committed by Chris Hill-Scott
parent e45bbcf99e
commit b5360c14cc
3 changed files with 5 additions and 4 deletions

View File

@@ -87,7 +87,7 @@
let name = $component.find('input').eq(0).attr('name');
let mousedownOption = null;
let showNowAsDefault = (
$component.data('show-now-as-default').toLowerCase() === 'true' ?
$component.data('show-now-as-default').toString() === 'true' ?
{'name': name} : false
);
const reset = () => {
@@ -131,7 +131,8 @@
'choices': choices.filter(
element => element.label.toLowerCase().indexOf(day) > -1
),
'name': name
'name': name,
'showNowAsDefault': showNowAsDefault
});
focusSelected(component);

View File

@@ -36,7 +36,7 @@
</span>
{% endif %}
</legend>
<div class="radio-select" data-module="radio-select" data-categories="{{ field.categories|join(',') }}" data-show-now-as-default="{{ show_now_as_default }}">
<div class="radio-select" data-module="radio-select" data-categories="{{ field.categories|join(',') }}" data-show-now-as-default="{{ show_now_as_default|string|lower }}">
<div class="radio-select-column">
{% for option in field %}
<div class="multiple-choice">

View File

@@ -100,7 +100,7 @@ describe('RadioSelect', () => {
<legend class="form-label">
When should Notify send these messages?
</legend>
<div class="radio-select" data-module="radio-select" data-categories="${CATEGORIES.join(',')}" data-show-now-as-default="True">
<div class="radio-select" data-module="radio-select" data-categories="${CATEGORIES.join(',')}" data-show-now-as-default="true">
<div class="radio-select__column">
<div class="multiple-choice">
<input checked="" id="scheduled_for-0" name="scheduled_for" type="radio" value="">