Commit 17531234 authored by Pramith Dayananda's avatar Pramith Dayananda Committed by Robert Lyon
Browse files

Bug 1694875: Annotation field validated via JS

Validation on portfolio collections
Validation on smartevidence grid
Behat tests added
A new feature file added

Change-Id: Ib5adf627f3391fb53805b0566a7c405313a3066b
parent 9f5861e4
......@@ -201,7 +201,10 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
'width' => '100%',
'height' => $height . 'px',
'defaultvalue' => $text,
'rules' => array('maxlength' => 65536),
'rules' => array(
'maxlength' => 65536,
'required' => true
),
),
'annotationreadonlymsg' => array(
'type' => 'html',
......@@ -455,7 +458,6 @@ class PluginBlocktypeAnnotation extends MaharaCoreBlocktype {
});
}
});
EOF;
}
}
......@@ -53,6 +53,7 @@ $string['makepublicrequestbyownermessage'] = '%s has requested that you make you
$string['makepublicrequestsent'] = 'A message has been sent to %s to request that the feedback be made public.';
$string['makepublicrequestbyauthormessage'] = '%s has requested that you make their feedback public.';
$string['annotationempty'] = 'This field is required.';
$string['annotationfeedbackempty'] = 'Your feedback is empty. Please enter a message.';
$string['newannotationfeedbacknotificationsubject'] = 'New feedback on %s';
......
......@@ -163,16 +163,25 @@ jQuery(function($) {
values[item.name] = item.value;
}
});
values['tags'] = tags.join();
values['framework'] = params.framework;
values['view'] = params.view;
values['option'] = params.option;
values['action'] = 'update';
if (hastinymce) {
tinyMCE.execCommand('mceRemoveEditor', false, "instconf_text");
if (values["text"].length == 0) {
if ($("#instconf_text").parent().find('.errmsg').length == 0) {
$("#instconf_text").parent().append('<div class="errmsg"><span>' + get_string_ajax('annotationempty', 'artefact.annotation') + '</span></div>');
}
$('#instconf button.submitcancel.submit').prop("disabled", false);
}
else {
values['tags'] = tags.join();
values['framework'] = params.framework;
values['view'] = params.view;
values['option'] = params.option;
values['action'] = 'update';
if (hastinymce) {
tinyMCE.execCommand('mceRemoveEditor', false, "instconf_text");
}
editmatrix_update(values);
hide_dock();
}
editmatrix_update(values);
hide_dock();
});
// When we are saving the annotation feedback form - changing the evidence status
$('#annotationfeedback').on('submit', function(se) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment