From 9c9214feed0e068212df673de34d271985ecac4f Mon Sep 17 00:00:00 2001 From: Robert Patrascu Date: Wed, 24 Sep 2025 12:41:09 +0200 Subject: [PATCH 1/8] IBX-10609: Add support for modal confirmation when deleting notifications --- .../js/scripts/admin.notifications.modal.js | 24 ++++++++++------- src/bundle/Resources/public/scss/_modals.scss | 8 ++++++ .../account/notifications/list.html.twig | 26 ++++++++++++++----- .../account/notifications/list_item.html.twig | 12 ++++++--- 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js index 7b97c35064..1392a75053 100644 --- a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js +++ b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js @@ -2,6 +2,7 @@ let currentPageLink = null; let getNotificationsStatusErrorShowed = false; let lastFailedCountFetchNotificationNode = null; + let selectedNotificationId = null; const SELECTOR_MODAL_ITEM = '.ibexa-notifications-modal__item'; const SELECTOR_MODAL_RESULTS = '.ibexa-notifications-modal__results .ibexa-scrollable-wrapper'; const SELECTOR_MODAL_TITLE = '.ibexa-side-panel__header'; @@ -214,9 +215,8 @@ currentTarget.textContent.trim() === markAsReadLabel ? markAsRead({ currentTarget }) : markAsUnread({ currentTarget }); }; - const deleteNotification = ({ currentTarget }) => { - const { notificationId } = currentTarget.dataset; - const deleteLink = Routing.generate('ibexa.notifications.delete', { notificationId }); + const deleteNotification = () => { + const deleteLink = Routing.generate('ibexa.notifications.delete', { notificationId: selectedNotificationId }); const message = Translator.trans( /* @Desc("Cannot delete notification") */ 'notifications.modal.message.error.delete', {}, @@ -227,11 +227,8 @@ .then(getJsonFromResponse) .then((response) => { if (response.status === 'success') { - const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${notificationId}"]`); - const menuBranch = currentTarget.closest('.ibexa-multilevel-popup-menu__branch'); - const menuInstance = ibexa.helpers.objectInstances.getInstance(menuBranch.menuInstanceElement); + const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`); - menuInstance.closeMenu(); notification.remove(); getNotificationsStatus(); } else { @@ -245,15 +242,24 @@ const attachActionsListeners = () => { const attachListener = (node, callback) => node.addEventListener('click', callback, false); const markAsButtons = doc.querySelectorAll('.ibexa-notifications-modal--mark-as'); - const deleteButtons = doc.querySelectorAll('.ibexa-notifications-modal--delete'); + const deleteButtons = doc.querySelectorAll('.ibexa-notifications-open-modal-button'); + const deleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm'); + + const setNotificationId = ({ currentTarget }) => { + selectedNotificationId = currentTarget.dataset.notificationId; + }; markAsButtons.forEach((markAsButton) => { attachListener(markAsButton, handleMarkAsAction); }); deleteButtons.forEach((deleteButton) => { - attachListener(deleteButton, deleteNotification); + attachListener(deleteButton, setNotificationId); }); + + if (deleteButton) { + deleteButton.addEventListener('click', deleteNotification); + } }; const showNotificationPage = (pageHtml) => { const modalResults = panel.querySelector(SELECTOR_MODAL_RESULTS); diff --git a/src/bundle/Resources/public/scss/_modals.scss b/src/bundle/Resources/public/scss/_modals.scss index e2e53774ef..e3d1f711be 100644 --- a/src/bundle/Resources/public/scss/_modals.scss +++ b/src/bundle/Resources/public/scss/_modals.scss @@ -97,3 +97,11 @@ } } } + +.modal-backdrop { + &.fade { + &.show { + z-index: 199; + } + } +} diff --git a/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig b/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig index 1d0cea87a2..1f35d22263 100644 --- a/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig @@ -12,16 +12,30 @@ } %} {% block tbody %} {% if pager.count is same as(0) %} -
- -

{{ 'notifications.list.empty'|trans|desc('You don\'t have any notifications.') }}

-
+
+ +

{{ 'notifications.list.empty'|trans|desc('You don\'t have any notifications.') }}

+
{% else %} {% for notification in sidebarNotifications %} {{ notification|raw }} {% endfor %} {% endif %} + + {% embed '@ibexadesign/ui/modal/delete_confirmation.html.twig' with { + id: 'delete-notification-modal', + message: 'notification.modal.delete.confirm_message'|trans|desc('Are you sure you want to delete this notification?'), + } %} + + {% trans_default_domain 'ibexa_product_catalog' %} + + {% block confirm_button %} + + {% endblock %} + {% endembed %} {% endblock %} {% endembed %} diff --git a/src/bundle/Resources/views/themes/admin/account/notifications/list_item.html.twig b/src/bundle/Resources/views/themes/admin/account/notifications/list_item.html.twig index 2da818d5ec..2dbb1c5328 100644 --- a/src/bundle/Resources/views/themes/admin/account/notifications/list_item.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/notifications/list_item.html.twig @@ -40,14 +40,18 @@ {% set popup_items = popup_items|merge([{ label: notification.isPending == 0 ? 'notification.mark_as_unread'|trans|desc('Mark as unread') : 'notification.mark_as_read'|trans|desc('Mark as read'), - action_attr: { - class: 'ibexa-notifications-modal--mark-as ibexa-notifications-modal--mark-as-' ~ (notification.isPending == 0 ? 'unread' : 'read'), + action_attr: { + class: 'ibexa-notifications-modal--mark-as ibexa-notifications-modal--mark-as-' ~ (notification.isPending == 0 ? 'unread' : 'read'), 'data-notification-id': notification.id }, }]) %} {% set popup_items = popup_items|merge([{ label: 'notification.delete'|trans|desc('Delete'), - action_attr: { class: 'ibexa-notifications-modal--delete', 'data-notification-id': notification.id }, + action_attr: { + class: 'ibexa-notifications-open-modal-button', + 'data-notification-id': notification.id, + 'data-bs-toggle': 'modal', + 'data-bs-target': '#delete-notification-modal', } }]) %} {% embed '@ibexadesign/ui/component/table/table_body_row.html.twig' with { @@ -71,7 +75,7 @@ {{ notification_type }}
{{ message }}
- {{ notification.created|ibexa_short_datetime }} + {{ notification.created|ibexa_short_datetime }}
{% endblock %} {% endembed %} From 488450555956cce9eb0f69ca197f6f268f9bf827 Mon Sep 17 00:00:00 2001 From: Robert Patrascu Date: Wed, 24 Sep 2025 13:00:59 +0200 Subject: [PATCH 2/8] yarn fix --- .../Resources/public/js/scripts/admin.notifications.modal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js index 1392a75053..577c544fc5 100644 --- a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js +++ b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js @@ -227,7 +227,9 @@ .then(getJsonFromResponse) .then((response) => { if (response.status === 'success') { - const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`); + const notification = doc.querySelector( + `.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`, + ); notification.remove(); getNotificationsStatus(); From 4dff162f4c74b8ca9c04f56827c0e33c2a473c5f Mon Sep 17 00:00:00 2001 From: Robert Patrascu Date: Wed, 24 Sep 2025 13:11:05 +0200 Subject: [PATCH 3/8] IBX-10609: Rename deleteButton to confirmDeleteButton for clarity in notifications modal --- .../public/js/scripts/admin.notifications.modal.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js index 577c544fc5..7c632f6938 100644 --- a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js +++ b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js @@ -227,9 +227,7 @@ .then(getJsonFromResponse) .then((response) => { if (response.status === 'success') { - const notification = doc.querySelector( - `.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`, - ); + const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`); notification.remove(); getNotificationsStatus(); @@ -245,7 +243,7 @@ const attachListener = (node, callback) => node.addEventListener('click', callback, false); const markAsButtons = doc.querySelectorAll('.ibexa-notifications-modal--mark-as'); const deleteButtons = doc.querySelectorAll('.ibexa-notifications-open-modal-button'); - const deleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm'); + const confirmDeleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm'); const setNotificationId = ({ currentTarget }) => { selectedNotificationId = currentTarget.dataset.notificationId; @@ -259,8 +257,8 @@ attachListener(deleteButton, setNotificationId); }); - if (deleteButton) { - deleteButton.addEventListener('click', deleteNotification); + if (confirmDeleteButton) { + confirmDeleteButton.addEventListener('click', deleteNotification); } }; const showNotificationPage = (pageHtml) => { From 9b11cab5d0de5175f836cc618ef918b146c36e16 Mon Sep 17 00:00:00 2001 From: Robert Patrascu Date: Wed, 24 Sep 2025 13:24:31 +0200 Subject: [PATCH 4/8] run fix yarn again :) --- .../Resources/public/js/scripts/admin.notifications.modal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js index 7c632f6938..e87e73c087 100644 --- a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js +++ b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js @@ -227,7 +227,9 @@ .then(getJsonFromResponse) .then((response) => { if (response.status === 'success') { - const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`); + const notification = doc.querySelector( + `.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`, + ); notification.remove(); getNotificationsStatus(); From ebae35f0cbc4530474e25faf3b85a974ef5165cc Mon Sep 17 00:00:00 2001 From: Robert Patrascu <162968581+RopRaptor@users.noreply.github.com> Date: Wed, 24 Sep 2025 19:26:38 +0200 Subject: [PATCH 5/8] Update src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aleksandra Bożek --- .../views/themes/admin/account/notifications/list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig b/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig index 1f35d22263..e931341dcb 100644 --- a/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig +++ b/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig @@ -14,7 +14,7 @@ {% if pager.count is same as(0) %}

{{ 'notifications.list.empty'|trans|desc('You don\'t have any notifications.') }}

From 44655b3cbe001c86fb5b83db0662b97954fbf1d7 Mon Sep 17 00:00:00 2001 From: Robert Patrascu Date: Thu, 25 Sep 2025 08:28:01 +0200 Subject: [PATCH 6/8] Installed Ibexa Commerce 4.6.x-dev --- .idea/copilot.data.migration.agent.xml | 6 + .idea/copilot.data.migration.ask.xml | 6 + .idea/copilot.data.migration.ask2agent.xml | 6 + .idea/copilot.data.migration.edit.xml | 6 + .idea/inspectionProfiles/Project_Default.xml | 6 + .idea/material_theme_project_new.xml | 13 ++ .../shelved.patch | 41 ++++ ...e_Update_at_24_09_2025_13_11__Changes_.xml | 4 + .../shelf/run_fix_yarn_again__)/shelved.patch | 195 ++++++++++++++++++ .idea/shelf/run_fix_yarn_again___.xml | 4 + .idea/workspace.xml | 142 +++++++++++++ 11 files changed, 429 insertions(+) create mode 100644 .idea/copilot.data.migration.agent.xml create mode 100644 .idea/copilot.data.migration.ask.xml create mode 100644 .idea/copilot.data.migration.ask2agent.xml create mode 100644 .idea/copilot.data.migration.edit.xml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/material_theme_project_new.xml create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11_[Changes]/shelved.patch create mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11__Changes_.xml create mode 100644 .idea/shelf/run_fix_yarn_again__)/shelved.patch create mode 100644 .idea/shelf/run_fix_yarn_again___.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/copilot.data.migration.agent.xml b/.idea/copilot.data.migration.agent.xml new file mode 100644 index 0000000000..4ea72a911a --- /dev/null +++ b/.idea/copilot.data.migration.agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask.xml b/.idea/copilot.data.migration.ask.xml new file mode 100644 index 0000000000..7ef04e2ea0 --- /dev/null +++ b/.idea/copilot.data.migration.ask.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask2agent.xml b/.idea/copilot.data.migration.ask2agent.xml new file mode 100644 index 0000000000..1f2ea11e7f --- /dev/null +++ b/.idea/copilot.data.migration.ask2agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.edit.xml b/.idea/copilot.data.migration.edit.xml new file mode 100644 index 0000000000..8648f9401a --- /dev/null +++ b/.idea/copilot.data.migration.edit.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000..03d9549ea8 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000000..64ade4c5d9 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11_[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11_[Changes]/shelved.patch new file mode 100644 index 0000000000..3d93224c5b --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11_[Changes]/shelved.patch @@ -0,0 +1,41 @@ +Index: src/bundle/Resources/public/js/scripts/admin.notifications.modal.js +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP +<+>(function (global, doc, ibexa, Translator, Routing) {\r\n let currentPageLink = null;\r\n let getNotificationsStatusErrorShowed = false;\r\n let lastFailedCountFetchNotificationNode = null;\r\n let selectedNotificationId = null;\r\n const SELECTOR_MODAL_ITEM = '.ibexa-notifications-modal__item';\r\n const SELECTOR_MODAL_RESULTS = '.ibexa-notifications-modal__results .ibexa-scrollable-wrapper';\r\n const SELECTOR_MODAL_TITLE = '.ibexa-side-panel__header';\r\n const SELECTOR_LIST = '.ibexa-list--notifications';\r\n const CLASS_MODAL_LOADING = 'ibexa-notifications-modal--loading';\r\n const INTERVAL = 30000;\r\n const panel = doc.querySelector('.ibexa-notifications-modal');\r\n const { showErrorNotification, showWarningNotification } = ibexa.helpers.notification;\r\n const { getJsonFromResponse, getTextFromResponse } = ibexa.helpers.request;\r\n const handleNotificationClickRequest = (notification, response) => {\r\n if (response.status === 'success') {\r\n notification.classList.add('ibexa-notifications-modal__item--read');\r\n }\r\n\r\n if (response.redirect) {\r\n global.location = response.redirect;\r\n }\r\n };\r\n const handleNotificationClick = (notification) => {\r\n const notificationReadLink = notification.dataset.notificationRead;\r\n const request = new Request(notificationReadLink, {\r\n mode: 'cors',\r\n credentials: 'same-origin',\r\n });\r\n\r\n fetch(request).then(getJsonFromResponse).then(handleNotificationClickRequest.bind(null, notification)).catch(showErrorNotification);\r\n };\r\n\r\n const getNotificationsStatus = () => {\r\n const notificationsTable = panel.querySelector(SELECTOR_LIST);\r\n const notificationsStatusLink = notificationsTable.dataset.notificationsCount;\r\n const request = new Request(notificationsStatusLink, {\r\n mode: 'cors',\r\n credentials: 'same-origin',\r\n headers: {\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n },\r\n });\r\n\r\n return fetch(request)\r\n .then(getJsonFromResponse)\r\n .then((notificationsInfo) => {\r\n setPendingNotificationCount(notificationsInfo);\r\n updateModalTitleTotalInfo(notificationsInfo.total);\r\n getNotificationsStatusErrorShowed = false;\r\n })\r\n .catch(onGetNotificationsStatusFailure);\r\n };\r\n const onGetNotificationsStatusFailure = (error) => {\r\n if (lastFailedCountFetchNotificationNode && doc.contains(lastFailedCountFetchNotificationNode)) {\r\n return;\r\n }\r\n\r\n if (!getNotificationsStatusErrorShowed) {\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot update notifications\") */ 'notifications.modal.message.error',\r\n { error: error.message },\r\n 'ibexa_notifications',\r\n );\r\n\r\n showWarningNotification(message, (notificationNode) => {\r\n lastFailedCountFetchNotificationNode = notificationNode;\r\n });\r\n }\r\n\r\n getNotificationsStatusErrorShowed = true;\r\n };\r\n const updateModalTitleTotalInfo = (notificationsCount) => {\r\n const modalTitle = panel.querySelector(SELECTOR_MODAL_TITLE);\r\n const modalFooter = panel.querySelector('.ibexa-notifications-modal__view-all-btn--count');\r\n\r\n modalFooter.textContent = ` (${notificationsCount})`;\r\n modalTitle.dataset.notificationsTotal = `(${notificationsCount})`;\r\n\r\n if (notificationsCount < 10) {\r\n panel.querySelector('.ibexa-notifications-modal__count').textContent = `(${notificationsCount})`;\r\n }\r\n };\r\n const updatePendingNotificationsView = (notificationsInfo) => {\r\n const noticeDot = doc.querySelector('.ibexa-header-user-menu__notice-dot');\r\n\r\n noticeDot.dataset.count = notificationsInfo.pending;\r\n noticeDot.classList.toggle('ibexa-header-user-menu__notice-dot--no-notice', notificationsInfo.pending === 0);\r\n };\r\n const setPendingNotificationCount = (notificationsInfo) => {\r\n updatePendingNotificationsView(notificationsInfo);\r\n\r\n const notificationsTable = panel.querySelector(SELECTOR_LIST);\r\n const notificationsTotal = notificationsInfo.total;\r\n const notificationsTotalOld = parseInt(notificationsTable.dataset.notificationsTotal, 10);\r\n\r\n markAllAsReadBtn.disabled = notificationsInfo.pending === 0;\r\n\r\n if (notificationsTotal !== notificationsTotalOld) {\r\n notificationsTable.dataset.notificationsTotal = notificationsTotal;\r\n\r\n fetchNotificationPage(currentPageLink);\r\n }\r\n };\r\n const markAllAsRead = () => {\r\n const markAllAsReadLink = Routing.generate('ibexa.notifications.mark_all_as_read');\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot mark all notifications as read\") */ 'notifications.modal.message.error.mark_all_as_read',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n fetch(markAllAsReadLink, { mode: 'same-origin', credentials: 'same-origin' })\r\n .then(getJsonFromResponse)\r\n .then((response) => {\r\n if (response.status === 'success') {\r\n const allUnreadNotifications = doc.querySelectorAll('.ibexa-notifications-modal__item');\r\n\r\n allUnreadNotifications.forEach((notification) => notification.classList.add('ibexa-notifications-modal__item--read'));\r\n getNotificationsStatus();\r\n const actions = doc.querySelectorAll('.ibexa-notifications-modal--mark-as-read');\r\n const markAsUnreadLabel = Translator.trans(\r\n /* @Desc(\"Mark as unread\") */ 'notification.mark_as_unread',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n actions.forEach((notification) => {\r\n notification.classList.remove('ibexa-notifications-modal--mark-as-read');\r\n notification.classList.add('ibexa-notifications-modal--mark-as-unread');\r\n notification.textContent = markAsUnreadLabel;\r\n });\r\n } else {\r\n showErrorNotification(message);\r\n }\r\n })\r\n .catch(() => {\r\n showErrorNotification(message);\r\n });\r\n };\r\n const markAsRead = ({ currentTarget }) => {\r\n const { notificationId } = currentTarget.dataset;\r\n const markAsReadLink = Routing.generate('ibexa.notifications.mark_as_read', { notificationId });\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot mark notification as read\") */ 'notifications.modal.message.error.mark_as_read',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n fetch(markAsReadLink, { mode: 'same-origin', credentials: 'same-origin' })\r\n .then(getJsonFromResponse)\r\n .then((response) => {\r\n if (response.status === 'success') {\r\n const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id=\"${notificationId}\"]`);\r\n const menuBranch = currentTarget.closest('.ibexa-multilevel-popup-menu__branch');\r\n const menuInstance = ibexa.helpers.objectInstances.getInstance(menuBranch.menuInstanceElement);\r\n const markAsUnreadLabel = Translator.trans(\r\n /* @Desc(\"Mark as unread\") */ 'notification.mark_as_unread',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n menuInstance.closeMenu();\r\n notification.classList.add('ibexa-notifications-modal__item--read');\r\n currentTarget.classList.remove('ibexa-notifications-modal--mark-as-read');\r\n currentTarget.classList.add('ibexa-notifications-modal--mark-as-unread');\r\n currentTarget.textContent = markAsUnreadLabel;\r\n getNotificationsStatus();\r\n } else {\r\n showErrorNotification(message);\r\n }\r\n })\r\n .catch(() => {\r\n showErrorNotification(message);\r\n });\r\n };\r\n const markAsUnread = ({ currentTarget }) => {\r\n const { notificationId } = currentTarget.dataset;\r\n const markAsUnreadLink = Routing.generate('ibexa.notifications.mark_as_unread', { notificationId });\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot mark notification as unread\") */ 'notifications.modal.message.error.mark_as_unread',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n fetch(markAsUnreadLink, { mode: 'same-origin', credentials: 'same-origin' })\r\n .then(getJsonFromResponse)\r\n .then((response) => {\r\n if (response.status === 'success') {\r\n const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id=\"${notificationId}\"]`);\r\n const menuBranch = currentTarget.closest('.ibexa-multilevel-popup-menu__branch');\r\n const menuInstance = ibexa.helpers.objectInstances.getInstance(menuBranch.menuInstanceElement);\r\n const markAsReadLabel = Translator.trans(\r\n /* @Desc(\"Mark as read\") */ 'notification.mark_as_read',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n menuInstance.closeMenu();\r\n notification.classList.remove('ibexa-notifications-modal__item--read');\r\n currentTarget.classList.remove('ibexa-notifications-modal--mark-as-unread');\r\n currentTarget.classList.add('ibexa-notifications-modal--mark-as-read');\r\n currentTarget.textContent = markAsReadLabel;\r\n getNotificationsStatus();\r\n } else {\r\n showErrorNotification(message);\r\n }\r\n })\r\n .catch(() => {\r\n showErrorNotification(message);\r\n });\r\n };\r\n const handleMarkAsAction = ({ currentTarget }) => {\r\n const markAsReadLabel = Translator.trans(/* @Desc(\"Mark as read\") */ 'notification.mark_as_read', {}, 'ibexa_notifications');\r\n\r\n currentTarget.textContent.trim() === markAsReadLabel ? markAsRead({ currentTarget }) : markAsUnread({ currentTarget });\r\n };\r\n const deleteNotification = () => {\r\n const deleteLink = Routing.generate('ibexa.notifications.delete', { notificationId: selectedNotificationId });\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot delete notification\") */ 'notifications.modal.message.error.delete',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n fetch(deleteLink, { method: 'POST', mode: 'same-origin', credentials: 'same-origin' })\r\n .then(getJsonFromResponse)\r\n .then((response) => {\r\n if (response.status === 'success') {\r\n const notification = doc.querySelector(\r\n `.ibexa-notifications-modal__item[data-notification-id=\"${selectedNotificationId}\"]`,\r\n );\r\n\r\n notification.remove();\r\n getNotificationsStatus();\r\n } else {\r\n showErrorNotification(message);\r\n }\r\n })\r\n .catch(() => {\r\n showErrorNotification(message);\r\n });\r\n };\r\n const attachActionsListeners = () => {\r\n const attachListener = (node, callback) => node.addEventListener('click', callback, false);\r\n const markAsButtons = doc.querySelectorAll('.ibexa-notifications-modal--mark-as');\r\n const deleteButtons = doc.querySelectorAll('.ibexa-notifications-open-modal-button');\r\n const deleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm');\r\n\r\n const setNotificationId = ({ currentTarget }) => {\r\n selectedNotificationId = currentTarget.dataset.notificationId;\r\n };\r\n\r\n markAsButtons.forEach((markAsButton) => {\r\n attachListener(markAsButton, handleMarkAsAction);\r\n });\r\n\r\n deleteButtons.forEach((deleteButton) => {\r\n attachListener(deleteButton, setNotificationId);\r\n });\r\n\r\n if (deleteButton) {\r\n deleteButton.addEventListener('click', deleteNotification);\r\n }\r\n };\r\n const showNotificationPage = (pageHtml) => {\r\n const modalResults = panel.querySelector(SELECTOR_MODAL_RESULTS);\r\n\r\n modalResults.innerHTML = pageHtml;\r\n toggleLoading(false);\r\n attachActionsListeners();\r\n\r\n doc.body.dispatchEvent(\r\n new CustomEvent('ibexa-multilevel-popup-menu:init', {\r\n detail: { container: modalResults },\r\n }),\r\n );\r\n };\r\n const toggleLoading = (show) => {\r\n panel.classList.toggle(CLASS_MODAL_LOADING, show);\r\n };\r\n const fetchNotificationPage = (link) => {\r\n if (!link) {\r\n return;\r\n }\r\n\r\n const request = new Request(link, {\r\n method: 'GET',\r\n headers: {\r\n Accept: 'text/html',\r\n },\r\n credentials: 'same-origin',\r\n mode: 'cors',\r\n });\r\n\r\n currentPageLink = link;\r\n toggleLoading(true);\r\n fetch(request).then(getTextFromResponse).then(showNotificationPage).catch(showErrorNotification);\r\n };\r\n const handleModalResultsClick = (event) => {\r\n const isActionBtn = event.target.closest('.ibexa-notifications-modal__actions');\r\n const notification = event.target.closest(SELECTOR_MODAL_ITEM);\r\n\r\n if (isActionBtn || !notification) {\r\n return;\r\n }\r\n\r\n handleNotificationClick(notification);\r\n };\r\n\r\n if (!panel) {\r\n return;\r\n }\r\n const markAllAsReadBtn = panel.querySelector('.ibexa-notifications-modal__mark-all-read-btn');\r\n const notificationsTable = panel.querySelector(SELECTOR_LIST);\r\n currentPageLink = notificationsTable.dataset.notifications;\r\n const interval = Number.parseInt(notificationsTable.dataset.notificationsCountInterval, 10) || INTERVAL;\r\n\r\n panel.querySelectorAll(SELECTOR_MODAL_RESULTS).forEach((link) => link.addEventListener('click', handleModalResultsClick, false));\r\n markAllAsReadBtn.addEventListener('click', markAllAsRead, false);\r\n\r\n const getNotificationsStatusLoop = () => {\r\n getNotificationsStatus().finally(() => {\r\n global.setTimeout(getNotificationsStatusLoop, interval);\r\n });\r\n };\r\n\r\n getNotificationsStatusLoop();\r\n attachActionsListeners();\r\n})(window, window.document, window.ibexa, window.Translator, window.Routing);\r\n +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js +--- a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js (revision 488450555956cce9eb0f69ca197f6f268f9bf827) ++++ b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js (date 1758712000972) +@@ -227,9 +227,7 @@ + .then(getJsonFromResponse) + .then((response) => { + if (response.status === 'success') { +- const notification = doc.querySelector( +- `.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`, +- ); ++ const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`); + + notification.remove(); + getNotificationsStatus(); +@@ -245,7 +243,7 @@ + const attachListener = (node, callback) => node.addEventListener('click', callback, false); + const markAsButtons = doc.querySelectorAll('.ibexa-notifications-modal--mark-as'); + const deleteButtons = doc.querySelectorAll('.ibexa-notifications-open-modal-button'); +- const deleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm'); ++ const confirmDeleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm'); + + const setNotificationId = ({ currentTarget }) => { + selectedNotificationId = currentTarget.dataset.notificationId; +@@ -259,8 +257,8 @@ + attachListener(deleteButton, setNotificationId); + }); + +- if (deleteButton) { +- deleteButton.addEventListener('click', deleteNotification); ++ if (confirmDeleteButton) { ++ confirmDeleteButton.addEventListener('click', deleteNotification); + } + }; + const showNotificationPage = (pageHtml) => { diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11__Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11__Changes_.xml new file mode 100644 index 0000000000..05cb50813e --- /dev/null +++ b/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11__Changes_.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/shelf/run_fix_yarn_again__)/shelved.patch b/.idea/shelf/run_fix_yarn_again__)/shelved.patch new file mode 100644 index 0000000000..6b14206475 --- /dev/null +++ b/.idea/shelf/run_fix_yarn_again__)/shelved.patch @@ -0,0 +1,195 @@ +Index: .idea/copilot.data.migration.agent.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/copilot.data.migration.agent.xml b/.idea/copilot.data.migration.agent.xml +new file mode 100644 +--- /dev/null (date 1758710860853) ++++ b/.idea/copilot.data.migration.agent.xml (date 1758710860853) +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/copilot.data.migration.ask2agent.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/copilot.data.migration.ask2agent.xml b/.idea/copilot.data.migration.ask2agent.xml +new file mode 100644 +--- /dev/null (date 1758710860908) ++++ b/.idea/copilot.data.migration.ask2agent.xml (date 1758710860908) +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/admin-ui.iml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/admin-ui.iml b/.idea/admin-ui.iml +new file mode 100644 +--- /dev/null (date 1758710860746) ++++ b/.idea/admin-ui.iml (date 1758710860746) +@@ -0,0 +1,12 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/modules.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/modules.xml b/.idea/modules.xml +new file mode 100644 +--- /dev/null (date 1758710860827) ++++ b/.idea/modules.xml (date 1758710860827) +@@ -0,0 +1,8 @@ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/git_toolbox_prj.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml +new file mode 100644 +--- /dev/null (date 1758711998552) ++++ b/.idea/git_toolbox_prj.xml (date 1758711998552) +@@ -0,0 +1,15 @@ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/.gitignore +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/.gitignore b/.idea/.gitignore +new file mode 100644 +--- /dev/null (date 1758710861190) ++++ b/.idea/.gitignore (date 1758710861190) +@@ -0,0 +1,8 @@ ++# Default ignored files ++/shelf/ ++/workspace.xml ++# Editor-based HTTP Client requests ++/httpRequests/ ++# Datasource local storage ignored files ++/dataSources/ ++/dataSources.local.xml +Index: .idea/copilot.data.migration.edit.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/copilot.data.migration.edit.xml b/.idea/copilot.data.migration.edit.xml +new file mode 100644 +--- /dev/null (date 1758710860998) ++++ b/.idea/copilot.data.migration.edit.xml (date 1758710860998) +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/material_theme_project_new.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml +new file mode 100644 +--- /dev/null (date 1758713047839) ++++ b/.idea/material_theme_project_new.xml (date 1758713047839) +@@ -0,0 +1,13 @@ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/copilot.data.migration.ask.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/copilot.data.migration.ask.xml b/.idea/copilot.data.migration.ask.xml +new file mode 100644 +--- /dev/null (date 1758710860955) ++++ b/.idea/copilot.data.migration.ask.xml (date 1758710860955) +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ +\ No newline at end of file +Index: .idea/vcs.xml +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/.idea/vcs.xml b/.idea/vcs.xml +new file mode 100644 +--- /dev/null (date 1758710860976) ++++ b/.idea/vcs.xml (date 1758710860976) +@@ -0,0 +1,6 @@ ++ ++ ++ ++ ++ ++ +\ No newline at end of file diff --git a/.idea/shelf/run_fix_yarn_again___.xml b/.idea/shelf/run_fix_yarn_again___.xml new file mode 100644 index 0000000000..e00f644011 --- /dev/null +++ b/.idea/shelf/run_fix_yarn_again___.xml @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..e220fcd4c3 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,142 @@ + + + + + + + + + + { + "lastFilter": { + "state": "OPEN", + "assignee": "RopRaptor" + } +} + + + + { + "selectedUrlAndAccountId": { + "url": "https://github.com/ibexa/admin-ui.git", + "accountId": "ffa75390-c98c-4fa2-a9ba-33a17e1ee938" + } +} + { + "customColor": "", + "associatedIndex": 6 +} + + + + { + "keyToString": { + "ModuleVcsDetector.initialDetectionPerformed": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true", + "RunOnceActivity.git.unshallow": "true", + "last_opened_file_path": "//wsl.localhost/Ubuntu/home/robert/ibexa-commerce/vendor/ibexa/admin-ui", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "vue.rearranger.settings.migration": "true" + } +} + + + + + + + + + + 1758710854312 + + + + + + + + + + + + + + + + \ No newline at end of file From 8b359eb22e2b345cc0a9acac0c476a1e0e539e9e Mon Sep 17 00:00:00 2001 From: Robert Patrascu Date: Mon, 29 Sep 2025 12:29:16 +0200 Subject: [PATCH 7/8] Revert "Installed Ibexa Commerce 4.6.x-dev" This reverts commit 44655b3cbe001c86fb5b83db0662b97954fbf1d7. revert .idea files commited --- .idea/copilot.data.migration.agent.xml | 6 - .idea/copilot.data.migration.ask.xml | 6 - .idea/copilot.data.migration.ask2agent.xml | 6 - .idea/copilot.data.migration.edit.xml | 6 - .idea/inspectionProfiles/Project_Default.xml | 6 - .idea/material_theme_project_new.xml | 13 -- .../shelved.patch | 41 ---- ...e_Update_at_24_09_2025_13_11__Changes_.xml | 4 - .../shelf/run_fix_yarn_again__)/shelved.patch | 195 ------------------ .idea/shelf/run_fix_yarn_again___.xml | 4 - .idea/workspace.xml | 142 ------------- 11 files changed, 429 deletions(-) delete mode 100644 .idea/copilot.data.migration.agent.xml delete mode 100644 .idea/copilot.data.migration.ask.xml delete mode 100644 .idea/copilot.data.migration.ask2agent.xml delete mode 100644 .idea/copilot.data.migration.edit.xml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/material_theme_project_new.xml delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11_[Changes]/shelved.patch delete mode 100644 .idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11__Changes_.xml delete mode 100644 .idea/shelf/run_fix_yarn_again__)/shelved.patch delete mode 100644 .idea/shelf/run_fix_yarn_again___.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/copilot.data.migration.agent.xml b/.idea/copilot.data.migration.agent.xml deleted file mode 100644 index 4ea72a911a..0000000000 --- a/.idea/copilot.data.migration.agent.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask.xml b/.idea/copilot.data.migration.ask.xml deleted file mode 100644 index 7ef04e2ea0..0000000000 --- a/.idea/copilot.data.migration.ask.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask2agent.xml b/.idea/copilot.data.migration.ask2agent.xml deleted file mode 100644 index 1f2ea11e7f..0000000000 --- a/.idea/copilot.data.migration.ask2agent.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/copilot.data.migration.edit.xml b/.idea/copilot.data.migration.edit.xml deleted file mode 100644 index 8648f9401a..0000000000 --- a/.idea/copilot.data.migration.edit.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 03d9549ea8..0000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml deleted file mode 100644 index 64ade4c5d9..0000000000 --- a/.idea/material_theme_project_new.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11_[Changes]/shelved.patch b/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11_[Changes]/shelved.patch deleted file mode 100644 index 3d93224c5b..0000000000 --- a/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11_[Changes]/shelved.patch +++ /dev/null @@ -1,41 +0,0 @@ -Index: src/bundle/Resources/public/js/scripts/admin.notifications.modal.js -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP -<+>(function (global, doc, ibexa, Translator, Routing) {\r\n let currentPageLink = null;\r\n let getNotificationsStatusErrorShowed = false;\r\n let lastFailedCountFetchNotificationNode = null;\r\n let selectedNotificationId = null;\r\n const SELECTOR_MODAL_ITEM = '.ibexa-notifications-modal__item';\r\n const SELECTOR_MODAL_RESULTS = '.ibexa-notifications-modal__results .ibexa-scrollable-wrapper';\r\n const SELECTOR_MODAL_TITLE = '.ibexa-side-panel__header';\r\n const SELECTOR_LIST = '.ibexa-list--notifications';\r\n const CLASS_MODAL_LOADING = 'ibexa-notifications-modal--loading';\r\n const INTERVAL = 30000;\r\n const panel = doc.querySelector('.ibexa-notifications-modal');\r\n const { showErrorNotification, showWarningNotification } = ibexa.helpers.notification;\r\n const { getJsonFromResponse, getTextFromResponse } = ibexa.helpers.request;\r\n const handleNotificationClickRequest = (notification, response) => {\r\n if (response.status === 'success') {\r\n notification.classList.add('ibexa-notifications-modal__item--read');\r\n }\r\n\r\n if (response.redirect) {\r\n global.location = response.redirect;\r\n }\r\n };\r\n const handleNotificationClick = (notification) => {\r\n const notificationReadLink = notification.dataset.notificationRead;\r\n const request = new Request(notificationReadLink, {\r\n mode: 'cors',\r\n credentials: 'same-origin',\r\n });\r\n\r\n fetch(request).then(getJsonFromResponse).then(handleNotificationClickRequest.bind(null, notification)).catch(showErrorNotification);\r\n };\r\n\r\n const getNotificationsStatus = () => {\r\n const notificationsTable = panel.querySelector(SELECTOR_LIST);\r\n const notificationsStatusLink = notificationsTable.dataset.notificationsCount;\r\n const request = new Request(notificationsStatusLink, {\r\n mode: 'cors',\r\n credentials: 'same-origin',\r\n headers: {\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n },\r\n });\r\n\r\n return fetch(request)\r\n .then(getJsonFromResponse)\r\n .then((notificationsInfo) => {\r\n setPendingNotificationCount(notificationsInfo);\r\n updateModalTitleTotalInfo(notificationsInfo.total);\r\n getNotificationsStatusErrorShowed = false;\r\n })\r\n .catch(onGetNotificationsStatusFailure);\r\n };\r\n const onGetNotificationsStatusFailure = (error) => {\r\n if (lastFailedCountFetchNotificationNode && doc.contains(lastFailedCountFetchNotificationNode)) {\r\n return;\r\n }\r\n\r\n if (!getNotificationsStatusErrorShowed) {\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot update notifications\") */ 'notifications.modal.message.error',\r\n { error: error.message },\r\n 'ibexa_notifications',\r\n );\r\n\r\n showWarningNotification(message, (notificationNode) => {\r\n lastFailedCountFetchNotificationNode = notificationNode;\r\n });\r\n }\r\n\r\n getNotificationsStatusErrorShowed = true;\r\n };\r\n const updateModalTitleTotalInfo = (notificationsCount) => {\r\n const modalTitle = panel.querySelector(SELECTOR_MODAL_TITLE);\r\n const modalFooter = panel.querySelector('.ibexa-notifications-modal__view-all-btn--count');\r\n\r\n modalFooter.textContent = ` (${notificationsCount})`;\r\n modalTitle.dataset.notificationsTotal = `(${notificationsCount})`;\r\n\r\n if (notificationsCount < 10) {\r\n panel.querySelector('.ibexa-notifications-modal__count').textContent = `(${notificationsCount})`;\r\n }\r\n };\r\n const updatePendingNotificationsView = (notificationsInfo) => {\r\n const noticeDot = doc.querySelector('.ibexa-header-user-menu__notice-dot');\r\n\r\n noticeDot.dataset.count = notificationsInfo.pending;\r\n noticeDot.classList.toggle('ibexa-header-user-menu__notice-dot--no-notice', notificationsInfo.pending === 0);\r\n };\r\n const setPendingNotificationCount = (notificationsInfo) => {\r\n updatePendingNotificationsView(notificationsInfo);\r\n\r\n const notificationsTable = panel.querySelector(SELECTOR_LIST);\r\n const notificationsTotal = notificationsInfo.total;\r\n const notificationsTotalOld = parseInt(notificationsTable.dataset.notificationsTotal, 10);\r\n\r\n markAllAsReadBtn.disabled = notificationsInfo.pending === 0;\r\n\r\n if (notificationsTotal !== notificationsTotalOld) {\r\n notificationsTable.dataset.notificationsTotal = notificationsTotal;\r\n\r\n fetchNotificationPage(currentPageLink);\r\n }\r\n };\r\n const markAllAsRead = () => {\r\n const markAllAsReadLink = Routing.generate('ibexa.notifications.mark_all_as_read');\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot mark all notifications as read\") */ 'notifications.modal.message.error.mark_all_as_read',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n fetch(markAllAsReadLink, { mode: 'same-origin', credentials: 'same-origin' })\r\n .then(getJsonFromResponse)\r\n .then((response) => {\r\n if (response.status === 'success') {\r\n const allUnreadNotifications = doc.querySelectorAll('.ibexa-notifications-modal__item');\r\n\r\n allUnreadNotifications.forEach((notification) => notification.classList.add('ibexa-notifications-modal__item--read'));\r\n getNotificationsStatus();\r\n const actions = doc.querySelectorAll('.ibexa-notifications-modal--mark-as-read');\r\n const markAsUnreadLabel = Translator.trans(\r\n /* @Desc(\"Mark as unread\") */ 'notification.mark_as_unread',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n actions.forEach((notification) => {\r\n notification.classList.remove('ibexa-notifications-modal--mark-as-read');\r\n notification.classList.add('ibexa-notifications-modal--mark-as-unread');\r\n notification.textContent = markAsUnreadLabel;\r\n });\r\n } else {\r\n showErrorNotification(message);\r\n }\r\n })\r\n .catch(() => {\r\n showErrorNotification(message);\r\n });\r\n };\r\n const markAsRead = ({ currentTarget }) => {\r\n const { notificationId } = currentTarget.dataset;\r\n const markAsReadLink = Routing.generate('ibexa.notifications.mark_as_read', { notificationId });\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot mark notification as read\") */ 'notifications.modal.message.error.mark_as_read',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n fetch(markAsReadLink, { mode: 'same-origin', credentials: 'same-origin' })\r\n .then(getJsonFromResponse)\r\n .then((response) => {\r\n if (response.status === 'success') {\r\n const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id=\"${notificationId}\"]`);\r\n const menuBranch = currentTarget.closest('.ibexa-multilevel-popup-menu__branch');\r\n const menuInstance = ibexa.helpers.objectInstances.getInstance(menuBranch.menuInstanceElement);\r\n const markAsUnreadLabel = Translator.trans(\r\n /* @Desc(\"Mark as unread\") */ 'notification.mark_as_unread',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n menuInstance.closeMenu();\r\n notification.classList.add('ibexa-notifications-modal__item--read');\r\n currentTarget.classList.remove('ibexa-notifications-modal--mark-as-read');\r\n currentTarget.classList.add('ibexa-notifications-modal--mark-as-unread');\r\n currentTarget.textContent = markAsUnreadLabel;\r\n getNotificationsStatus();\r\n } else {\r\n showErrorNotification(message);\r\n }\r\n })\r\n .catch(() => {\r\n showErrorNotification(message);\r\n });\r\n };\r\n const markAsUnread = ({ currentTarget }) => {\r\n const { notificationId } = currentTarget.dataset;\r\n const markAsUnreadLink = Routing.generate('ibexa.notifications.mark_as_unread', { notificationId });\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot mark notification as unread\") */ 'notifications.modal.message.error.mark_as_unread',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n fetch(markAsUnreadLink, { mode: 'same-origin', credentials: 'same-origin' })\r\n .then(getJsonFromResponse)\r\n .then((response) => {\r\n if (response.status === 'success') {\r\n const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id=\"${notificationId}\"]`);\r\n const menuBranch = currentTarget.closest('.ibexa-multilevel-popup-menu__branch');\r\n const menuInstance = ibexa.helpers.objectInstances.getInstance(menuBranch.menuInstanceElement);\r\n const markAsReadLabel = Translator.trans(\r\n /* @Desc(\"Mark as read\") */ 'notification.mark_as_read',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n menuInstance.closeMenu();\r\n notification.classList.remove('ibexa-notifications-modal__item--read');\r\n currentTarget.classList.remove('ibexa-notifications-modal--mark-as-unread');\r\n currentTarget.classList.add('ibexa-notifications-modal--mark-as-read');\r\n currentTarget.textContent = markAsReadLabel;\r\n getNotificationsStatus();\r\n } else {\r\n showErrorNotification(message);\r\n }\r\n })\r\n .catch(() => {\r\n showErrorNotification(message);\r\n });\r\n };\r\n const handleMarkAsAction = ({ currentTarget }) => {\r\n const markAsReadLabel = Translator.trans(/* @Desc(\"Mark as read\") */ 'notification.mark_as_read', {}, 'ibexa_notifications');\r\n\r\n currentTarget.textContent.trim() === markAsReadLabel ? markAsRead({ currentTarget }) : markAsUnread({ currentTarget });\r\n };\r\n const deleteNotification = () => {\r\n const deleteLink = Routing.generate('ibexa.notifications.delete', { notificationId: selectedNotificationId });\r\n const message = Translator.trans(\r\n /* @Desc(\"Cannot delete notification\") */ 'notifications.modal.message.error.delete',\r\n {},\r\n 'ibexa_notifications',\r\n );\r\n\r\n fetch(deleteLink, { method: 'POST', mode: 'same-origin', credentials: 'same-origin' })\r\n .then(getJsonFromResponse)\r\n .then((response) => {\r\n if (response.status === 'success') {\r\n const notification = doc.querySelector(\r\n `.ibexa-notifications-modal__item[data-notification-id=\"${selectedNotificationId}\"]`,\r\n );\r\n\r\n notification.remove();\r\n getNotificationsStatus();\r\n } else {\r\n showErrorNotification(message);\r\n }\r\n })\r\n .catch(() => {\r\n showErrorNotification(message);\r\n });\r\n };\r\n const attachActionsListeners = () => {\r\n const attachListener = (node, callback) => node.addEventListener('click', callback, false);\r\n const markAsButtons = doc.querySelectorAll('.ibexa-notifications-modal--mark-as');\r\n const deleteButtons = doc.querySelectorAll('.ibexa-notifications-open-modal-button');\r\n const deleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm');\r\n\r\n const setNotificationId = ({ currentTarget }) => {\r\n selectedNotificationId = currentTarget.dataset.notificationId;\r\n };\r\n\r\n markAsButtons.forEach((markAsButton) => {\r\n attachListener(markAsButton, handleMarkAsAction);\r\n });\r\n\r\n deleteButtons.forEach((deleteButton) => {\r\n attachListener(deleteButton, setNotificationId);\r\n });\r\n\r\n if (deleteButton) {\r\n deleteButton.addEventListener('click', deleteNotification);\r\n }\r\n };\r\n const showNotificationPage = (pageHtml) => {\r\n const modalResults = panel.querySelector(SELECTOR_MODAL_RESULTS);\r\n\r\n modalResults.innerHTML = pageHtml;\r\n toggleLoading(false);\r\n attachActionsListeners();\r\n\r\n doc.body.dispatchEvent(\r\n new CustomEvent('ibexa-multilevel-popup-menu:init', {\r\n detail: { container: modalResults },\r\n }),\r\n );\r\n };\r\n const toggleLoading = (show) => {\r\n panel.classList.toggle(CLASS_MODAL_LOADING, show);\r\n };\r\n const fetchNotificationPage = (link) => {\r\n if (!link) {\r\n return;\r\n }\r\n\r\n const request = new Request(link, {\r\n method: 'GET',\r\n headers: {\r\n Accept: 'text/html',\r\n },\r\n credentials: 'same-origin',\r\n mode: 'cors',\r\n });\r\n\r\n currentPageLink = link;\r\n toggleLoading(true);\r\n fetch(request).then(getTextFromResponse).then(showNotificationPage).catch(showErrorNotification);\r\n };\r\n const handleModalResultsClick = (event) => {\r\n const isActionBtn = event.target.closest('.ibexa-notifications-modal__actions');\r\n const notification = event.target.closest(SELECTOR_MODAL_ITEM);\r\n\r\n if (isActionBtn || !notification) {\r\n return;\r\n }\r\n\r\n handleNotificationClick(notification);\r\n };\r\n\r\n if (!panel) {\r\n return;\r\n }\r\n const markAllAsReadBtn = panel.querySelector('.ibexa-notifications-modal__mark-all-read-btn');\r\n const notificationsTable = panel.querySelector(SELECTOR_LIST);\r\n currentPageLink = notificationsTable.dataset.notifications;\r\n const interval = Number.parseInt(notificationsTable.dataset.notificationsCountInterval, 10) || INTERVAL;\r\n\r\n panel.querySelectorAll(SELECTOR_MODAL_RESULTS).forEach((link) => link.addEventListener('click', handleModalResultsClick, false));\r\n markAllAsReadBtn.addEventListener('click', markAllAsRead, false);\r\n\r\n const getNotificationsStatusLoop = () => {\r\n getNotificationsStatus().finally(() => {\r\n global.setTimeout(getNotificationsStatusLoop, interval);\r\n });\r\n };\r\n\r\n getNotificationsStatusLoop();\r\n attachActionsListeners();\r\n})(window, window.document, window.ibexa, window.Translator, window.Routing);\r\n -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js ---- a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js (revision 488450555956cce9eb0f69ca197f6f268f9bf827) -+++ b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js (date 1758712000972) -@@ -227,9 +227,7 @@ - .then(getJsonFromResponse) - .then((response) => { - if (response.status === 'success') { -- const notification = doc.querySelector( -- `.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`, -- ); -+ const notification = doc.querySelector(`.ibexa-notifications-modal__item[data-notification-id="${selectedNotificationId}"]`); - - notification.remove(); - getNotificationsStatus(); -@@ -245,7 +243,7 @@ - const attachListener = (node, callback) => node.addEventListener('click', callback, false); - const markAsButtons = doc.querySelectorAll('.ibexa-notifications-modal--mark-as'); - const deleteButtons = doc.querySelectorAll('.ibexa-notifications-open-modal-button'); -- const deleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm'); -+ const confirmDeleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm'); - - const setNotificationId = ({ currentTarget }) => { - selectedNotificationId = currentTarget.dataset.notificationId; -@@ -259,8 +257,8 @@ - attachListener(deleteButton, setNotificationId); - }); - -- if (deleteButton) { -- deleteButton.addEventListener('click', deleteNotification); -+ if (confirmDeleteButton) { -+ confirmDeleteButton.addEventListener('click', deleteNotification); - } - }; - const showNotificationPage = (pageHtml) => { diff --git a/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11__Changes_.xml b/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11__Changes_.xml deleted file mode 100644 index 05cb50813e..0000000000 --- a/.idea/shelf/Uncommitted_changes_before_Update_at_24_09_2025_13_11__Changes_.xml +++ /dev/null @@ -1,4 +0,0 @@ - - \ No newline at end of file diff --git a/.idea/shelf/run_fix_yarn_again__)/shelved.patch b/.idea/shelf/run_fix_yarn_again__)/shelved.patch deleted file mode 100644 index 6b14206475..0000000000 --- a/.idea/shelf/run_fix_yarn_again__)/shelved.patch +++ /dev/null @@ -1,195 +0,0 @@ -Index: .idea/copilot.data.migration.agent.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/copilot.data.migration.agent.xml b/.idea/copilot.data.migration.agent.xml -new file mode 100644 ---- /dev/null (date 1758710860853) -+++ b/.idea/copilot.data.migration.agent.xml (date 1758710860853) -@@ -0,0 +1,6 @@ -+ -+ -+ -+ -+ -\ No newline at end of file -Index: .idea/copilot.data.migration.ask2agent.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/copilot.data.migration.ask2agent.xml b/.idea/copilot.data.migration.ask2agent.xml -new file mode 100644 ---- /dev/null (date 1758710860908) -+++ b/.idea/copilot.data.migration.ask2agent.xml (date 1758710860908) -@@ -0,0 +1,6 @@ -+ -+ -+ -+ -+ -\ No newline at end of file -Index: .idea/admin-ui.iml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/admin-ui.iml b/.idea/admin-ui.iml -new file mode 100644 ---- /dev/null (date 1758710860746) -+++ b/.idea/admin-ui.iml (date 1758710860746) -@@ -0,0 +1,12 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -\ No newline at end of file -Index: .idea/modules.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/modules.xml b/.idea/modules.xml -new file mode 100644 ---- /dev/null (date 1758710860827) -+++ b/.idea/modules.xml (date 1758710860827) -@@ -0,0 +1,8 @@ -+ -+ -+ -+ -+ -+ -+ -+ -\ No newline at end of file -Index: .idea/git_toolbox_prj.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml -new file mode 100644 ---- /dev/null (date 1758711998552) -+++ b/.idea/git_toolbox_prj.xml (date 1758711998552) -@@ -0,0 +1,15 @@ -+ -+ -+ -+ -+ -+ -+ -\ No newline at end of file -Index: .idea/.gitignore -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/.gitignore b/.idea/.gitignore -new file mode 100644 ---- /dev/null (date 1758710861190) -+++ b/.idea/.gitignore (date 1758710861190) -@@ -0,0 +1,8 @@ -+# Default ignored files -+/shelf/ -+/workspace.xml -+# Editor-based HTTP Client requests -+/httpRequests/ -+# Datasource local storage ignored files -+/dataSources/ -+/dataSources.local.xml -Index: .idea/copilot.data.migration.edit.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/copilot.data.migration.edit.xml b/.idea/copilot.data.migration.edit.xml -new file mode 100644 ---- /dev/null (date 1758710860998) -+++ b/.idea/copilot.data.migration.edit.xml (date 1758710860998) -@@ -0,0 +1,6 @@ -+ -+ -+ -+ -+ -\ No newline at end of file -Index: .idea/material_theme_project_new.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml -new file mode 100644 ---- /dev/null (date 1758713047839) -+++ b/.idea/material_theme_project_new.xml (date 1758713047839) -@@ -0,0 +1,13 @@ -+ -+ -+ -+ -+ -+ -\ No newline at end of file -Index: .idea/copilot.data.migration.ask.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/copilot.data.migration.ask.xml b/.idea/copilot.data.migration.ask.xml -new file mode 100644 ---- /dev/null (date 1758710860955) -+++ b/.idea/copilot.data.migration.ask.xml (date 1758710860955) -@@ -0,0 +1,6 @@ -+ -+ -+ -+ -+ -\ No newline at end of file -Index: .idea/vcs.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/.idea/vcs.xml b/.idea/vcs.xml -new file mode 100644 ---- /dev/null (date 1758710860976) -+++ b/.idea/vcs.xml (date 1758710860976) -@@ -0,0 +1,6 @@ -+ -+ -+ -+ -+ -+ -\ No newline at end of file diff --git a/.idea/shelf/run_fix_yarn_again___.xml b/.idea/shelf/run_fix_yarn_again___.xml deleted file mode 100644 index e00f644011..0000000000 --- a/.idea/shelf/run_fix_yarn_again___.xml +++ /dev/null @@ -1,4 +0,0 @@ - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index e220fcd4c3..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - { - "lastFilter": { - "state": "OPEN", - "assignee": "RopRaptor" - } -} - - - - { - "selectedUrlAndAccountId": { - "url": "https://github.com/ibexa/admin-ui.git", - "accountId": "ffa75390-c98c-4fa2-a9ba-33a17e1ee938" - } -} - { - "customColor": "", - "associatedIndex": 6 -} - - - - { - "keyToString": { - "ModuleVcsDetector.initialDetectionPerformed": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true", - "RunOnceActivity.git.unshallow": "true", - "last_opened_file_path": "//wsl.localhost/Ubuntu/home/robert/ibexa-commerce/vendor/ibexa/admin-ui", - "node.js.detected.package.eslint": "true", - "node.js.detected.package.tslint": "true", - "node.js.selected.package.eslint": "(autodetect)", - "node.js.selected.package.tslint": "(autodetect)", - "nodejs_package_manager_path": "npm", - "vue.rearranger.settings.migration": "true" - } -} - - - - - - - - - - 1758710854312 - - - - - - - - - - - - - - - - \ No newline at end of file From 0401be311e0aa7b6ba44ef4976869fa013c51b57 Mon Sep 17 00:00:00 2001 From: Robert Patrascu <162968581+RopRaptor@users.noreply.github.com> Date: Tue, 30 Sep 2025 18:31:54 +0200 Subject: [PATCH 8/8] Update src/bundle/Resources/public/js/scripts/admin.notifications.modal.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Aleksandra Bożek --- .../Resources/public/js/scripts/admin.notifications.modal.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js index e87e73c087..a0b3d01fac 100644 --- a/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js +++ b/src/bundle/Resources/public/js/scripts/admin.notifications.modal.js @@ -246,7 +246,6 @@ const markAsButtons = doc.querySelectorAll('.ibexa-notifications-modal--mark-as'); const deleteButtons = doc.querySelectorAll('.ibexa-notifications-open-modal-button'); const confirmDeleteButton = doc.querySelector('.ibexa-notifications-modal--delete--confirm'); - const setNotificationId = ({ currentTarget }) => { selectedNotificationId = currentTarget.dataset.notificationId; };