Skip to content

Commit 99a06f5

Browse files
committed
PB-235: Story Bug for PB-107: Adding Condition Filter will Not Update Total until After Saving Edit Form & Reopening
1 parent 93791a1 commit 99a06f5

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

app/code/Magento/PageBuilder/view/adminhtml/ui_component/pagebuilder_modal_form.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
</dataProvider>
2424
</dataSource>
2525
<modal name="modal" component="Magento_PageBuilder/js/modal/modal">
26+
<argument name="data" xsi:type="array">
27+
<item name="config" xsi:type="array">
28+
<item name="insertFormProvider" xsi:type="string">${ $.name }.insert_form</item>
29+
</item>
30+
</argument>
2631
<settings>
2732
<options>
2833
<option name="title" xsi:type="string" translate="true">Edit</option>

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/product-totals.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ define([
2525
listens: {
2626
conditionOption: 'updateProductTotals',
2727
conditionValue: 'updateProductTotals',
28+
'${ $.provider }:data.modalClosed': 'abortRunningRequest'
2829
},
2930
imports: {
3031
formData: '${ $.provider }:data'
@@ -42,15 +43,6 @@ define([
4243
jqXHR: null
4344
},
4445

45-
/** @inheritdoc */
46-
initialize: function () {
47-
$('.cms-page-edit .modals-wrapper').on('modalclosed', function () {
48-
this.abortRunningRequest();
49-
}.bind(this));
50-
51-
return this._super();
52-
},
53-
5446
/**
5547
* Abort running Ajax request
5648
*/

app/code/Magento/PageBuilder/view/adminhtml/web/js/modal/modal.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ define([
1111

1212
return ModalComponent.extend({
1313
defaults: {
14-
titlePrefix: '${ $.options.title }'
14+
titlePrefix: '${ $.options.title }',
15+
modules: {
16+
insertForm: '${ $.insertFormProvider }'
17+
}
1518
},
1619

1720
/** @inheritdoc */
@@ -37,6 +40,19 @@ define([
3740
this.closeModal();
3841
}.bind(this));
3942

43+
},
44+
45+
/**
46+
* Trigger modalClosed event on external provider
47+
*
48+
* @returns {any}
49+
*/
50+
closeModal: function () {
51+
this.insertForm() &&
52+
this.insertForm().externalSource() &&
53+
this.insertForm().externalSource().trigger('data.modalClosed');
54+
55+
return this._super();
4056
}
4157
});
4258
});

0 commit comments

Comments
 (0)