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-3884 translation and advanced search field name #4348

Merged
merged 2 commits into from
Jul 26, 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: 90
assetFileVersion: 91
};
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=90";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=91";
/******/ 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=90";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=91";
/******/ 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=90";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=91";
/******/ 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=90";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=91";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
23 changes: 20 additions & 3 deletions Phraseanet-production-client/dist/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -3968,7 +3968,7 @@ var workzoneFacets = function workzoneFacets(services) {
(0, _jquery2.default)(el).hide();
}
});
ul.append('<button class="see_more_btn">See more</button>');
ul.append('<button class="see_more_btn">' + localeService.t('seeMore') + '</button>');
}
});
(0, _jquery2.default)('.see_more_btn').on('click', function () {
Expand Down Expand Up @@ -65046,6 +65046,12 @@ var preferences = function preferences(services) {
appEvents.emit('search.doRefreshState');
});

$container.on('change', '.preferences-see-real-field-name', function (event) {
var $el = (0, _jquery2.default)(event.currentTarget);
event.preventDefault();
appCommons.userModule.setPref('see_real_field_name', $el.prop('checked') ? '1' : '0');
});

$container.on('change', '.preferences-options-basket-status', function (event) {
var $el = (0, _jquery2.default)(event.currentTarget);
event.preventDefault();
Expand Down Expand Up @@ -69672,6 +69678,15 @@ var searchAdvancedForm = function searchAdvancedForm(services) {
checkFilters(true);
});

(0, _jquery2.default)('#ADVSRCH_FIELDS_ZONE input.see-real-field-name').change(function () {
if ((0, _jquery2.default)(this).prop('checked') === true) {
(0, _jquery2.default)(this).data('real-field', 'field_with_real_name');
} else {
(0, _jquery2.default)(this).data('real-field', 'field_without_real_name');
}
checkFilters(true);
});

var checkFilters = function checkFilters(save) {
var danger = false;
var search = {
Expand Down Expand Up @@ -69788,13 +69803,15 @@ var searchAdvancedForm = function searchAdvancedForm(services) {
// at least one coll checked for this databox
// show again the relevant fields in "sort by" select
(0, _jquery2.default)('.db_' + sbas_id, fieldsSort).show().prop('disabled', false);

var realFieldClass = (0, _jquery2.default)('input.preferences-see-real-field-name').data('real-field');
// show again the relevant fields in "from fields" select
(0, _jquery2.default)('.db_' + sbas_id, fieldsSelect).show().prop('disabled', false);
(0, _jquery2.default)('.db_' + sbas_id, fieldsSelectFake).show().prop('disabled', false);
(0, _jquery2.default)('.db_' + sbas_id + '.' + realFieldClass, fieldsSelectFake).show().prop('disabled', false);
// show the sb
(0, _jquery2.default)('#ADVSRCH_SB_ZONE_' + sbas_id, container).show();
// show again the relevant fields in "date field" select
(0, _jquery2.default)('.db_' + sbas_id, dateFilterSelect).show().prop('disabled', false);
(0, _jquery2.default)('.db_' + sbas_id + '.' + realFieldClass, dateFilterSelect).show().prop('disabled', false);
}
});

Expand Down
23 changes: 20 additions & 3 deletions Phraseanet-production-client/dist/production.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3968,7 +3968,7 @@ var workzoneFacets = function workzoneFacets(services) {
(0, _jquery2.default)(el).hide();
}
});
ul.append('<button class="see_more_btn">See more</button>');
ul.append('<button class="see_more_btn">' + localeService.t('seeMore') + '</button>');
}
});
(0, _jquery2.default)('.see_more_btn').on('click', function () {
Expand Down Expand Up @@ -65046,6 +65046,12 @@ var preferences = function preferences(services) {
appEvents.emit('search.doRefreshState');
});

$container.on('change', '.preferences-see-real-field-name', function (event) {
var $el = (0, _jquery2.default)(event.currentTarget);
event.preventDefault();
appCommons.userModule.setPref('see_real_field_name', $el.prop('checked') ? '1' : '0');
});

$container.on('change', '.preferences-options-basket-status', function (event) {
var $el = (0, _jquery2.default)(event.currentTarget);
event.preventDefault();
Expand Down Expand Up @@ -69672,6 +69678,15 @@ var searchAdvancedForm = function searchAdvancedForm(services) {
checkFilters(true);
});

(0, _jquery2.default)('#ADVSRCH_FIELDS_ZONE input.see-real-field-name').change(function () {
if ((0, _jquery2.default)(this).prop('checked') === true) {
(0, _jquery2.default)(this).data('real-field', 'field_with_real_name');
} else {
(0, _jquery2.default)(this).data('real-field', 'field_without_real_name');
}
checkFilters(true);
});

var checkFilters = function checkFilters(save) {
var danger = false;
var search = {
Expand Down Expand Up @@ -69788,13 +69803,15 @@ var searchAdvancedForm = function searchAdvancedForm(services) {
// at least one coll checked for this databox
// show again the relevant fields in "sort by" select
(0, _jquery2.default)('.db_' + sbas_id, fieldsSort).show().prop('disabled', false);

var realFieldClass = (0, _jquery2.default)('input.preferences-see-real-field-name').data('real-field');
// show again the relevant fields in "from fields" select
(0, _jquery2.default)('.db_' + sbas_id, fieldsSelect).show().prop('disabled', false);
(0, _jquery2.default)('.db_' + sbas_id, fieldsSelectFake).show().prop('disabled', false);
(0, _jquery2.default)('.db_' + sbas_id + '.' + realFieldClass, fieldsSelectFake).show().prop('disabled', false);
// show the sb
(0, _jquery2.default)('#ADVSRCH_SB_ZONE_' + sbas_id, container).show();
// show again the relevant fields in "date field" select
(0, _jquery2.default)('.db_' + sbas_id, dateFilterSelect).show().prop('disabled', false);
(0, _jquery2.default)('.db_' + sbas_id + '.' + realFieldClass, dateFilterSelect).show().prop('disabled', false);
}
});

Expand Down
1 change: 0 additions & 1 deletion Phraseanet-production-client/dist/skin-000000.css
Original file line number Diff line number Diff line change
Expand Up @@ -11233,7 +11233,6 @@ TABLE.explain3 TR TD {
}

.advanced_search_dialog_container.ui-dialog .add_new_term {
width: 54px;
height: 20px;
font-size: 12px;
color: #979797;
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/skin-000000.min.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Phraseanet-production-client/dist/skin-959595.css
Original file line number Diff line number Diff line change
Expand Up @@ -11248,7 +11248,6 @@ TABLE.explain3 TR TD {
}

.advanced_search_dialog_container.ui-dialog .add_new_term {
width: 54px;
height: 20px;
font-size: 12px;
color: #979797;
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/skin-959595.min.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Phraseanet-production-client/dist/skin-FFFFFF.css
Original file line number Diff line number Diff line change
Expand Up @@ -11250,7 +11250,6 @@ TABLE.explain3 TR TD {
}

.advanced_search_dialog_container.ui-dialog .add_new_term {
width: 54px;
height: 20px;
font-size: 12px;
color: #979797;
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/skin-FFFFFF.min.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ const preferences = services => {
}
);

$container.on('change', '.preferences-see-real-field-name', event => {
let $el = $(event.currentTarget);
event.preventDefault();
appCommons.userModule.setPref(
'see_real_field_name',
$el.prop('checked') ? '1' : '0'
);
});

$container.on('change', '.preferences-options-basket-status', event => {
let $el = $(event.currentTarget);
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,15 @@ const searchAdvancedForm = (services) => {
checkFilters(true);
});

$('#ADVSRCH_FIELDS_ZONE input.see-real-field-name').change(function () {
if ($(this).prop('checked') === true) {
$(this).data('real-field', 'field_with_real_name');
} else {
$(this).data('real-field', 'field_without_real_name');
}
checkFilters(true);
});

const checkFilters = (save) => {
var danger = false;
var search = {
Expand Down Expand Up @@ -323,13 +332,15 @@ const searchAdvancedForm = (services) => {
// at least one coll checked for this databox
// show again the relevant fields in "sort by" select
$('.db_' + sbas_id, fieldsSort).show().prop('disabled', false);

let realFieldClass = $('input.preferences-see-real-field-name').data('real-field');
// show again the relevant fields in "from fields" select
$('.db_' + sbas_id, fieldsSelect).show().prop('disabled', false);
$('.db_' + sbas_id, fieldsSelectFake).show().prop('disabled', false);
$('.db_' + sbas_id + '.' + realFieldClass, fieldsSelectFake).show().prop('disabled', false);
// show the sb
$('#ADVSRCH_SB_ZONE_' + sbas_id, container).show();
// show again the relevant fields in "date field" select
$('.db_' + sbas_id, dateFilterSelect).show().prop('disabled', false);
$('.db_' + sbas_id + '.' + realFieldClass, dateFilterSelect).show().prop('disabled', false);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const workzoneFacets = services => {
$(el).hide();
}
});
ul.append('<button class="see_more_btn">See more</button>');
ul.append('<button class="see_more_btn">' + localeService.t('seeMore') + '</button>');
}
});
$('.see_more_btn').on('click', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@
color: #6e6e6e;
}
.add_new_term {
width: 54px;
height: 20px;
font-size: 12px;
color: #979797;
Expand Down
1 change: 1 addition & 0 deletions lib/Alchemy/Phrasea/Controller/Prod/LanguageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public function getTranslationsAction()
'shareTitle' => $translator->trans('prod::dialog sharebasket title'),
'feedbackTitle' => $translator->trans('prod::dialog feedback title'),
'listmanagerTitle' => $translator->trans('prod::dialog listmanager title'),
'seeMore' => $translator->trans('prod::workzone:facet see more'),
]);
}
}
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' => 90
'assetFileVersion' => 91
];

}
Expand Down
Loading