Skip to content

Commit

Permalink
search in thesaurus (#4430)
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix authored Dec 11, 2023
1 parent 4cefad3 commit e72a210
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Phraseanet-production-client/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ module.exports = {
setupDir: _root + 'tests/setup/node.js',
karmaConf: _root + 'config/karma.conf.js',
// change this version when you change JS file for lazy loading
assetFileVersion: 99
assetFileVersion: 100
};
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=99";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=100";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/authenticate.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=99";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=100";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=99";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=100";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/commons.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=99";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=100";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
16 changes: 16 additions & 0 deletions Phraseanet-production-client/dist/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -22280,6 +22280,7 @@ var recordEditorService = function recordEditorService(services) {
var $editTimeArea = void 0;
var $editMonoValTextArea = void 0;
var $editMultiValTextArea = void 0;
var $searchThesaurus = void 0;
var $toolsTabs = void 0;
var $idExplain = void 0;
var $dateFormat = /^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}\/\d{2}\/\d{2}$|^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}-\d{2}-\d{2}$/;
Expand Down Expand Up @@ -22307,6 +22308,7 @@ var recordEditorService = function recordEditorService(services) {
$editMultiValTextArea = (0, _jquery2.default)('#EditTextMultiValued', options.$container);
$toolsTabs = (0, _jquery2.default)('#EDIT_MID_R .tabs', options.$container);
$idExplain = (0, _jquery2.default)('#idExplain', options.$container);
$searchThesaurus = (0, _jquery2.default)('.editor-thesaurus-search', options.$container);

$toolsTabs.tabs({
activate: function activate(event, ui) {
Expand Down Expand Up @@ -22441,6 +22443,10 @@ var recordEditorService = function recordEditorService(services) {
$editTimeArea.hide();
$editDateArea.css('width', 210);
}
}).on('mouseup mousedown keyup keydown', '.editor-thesaurus-search', function (event) {
var currentField = options.fieldCollection.getActiveField();

onUserInputComplete(event, $searchThesaurus.val(), currentField);
});
};

Expand Down Expand Up @@ -22686,6 +22692,8 @@ var recordEditorService = function recordEditorService(services) {
function onSelectField(evt, fieldIndex) {
$editTextArea.blur();
$editMultiValTextArea.blur();
$searchThesaurus.blur();

(0, _jquery2.default)('.editDiaButtons', options.$container).hide();

(0, _jquery2.default)($editTextArea, $editMultiValTextArea).unbind('keyup.maxLength');
Expand Down Expand Up @@ -22802,6 +22810,8 @@ var recordEditorService = function recordEditorService(services) {
if (field.type === 'date') {
$editTextArea.hide();
$editDateArea.show();
$searchThesaurus.hide();

(0, _jquery2.default)('#idEditDateZone', options.$container).show();
$editDateArea.val(field._value);

Expand Down Expand Up @@ -22830,6 +22840,7 @@ var recordEditorService = function recordEditorService(services) {
(0, _jquery2.default)('#idEditDateZone', options.$container).hide();
$editTextArea.show();
$editTextArea.css('height', '100%');
$searchThesaurus.show();

if (field.input_disable) {
$editTextArea.prop('disabled', true);
Expand Down Expand Up @@ -22906,6 +22917,8 @@ var recordEditorService = function recordEditorService(services) {
return $editMultiValTextArea.focus();
}, 50);

$searchThesaurus.show();

// reveal_mval();
}
}
Expand Down Expand Up @@ -23033,6 +23046,9 @@ var recordEditorService = function recordEditorService(services) {

$editTextArea.blur();
$editMultiValTextArea.blur();
$searchThesaurus.blur();

$searchThesaurus.hide();

(0, _jquery2.default)('#idFieldNameEdit', options.$container).html('[STATUS]');
$idExplain.html(' ');
Expand Down
16 changes: 16 additions & 0 deletions Phraseanet-production-client/dist/production.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -22280,6 +22280,7 @@ var recordEditorService = function recordEditorService(services) {
var $editTimeArea = void 0;
var $editMonoValTextArea = void 0;
var $editMultiValTextArea = void 0;
var $searchThesaurus = void 0;
var $toolsTabs = void 0;
var $idExplain = void 0;
var $dateFormat = /^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}\/\d{2}\/\d{2}$|^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}-\d{2}-\d{2}$/;
Expand Down Expand Up @@ -22307,6 +22308,7 @@ var recordEditorService = function recordEditorService(services) {
$editMultiValTextArea = (0, _jquery2.default)('#EditTextMultiValued', options.$container);
$toolsTabs = (0, _jquery2.default)('#EDIT_MID_R .tabs', options.$container);
$idExplain = (0, _jquery2.default)('#idExplain', options.$container);
$searchThesaurus = (0, _jquery2.default)('.editor-thesaurus-search', options.$container);

$toolsTabs.tabs({
activate: function activate(event, ui) {
Expand Down Expand Up @@ -22441,6 +22443,10 @@ var recordEditorService = function recordEditorService(services) {
$editTimeArea.hide();
$editDateArea.css('width', 210);
}
}).on('mouseup mousedown keyup keydown', '.editor-thesaurus-search', function (event) {
var currentField = options.fieldCollection.getActiveField();

onUserInputComplete(event, $searchThesaurus.val(), currentField);
});
};

Expand Down Expand Up @@ -22686,6 +22692,8 @@ var recordEditorService = function recordEditorService(services) {
function onSelectField(evt, fieldIndex) {
$editTextArea.blur();
$editMultiValTextArea.blur();
$searchThesaurus.blur();

(0, _jquery2.default)('.editDiaButtons', options.$container).hide();

(0, _jquery2.default)($editTextArea, $editMultiValTextArea).unbind('keyup.maxLength');
Expand Down Expand Up @@ -22802,6 +22810,8 @@ var recordEditorService = function recordEditorService(services) {
if (field.type === 'date') {
$editTextArea.hide();
$editDateArea.show();
$searchThesaurus.hide();

(0, _jquery2.default)('#idEditDateZone', options.$container).show();
$editDateArea.val(field._value);

Expand Down Expand Up @@ -22830,6 +22840,7 @@ var recordEditorService = function recordEditorService(services) {
(0, _jquery2.default)('#idEditDateZone', options.$container).hide();
$editTextArea.show();
$editTextArea.css('height', '100%');
$searchThesaurus.show();

if (field.input_disable) {
$editTextArea.prop('disabled', true);
Expand Down Expand Up @@ -22906,6 +22917,8 @@ var recordEditorService = function recordEditorService(services) {
return $editMultiValTextArea.focus();
}, 50);

$searchThesaurus.show();

// reveal_mval();
}
}
Expand Down Expand Up @@ -23033,6 +23046,9 @@ var recordEditorService = function recordEditorService(services) {

$editTextArea.blur();
$editMultiValTextArea.blur();
$searchThesaurus.blur();

$searchThesaurus.hide();

(0, _jquery2.default)('#idFieldNameEdit', options.$container).html('[STATUS]');
$idExplain.html(' ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const recordEditorService = services => {
let $editTimeArea;
let $editMonoValTextArea;
let $editMultiValTextArea;
let $searchThesaurus;
let $toolsTabs;
let $idExplain;
let $dateFormat = /^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}\/\d{2}\/\d{2}$|^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$|^\d{4}-\d{2}-\d{2}$/;
Expand All @@ -59,6 +60,7 @@ const recordEditorService = services => {
$editMultiValTextArea = $('#EditTextMultiValued', options.$container);
$toolsTabs = $('#EDIT_MID_R .tabs', options.$container);
$idExplain = $('#idExplain', options.$container);
$searchThesaurus = $('.editor-thesaurus-search', options.$container);

$toolsTabs.tabs({
activate: function (event, ui) {
Expand Down Expand Up @@ -213,6 +215,11 @@ const recordEditorService = services => {
$editDateArea.css('width',210);
}
})
.on('mouseup mousedown keyup keydown', '.editor-thesaurus-search', (event) => {
let currentField = options.fieldCollection.getActiveField();

onUserInputComplete(event, $searchThesaurus.val(), currentField);
})
;
};

Expand Down Expand Up @@ -476,6 +483,8 @@ const recordEditorService = services => {
function onSelectField(evt, fieldIndex) {
$editTextArea.blur();
$editMultiValTextArea.blur();
$searchThesaurus.blur();

$('.editDiaButtons', options.$container).hide();

$($editTextArea, $editMultiValTextArea).unbind('keyup.maxLength');
Expand Down Expand Up @@ -607,6 +616,8 @@ const recordEditorService = services => {
if (field.type === 'date') {
$editTextArea.hide();
$editDateArea.show();
$searchThesaurus.hide();

$('#idEditDateZone', options.$container).show();
$editDateArea.val(field._value);

Expand Down Expand Up @@ -635,6 +646,7 @@ const recordEditorService = services => {
$('#idEditDateZone', options.$container).hide();
$editTextArea.show();
$editTextArea.css('height', '100%');
$searchThesaurus.show();

if (field.input_disable) {
$editTextArea.prop('disabled', true);
Expand Down Expand Up @@ -718,6 +730,8 @@ const recordEditorService = services => {

self.setTimeout(() => $editMultiValTextArea.focus(), 50);

$searchThesaurus.show();

// reveal_mval();
}
}
Expand Down Expand Up @@ -867,6 +881,9 @@ const recordEditorService = services => {

$editTextArea.blur();
$editMultiValTextArea.blur();
$searchThesaurus.blur();

$searchThesaurus.hide();

$('#idFieldNameEdit', options.$container).html('[STATUS]');
$idExplain.html(' ');
Expand Down
2 changes: 1 addition & 1 deletion lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getGlobals()
{
return [
// change this version when you change JS file to force the navigation to reload js file
'assetFileVersion' => 99
'assetFileVersion' => 100
];

}
Expand Down
1 change: 1 addition & 0 deletions templates/web/prod/actions/edit_default.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
</ul>
{% if thesaurus %}
<div id='TH_Ofull'>
<input type="text" class="editor-thesaurus-search" style="margin-top: 10px; margin-left: 10px; display: none;">
<div class='thesaurus edit-thesaurus-action'>
<p id='TH_T.{{ databox.get_sbas_id() }}.T' class="thesaurus-db-root">
<u id='TH_P.{{ databox.get_sbas_id() }}.T'>+</u><a id='GL_W.{{ databox.get_sbas_id() }}.T' style='FONT-WEIGHT: bold;'>{{ databox.get_label(app['locale']) }}</a>
Expand Down

0 comments on commit e72a210

Please sign in to comment.