Skip to content

Commit 106a9e1

Browse files
committed
Merge branch 'MC-1413' of github.com:magento-trigger/magento2-page-builder into MC-1413
2 parents 61b28de + 8d5b01f commit 106a9e1

File tree

2 files changed

+22
-51
lines changed

2 files changed

+22
-51
lines changed

app/code/Magento/PageBuilder/docs/master-format.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,25 @@ Inline styles
10241024
6. margin
10251025
7. padding
10261026

1027+
## Dynamic Block
1028+
1029+
```
1030+
<div data-role="dynamic_block" data-appearance="default">{{widget type="Magento\Banner\Block\Widget\Banner" display_mode="fixed" rotate="" template="widget/block.phtml" banner_ids="54" unique_id="54" type_name="Dynamic Blocks Rotator"}</div>
1031+
```
1032+
1033+
Attributes
1034+
1. data-role [dynamic_block]
1035+
2. data-appearance [default]
1036+
1037+
Inline styles
1038+
1. text-align
1039+
2. border
1040+
3. border_color
1041+
4. border_width
1042+
5. border_radius
1043+
6. margins
1044+
7. padding
1045+
10271046
## Products
10281047

10291048
```

app/code/Magento/PageBuilder/view/adminhtml/web/js/form/element/block-chooser.js

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ define([
1818
meta: {},
1919
errorMessage: null,
2020
displayMetadata: true,
21-
initialValue: {},
2221
messages: {
2322
UNKOWN_ERROR: $t('Sorry, there was an error getting requested content. ' +
2423
'Please contact the store owner.'),
@@ -44,61 +43,16 @@ define([
4443
}
4544
},
4645
listens: {
47-
id: 'updateFromServer',
48-
'${ $.provider }:data.reset': 'reset'
46+
id: 'updateFromServer'
4947
}
5048
},
5149

52-
/**
53-
* Invokes initialize method of parent class,
54-
* contains initialization logic
55-
*/
56-
initialize: function () {
57-
_.bindAll(this, 'reset');
58-
59-
this._super()
60-
.setInitialValue();
61-
62-
return this;
63-
},
64-
65-
/**
66-
* Sets initial value of the element and subscribes to it's changes.
67-
*
68-
* @returns {Abstract} Chainable.
69-
*/
70-
setInitialValue: function () {
71-
if (this.id()) {
72-
this.initialValue(false);
73-
}
74-
return this;
75-
},
76-
7750
/**
7851
* @inheritdoc
7952
*/
8053
initObservable: function () {
8154
return this._super()
82-
.observe('id meta errorMessage displayMetadata initialValue');
83-
},
84-
85-
/**
86-
* Resets metadata
87-
*
88-
* @returns void
89-
*/
90-
reset: function () {
91-
this.meta(this.initialValue());
92-
this.errorMessage(null);
93-
},
94-
95-
/**
96-
* Resets metadata
97-
*
98-
* @returns void
99-
*/
100-
reset: function () {
101-
this.meta({});
55+
.observe('id meta errorMessage displayMetadata');
10256
},
10357

10458
/**
@@ -111,6 +65,7 @@ define([
11165

11266
// The component hasn't be configured yet. Nothing to do.
11367
if (!this.id() || !this.requestParameter || !this.dataUrlConfigPath) {
68+
this.meta({});
11469
return;
11570
}
11671

@@ -136,9 +91,6 @@ define([
13691
}
13792

13893
this.meta(response);
139-
if (this.initialValue() === false) {
140-
this.initialValue(response)
141-
}
14294
}.bind(this))
14395
.fail(function () {
14496
this.meta({});

0 commit comments

Comments
 (0)