Skip to content

Commit c1df489

Browse files
author
Vitaliy Boyko
committed
Merge branch 'mainline-eav-attr-code-genearators' of https://github.com/magento/magento2-phpstorm-plugin into 525-зroduct-attribute-setup-patch-generator
2 parents 800e1c9 + 27fb74b commit c1df489

File tree

296 files changed

+15853
-2576
lines changed

Some content is hidden

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

296 files changed

+15853
-2576
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Run automated tests
55

66
on:
77
pull_request:
8-
branches: [ master, 3.2.0-develop ]
8+
branches: [ master, 4.0.0-develop ]
99

1010
jobs:
1111
build-linux:

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,25 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
66

7+
## 4.0.0
8+
79
## 3.2.0
810

11+
### Added
12+
13+
- Code generation for a Magento Entity in [#521](https://github.com/magento/magento2-phpstorm-plugin/pull/521)
14+
- Code generation for email templates in [#350](https://github.com/magento/magento2-phpstorm-plugin/pull/350)
15+
- Reference navigation for disabled observers in `events.xml` in [#439](https://github.com/magento/magento2-phpstorm-plugin/pull/439)
16+
- Line markers for test fixtures in [#477](https://github.com/magento/magento2-phpstorm-plugin/pull/477)
17+
18+
### Changed
19+
20+
- Added ability to set the module sequence at generating new module [#266](https://github.com/magento/magento2-phpstorm-plugin/pull/266)
21+
22+
### Fixed
23+
24+
- ArrayIndexOutOfBoundsException in the New Module Action in [#519](https://github.com/magento/magento2-phpstorm-plugin/pull/519)
25+
926
## 3.1.3
1027

1128
### Changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
## Works with
2424

25-
* PhpStorm >= 2020.3
25+
* PhpStorm >= 2021.1
2626
* JRE >= 11
2727

2828
## Features

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ repositories {
1515
}
1616

1717
group 'com.magento.idea'
18-
version '3.2.0'
18+
version '4.0.0'
1919

2020
apply plugin: 'org.jetbrains.intellij'
2121
apply plugin: 'java'
2222
apply plugin: 'idea'
2323
apply plugin: 'groovy'
2424
apply plugin: 'org.jetbrains.changelog'
2525

26-
def phpPluginVersion = System.getProperty("phpPluginVersion", "203.5981.175")
27-
def ideaVersion = System.getProperty("ideaVersion", "2020.3")
26+
def phpPluginVersion = System.getProperty("phpPluginVersion", "211.6693.111")
27+
def ideaVersion = System.getProperty("ideaVersion", "2021.1")
2828
def javaVersion = 11
2929

3030
sourceCompatibility = javaVersion
@@ -41,7 +41,7 @@ intellij {
4141
'properties',
4242
'CSS',
4343
'JavaScriptLanguage',
44-
'com.intellij.lang.jsgraphql:2.7.0',
44+
'com.intellij.lang.jsgraphql:2.9.1',
4545
'platform-images',
4646
'copyright'
4747
]

resources/META-INF/plugin.xml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<idea-plugin require-restart="true">
88
<id>com.magento.idea.magento2plugin</id>
99
<name>Magento PhpStorm</name>
10-
<version>3.2.0</version>
10+
<version>4.0.0</version>
1111
<vendor url="https://github.com/magento/magento2-phpstorm-plugin">Magento Inc.</vendor>
1212

1313
<description><![CDATA[
@@ -24,7 +24,7 @@
2424
</change-notes>
2525

2626
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
27-
<idea-version since-build="203.5981.155"/>
27+
<idea-version since-build="211.6693.111"/>
2828

2929
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
3030
on how to target different products -->
@@ -58,6 +58,7 @@
5858

5959
<!-- Module file generators -->
6060
<group id="MagentoNewModuleFileGroup" class="com.magento.idea.magento2plugin.actions.groups.NewModuleFileGroup" text="Module File" popup="true">
61+
<action id="MagentoCreateEntity" class="com.magento.idea.magento2plugin.actions.generation.NewEntityAction" />
6162
<action id="MagentoCreateABlock" class="com.magento.idea.magento2plugin.actions.generation.NewBlockAction" />
6263
<action id="MagentoCreateAController" class="com.magento.idea.magento2plugin.actions.generation.NewControllerAction" />
6364
<action id="MagentoCreateACronjob" class="com.magento.idea.magento2plugin.actions.generation.NewCronjobAction" />
@@ -230,6 +231,18 @@
230231
<internalFileTemplate name="Magento Data Model Interface"/>
231232
<internalFileTemplate name="Magento Module Declarative Schema XML"/>
232233
<internalFileTemplate name="Magento Module Declarative Schema Whitelist JSON"/>
234+
<internalFileTemplate name="Magento Get List Query Model"/>
235+
<internalFileTemplate name="Magento Entity Save Controller Class"/>
236+
<internalFileTemplate name="Magento Entity Data Mapper"/>
237+
<internalFileTemplate name="Magento Save Entity Command Model"/>
238+
<internalFileTemplate name="Magento Entity Index Adminhtml Controller Class"/>
239+
<internalFileTemplate name="Magento Grid Ui Component Action Column Class"/>
240+
<internalFileTemplate name="Magento PHP Form Generic Button Block Class"/>
241+
<internalFileTemplate name="Magento Entity New Action Controller Class"/>
242+
<internalFileTemplate name="Magento New Entity Layout XML"/>
243+
<internalFileTemplate name="Magento Delete Entity By Id Command"/>
244+
<internalFileTemplate name="Magento Entity Edit Action Controller Class"/>
245+
<internalFileTemplate name="Magento Entity Delete Controller Class"/>
233246

234247
<defaultLiveTemplates file="/liveTemplates/MagentoPWA.xml"/>
235248

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<html lang="en">
2+
<body>
3+
<p face="verdana" size="-1">
4+
5+
</p>
6+
7+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
8+
<tr>
9+
<td colspan="3"><font face="verdana" size="-1">Template's predefined variables:</font></td>
10+
</tr>
11+
<tr>
12+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
13+
<td width="10">&nbsp;</td>
14+
<td width="100%" valign="top"><font face="verdana" size="-1"></font></td>
15+
</tr>
16+
</table>
17+
</body>
18+
</html>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
#parse("PHP File Header.php")
3+
4+
namespace ${NAMESPACE};
5+
6+
#set($uses = ${USES})
7+
#foreach ($use in $uses.split(","))
8+
use $use;
9+
#end
10+
11+
/**
12+
* Converts a collection of ${ENTITY_NAME} entities to an array of data transfer objects.
13+
*/
14+
class ${CLASS_NAME}
15+
{
16+
/**
17+
* @var ${DTO_FACTORY}
18+
*/
19+
private $entityDtoFactory;
20+
21+
/**
22+
* @param ${DTO_FACTORY} $entityDtoFactory
23+
*/
24+
public function __construct(
25+
${DTO_FACTORY} $entityDtoFactory
26+
) {
27+
$this->entityDtoFactory = $entityDtoFactory;
28+
}
29+
30+
/**
31+
* Map magento models to DTO array.
32+
*
33+
* @param ${ABSTRACT_COLLECTION} $collection
34+
*
35+
* @return array|${DTO_TYPE}[]
36+
*/
37+
public function map(${ABSTRACT_COLLECTION} $collection): array
38+
{
39+
$results = [];
40+
/** @var ${MAGENTO_MODEL_TYPE} $item */
41+
foreach ($collection->getItems() as $item) {
42+
/** @var ${DTO_TYPE}|${DATA_OBJECT} $entityDto */
43+
$entityDto = $this->entityDtoFactory->create();
44+
$entityDto->addData($item->getData());
45+
46+
#set($brackets = "[]")
47+
$results$brackets = $entityDto;
48+
}
49+
50+
return $results;
51+
}
52+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<column name="${COLUMN_NAME}">
2+
<settings>
3+
#if (${COLUMN_FILTER})
4+
<filter>${COLUMN_FILTER}</filter>
5+
#end
6+
<label translate="true">${COLUMN_LABEL}</label>
7+
</settings>
8+
</column>

resources/fileTemplates/code/Magento Grid UI Component Column.xml.html

Whitespace-only changes.

resources/fileTemplates/code/Magento Module UI Component Form Field Xml.xml.ft

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,17 @@
99
<label translate="true">${LABEL}</label>
1010
<dataScope>${NAME}</dataScope>
1111
</settings>
12+
#if(${FORM_ELEMENT} == 'checkbox')
13+
<formElements>
14+
<checkbox>
15+
<settings>
16+
<valueMap>
17+
<map name="false" xsi:type="number">0</map>
18+
<map name="true" xsi:type="number">1</map>
19+
</valueMap>
20+
<prefer>toggle</prefer>
21+
</settings>
22+
</checkbox>
23+
</formElements>
24+
#end
1225
</field>

0 commit comments

Comments
 (0)