Skip to content

Commit a4cd6f8

Browse files
authored
Merge pull request #311 from magento/ui-component-grid-controller-layout-acl-menu
Added menu.xml, acl.xml, controller and layout to UI component grid generation
2 parents bf38b0f + acce71f commit a4cd6f8

File tree

41 files changed

+1652
-1001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1652
-1001
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0"?>
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
3+
<menu>
4+
</menu>
5+
</config>

resources/fileTemplates/internal/Magento Menu Xml.xml.html

Whitespace-only changes.

resources/fileTemplates/internal/Magento Module Controller Backend Class.php.ft

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ class ${NAME}#if (${EXTENDS}) extends ${EXTENDS}#end#if (${IMPLEMENTS}) implemen
2626
*/
2727
public function execute()
2828
{
29-
// TODO: Implement execute method.
29+
return $this->resultFactory->create(\Magento\Framework\Controller\ResultFactory::TYPE_PAGE);
3030
}
3131
}

resources/fileTemplates/internal/Magento Module Ui Custom Data Provider Php.php.ft

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ class ${CLASS_NAME} extends DataProvider
1414
*/
1515
public function getData()
1616
{
17-
// todo: implement data retrieving here based on search criteria
18-
return parent::getData();
17+
//TODO: implement data retrieving here based on search criteria
18+
return [
19+
[]
20+
];
1921
}
2022
}

resources/fileTemplates/internal/Magento Module Ui Grid Collection Data Provider Php.php.ft

Lines changed: 0 additions & 130 deletions
This file was deleted.

resources/fileTemplates/internal/Magento Module Ui Grid Collection Data Provider Php.php.html

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/com/magento/idea/magento2plugin/actions/generation/NewUiComponentFormAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import com.magento.idea.magento2plugin.actions.generation.dialog.NewUiComponentFormDialog;
1818

1919
public class NewUiComponentFormAction extends AnAction {
20-
public static final String ACTION_NAME = "Magento 2 UI Form";
20+
public static final String ACTION_NAME = "Magento 2 UI Component Form";
2121
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 UI Form";
2222

2323
/**
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
package com.magento.idea.magento2plugin.actions.generation.data;
7+
8+
public class DataProviderDeclarationData {
9+
10+
private final String moduleName;
11+
private final String virtualTypeName;
12+
private final String collectionFqn;
13+
private final String dataSource;
14+
private final String tableName;
15+
16+
/**
17+
* Data Provider XML declaration data.
18+
*
19+
* @param moduleName String
20+
* @param virtualTypeName String
21+
* @param collectionFqn String
22+
* @param dataSource String
23+
*/
24+
public DataProviderDeclarationData(
25+
final String moduleName,
26+
final String virtualTypeName,
27+
final String collectionFqn,
28+
final String dataSource,
29+
final String tableName
30+
) {
31+
this.moduleName = moduleName;
32+
this.virtualTypeName = virtualTypeName;
33+
this.collectionFqn = collectionFqn;
34+
this.dataSource = dataSource;
35+
this.tableName = tableName;
36+
}
37+
38+
public String getModuleName() {
39+
return moduleName;
40+
}
41+
42+
public String getVirtualTypeName() {
43+
return virtualTypeName;
44+
}
45+
46+
public String getCollectionFqn() {
47+
return collectionFqn;
48+
}
49+
50+
public String getDataSource() {
51+
return dataSource;
52+
}
53+
54+
public String getTableName() {
55+
return tableName;
56+
}
57+
}

src/com/magento/idea/magento2plugin/actions/generation/data/LayoutXmlData.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class LayoutXmlData {
1111
private final String moduleName;
1212
private final String controllerName;
1313
private final String actionName;
14-
private final String formName;
14+
private final String uiComponentName;
1515

1616
/**
1717
* Layout XML data.
@@ -21,22 +21,22 @@ public class LayoutXmlData {
2121
* @param moduleName String
2222
* @param controllerName String
2323
* @param actionName String
24-
* @param formName String
24+
* @param uiComponentName String
2525
*/
2626
public LayoutXmlData(
2727
final String area,
2828
final String route,
2929
final String moduleName,
3030
final String controllerName,
3131
final String actionName,
32-
final String formName
32+
final String uiComponentName
3333
) {
3434
this.area = area;
3535
this.route = route;
3636
this.moduleName = moduleName;
3737
this.controllerName = controllerName;
3838
this.actionName = actionName;
39-
this.formName = formName;
39+
this.uiComponentName = uiComponentName;
4040
}
4141

4242
public String getArea() {
@@ -59,7 +59,7 @@ public String getActionName() {
5959
return actionName;
6060
}
6161

62-
public String getFormName() {
63-
return formName;
62+
public String getUiComponentName() {
63+
return uiComponentName;
6464
}
6565
}

0 commit comments

Comments
 (0)