Skip to content

Commit e0dfaeb

Browse files
authored
Fix issue with merge button in customer duplicates (#510)
* Fix issue with merge button in customer duplicates * Update src/Resources/public/js/CustomerDuplicates/frontend.js * Removed unintended code
1 parent 9e6c392 commit e0dfaeb

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

src/Resources/public/admin/js/cmf.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -853,13 +853,5 @@ app.SearchFilter.DateRangePicker = (function () {
853853

854854
$(document).ready(function() {
855855
window.app.init($('body'));
856-
857-
const duplicates = $('.customer-duplicates-merge');
858-
$.each(duplicates , function(index,duplicate) {
859-
duplicate.addEventListener('click', (event) => {
860-
const duplicateIds = JSON.parse(duplicate.dataset.duplicateIds);
861-
new window.top.pimcore.plugin.objectmerger.panel(duplicateIds[0], duplicateIds[1]);
862-
});
863-
});
864856
});
865857
})(jQuery);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Pimcore
3+
*
4+
* This source file is available under two different licenses:
5+
* - GNU General Public License version 3 (GPLv3)
6+
* - Pimcore Commercial License (PCL)
7+
* Full copyright and license information is available in
8+
* LICENSE.md which is distributed with this source code.
9+
*
10+
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)
11+
* @license http://www.pimcore.org/license GPLv3 and PCL
12+
*/
13+
14+
15+
$(function() {
16+
17+
// Merge button in customer duplicates view
18+
const duplicates = document.getElementsByClassName('customer-duplicates-merge');
19+
for(let duplicate of duplicates){
20+
duplicate.addEventListener('click', (event) => {
21+
const duplicateIds = JSON.parse(duplicate.dataset.duplicateIds);
22+
new window.top.pimcore.plugin.objectmerger.panel(duplicateIds[0], duplicateIds[1]);
23+
});
24+
}
25+
26+
}());

src/Resources/views/admin/duplicates/list.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{% block content %}
44

55
{% do cmf_jsConfig().add('declineDuplicates', true) %}
6+
{% do pimcore_head_script().appendFile(asset('/bundles/pimcorecustomermanagementframework/js/CustomerDuplicates/frontend.js')) %}
67

78
<div class="container">
89
<h2>{{ 'cmf_duplicates_potential_duplicates' | trans({}, 'admin') }}</h2>

0 commit comments

Comments
 (0)