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

IBX-5017: Select all checkbox in Relation List is inconsistent #700

Merged
merged 3 commits into from
Feb 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 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