Skip to content

Commit

Permalink
Merge pull request #280 from CCALI/420-author-min-max
Browse files Browse the repository at this point in the history
add min/max ranges to proper fields
  • Loading branch information
tobiasnteireho authored Feb 13, 2025
2 parents d874869 + 141fede commit 16da41a
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 65 deletions.
2 changes: 1 addition & 1 deletion index.dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
errRepURL: ''
}));
</script>
<script src="node_modules/steal/steal.production.js?v=1733872401300" cache-key="v" cache-version="1733872401300" main="@caliorg/a2jviewer/app"></script>
<script src="node_modules/steal/steal.production.js?v=1738596676504" cache-key="v" cache-version="1738596676504" main="@caliorg/a2jviewer/app"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
errRepURL: ''
}));
</script>
<script src="node_modules/steal/steal.production.js?v=1733928463964" cache-key="v" cache-version="1733928463964" main="@caliorg/a2jviewer/app"></script>
<script src="node_modules/steal/steal.production.js?v=1739423482585" cache-key="v" cache-version="1739423482585" main="@caliorg/a2jviewer/app"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@caliorg/a2jviewer",
"version": "8.4.0",
"version": "8.4.1",
"description": "A2J Viewer standalone and preview app.",
"main": "a2jviewer/app",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/footer/footerVersion.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

const version = {
number: '8.4.0',
date: '2024-12-11'
number: '8.4.1',
date: '2025-02-13'
}

export default version
8 changes: 8 additions & 0 deletions src/mobile/pages/fields/field/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ export const FieldVM = DefineMap.extend('FieldVM', {
get () {
const min = this.field.min || 'any'
const max = this.field.max || 'any'
const isDateMDY = this.field.type === 'datemdy'

if (isDateMDY) {
let minDate = moment(min, 'MMDDYYYY').format('MM/DD/YYYY')
let maxDate = moment(max, 'MMDDYYYY').format('MM/DD/YYYY')
return `(${minDate} ~~~ ${maxDate})`
}

return `(${min} ~~~ ${max})`
}
},
Expand Down
16 changes: 7 additions & 9 deletions src/mobile/pages/fields/field/views/datemdy.stache
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
{{#if(field.required)}}<small class="text-danger">({{lang.Required}})</small>{{/if}}
</label>
<div class="datepicker-field-field">
<input
type="text"
id:from="this.idFromLabelHTML(field.label)"
name="{{field.name}}"
value:bind="field._answerVm.textValue"
on:change="validateField(null, scope.element)"
{{#if(field.required)}}required{{/if}}
class="form-control datepicker-input" />
<input type="text" id:from="this.idFromLabelHTML(field.label)" name="{{field.name}}"
value:bind="field._answerVm.textValue" on:change="validateField(null, scope.element)"
{{#if(field.required)}}required{{/if}} class="form-control datepicker-input" />
</div>
{{#if(showMinMaxPrompt)}}
{{minMaxPrompt}}
{{/if}}
</div>

{{> invalid-prompt-tpl }}
</div>
</div>
15 changes: 6 additions & 9 deletions src/mobile/pages/fields/field/views/invalid-prompt.stache
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{{#if(showInvalidPrompt)}}
<div class="alert alert-danger" role="alert">
<span class="glyphicon-attention" aria-hidden="true">
{{{ parseText(scope.vm.invalidPrompt) }}}
{{#if(showMinMaxPrompt)}}
{{minMaxPrompt}}
{{/if}}
</span>
</div>
{{/if}}
<div class="alert alert-danger" role="alert">
<span class="glyphicon-attention" aria-hidden="true">
{{{ parseText(scope.vm.invalidPrompt) }}}
</span>
</div>
{{/if}}
33 changes: 13 additions & 20 deletions src/mobile/pages/fields/field/views/number.stache
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,19 @@
{{#if(field.required)}}<small class="text-danger">({{lang.Required}})</small>{{/if}}
</label>
<div class="number-field">
<input
type="text"
inputmode="decimal"
id="{{idFromLabelHTML(field.label)}}"
name="{{field.name}}"
{{#if(field.required)}}required{{/if}}
class="form-control"
on:input="preValidateNumber(null, scope.element)"
on:change="validateField(null, scope.element)"
value:bind="field._answerVm.textValue"/>
{{#if(field.calculator)}}
<button
aria-label="Expand Calculator"
class="btn btn-default expand-calc pull-right"
on:click="showCalculator(field)"
aui-action="open">
<span class="icon calc-icon glyphicon-calc" aria-hidden="true"></span>
</button>
{{/if}}
<input type="text" inputmode="decimal" id="{{idFromLabelHTML(field.label)}}" name="{{field.name}}"
{{#if(field.required)}}required{{/if}} class="form-control" on:input="preValidateNumber(null, scope.element)"
on:change="validateField(null, scope.element)" value:bind="field._answerVm.textValue" />
{{#if(field.calculator)}}
<button aria-label="Expand Calculator" class="btn btn-default expand-calc pull-right"
on:click="showCalculator(field)" aui-action="open">
<span class="icon calc-icon glyphicon-calc" aria-hidden="true"></span>
</button>
{{/if}}
</div>
{{#if(showMinMaxPrompt)}}
{{minMaxPrompt}}
{{/if}}
</div>
{{> invalid-prompt-tpl }}
</div>
</div>
33 changes: 13 additions & 20 deletions src/mobile/pages/fields/field/views/numberdollar.stache
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,20 @@

<div class="numberdollar-field">
<span>$</span>
<input
type="text"
inputmode="decimal"
id="{{idFromLabelHTML(field.label)}}"
name="{{field.name}}"
{{#if(field.required)}}required{{/if}}
class="form-control"
on:input="preValidateNumber(null, scope.element)"
on:change="validateField(null, scope.element)"
value:bind="field._answerVm.values"/>
{{#if(field.calculator)}}
<button
aria-label="Expand Calculator"
class="btn btn-default expand-calc pull-right"
on:click="showCalculator(field)"
aui-action="open">
<span class="icon calc-icon glyphicon-calc" aria-hidden="true"></span>
</button>
{{/if}}
<input type="text" inputmode="decimal" id="{{idFromLabelHTML(field.label)}}" name="{{field.name}}"
{{#if(field.required)}}required{{/if}} class="form-control" on:input="preValidateNumber(null, scope.element)"
on:change="validateField(null, scope.element)" value:bind="field._answerVm.values" />
{{#if(field.calculator)}}
<button aria-label="Expand Calculator" class="btn btn-default expand-calc pull-right"
on:click="showCalculator(field)" aui-action="open">
<span class="icon calc-icon glyphicon-calc" aria-hidden="true"></span>
</button>
{{/if}}
</div>
{{#if(showMinMaxPrompt)}}
{{minMaxPrompt}}
{{/if}}
</div>

{{> invalid-prompt-tpl }}
</div>
</div>

0 comments on commit 16da41a

Please sign in to comment.