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

PHRAS-3957: editing: search in thesaurus, from the th zone #4430

Merged
merged 4 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe only on keyup ? to be user-tested to see if refresh on click is expected or annoying...

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