Skip to content

Commit

Permalink
After QA
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasOsti committed Jan 7, 2025
1 parent ce73425 commit 97587d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
const itemNodeNameCell = itemNode.querySelector('.ibexa-relations__item-name');

itemNode.dataset.contentId = contentId;
itemNode.dataset.locationId = locationId;
itemNode.querySelector('.ibexa-relations__table-action--remove-item').addEventListener('click', removeItem, false);

itemNodeNameCell.dataset.ibexaUpdateContentId = contentId;
Expand Down Expand Up @@ -128,9 +129,15 @@
};
const openUDW = (event) => {
event.preventDefault();

const selectedItemsRow = fieldContainer.querySelectorAll(SELECTOR_ROW);
const config = JSON.parse(event.currentTarget.dataset.udwConfig);
const limit = parseInt(event.currentTarget.dataset.limit, 10);
const selectedLocations = [...selectedItemsRow].reduce((locationsIds, selectedItemRow) => {
const { locationId } = selectedItemRow.dataset;
const parsedLocationId = parseInt(locationId, 10);

return isNaN(parsedLocationId) ? locationsIds : [...locationsIds, parsedLocationId];
}, []);
const title =
limit === 1
? Translator.trans(
Expand All @@ -151,6 +158,7 @@
onCancel: closeUDW,
title,
startingLocationId,
selectedLocations,
...config,
multiple: isSingle ? false : selectedItemsLimit !== 1,
multipleItemsLimit: selectedItemsLimit > 1 ? selectedItemsLimit - selectedItems.length : selectedItemsLimit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@
{% set body_rows = body_rows|merge([{
cols: body_row_cols,
class: 'ibexa-relations__item',
attr: { 'data-content-id': relation.contentInfo.id },
attr: {
'data-content-id': relation.contentInfo.id,
'data-location-id': relation.contentInfo.mainLocationId,
},
}]) %}
{% elseif relation.unauthorized %}
{% set col_raw_unauthorised %}
Expand All @@ -194,7 +197,10 @@
{ content: col_raw_order_input, raw: true, attr: { class: 'ibexa-relations__order-wrapper' } }
],
class: 'ibexa-relations__item',
attr: { 'data-content-id': relation.contentId },
attr: {
'data-content-id': relation.contentId,
'data-location-id': relation.contentInfo.mainLocationId,
},
}]) %}
{% endif %}
{% endfor %}
Expand Down

0 comments on commit 97587d0

Please sign in to comment.