Skip to content

Commit

Permalink
sanitize for repeat loops working
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasnteireho committed Sep 13, 2024
1 parent f029a7c commit c5da3bc
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions demo/viewer/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
<script main="@empty"
env="production"
config="../package.json!npm"
src="../dist/bundles/app.js?v=1724972361669"
src="../dist/bundles/app.js?v=1726195165763"
cache-key="v"
cache-version="1724972361669"
cache-version="1726195165763"
base-url="../">
</script>
</body>
Expand Down
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=1724972332735" cache-key="v" cache-version="1724972332735" main="@caliorg/a2jviewer/app"></script>
<script src="node_modules/steal/steal.production.js?v=1726194667293" cache-key="v" cache-version="1726194667293" 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=1725637191625" cache-key="v" cache-version="1725637191625" main="@caliorg/a2jviewer/app"></script>
<script src="node_modules/steal/steal.production.js?v=1726195110818" cache-key="v" cache-version="1726195110818" 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.1.7-0",
"version": "8.1.7-9",
"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.1.6',
date: '2023-10-16'
number: '8.1.7-9',
date: '2024-09-13'
}

export default version
19 changes: 11 additions & 8 deletions src/mobile/pages/pages-vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export default DefineMap.extend('PagesVM', {
* check is date is valid
*/
function isValidDate (date) {
console.log("date: " + date)
let dmy = date.split('/')
// js wants mdy or ymd
// while a2j dates are d/m/yyyy
Expand Down Expand Up @@ -246,14 +247,16 @@ export default DefineMap.extend('PagesVM', {
}

function sanitizeAnswerValues (answer) {
let validator = []

validator['Date'] = isValidDate
validator['Number'] = isValidNumber

for (let i = 1; i > answer.values.length; i++) {
if (!validator[answer.type](answer.values[i])) {
delete answer.values[i]
const validator = new Map()

validator.set('Date', isValidDate)
validator.set('Number', isValidNumber)

if (validator.has(answer.type)){
for (let i = 1; i < answer.values.length; i++) {
if (!validator.get(answer.type)(answer.values[i])) {
delete answer.values[i]
}
}
}

Expand Down

0 comments on commit c5da3bc

Please sign in to comment.