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-3909 : Prod - Expose cli - load more publications - add pagination #4379

Merged
merged 2 commits into from
Sep 21, 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: 92
assetFileVersion: 93
};
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=92";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=93";
/******/ 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=92";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=93";
/******/ 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=92";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=93";
/******/ 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=92";
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=93";
/******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() {
Expand Down
44 changes: 43 additions & 1 deletion Phraseanet-production-client/dist/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -10058,6 +10058,21 @@ var workzone = function workzone(services) {
updatePublicationList(exposeName);
});

(0, _jquery2.default)('.publication-pagination').on('click', function (event) {
var exposeName = (0, _jquery2.default)('#expose_list').val();
(0, _jquery2.default)('.publication-list').empty().html('<div style="text-align: center;"><img src="/assets/common/images/icons/main-loader.gif" alt="loading"/></div>');
var pageEl = (0, _jquery2.default)('#expose_workzone .publication-page');
var page = pageEl.text();

if ((0, _jquery2.default)(this).hasClass('previous-publication')) {
page = parseInt(page) - 1;
} else if ((0, _jquery2.default)(this).hasClass('next-publication')) {
page = parseInt(page) + 1;
}

updatePublicationList(exposeName, page);
});

(0, _jquery2.default)('#expose_list').on('change', function () {
(0, _jquery2.default)('.publication-list').empty().html('<div style="text-align: center;"><img src="/assets/common/images/icons/main-loader.gif" alt="loading"/></div>');
updatePublicationList(this.value);
Expand Down Expand Up @@ -10991,10 +11006,11 @@ var workzone = function workzone(services) {
}

function updatePublicationList(exposeName) {
var page = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;

_jquery2.default.ajax({
type: 'GET',
url: '/prod/expose/list-publication/?exposeName=' + exposeName,
url: '/prod/expose/list-publication/?exposeName=' + exposeName + '&page=' + page,
data: {
mine: (0, _jquery2.default)("#expose_mine_only").is(':checked') ? 1 : 0,
editable: (0, _jquery2.default)("#expose_editable_only").is(':checked') ? 1 : 0
Expand Down Expand Up @@ -11038,18 +11054,44 @@ var workzone = function workzone(services) {
(0, _jquery2.default)('.expose_logout_link').removeClass('hidden');
(0, _jquery2.default)('.expose_field_mapping').removeClass('hidden');
(0, _jquery2.default)('.add_expose_block').removeClass('hidden');
(0, _jquery2.default)('.expose-pagination').removeClass('hidden');
} else {
(0, _jquery2.default)('.expose_connected').empty();
(0, _jquery2.default)('.expose_logout_link').addClass('hidden');
(0, _jquery2.default)('.expose_field_mapping').addClass('hidden');
(0, _jquery2.default)('.add_expose_block').addClass('hidden');
(0, _jquery2.default)('.expose-pagination').addClass('hidden');
}

if ('previousPage' in data) {
if (data.previousPage) {
(0, _jquery2.default)('#expose_workzone .previous-publication').removeClass('hidden');
(0, _jquery2.default)('#expose_workzone .publication-page').removeClass('hidden');
} else {
(0, _jquery2.default)('#expose_workzone .previous-publication').addClass('hidden');
}
}

if ('nextPage' in data) {
if (data.nextPage) {
(0, _jquery2.default)('#expose_workzone .next-publication').removeClass('hidden');
(0, _jquery2.default)('#expose_workzone .publication-page').removeClass('hidden');
} else {
(0, _jquery2.default)('#expose_workzone .next-publication').addClass('hidden');
}
}

if ('previousPage' in data && 'nextPage' in data && !data.previousPage && !data.nextPage) {
(0, _jquery2.default)('#expose_workzone .publication-page').addClass('hidden');
}

if ('error' in data) {
(0, _jquery2.default)('.publication-list').empty().html(data.error);
}
}
});

(0, _jquery2.default)('#expose_workzone .publication-page').text(page);
}

function getPublicationAssetsList(publicationId, exposeName, assetsContainer) {
Expand Down
44 changes: 43 additions & 1 deletion Phraseanet-production-client/dist/production.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -10058,6 +10058,21 @@ var workzone = function workzone(services) {
updatePublicationList(exposeName);
});

(0, _jquery2.default)('.publication-pagination').on('click', function (event) {
var exposeName = (0, _jquery2.default)('#expose_list').val();
(0, _jquery2.default)('.publication-list').empty().html('<div style="text-align: center;"><img src="/assets/common/images/icons/main-loader.gif" alt="loading"/></div>');
var pageEl = (0, _jquery2.default)('#expose_workzone .publication-page');
var page = pageEl.text();

if ((0, _jquery2.default)(this).hasClass('previous-publication')) {
page = parseInt(page) - 1;
} else if ((0, _jquery2.default)(this).hasClass('next-publication')) {
page = parseInt(page) + 1;
}

updatePublicationList(exposeName, page);
});

(0, _jquery2.default)('#expose_list').on('change', function () {
(0, _jquery2.default)('.publication-list').empty().html('<div style="text-align: center;"><img src="/assets/common/images/icons/main-loader.gif" alt="loading"/></div>');
updatePublicationList(this.value);
Expand Down Expand Up @@ -10991,10 +11006,11 @@ var workzone = function workzone(services) {
}

function updatePublicationList(exposeName) {
var page = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;

_jquery2.default.ajax({
type: 'GET',
url: '/prod/expose/list-publication/?exposeName=' + exposeName,
url: '/prod/expose/list-publication/?exposeName=' + exposeName + '&page=' + page,
data: {
mine: (0, _jquery2.default)("#expose_mine_only").is(':checked') ? 1 : 0,
editable: (0, _jquery2.default)("#expose_editable_only").is(':checked') ? 1 : 0
Expand Down Expand Up @@ -11038,18 +11054,44 @@ var workzone = function workzone(services) {
(0, _jquery2.default)('.expose_logout_link').removeClass('hidden');
(0, _jquery2.default)('.expose_field_mapping').removeClass('hidden');
(0, _jquery2.default)('.add_expose_block').removeClass('hidden');
(0, _jquery2.default)('.expose-pagination').removeClass('hidden');
} else {
(0, _jquery2.default)('.expose_connected').empty();
(0, _jquery2.default)('.expose_logout_link').addClass('hidden');
(0, _jquery2.default)('.expose_field_mapping').addClass('hidden');
(0, _jquery2.default)('.add_expose_block').addClass('hidden');
(0, _jquery2.default)('.expose-pagination').addClass('hidden');
}

if ('previousPage' in data) {
if (data.previousPage) {
(0, _jquery2.default)('#expose_workzone .previous-publication').removeClass('hidden');
(0, _jquery2.default)('#expose_workzone .publication-page').removeClass('hidden');
} else {
(0, _jquery2.default)('#expose_workzone .previous-publication').addClass('hidden');
}
}

if ('nextPage' in data) {
if (data.nextPage) {
(0, _jquery2.default)('#expose_workzone .next-publication').removeClass('hidden');
(0, _jquery2.default)('#expose_workzone .publication-page').removeClass('hidden');
} else {
(0, _jquery2.default)('#expose_workzone .next-publication').addClass('hidden');
}
}

if ('previousPage' in data && 'nextPage' in data && !data.previousPage && !data.nextPage) {
(0, _jquery2.default)('#expose_workzone .publication-page').addClass('hidden');
}

if ('error' in data) {
(0, _jquery2.default)('.publication-list').empty().html(data.error);
}
}
});

(0, _jquery2.default)('#expose_workzone .publication-page').text(page);
}

function getPublicationAssetsList(publicationId, exposeName, assetsContainer) {
Expand Down
10 changes: 10 additions & 0 deletions Phraseanet-production-client/dist/skin-000000.css
Original file line number Diff line number Diff line change
Expand Up @@ -7925,6 +7925,16 @@ dans l'onglet thesaurus : arbres, menus contextuels
border-bottom: 1px solid #076882;
}

#idFrameC #expose_tabs #expose_tab .expose_workzone {
position: absolute;
top: 0;
left: 2px;
right: 2px;
bottom: 0;
display: flex;
flex-direction: column;
}

#idFrameC #baskets {
top: 86px;
border-top: 1px solid #303030;
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/skin-000000.min.css

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Phraseanet-production-client/dist/skin-959595.css
Original file line number Diff line number Diff line change
Expand Up @@ -7940,6 +7940,16 @@ dans l'onglet thesaurus : arbres, menus contextuels
border-bottom: 1px solid #076882;
}

#idFrameC #expose_tabs #expose_tab .expose_workzone {
position: absolute;
top: 0;
left: 2px;
right: 2px;
bottom: 0;
display: flex;
flex-direction: column;
}

#idFrameC #baskets {
top: 86px;
border-top: 1px solid #838383;
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/skin-959595.min.css

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Phraseanet-production-client/dist/skin-FFFFFF.css
Original file line number Diff line number Diff line change
Expand Up @@ -7942,6 +7942,16 @@ dans l'onglet thesaurus : arbres, menus contextuels
border-bottom: 1px solid #076882;
}

#idFrameC #expose_tabs #expose_tab .expose_workzone {
position: absolute;
top: 0;
left: 2px;
right: 2px;
bottom: 0;
display: flex;
flex-direction: column;
}

#idFrameC #baskets {
top: 86px;
border-top: 1px solid #a6a6a6;
Expand Down
2 changes: 1 addition & 1 deletion Phraseanet-production-client/dist/skin-FFFFFF.min.css

Large diffs are not rendered by default.

46 changes: 43 additions & 3 deletions Phraseanet-production-client/src/components/ui/workzone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,21 @@ const workzone = (services) => {
updatePublicationList(exposeName);
});

$('.publication-pagination').on('click', function (event) {
let exposeName = $('#expose_list').val();
$('.publication-list').empty().html('<div style="text-align: center;"><img src="/assets/common/images/icons/main-loader.gif" alt="loading"/></div>');
let pageEl = $('#expose_workzone .publication-page');
let page = pageEl.text();

if ($(this).hasClass('previous-publication')) {
page = parseInt(page) - 1;
} else if ($(this).hasClass('next-publication')) {
page = parseInt(page) + 1;
}

updatePublicationList(exposeName, page);
});

$('#expose_list').on('change', function () {
$('.publication-list').empty().html('<div style="text-align: center;"><img src="/assets/common/images/icons/main-loader.gif" alt="loading"/></div>');
updatePublicationList(this.value);
Expand Down Expand Up @@ -1079,12 +1094,11 @@ const workzone = (services) => {

}

function updatePublicationList(exposeName)
function updatePublicationList(exposeName, page = 1)
{

$.ajax({
type: 'GET',
url: '/prod/expose/list-publication/?exposeName=' + exposeName,
url: '/prod/expose/list-publication/?exposeName=' + exposeName + '&page=' + page,
data:{
mine : $("#expose_mine_only").is(':checked') ? 1 : 0,
editable: $("#expose_editable_only").is(':checked') ? 1 : 0
Expand Down Expand Up @@ -1129,18 +1143,44 @@ const workzone = (services) => {
$('.expose_logout_link').removeClass('hidden');
$('.expose_field_mapping').removeClass('hidden');
$('.add_expose_block').removeClass('hidden');
$('.expose-pagination').removeClass('hidden');
} else {
$('.expose_connected').empty();
$('.expose_logout_link').addClass('hidden');
$('.expose_field_mapping').addClass('hidden');
$('.add_expose_block').addClass('hidden');
$('.expose-pagination').addClass('hidden');
}

if ('previousPage' in data) {
if (data.previousPage) {
$('#expose_workzone .previous-publication').removeClass('hidden');
$('#expose_workzone .publication-page').removeClass('hidden');
} else {
$('#expose_workzone .previous-publication').addClass('hidden');
}
}

if ('nextPage' in data) {
if (data.nextPage) {
$('#expose_workzone .next-publication').removeClass('hidden');
$('#expose_workzone .publication-page').removeClass('hidden');
} else {
$('#expose_workzone .next-publication').addClass('hidden');
}
}

if ('previousPage' in data && 'nextPage' in data && !data.previousPage && !data.nextPage) {
$('#expose_workzone .publication-page').addClass('hidden');
}

if ('error' in data) {
$('.publication-list').empty().html(data.error);
}
}
});

$('#expose_workzone .publication-page').text(page);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@
}
}
}
#expose_tab{
.expose_workzone {
position: absolute;
top: 0;
left: 2px;
right: 2px;
bottom: 0;
display: flex;
flex-direction: column;
}
}
}
#baskets {
top: $tabHeight ;
Expand Down
Loading