Skip to content

Commit

Permalink
IBX-5017: Select all checkbox in Relation List is inconsistent (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabowskiM authored Feb 21, 2023
1 parent 0ccff6e commit 2d3ee7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bundle/Resources/public/js/scripts/admin.table.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
subCheckboxes.forEach((subCheckbox) => {
if (!subCheckbox.disabled) {
subCheckbox.checked = mainCheckbox.checked;
subCheckbox.dispatchEvent(new CustomEvent('change', { detail: { isFromJS: true } }));
subCheckbox.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { isFromJS: true } }));
}
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
closeUDW();
updateFieldState();
updateAddBtnState();
relationsTable.dispatchEvent(new CustomEvent('ibexa-refresh-main-table-checkbox'));
};
const openUDW = (event) => {
event.preventDefault();
Expand Down Expand Up @@ -142,9 +143,11 @@
const { formatShortDateTime } = ibexa.helpers.timezone;
const contentTypeName = ibexa.helpers.contentType.getContentTypeName(item.ContentInfo.Content.ContentTypeInfo.identifier);
const contentName = escapeHTML(item.ContentInfo.Content.TranslatedName);
const contentId = item.ContentInfo.Content._id;
const { rowTemplate } = relationsWrapper.dataset;

return rowTemplate
.replace('{{ content_id }}', contentId)
.replace('{{ content_name }}', contentName)
.replace('{{ content_type_name }}', contentTypeName)
.replace('{{ published_date }}', formatShortDateTime(item.ContentInfo.Content.publishedDate))
Expand Down Expand Up @@ -206,6 +209,7 @@
updateInputValue(selectedItems);
updateFieldState();
updateAddBtnState();
relationsTable.dispatchEvent(new CustomEvent('ibexa-refresh-main-table-checkbox'));
};
const removeItem = (event) => {
const row = event.target.closest('.ibexa-relations__item');
Expand All @@ -218,6 +222,7 @@
updateInputValue(selectedItems);
updateFieldState();
updateAddBtnState();
relationsTable.dispatchEvent(new CustomEvent('ibexa-refresh-main-table-checkbox'));
};
const findOrderInputs = () => {
return [...relationsContainer.querySelectorAll('.ibexa-relations__order-input')];
Expand Down

0 comments on commit 2d3ee7d

Please sign in to comment.