Skip to content

Commit

Permalink
Merge pull request #2498 from oat-sa/fix/AUT-1480/additional-FE-categ…
Browse files Browse the repository at this point in the history
…ory-validation

fix: Additional input validation for category setting
  • Loading branch information
KirylHatalski authored Aug 29, 2024
2 parents 1aa58f6 + abfef61 commit 93f0461
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions views/js/controller/creator/helpers/categorySelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ define([
tags: customCategories,
multiple: true,
tokenSeparators: [',', ' ', ';'],
formatNoMatches: function () {
return __('Enter a custom category');
},
createSearchChoice: (category) => category.match(/^[a-zA-Z_][a-zA-Z0-9_-]*$/)
? { id: category, text: category }
: null,
formatNoMatches: () => __('Category name not allowed'),
maximumInputLength: 32
})
.on('change', () => this.updateCategories());
Expand Down
2 changes: 1 addition & 1 deletion views/js/controller/creator/helpers/outcomeValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ define([
* The RegEx that validates outcome identifiers
* @type {RegExp}
*/
var identifierValidator = /^[a-zA-Z_][a-zA-Z0-9_\.-]*$/;
var identifierValidator = /^[a-zA-Z_][a-zA-Z0-9_-]*$/;

/**
* Checks the validity of an identifier
Expand Down
2 changes: 1 addition & 1 deletion views/js/loader/taoQtiTest.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/js/loader/taoQtiTest.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/js/loader/taoQtiTestRunner.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/js/loader/taoQtiTestXMLEditor.min.js.map

Large diffs are not rendered by default.

0 comments on commit 93f0461

Please sign in to comment.