Skip to content
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

397 lhi contract #415

Merged
merged 90 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
0974f9c
wip add hebrew
tobiasnteireho Dec 14, 2023
75a2a2a
permissions fix for mac
tobiasnteireho Feb 7, 2024
19a1a74
Merge branch '389-permissions' into 10-2-0-0
tobiasnteireho Feb 8, 2024
4b170d4
10-2-0-0 prerelease, today fix, hebrew, permissions, conditional-space
tobiasnteireho Feb 8, 2024
df546f6
update viewer to correct version
tobiasnteireho Feb 8, 2024
10c351e
wip date type restrictions
tobiasnteireho Feb 16, 2024
a864dab
ui works
tobiasnteireho Feb 25, 2024
fa3dfbb
viewer limits work
tobiasnteireho Feb 26, 2024
68c028d
fix viewwer limit edge case
tobiasnteireho Feb 26, 2024
0c3dc62
cleanup
tobiasnteireho Feb 26, 2024
aa12553
pre release. Update viewer version
tobiasnteireho Feb 26, 2024
8c5c216
Merge pull request #394 from CCALI/393-date-bounds-type-restrict
tobiasnteireho Feb 26, 2024
7593f0f
cleanup
tobiasnteireho Feb 26, 2024
6dad172
Merge branch '393-date-bounds-type-restrict' into 10-2-0-0
tobiasnteireho Feb 26, 2024
1c1a576
cleanup, properly bind today checkbox to field.field.max
tobiasnteireho Mar 28, 2024
85448bb
fix preview version
tobiasnteireho Mar 28, 2024
c5ccf23
fix preview version
tobiasnteireho Mar 28, 2024
ffdea74
field to variable type check util
mikemitchel Aug 8, 2024
a321f04
set default index to dev mode
mikemitchel Aug 8, 2024
f846616
cleanup page-fields code for readability
mikemitchel Aug 8, 2024
db2c8fe
mvp working
mikemitchel Aug 8, 2024
a39955b
better responsive error message
mikemitchel Aug 13, 2024
9c81c4a
add prettier-standard to dev deps
mikemitchel Aug 16, 2024
d859ce7
remove legal-nav references
mikemitchel Aug 16, 2024
4cdaf0a
WIP GuideHealth Model with messages
mikemitchel Aug 16, 2024
2d32cd5
allow QDE load with no var assigned
mikemitchel Aug 19, 2024
5218785
update report to DefineMap/DefineList
mikemitchel Aug 20, 2024
210dc21
udpate report
mikemitchel Aug 20, 2024
91e4b4a
delete guide-health models
mikemitchel Aug 20, 2024
69c6719
restore model
mikemitchel Aug 20, 2024
3a3574a
fix typo
mikemitchel Aug 20, 2024
ceb2889
user internal function
mikemitchel Aug 20, 2024
b6a8ab6
add problem prop to TField
mikemitchel Aug 20, 2024
7d03673
move problem styles out
mikemitchel Aug 20, 2024
a9b8f40
guide-health component skeleton
mikemitchel Aug 20, 2024
bb96bc2
use guide-health component
mikemitchel Aug 20, 2024
52bdad9
tests passing
mikemitchel Aug 20, 2024
66f4654
set default message
mikemitchel Aug 22, 2024
a50bb1d
cleanup comment
mikemitchel Aug 22, 2024
b4e42d5
take message back out of type
mikemitchel Aug 26, 2024
5bb6654
rename and refactor to health-message
mikemitchel Aug 26, 2024
2b5e380
make report type health message work the same as QDE
mikemitchel Aug 26, 2024
c85dbea
remove overload of fields on a page
mikemitchel Aug 26, 2024
bf3d8dc
upgrade variable-editor to DefineMap
mikemitchel Aug 26, 2024
0aaf80d
QDE slightly wider by default
mikemitchel Aug 26, 2024
a69a2aa
edit variable and add variable working
mikemitchel Aug 27, 2024
f8e7816
remove test for now
mikemitchel Aug 27, 2024
13b3fca
fix report-test
mikemitchel Aug 27, 2024
ad7b561
warning messages up, remove bad vars from fields on save
mikemitchel Aug 27, 2024
48cadec
disable var edit button when name empty
mikemitchel Aug 27, 2024
9bb0635
add alertClass to report health-message
mikemitchel Aug 27, 2024
0d62c22
handle non fields
mikemitchel Aug 27, 2024
c3a6c2f
fix indent
mikemitchel Aug 27, 2024
228fcb6
add var warning for non number counting variables
mikemitchel Aug 27, 2024
0a54cd4
move show boolean and alertClass to health-message
mikemitchel Sep 3, 2024
eaa9ea5
remove prettier-standard
mikemitchel Sep 10, 2024
e8a1966
add var-picker-field tests and make them pass
mikemitchel Sep 11, 2024
bd2033c
WIP bad answer alert
tobiasnteireho Sep 13, 2024
0f9995f
cleanup
tobiasnteireho Sep 13, 2024
3730740
cleanup
tobiasnteireho Sep 13, 2024
2cf96ba
Merge remote-tracking branch 'origin/396-field-types' into 397-lhi-co…
tobiasnteireho Sep 14, 2024
6fcdafd
update messages in pages and reports tab
mikemitchel Sep 16, 2024
1d8290a
fix cors
tobiasnteireho Sep 18, 2024
5190b0a
fix config path
tobiasnteireho Sep 18, 2024
2c808d0
Merge branch '406-bad-answer-alert' into 397-lhi-contract
tobiasnteireho Sep 18, 2024
d7d31de
improve reporting
tobiasnteireho Sep 18, 2024
0ee7fac
Merge branch '406-bad-answer-alert' into 397-lhi-contract
tobiasnteireho Sep 18, 2024
708cdd5
use json body
tobiasnteireho Sep 18, 2024
472c75d
Merge branch '406-bad-answer-alert' into 397-lhi-contract
tobiasnteireho Sep 18, 2024
3b0b91e
formatting
tobiasnteireho Sep 18, 2024
cd98a5f
Merge branch '406-bad-answer-alert' into 397-lhi-contract
tobiasnteireho Sep 18, 2024
e9a29e3
fix html
tobiasnteireho Sep 18, 2024
6fd8be8
Merge branch '406-bad-answer-alert' into 397-lhi-contract
tobiasnteireho Sep 18, 2024
4e58d67
add url and version
tobiasnteireho Sep 20, 2024
e559660
add updated viewer
tobiasnteireho Oct 2, 2024
4150d90
cleanup
tobiasnteireho Oct 2, 2024
efeccc1
fix index
tobiasnteireho Oct 2, 2024
0b5b210
add demo and basic tests to health-message
mikemitchel Oct 2, 2024
7cefa85
add field picker tests and message for unknown variable name
mikemitchel Oct 2, 2024
9a408e6
Merge pull request #407 from CCALI/396-field-types
tobiasnteireho Oct 9, 2024
ac0a025
update stricter field types
tobiasnteireho Oct 9, 2024
f77b7b7
fix viewer version
tobiasnteireho Oct 9, 2024
aebaad0
add improved date bounds for date field
tobiasnteireho Oct 18, 2024
2d91c8c
update version
tobiasnteireho Oct 18, 2024
1e30603
update datebound fix for new fieldvm
tobiasnteireho Oct 18, 2024
63115ea
update viewer with no preview var reporting
tobiasnteireho Oct 22, 2024
9701b1e
update answer alerter for url and uri
tobiasnteireho Oct 31, 2024
276b044
update viewer for date fix
tobiasnteireho Nov 18, 2024
e7e9311
minor viewer version update
tobiasnteireho Nov 19, 2024
eff6d1f
final release
tobiasnteireho Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CAJA_WS.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@
$sql="insert into guides (title,editoruid) values ('".$mysqli->real_escape_string($title)."', ".$userid.")";
// If this fails on blank interview, likely `archive` Field in guides db needs to be ticked to allow default value of null
// Also make sure `archive` Field in guides db is set to 0 for default value
if ($res=$mysqli->query($sql)) {
if ($res=$mysqli->query($sql)) {
// Save as content to new folder owned by editor
$newgid=$mysqli->insert_id;
$userdir=$_SESSION['userdir'];
Expand All @@ -584,7 +584,9 @@
$newfile = $newdir.'/Guide.xml';
// ex: some/sever/path/userfiles/dev/guides/Guide924
$assetsdir = GUIDES_DIR.$newdir;
mkdir($assetsdir);

error_log("changing permissions fix for mac" . $assetsdir);
mkdir($assetsdir, 0775, true);
$filename=GUIDES_DIR.$newfile;
// create default Guide.xml and Guide.json
file_put_contents($filename,$xml);
Expand Down
72 changes: 72 additions & 0 deletions bad-answer-alert.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');
header("Access-Control-Allow-Headers: X-Requested-With");


$entityBody = file_get_contents('php://input');
$body_data = json_decode(file_get_contents('php://input'), true);

$path = dirname(__FILE__, 2);
$config = parse_ini_file($path . '/config_env.ini');
$service_email = $config['SERVICE_EMAIL'];


$keys = ["interviewtitle", "viewerversion",
"type", "authoremail"];
$user_agent = $_SERVER['HTTP_USER_AGENT'];

function checkRequest($keys, $user_agent){

foreach ($keys as $key){
if ((empty($_REQUEST[$key])) ||
(strlen($_REQUEST[$key]) === 0) ){
return false;
}
}
return true;
}

if (checkRequest($keys, $user_agent)){
error_log('bad viewer variable alert: '. $user_agent,0);
die();
}

$interviewtitle= ($body_data["guideTitle"]);
$viewerversion= ($body_data["viewerversion"]);
$variables = json_encode($body_data["invalidAnswers"]);
$authorid = ($body_data["authorid"]);
$url = $body_data["url"];
$uri = $body_data["uri"];
$created=$now=date("Y-m-d-H-i-s");


$message="
An A2J user has submitted an answerset with invalid dates or numbers:
<ul>
<li>Bad vars: " . $variables . "</li>
<li>Author ID: " . $authorid . "</li>
<li>Interview Title: " . htmlentities(stripslashes($interviewtitle)) . "</li>
<li>Interview URL: " . htmlentities(stripslashes($url)). "</li>
<li>Interview URI: " . htmlentities(stripslashes($uri)). "</li>
<li>Viewer Version: " . $viewerversion . "</li>
<li>User Agent: " . $user_agent . "</li>
</ul>

";


$to = $service_email;

/* subject */
$subject = "Bad Answer Values";

/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

/* additional headers */
$headers .= "From: A2J Viewer answerset parser <[email protected]>\r\n";

/* and now mail it */
mail($to, $subject, $message, $headers);
2 changes: 1 addition & 1 deletion index.dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
window.less = {async: true, fileSync: true};
</script>

<script src=node_modules/steal/steal.production.js?v=1696363232026" cache-key="v" cache-version="1696363232026" main="a2jauthor/app"></script>
<script src=node_modules/steal/steal.production.js?v=1732047794755" cache-key="v" cache-version="1732047794755" main="a2jauthor/app"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
window.less = {async: true, fileSync: true};
</script>

<script src=node_modules/steal/steal.production.js?v=1697490197354" cache-key="v" cache-version="1697490197354" main="a2jauthor/app"></script>
<script src=node_modules/steal/steal.production.js?v=1733873012596" cache-key="v" cache-version="1733873012596" main="a2jauthor/app"></script>
</body>
</html>
19 changes: 19 additions & 0 deletions legacy/A2J_Pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,23 @@ var handleNullButtonTargets = function (buttons) {
return buttons
}

// this clears vars and problem messages before save in QDE
function checkPageHealth (page) {
var fields = page && page.fields
for (var field of fields) {
// no var assigned, clear any problem message
if (field.name === '') {
field.problem = ''
return
}
// bad var assigned, clear var name and problem message
if (field && field.problem && field.problem.length !== 0) {
field.name = ''
field.problem = ''
}
}
}

// Bring page edit window forward with page content
function gotoPageEdit (pageName) {
$pageEditDialog = window.$('.page-edit-form')
Expand Down Expand Up @@ -487,6 +504,8 @@ function gotoPageEdit (pageName) {
close: function () {
// cleanup QDE resize eventListener
window.removeEventListener('resize', debouncedSetQDEmaxHeight)
// check for mismatched field/variable types and clear assignments if `health problem`
checkPageHealth(page)
// callback from open below
this.removeOverlay()
// Update view and save any time edit dialog closes
Expand Down
79 changes: 79 additions & 0 deletions legacy/viewer/A2J_Languages.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Currently supported languages:
Chinese-Simplified
Korean
French
Hebrew
Polish
Russian
Dutch
Expand Down Expand Up @@ -229,6 +230,9 @@ Languages.regional.en = {
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
Expand Down Expand Up @@ -1365,6 +1369,81 @@ Languages.regional.th = {
RepeatAnd: 'และ'
}

Languages.regional.he = {
locale: 'he',
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:'לִפְתוֹחַ',

}

if ($.datepicker) {
jQuery(function ($) {
/* Save the English in case author switches back */
Expand Down
Loading
Loading