Skip to content

Commit 2224ed5

Browse files
MAGETWO-91307: Clean up TypeScript errors after code restructuring
- fix naming issues and documantation formating issues
1 parent d5cda5b commit 2224ed5

File tree

11 files changed

+37
-37
lines changed

11 files changed

+37
-37
lines changed

app/code/Magento/PageBuilder/Model/ContentType/DataProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class DataProvider extends \Magento\Framework\View\Element\UiComponent\DataProvi
1818
*
1919
* @return array
2020
*/
21-
public function getData()
21+
public function getData(): array
2222
{
2323
return [];
2424
}

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderActionsSection.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
<element name="contentTypeMove" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[1]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="move-structural"]' parameterized="true"/>
5454
<element name="contentTypeMoveByIndex" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="move-structural"]' parameterized="true"/>
5555
<element name="contentTypeAdd" type="button" selector="div.pagebuilder-content-type.pagebuilder-{{arg1}} div.pagebuilder-options li.pagebuilder-options-link a.add-child" parameterized="true"/>
56-
<element name="contentTypeEdit" type="button" selector="div.pagebuilder-content-type.pagebuilder-{{arg1}} div.pagebuilder-options li.pagebuilder-options-link a.edit-block" parameterized="true"/>
57-
<element name="contentTypeEditByIndex" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]//div[contains(@class,"pagebuilder-options-visible")]//descendant::*[@class="edit-block"]' parameterized="true"/>
56+
<element name="contentTypeEdit" type="button" selector="div.pagebuilder-content-type.pagebuilder-{{arg1}} div.pagebuilder-options li.pagebuilder-options-link a.edit-content-type" parameterized="true"/>
57+
<element name="contentTypeEditByIndex" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]//div[contains(@class,"pagebuilder-options-visible")]//descendant::*[@class="edit-content-type"]' parameterized="true"/>
5858
<element name="contentTypeDuplicate" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]//div[contains(@class,"pagebuilder-options-visible")]//a[@title="Duplicate"]' parameterized="true"/>
5959
<element name="contentTypeRemove" type="button" selector="div.pagebuilder-content-type.pagebuilder-{{arg1}} div.pagebuilder-options li.pagebuilder-options-link a.remove-structural" parameterized="true"/>
6060
<element name="contentTypeRemoveByIndex" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-{{arg1}}")])[{{arg2}}]//div[contains(@class,"pagebuilder-options-visible")]//a[@title="Remove"]' parameterized="true"/>
61-
<element name="editColumn" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-column")])[1]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="edit-block"]'/>
61+
<element name="editColumn" type="button" selector='(//div[contains(@class, "pagebuilder-content-type") and contains(@class, "pagebuilder-column")])[1]/div[contains(@class,"pagebuilder-options-visible")]/descendant::*[@class="edit-content-type"]'/>
6262
<element name="contentTypeDelete" type="button" selector='.pagebuilder-options .remove-structural[title="Remove"]'/>
6363
<element name="contentTypeDeleteDisabled" type="button" selector='.pagebuilder-options .remove-structural[title="Remove"].disabled'/>
6464
<element name="editForm" type="text" selector='//div[contains(@class, "pagebuilder_modal_form_pagebuilder_modal_form_modal")]'/>

app/code/Magento/PageBuilder/docs/architecture-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ To revert back to using the default WYSIWYG, add the following entry to the fiel
9191
| ----------------- | --------------------- | -------------------------------------------------------------------------------------------------------------- |
9292
| Content type | `component` | View model responsible for rendering the preview and master format |
9393
| Preview component | `preview_component` | Contains preview specific logic that is generic for all appearances. Preview component is optional |
94-
| Master component | `master_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional |
94+
| Master component | `master_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional |
9595
| Data Store | | Contains data for the content type |
9696
| Appearance | `appearance` | Configuration for content type that defines look and behavior. Includes data mapping, form, templates, reader. |
9797
| Preview template | `preview_template` | Template used to display the element in the preview |

app/code/Magento/PageBuilder/docs/content-type-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ The following is an example of a content type configuration in `view/adminhtml/p
193193
| `icon` | Icon displayed on the menu. |
194194
| `component` | View model responsible for rendering the preview and master format. |
195195
| `preview_component` | Helper component that contains preview specific logic. Helper component is optional. |
196-
| `master_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional. |
196+
| `master_component` | Contains master format rendering logic that is generic for all appearances. Content component is optional. |
197197
| `form` | UI component form used for editing the content type |
198198
| `group` | Existing menu group that contains this content type. |
199199
| `allowed_parents` | List of parent content types that can accept this type as a child. |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<item name="component" xsi:type="string">Magento_PageBuilder/js/form/map-location-provider</item>
3232
</item>
3333
</argument>
34-
<dataProvider name="pagebuilder_map_location_form_data_source" class="Magento\PageBuilder\Model\ContentBlock\DataProvider">
34+
<dataProvider name="pagebuilder_map_location_form_data_source" class="Magento\PageBuilder\Model\ContentType\DataProvider">
3535
<settings>
3636
<requestFieldName/>
3737
<primaryFieldName/>

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/preview.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/preview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ export default class Preview {
210210
* @returns {Promise<ContentTypeInterface>}
211211
*/
212212
public clone(contentType: ContentTypeInterface, autoAppend: boolean = true): Promise<ContentTypeInterface> {
213-
const contentContentTypeData = contentType.dataStore.get();
213+
const contentTypeData = contentType.dataStore.get();
214214
const index = contentType.parent.collection.children.indexOf(contentType) + 1 || null;
215215

216216
return new Promise((resolve, reject) => {
217217
createContentType(
218218
contentType.config,
219219
contentType.parent,
220220
contentType.stageId,
221-
contentContentTypeData,
221+
contentTypeData,
222222
).then((duplicateContentType: ContentTypeInterface) => {
223223
if (autoAppend) {
224224
contentType.parent.addChild(duplicateContentType, index);

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/panel.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class Panel implements PanelInterface {
4242
*/
4343
public initListeners(): void {
4444
events.on("stage:ready:" + this.id, () => {
45-
this.populateContentContentTypes();
45+
this.populateContentTypes();
4646
this.isVisible(true);
4747
});
4848
}
@@ -72,16 +72,16 @@ export default class Panel implements PanelInterface {
7272
this.searchResults(_.map(
7373
_.filter(
7474
Config.getConfig("content_types"),
75-
(contentContentType: ContentTypeConfigInterface) => {
75+
(contentType: ContentTypeConfigInterface) => {
7676
const regEx = new RegExp("\\b" + self.searchValue(), "gi");
77-
const matches = !!contentContentType.label.toLowerCase().match(regEx);
77+
const matches = !!contentType.label.toLowerCase().match(regEx);
7878
return matches &&
79-
contentContentType.is_visible === true;
79+
contentType.is_visible === true;
8080
},
8181
),
82-
(contentContentType, identifier: string) => {
82+
(contentType, identifier: string) => {
8383
// Create a new instance of GroupContentType for each result
84-
return new GroupContentType(identifier, contentContentType);
84+
return new GroupContentType(identifier, contentType);
8585
}),
8686
);
8787
}
@@ -112,25 +112,25 @@ export default class Panel implements PanelInterface {
112112
/**
113113
* Populate the panel with the content types
114114
*/
115-
private populateContentContentTypes(): void {
115+
private populateContentTypes(): void {
116116
const groups = Config.getConfig("groups");
117-
const contentContentTypes = Config.getConfig("content_types");
117+
const contentTypes = Config.getConfig("content_types");
118118

119119
// Verify the configuration contains the required information
120-
if (groups && contentContentTypes) {
120+
if (groups && contentTypes) {
121121
// Iterate through the groups creating new instances with their associated content types
122122
_.each(groups, (group, id) => {
123123
// Push the group instance into the observable array to update the UI
124124
this.groups.push(new Group(
125125
id,
126126
group,
127127
_.map(
128-
_.where(contentContentTypes, {
128+
_.where(contentTypes, {
129129
group: id,
130130
is_visible: true,
131131
}), /* Retrieve content types with group id */
132-
(contentContentType: ContentTypeConfigInterface, identifier: string) => {
133-
const groupContentType = new GroupContentType(identifier, contentContentType);
132+
(contentType: ContentTypeConfigInterface, identifier: string) => {
133+
const groupContentType = new GroupContentType(identifier, contentType);
134134
return groupContentType;
135135
},
136136
),

0 commit comments

Comments
 (0)