From 3def79fab23f4a6c7c0c2be2873c348b80eca2e5 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Thu, 14 Dec 2023 13:47:01 -0600 Subject: [PATCH 01/32] wip add hebrew --- src/mobile/util/tlang.js | 77 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/src/mobile/util/tlang.js b/src/mobile/util/tlang.js index 93b513ea..55ddaa35 100644 --- a/src/mobile/util/tlang.js +++ b/src/mobile/util/tlang.js @@ -22,6 +22,7 @@ export default function (lang, makestr) { Dutch English French + Hebrew Hmong Korean Mon Khmer @@ -1297,5 +1298,81 @@ export default function (lang, makestr) { RepeatAnd: 'และ' } + Languages.regional.he = { + locale: 'en', + Language: 'עברית', + LanguageEN: 'Hebrew', + AskYesNo_Yes: 'כן', + AskYesNo_No: 'לא', + Close: 'סגור', + Comment: 'הערה', + GoBack: 'חזרה', + GoNext: 'הבא', + LearnMore: 'קריאה נוספת', + MyProgress: 'ההתקדמות שלי', + ProvideFeedbackOrComment: 'משוב על עמוד זה', + SaveAndExit: 'שמור וצא', + ResumeExit: 'התחלה מחדש', + SendFeedback: 'שלח משוב', + SoundIsOff: 'צליל מושתק', + SoundIsOn: 'צליל פועל', + SoundPlay: 'הפעל', + SoundStop: 'עצור', + WhatDoYouMean: 'מה הכוונה?', + Continue: 'המשך', + Exit: 'יציאה ללא שמירה', + Male: 'זכר', + Female: 'נקבה', + ChooseListNumber: 'בחירה: ', + ChooseListText: 'בחר מרשימה זו: ', + CheckBoxNOTALabel: 'אף אחד מהתשובות', + ZoomNormal: 'גודל רגיל', + ZoomFull: 'מסך מלא', + TextEnlarge: 'הגדל תיבת טקסט', + TextShrink: 'הקטן תיבת טקסט', + TextSizeLetter: 'א', + UploadAnswers: 'יוצא, נא להמתין...', + CalcClear: 'נקה', + CalcEnter: 'הכנס', + MonthNamesShort: "ינו', פבר', מרץ, אפר', מאי, יוני, יולי, אוג', ספט', אוק', נוב', דצמ'", + MonthNamesLong: "ינואר, פברואר, מרץ, אפריל, מאי, יוני, יולי, ספטמבר, אוקטובר, נובמבר, דצמבר", + FieldPrompts_ResponseRequired: "חובה למלא תשובה בקווים הריקים ליד התיוג האדום לפני שממשיכים.", + FieldPrompts_SelectionRequired: 'חובה לבצע בחירה לפני שממשיכים.', + FieldPrompts_text: 'חובה להקליד תשובה במקומות הממורקרים לפני שממשיכים.', + FieldPrompts_textlong: 'חובה להקליד תשובה במקומות הממורקרים לפני שממשיכים.', + FieldPrompts_textpick: 'חובה לבחור מתוך המקום הממורקר לפני שממשיכים.', + FieldPrompts_number: 'חובה הלקליד מספר במקום הממורקר לפני שממשיכים.', + FieldPrompts_numberdollar: 'חובה להכניס סימן דולר במקום הממורקר לפני שממשיכים.', + FieldPrompts_numberssn: "חובה להכניס מס' תעודת זהות במקום הממורקר לפני שממשיכים.", + FieldPrompts_numberphone: "חובה להקליד מס' טלפון במקום הממורקר לפני שממשיכים.", + FieldPrompts_numberzip: 'חובה להקליד מיקוד במקום הממורקר לפני שממשיכים.', + FieldPrompts_numberpick: 'חובה לבחור מספר מתוך המקום הממורקר לפני שממשיכים.', + FieldPrompts_datemdy: 'חובה להקליד חודש, יום ושנה במקום הממורקר לפני שממשיכים.', + FieldPrompts_gender: 'בחרו אוואטר שייצג אותך.', + FieldPrompts_radio: 'חובה לבחור תגובה מתוך הבחירה הממורקרת לפני שממשיכים.', + FieldPrompts_checkbox: 'חובה לבחור אפשרות אחת או כמה לפני שממשיכים.', + FieldPrompts_checkboxNOTA: 'בחרו בבקשה אפשרות אחת או יותר או "אף אחת מהתשובות" לפני שממשיכים.', + Ordinals_1: 'ראשון', + Ordinals_2: 'שני', + Ordinals_3: 'שלישי', + Ordinals_4: 'רביעי', + Ordinals_5: 'חמישי', + Ordinals_6: 'שישי', + Ordinals_7: 'שביעי', + Ordinals_8: 'שמיני', + Ordinals_9: 'תשיעי', + Ordinals_10: 'עשירי', + Ordinals_11: 'אחד עשר', + Ordinals_12: 'שנים עשר', + Ordinals_13: 'שלושה עשר', + RepeatAnd: 'וגם', + Required: 'חובה', + Show_Navigation:'הראה ניווט', + Navigation_Panel:'לוח ניווט', + Open:'לִפְתוֹחַ', + + } + + return Languages } From 3d343792984cb558abcbc2b19fda0fb4f1616bd1 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Thu, 14 Dec 2023 15:27:38 -0600 Subject: [PATCH 02/32] Add new english strings --- src/mobile/util/tlang.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mobile/util/tlang.js b/src/mobile/util/tlang.js index 55ddaa35..64dc29de 100644 --- a/src/mobile/util/tlang.js +++ b/src/mobile/util/tlang.js @@ -162,6 +162,9 @@ export default function (lang, makestr) { Ordinals_12: 'twelfth', Ordinals_13: '13th', RepeatAnd: 'and', + Show_Navigation:'Show Navigation', + Navigation_Panel:'Navigation Panel', + Open:'Open', // Authoring system, non-translated elements. // Tab names From f9d1065fa149c0fb7e3758e7c73a5c8322feec94 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Thu, 14 Dec 2023 16:00:01 -0600 Subject: [PATCH 03/32] fix locale --- src/mobile/util/tlang.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mobile/util/tlang.js b/src/mobile/util/tlang.js index 64dc29de..e2c94014 100644 --- a/src/mobile/util/tlang.js +++ b/src/mobile/util/tlang.js @@ -1302,7 +1302,7 @@ export default function (lang, makestr) { } Languages.regional.he = { - locale: 'en', + locale: 'he', Language: 'עברית', LanguageEN: 'Hebrew', AskYesNo_Yes: 'כן', From 2ef8a7951d73f6696a41eb142df3a51a5fa2b6ef Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Wed, 7 Feb 2024 17:31:07 -0600 Subject: [PATCH 04/32] add extra hebrew strings --- src/mobile/util/tlang.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/mobile/util/tlang.js b/src/mobile/util/tlang.js index e2c94014..519467ab 100644 --- a/src/mobile/util/tlang.js +++ b/src/mobile/util/tlang.js @@ -162,9 +162,9 @@ export default function (lang, makestr) { Ordinals_12: 'twelfth', Ordinals_13: '13th', RepeatAnd: 'and', - Show_Navigation:'Show Navigation', - Navigation_Panel:'Navigation Panel', - Open:'Open', + Show_Navigation: 'Show Navigation', + Navigation_Panel: 'Navigation Panel', + Open: 'Open', // Authoring system, non-translated elements. // Tab names @@ -1338,8 +1338,8 @@ export default function (lang, makestr) { CalcClear: 'נקה', CalcEnter: 'הכנס', MonthNamesShort: "ינו', פבר', מרץ, אפר', מאי, יוני, יולי, אוג', ספט', אוק', נוב', דצמ'", - MonthNamesLong: "ינואר, פברואר, מרץ, אפריל, מאי, יוני, יולי, ספטמבר, אוקטובר, נובמבר, דצמבר", - FieldPrompts_ResponseRequired: "חובה למלא תשובה בקווים הריקים ליד התיוג האדום לפני שממשיכים.", + MonthNamesLong: 'ינואר, פברואר, מרץ, אפריל, מאי, יוני, יולי, ספטמבר, אוקטובר, נובמבר, דצמבר', + FieldPrompts_ResponseRequired: 'חובה למלא תשובה בקווים הריקים ליד התיוג האדום לפני שממשיכים.', FieldPrompts_SelectionRequired: 'חובה לבצע בחירה לפני שממשיכים.', FieldPrompts_text: 'חובה להקליד תשובה במקומות הממורקרים לפני שממשיכים.', FieldPrompts_textlong: 'חובה להקליד תשובה במקומות הממורקרים לפני שממשיכים.', @@ -1370,12 +1370,11 @@ export default function (lang, makestr) { Ordinals_13: 'שלושה עשר', RepeatAnd: 'וגם', Required: 'חובה', - Show_Navigation:'הראה ניווט', - Navigation_Panel:'לוח ניווט', - Open:'לִפְתוֹחַ', - + Show_Navigation: 'הראה ניווט', + Navigation_Panel: 'לוח ניווט', + Open: 'לִפְתוֹחַ' + } - return Languages } From 7e7df48e5ad891d1422f3339771ec2ac8178d510 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Wed, 7 Feb 2024 18:08:08 -0600 Subject: [PATCH 05/32] 8.2.0-0 pre --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c3716c70..4bf3fe77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caliorg/a2jviewer", - "version": "8.1.7-0", + "version": "8.2.0-0", "description": "A2J Viewer standalone and preview app.", "main": "a2jviewer/app", "scripts": { From 1a4f9cf3f1aa53f341f0037788dbc5beb232eb02 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Wed, 7 Feb 2024 18:10:20 -0600 Subject: [PATCH 06/32] 8.2.0-1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd236c94..ce8cb92f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@caliorg/a2jviewer", - "version": "8.1.6", + "version": "8.2.0-1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@caliorg/a2jviewer", - "version": "8.1.6", + "version": "8.2.0-1", "license": "GNU AGPL v3.0", "dependencies": { "@caliorg/a2jdeps": "^7.1.7", diff --git a/package.json b/package.json index 4bf3fe77..9b970751 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-0", + "version": "8.2.0-1", "description": "A2J Viewer standalone and preview app.", "main": "a2jviewer/app", "scripts": { From a356a27ec0bda1227495de06cb3a87b52d27584c Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Wed, 7 Feb 2024 18:10:46 -0600 Subject: [PATCH 07/32] Update footerVersion --- src/footer/footerVersion.js | 4 ++-- src/mobile/pages/pages.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/footer/footerVersion.js b/src/footer/footerVersion.js index 79f74147..bbe88649 100644 --- a/src/footer/footerVersion.js +++ b/src/footer/footerVersion.js @@ -1,7 +1,7 @@ const version = { - number: '8.1.6', - date: '2023-10-16' + number: '8.2.0-1', + date: '2024-02-08' } export default version diff --git a/src/mobile/pages/pages.js b/src/mobile/pages/pages.js index 0369e96f..fe17adda 100644 --- a/src/mobile/pages/pages.js +++ b/src/mobile/pages/pages.js @@ -92,15 +92,15 @@ export default Component.extend({ const pages = this.viewModel.interview.pages const pageName = this.viewModel.currentPage.name // vm.appState.page - + if (pages && pageName) { const page = pages.find(pageName) - + // piwik tracking of learn-more clicks if (window._paq) { analytics.trackCustomEvent('Learn-More', 'from: ' + pageName, page.learn) } - + vm.appState.modalContent = { // name undefined prevents stache warnings title: page.learn, From 690b64e948c4d17f757b0ad44ce0b4c811436260 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Mon, 12 Feb 2024 17:23:09 -0600 Subject: [PATCH 08/32] wip date bounds enforcement --- src/mobile/pages/fields/field/field.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 112998cd..8de4865e 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -308,9 +308,19 @@ export const FieldVM = DefineMap.extend('FieldVM', { } else if (field.type === 'useravatar') { // TODO: validate the JSON string here? value = JSON.stringify(this.userAvatar.serialize()) } else if (field.type === 'datemdy') { + // format date to (mm/dd/yyyy) from acceptable inputs value = this.normalizeDateInput($el.val()) // render formatted date for end user + + if (Date.parse(value) < Date.parse(field.min)){ + value = field.min + } else if (Date.parse(value) > Date.parse(field.max)){ + value = field.min + } + + + $el.val(value) } else { value = $el.val() From 9a3ce25d1a0d94882c1161fbd4053699e9fe884e Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Mon, 12 Feb 2024 18:35:13 -0600 Subject: [PATCH 09/32] check max --- src/mobile/pages/fields/field/field.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 8de4865e..72106539 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -311,15 +311,19 @@ export const FieldVM = DefineMap.extend('FieldVM', { // format date to (mm/dd/yyyy) from acceptable inputs value = this.normalizeDateInput($el.val()) - // render formatted date for end user + + console.log("changed") + if (Date.parse(value) < Date.parse(field.min)){ + console.log("smaller") value = field.min } else if (Date.parse(value) > Date.parse(field.max)){ - value = field.min + console.log("bigger") + value = field.max } - + // render formatted date for end user $el.val(value) } else { From deb6ae9f89d993c1b132982af646e2f5ba2b04d1 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Mon, 12 Feb 2024 18:43:52 -0600 Subject: [PATCH 10/32] debug --- src/mobile/pages/fields/field/field.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 72106539..1ed83194 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -313,6 +313,11 @@ export const FieldVM = DefineMap.extend('FieldVM', { value = this.normalizeDateInput($el.val()) console.log("changed") + console.log(value) + console.log(field.min) + console.log(field.max) + console.log(field) + if (Date.parse(value) < Date.parse(field.min)){ From 9bb801afad650841d919993e5da1f51149aec09a Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Mon, 12 Feb 2024 19:11:05 -0600 Subject: [PATCH 11/32] normalize min and max --- src/mobile/pages/fields/field/field.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 1ed83194..4b79b0a0 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -320,10 +320,10 @@ export const FieldVM = DefineMap.extend('FieldVM', { - if (Date.parse(value) < Date.parse(field.min)){ + if (Date.parse(value) < Date.parse(normalizeDateInput(field.min))){ console.log("smaller") value = field.min - } else if (Date.parse(value) > Date.parse(field.max)){ + } else if (Date.parse(value) > Date.parse(normalizeDateInput(field.max))){ console.log("bigger") value = field.max } From c2b0b65eed078da0d783714c54cb7d985eb99da2 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Wed, 14 Feb 2024 14:11:34 -0600 Subject: [PATCH 12/32] use denormalize max and min --- src/mobile/pages/fields/field/field.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 4b79b0a0..e8231283 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -320,12 +320,24 @@ export const FieldVM = DefineMap.extend('FieldVM', { - if (Date.parse(value) < Date.parse(normalizeDateInput(field.min))){ + let maxDate = Date.parse( + field.max.substr(0,2) + "/" + + field.max.substr(2,2) + "/" + + field.max.substr(4)) + + let minDate = Date.parse( + field.min.substr(0,2) + "/" + + field.min.substr(2,2) + "/" + + field.min.substr(4)) + + + + if (Date.parse(value) < minDate){ console.log("smaller") - value = field.min - } else if (Date.parse(value) > Date.parse(normalizeDateInput(field.max))){ + value = minDate //field.min + } else if (Date.parse(value) > maxDate){ console.log("bigger") - value = field.max + value = maxDate //field.max } // render formatted date for end user From 2170b5a0782abedbc792b4f3535ca80703cceb73 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Wed, 14 Feb 2024 14:21:45 -0600 Subject: [PATCH 13/32] parse min and max only in comparison --- src/mobile/pages/fields/field/field.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index e8231283..aa5c8a47 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -320,22 +320,22 @@ export const FieldVM = DefineMap.extend('FieldVM', { - let maxDate = Date.parse( + let maxDate = field.max.substr(0,2) + "/" + field.max.substr(2,2) + "/" + - field.max.substr(4)) + field.max.substr(4) - let minDate = Date.parse( + let minDate = field.min.substr(0,2) + "/" + field.min.substr(2,2) + "/" + - field.min.substr(4)) + field.min.substr(4) - if (Date.parse(value) < minDate){ + if (Date.parse(value) < Date.parse(minDate)){ console.log("smaller") value = minDate //field.min - } else if (Date.parse(value) > maxDate){ + } else if (Date.parse(value) > Date.parse(maxDate)){ console.log("bigger") value = maxDate //field.max } From a018970e00e0758e68570c3c084c2718abe83b09 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Wed, 14 Feb 2024 15:02:23 -0600 Subject: [PATCH 14/32] cleanup --- src/mobile/pages/fields/field/field.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index aa5c8a47..4e55f3f6 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -312,14 +312,9 @@ export const FieldVM = DefineMap.extend('FieldVM', { // format date to (mm/dd/yyyy) from acceptable inputs value = this.normalizeDateInput($el.val()) - console.log("changed") - console.log(value) - console.log(field.min) - console.log(field.max) - console.log(field) - - + // date bounds are in 6 or 8 digit texts + // need to change to same format as value let maxDate = field.max.substr(0,2) + "/" + field.max.substr(2,2) + "/" + @@ -330,13 +325,9 @@ export const FieldVM = DefineMap.extend('FieldVM', { field.min.substr(2,2) + "/" + field.min.substr(4) - - if (Date.parse(value) < Date.parse(minDate)){ - console.log("smaller") value = minDate //field.min } else if (Date.parse(value) > Date.parse(maxDate)){ - console.log("bigger") value = maxDate //field.max } From 984cc291235a21bab8d3b79409a8862edce5d0b0 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Wed, 14 Feb 2024 15:03:21 -0600 Subject: [PATCH 15/32] update prerel ver --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9b970751..7cfb9ce5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-1", + "version": "8.2.0-8", "description": "A2J Viewer standalone and preview app.", "main": "a2jviewer/app", "scripts": { From 67d03b2f1d213f80ad20b267726a4efba0287b22 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Thu, 15 Feb 2024 07:34:15 -0600 Subject: [PATCH 16/32] add more comments --- src/mobile/pages/fields/field/field.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 4e55f3f6..83080237 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -315,6 +315,10 @@ export const FieldVM = DefineMap.extend('FieldVM', { // date bounds are in 6 or 8 digit texts // need to change to same format as value + // it would be sensible to keep bounds in this + // format but we need to support it to properly + // support older released guides without adding + // more complex code let maxDate = field.max.substr(0,2) + "/" + field.max.substr(2,2) + "/" + From eed84ea8ca01848daf50819e70dfbe928b2542b8 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Thu, 15 Feb 2024 19:13:59 -0600 Subject: [PATCH 17/32] fix failing tests by not always assuming bounds for dates exist. --- index.dev.html | 2 +- index.html | 2 +- package-lock.json | 4 +-- package.json | 2 +- src/mobile/pages/fields/field/field.js | 37 +++++++++++++++----------- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/index.dev.html b/index.dev.html index 6b57e8eb..f93d3ae3 100644 --- a/index.dev.html +++ b/index.dev.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/index.html b/index.html index f93d3ae3..80dbcb37 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ce8cb92f..676177c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-1", + "version": "8.2.0-8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@caliorg/a2jviewer", - "version": "8.2.0-1", + "version": "8.2.0-8", "license": "GNU AGPL v3.0", "dependencies": { "@caliorg/a2jdeps": "^7.1.7", diff --git a/package.json b/package.json index 7cfb9ce5..5489e81a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-8", + "version": "8.2.0-9", "description": "A2J Viewer standalone and preview app.", "main": "a2jviewer/app", "scripts": { diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 83080237..8c56dc4a 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -308,31 +308,36 @@ export const FieldVM = DefineMap.extend('FieldVM', { } else if (field.type === 'useravatar') { // TODO: validate the JSON string here? value = JSON.stringify(this.userAvatar.serialize()) } else if (field.type === 'datemdy') { - // format date to (mm/dd/yyyy) from acceptable inputs value = this.normalizeDateInput($el.val()) - // date bounds are in 6 or 8 digit texts // need to change to same format as value // it would be sensible to keep bounds in this // format but we need to support it to properly // support older released guides without adding // more complex code - let maxDate = - field.max.substr(0,2) + "/" + - field.max.substr(2,2) + "/" + - field.max.substr(4) - - let minDate = - field.min.substr(0,2) + "/" + - field.min.substr(2,2) + "/" + - field.min.substr(4) - - if (Date.parse(value) < Date.parse(minDate)){ - value = minDate //field.min - } else if (Date.parse(value) > Date.parse(maxDate)){ - value = maxDate //field.max + + if (field.hasOwnProperty('max')) { + let maxDate = + field.max.substr(0, 2) + '/' + + field.max.substr(2, 2) + '/' + + field.max.substr(4) + + if (Date.parse(value) > Date.parse(maxDate)) { + value = maxDate + } + } + + if (field.hasOwnProperty('min')) { + let minDate = + field.min.substr(0, 2) + '/' + + field.min.substr(2, 2) + '/' + + field.min.substr(4) + + if (Date.parse(value) < Date.parse(minDate)) { + value = minDate + } } // render formatted date for end user From 495331e1e101f2b6af9b8f8130b162555aed8c8a Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Mon, 26 Feb 2024 15:41:44 -0600 Subject: [PATCH 18/32] pre-release commit --- index.dev.html | 2 +- index.html | 2 +- package-lock.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.dev.html b/index.dev.html index f93d3ae3..80dbcb37 100644 --- a/index.dev.html +++ b/index.dev.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/index.html b/index.html index 80dbcb37..1343ec79 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 676177c4..fd813c6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-8", + "version": "8.2.0-9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@caliorg/a2jviewer", - "version": "8.2.0-8", + "version": "8.2.0-9", "license": "GNU AGPL v3.0", "dependencies": { "@caliorg/a2jdeps": "^7.1.7", From 13a84d609bdaf46312e487ba978f731aa632804c Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Mon, 26 Feb 2024 15:42:07 -0600 Subject: [PATCH 19/32] 8.2.0-10 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd813c6e..26acd6a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-9", + "version": "8.2.0-10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@caliorg/a2jviewer", - "version": "8.2.0-9", + "version": "8.2.0-10", "license": "GNU AGPL v3.0", "dependencies": { "@caliorg/a2jdeps": "^7.1.7", diff --git a/package.json b/package.json index 5489e81a..e762d078 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-9", + "version": "8.2.0-10", "description": "A2J Viewer standalone and preview app.", "main": "a2jviewer/app", "scripts": { From 8858513ea5923370ba23dbe1fc7f033800718a3a Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Mon, 26 Feb 2024 15:43:13 -0600 Subject: [PATCH 20/32] Update footerVersion --- src/footer/footerVersion.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/footer/footerVersion.js b/src/footer/footerVersion.js index bbe88649..2006f72f 100644 --- a/src/footer/footerVersion.js +++ b/src/footer/footerVersion.js @@ -1,7 +1,7 @@ const version = { - number: '8.2.0-1', - date: '2024-02-08' + number: '8.2.0-10', + date: '2024-02-26' } export default version From acf56d55f9f055cbadd64e944b4f1ac2d4dc6f94 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Fri, 22 Mar 2024 15:18:15 -0500 Subject: [PATCH 21/32] wip date validation improvement --- src/mobile/pages/fields/field/field.js | 38 ++++++++++++++++---------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 8c56dc4a..79371b75 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -308,6 +308,10 @@ export const FieldVM = DefineMap.extend('FieldVM', { } else if (field.type === 'useravatar') { // TODO: validate the JSON string here? value = JSON.stringify(this.userAvatar.serialize()) } else if (field.type === 'datemdy') { + + if ($el.val().length < 6){ + value = "" + } // format date to (mm/dd/yyyy) from acceptable inputs value = this.normalizeDateInput($el.val()) @@ -318,25 +322,29 @@ export const FieldVM = DefineMap.extend('FieldVM', { // support older released guides without adding // more complex code - if (field.hasOwnProperty('max')) { - let maxDate = - field.max.substr(0, 2) + '/' + - field.max.substr(2, 2) + '/' + - field.max.substr(4) + if (value.length) + { + + if (field.hasOwnProperty('max')) { + let maxDate = + field.max.substr(0, 2) + '/' + + field.max.substr(2, 2) + '/' + + field.max.substr(4) - if (Date.parse(value) > Date.parse(maxDate)) { - value = maxDate + if (Date.parse(value) > Date.parse(maxDate)) { + value = maxDate + } } - } - if (field.hasOwnProperty('min')) { - let minDate = - field.min.substr(0, 2) + '/' + - field.min.substr(2, 2) + '/' + - field.min.substr(4) + if (field.hasOwnProperty('min')) { + let minDate = + field.min.substr(0, 2) + '/' + + field.min.substr(2, 2) + '/' + + field.min.substr(4) - if (Date.parse(value) < Date.parse(minDate)) { - value = minDate + if (Date.parse(value) < Date.parse(minDate)) { + value = minDate + } } } From 9ab43801c93c788435b11382e97a90619a39047f Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Fri, 22 Mar 2024 15:22:02 -0500 Subject: [PATCH 22/32] only set answer if valid date or not a date --- src/mobile/pages/fields/field/field.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 79371b75..99c0470e 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -355,7 +355,10 @@ export const FieldVM = DefineMap.extend('FieldVM', { value = $el.val() } - _answerVm.values = value + if (((field.type === 'datemdy') && (value.length >= 6)) || + (field.type != 'datemdy') ){ + _answerVm.values = value + } let errors = _answerVm.errors field.hasError = errors From a9e23f897c158487ac9677dc2293656d982b0067 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Fri, 22 Mar 2024 15:24:46 -0500 Subject: [PATCH 23/32] lint fix --- src/mobile/pages/fields/field/field.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 99c0470e..1202f248 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -356,7 +356,7 @@ export const FieldVM = DefineMap.extend('FieldVM', { } if (((field.type === 'datemdy') && (value.length >= 6)) || - (field.type != 'datemdy') ){ + (field.type !== 'datemdy') ){ _answerVm.values = value } From 093ff97ede4f78de6feb85dda200c14504dbeb23 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Fri, 22 Mar 2024 15:52:35 -0500 Subject: [PATCH 24/32] lint fixes, version update --- index.dev.html | 2 +- index.html | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/mobile/pages/fields/field/field.js | 15 ++++++--------- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/index.dev.html b/index.dev.html index 80dbcb37..1343ec79 100644 --- a/index.dev.html +++ b/index.dev.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/index.html b/index.html index 1343ec79..6a03eb1f 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 26acd6a2..8081cde7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-10", + "version": "8.3.0-0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@caliorg/a2jviewer", - "version": "8.2.0-10", + "version": "8.3.0-0", "license": "GNU AGPL v3.0", "dependencies": { "@caliorg/a2jdeps": "^7.1.7", diff --git a/package.json b/package.json index e762d078..a7289513 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-10", + "version": "8.3.0-0", "description": "A2J Viewer standalone and preview app.", "main": "a2jviewer/app", "scripts": { diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 1202f248..6d139c2b 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -308,9 +308,8 @@ export const FieldVM = DefineMap.extend('FieldVM', { } else if (field.type === 'useravatar') { // TODO: validate the JSON string here? value = JSON.stringify(this.userAvatar.serialize()) } else if (field.type === 'datemdy') { - - if ($el.val().length < 6){ - value = "" + if ($el.val().length < 6) { + value = '' } // format date to (mm/dd/yyyy) from acceptable inputs value = this.normalizeDateInput($el.val()) @@ -322,9 +321,7 @@ export const FieldVM = DefineMap.extend('FieldVM', { // support older released guides without adding // more complex code - if (value.length) - { - + if (value.length) { if (field.hasOwnProperty('max')) { let maxDate = field.max.substr(0, 2) + '/' + @@ -356,9 +353,9 @@ export const FieldVM = DefineMap.extend('FieldVM', { } if (((field.type === 'datemdy') && (value.length >= 6)) || - (field.type !== 'datemdy') ){ - _answerVm.values = value - } + (field.type !== 'datemdy')) { + _answerVm.values = value + } let errors = _answerVm.errors field.hasError = errors From a52f352763ffab1e80338b6b76bb83f278ec22f4 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Fri, 22 Mar 2024 16:06:15 -0500 Subject: [PATCH 25/32] update footer --- demo/viewer/viewer.html | 4 ++-- src/footer/footerVersion.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/viewer/viewer.html b/demo/viewer/viewer.html index 41fac8bf..d5972bec 100644 --- a/demo/viewer/viewer.html +++ b/demo/viewer/viewer.html @@ -53,9 +53,9 @@ diff --git a/src/footer/footerVersion.js b/src/footer/footerVersion.js index 2006f72f..58ae1ede 100644 --- a/src/footer/footerVersion.js +++ b/src/footer/footerVersion.js @@ -1,7 +1,7 @@ const version = { - number: '8.2.0-10', - date: '2024-02-26' + number: '8.3.0-0', + date: '2024-03-22' } export default version From 9a2afc4dfac1a1e45940d5b273d9525e0051c642 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Sat, 23 Mar 2024 05:57:05 -0500 Subject: [PATCH 26/32] prevent invalid date from setting answervm and delete answervm if invalid --- demo/viewer/viewer.html | 4 ++-- index.dev.html | 2 +- index.html | 2 +- src/mobile/pages/fields/field/field.js | 22 +++++++++++++++++----- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/demo/viewer/viewer.html b/demo/viewer/viewer.html index d5972bec..4e10957b 100644 --- a/demo/viewer/viewer.html +++ b/demo/viewer/viewer.html @@ -53,9 +53,9 @@ diff --git a/index.dev.html b/index.dev.html index 1343ec79..5870ddd1 100644 --- a/index.dev.html +++ b/index.dev.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/index.html b/index.html index 6a03eb1f..400bc7b4 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 6d139c2b..030935c6 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -310,9 +310,10 @@ export const FieldVM = DefineMap.extend('FieldVM', { } else if (field.type === 'datemdy') { if ($el.val().length < 6) { value = '' - } + } else { // format date to (mm/dd/yyyy) from acceptable inputs - value = this.normalizeDateInput($el.val()) + value = this.normalizeDateInput($el.val()) + } // date bounds are in 6 or 8 digit texts // need to change to same format as value @@ -351,11 +352,18 @@ export const FieldVM = DefineMap.extend('FieldVM', { } else { value = $el.val() } + //console.log("value after: " + value) + //console.log("answer value before: " + _answerVm.values) - if (((field.type === 'datemdy') && (value.length >= 6)) || - (field.type !== 'datemdy')) { + //if (((field.type === 'datemdy') && (value.length >= 6)) || + // (field.type !== 'datemdy')) { _answerVm.values = value - } + //} else { + // I don't understand why this is necessary but it is + // _answerVm.values = '' + //} + + console.log("answer value: " + _answerVm.values) let errors = _answerVm.errors field.hasError = errors @@ -367,6 +375,10 @@ export const FieldVM = DefineMap.extend('FieldVM', { this.debugPanelMessage(field, value) } + if (((field.type === 'datemdy') && (value.length < 6))){ + _answerVm = undefined + } + return errors }, From e4d5ad301e6f9275e72afa371abdbcf6aa539353 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Sat, 23 Mar 2024 06:00:01 -0500 Subject: [PATCH 27/32] cleanup --- src/mobile/pages/fields/field/field.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 030935c6..9a690676 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -352,18 +352,10 @@ export const FieldVM = DefineMap.extend('FieldVM', { } else { value = $el.val() } - //console.log("value after: " + value) - //console.log("answer value before: " + _answerVm.values) - //if (((field.type === 'datemdy') && (value.length >= 6)) || - // (field.type !== 'datemdy')) { - _answerVm.values = value - //} else { - // I don't understand why this is necessary but it is - // _answerVm.values = '' - //} + _answerVm.values = value - console.log("answer value: " + _answerVm.values) + console.log('answer value: ' + _answerVm.values) let errors = _answerVm.errors field.hasError = errors @@ -375,7 +367,7 @@ export const FieldVM = DefineMap.extend('FieldVM', { this.debugPanelMessage(field, value) } - if (((field.type === 'datemdy') && (value.length < 6))){ + if (((field.type === 'datemdy') && (value.length < 6))) { _answerVm = undefined } From 3f11bb2fdca146b481f13cd2b76e04f17ad9db33 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Sat, 23 Mar 2024 06:01:35 -0500 Subject: [PATCH 28/32] cleanup --- demo/viewer/viewer.html | 4 ++-- index.dev.html | 2 +- index.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/viewer/viewer.html b/demo/viewer/viewer.html index 4e10957b..db4abf2c 100644 --- a/demo/viewer/viewer.html +++ b/demo/viewer/viewer.html @@ -53,9 +53,9 @@ diff --git a/index.dev.html b/index.dev.html index 5870ddd1..400bc7b4 100644 --- a/index.dev.html +++ b/index.dev.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/index.html b/index.html index 400bc7b4..ee262ea9 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file From d918407674c4bdc6e7e3707bb2063c6ff878fd4e Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Tue, 26 Mar 2024 12:22:24 -0500 Subject: [PATCH 29/32] wip author message fix for non-preview vieweer --- src/mobile/pages/pages-vm.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mobile/pages/pages-vm.js b/src/mobile/pages/pages-vm.js index ca96197a..b0a877f4 100644 --- a/src/mobile/pages/pages-vm.js +++ b/src/mobile/pages/pages-vm.js @@ -368,6 +368,11 @@ export default DefineMap.extend('PagesVM', { return // these buttons skip rest of navigate } + if (button.next === constants.qMESSAGE){ + vm.handleMessage(button,vm) + return + } + vm.handleCodeAfter(button, vm, page, logic) // afterLogic fired, but GOTO resolves later vm.setRepeatVariable(button) // set counting variables if exist @@ -568,6 +573,14 @@ export default DefineMap.extend('PagesVM', { } }, + handleMessage(button, ev){ + ev && ev.preventDefault() + this.appState.modalContent = { + title: 'Author note:', + text: button.message || 'You have completed this A2J Guided Interview. Please close your browser window to exit.' + } + }, + handlePreviewResponses (button, ev) { ev && ev.preventDefault() switch (button.next) { @@ -613,6 +626,7 @@ export default DefineMap.extend('PagesVM', { break } }, + /** Track special button clicks in Matomo analytics * @param button button id */ From 8da88117c1b3d9d9da468a9942cf225ebfdbb8b7 Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Tue, 26 Mar 2024 12:31:33 -0500 Subject: [PATCH 30/32] cleanup --- src/mobile/pages/pages-vm.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mobile/pages/pages-vm.js b/src/mobile/pages/pages-vm.js index b0a877f4..64758a4d 100644 --- a/src/mobile/pages/pages-vm.js +++ b/src/mobile/pages/pages-vm.js @@ -368,8 +368,8 @@ export default DefineMap.extend('PagesVM', { return // these buttons skip rest of navigate } - if (button.next === constants.qMESSAGE){ - vm.handleMessage(button,vm) + if (button.next === constants.qMESSAGE) { + vm.handleMessage(button, vm) return } @@ -573,7 +573,7 @@ export default DefineMap.extend('PagesVM', { } }, - handleMessage(button, ev){ + handleMessage (button, ev) { ev && ev.preventDefault() this.appState.modalContent = { title: 'Author note:', From 556db6a24bb5f8669a10716fe3b85f5c6f8daffe Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Tue, 26 Mar 2024 13:12:58 -0500 Subject: [PATCH 31/32] cleanup --- demo/viewer/viewer.html | 4 ++-- index.dev.html | 2 +- index.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/viewer/viewer.html b/demo/viewer/viewer.html index db4abf2c..4e212c0d 100644 --- a/demo/viewer/viewer.html +++ b/demo/viewer/viewer.html @@ -53,9 +53,9 @@ diff --git a/index.dev.html b/index.dev.html index 400bc7b4..ee262ea9 100644 --- a/index.dev.html +++ b/index.dev.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/index.html b/index.html index ee262ea9..680a32e0 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file From c475e67427f40358514e424f892708648470a18b Mon Sep 17 00:00:00 2001 From: Tobias Nteireho Date: Tue, 26 Mar 2024 13:16:21 -0500 Subject: [PATCH 32/32] properly pass event --- demo/viewer/viewer.html | 4 ++-- index.dev.html | 2 +- index.html | 2 +- src/mobile/pages/pages-vm.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/demo/viewer/viewer.html b/demo/viewer/viewer.html index 4e212c0d..4eca491b 100644 --- a/demo/viewer/viewer.html +++ b/demo/viewer/viewer.html @@ -53,9 +53,9 @@ diff --git a/index.dev.html b/index.dev.html index ee262ea9..680a32e0 100644 --- a/index.dev.html +++ b/index.dev.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/index.html b/index.html index 680a32e0..83ac929a 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/src/mobile/pages/pages-vm.js b/src/mobile/pages/pages-vm.js index 64758a4d..c16bb619 100644 --- a/src/mobile/pages/pages-vm.js +++ b/src/mobile/pages/pages-vm.js @@ -369,7 +369,7 @@ export default DefineMap.extend('PagesVM', { } if (button.next === constants.qMESSAGE) { - vm.handleMessage(button, vm) + vm.handleMessage(button, ev) return }