Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
f58461d
#186: Extend the new Magento 2 module generation with the ability to …
Jul 8, 2020
f5708e1
Merge branch '2.0.0-develop' into issue-186
Sep 4, 2020
7255394
#issue-179 Added email template generation
Oct 24, 2020
6b572c6
Merge branch '2.1.0-develop' into feature/issue-179
serhiyzhovnir Oct 24, 2020
422fff4
fixing static tests
Oct 24, 2020
cfc6845
Merge branches 'feature/issue-179' and 'feature/issue-179' of github.…
Oct 24, 2020
fe55a5f
Fixed static tests
Oct 24, 2020
5a4bccc
Fixed lexicographical order for imports
Oct 24, 2020
1c93c88
Fixed lexicographical order for imports
Oct 24, 2020
26f7c1c
Merge branch '2.1.0-develop' into feature/issue-179
Oct 28, 2020
5eca487
Added reference navigation for observer name
drpayyne Dec 18, 2020
0f26f95
Fixed CheckStyle issues
drpayyne Dec 22, 2020
b2d9130
Added test coverage for disabled observer reference navigation
drpayyne Dec 22, 2020
bb501c7
Merge branch '3.1.0-develop' into issue-423
coderimus Dec 26, 2020
df97f61
Fixed test
drpayyne Dec 28, 2020
070fe6d
Merge branch '3.1.0-develop' into issue-423
coderimus Jan 18, 2021
8e1df95
Merge branch '3.1.0-develop' into issue-423
Jan 22, 2021
9619747
Merge branch '3.1.0-develop' into issue-423
coderimus Jan 24, 2021
3c2217f
Merge branch '3.1.0-develop' into issue-423
coderimus Feb 2, 2021
c1fac7e
Merge branch '3.2.0-develop' into issue-423
drpayyne Feb 8, 2021
682381e
FORWARDPORT: 3.1.0 to 3.1.1
coderimus Feb 10, 2021
39381dc
Merge pull request #480 from magento/forwardport/3.1.1-3.1.0
Feb 10, 2021
c45dbb8
Merge branch '3.2.0-develop' of github.com:magento/magento2-phpstorm-…
Feb 12, 2021
cc3a94b
Fixed tests
Feb 12, 2021
e34731a
Do not adding the sequence attribute, if no sequence has been selected
eduard13 Feb 12, 2021
df82626
Fixing static tests
eduard13 Feb 12, 2021
264c5ef
Merge pull request #266 from mmezhensky/issue-186
eduard13 Feb 12, 2021
5bc86d5
Fixed null pointer exception on the copy path action
Feb 12, 2021
68ea1b0
Merge remote-tracking branch 'origin/3.1.1-develop' into 3.1.1-develop
Feb 12, 2021
94ff9a0
Updated CHANGELOG.md
Feb 12, 2021
c8c3611
Static fixes
Feb 12, 2021
8fc2a8a
Merge pull request #485 from magento/fixed-null-pointer-copy-path
eduard13 Feb 12, 2021
2709820
#issue-179 Adjust the logic for validation
Feb 12, 2021
1bd5944
Merge branch '3.2.0-develop' of github.com:magento/magento2-phpstorm-…
Feb 12, 2021
e395630
Fix long line issue
Feb 12, 2021
cdb0ef6
Fix static tests
Feb 12, 2021
cc40bfb
Fix static tests
Feb 12, 2021
1c66663
Fixed the issue with GetCodeTemplate class
Feb 12, 2021
73b5292
3.1.2 initial
Feb 13, 2021
6bf866c
Merge branch '3.2.0-develop' of github.com:magento/magento2-phpstorm-…
Feb 13, 2021
421c3eb
#issue-179 Fixed issue with Null pointer
Feb 15, 2021
374ecef
Merge pull request #350 from serhiyzhovnir/feature/issue-179
coderimus Feb 15, 2021
26fa745
Merge branch '3.2.0-develop' into 3.1.1->3.2.0-forwardport
Feb 15, 2021
6aaaf2b
464: fixed reference navigation for classes under directories with un…
Feb 15, 2021
c5d67a8
Updated CHANGELOG.md
Feb 15, 2021
5bc14d6
Fixed expression
Feb 15, 2021
9d5e4ed
Fixed expression 2
Feb 16, 2021
bd7df28
Merge pull request #486 from magento/3.1.1->3.2.0-forwardport
eduard13 Feb 16, 2021
53b1d4d
Fixed tests
Feb 17, 2021
e08518b
Static fixes
Feb 17, 2021
830d2e6
Static fixes 2
Feb 17, 2021
eff7209
Merge pull request #488 from magento/464-underscore-within-directorie…
eduard13 Feb 18, 2021
83d5a5f
495: Fixed the array access exception when using copy path
Feb 22, 2021
4f796a8
495: updated CHANGELOG.md
Feb 22, 2021
c40be92
Merge pull request #496 from magento/BRN-495-Array_access_exception_w…
eduard13 Feb 22, 2021
05c4e3a
3.1.3 initial
Feb 22, 2021
0b69098
Merge branch '3.1.2-develop' of github.com:magento/magento2-phpstorm-…
Feb 22, 2021
4d7dddd
Merge pull request #497 from magento/forwardport_3.1.2->3.2.0
eduard13 Feb 22, 2021
14ac491
Require restart
Feb 27, 2021
66b4808
Removed caching the project global object in singletons
Mar 9, 2021
30b4c74
Static fixes
Mar 9, 2021
02bb789
Merge pull request #499 from magento/require-restart-on-plugin-update
Mar 9, 2021
030b66c
Fixed bug invalid check setup_version
anzin Mar 10, 2021
b4c7ea9
502: Class completion doesn't display interfaces.
Mar 10, 2021
7f175a3
Merge branch '3.1.3-develop' of github.com:magento/magento2-phpstorm-…
Mar 10, 2021
9c91819
502: Updated CHANGELOG.md
Mar 10, 2021
edcff33
Merge pull request #505 from magento/502-Class_completion_doesn't_dis…
eduard13 Mar 10, 2021
c48a75d
Fixed code by recommendation, added test
anzin Mar 11, 2021
07a3672
Merge branch '3.1.3-develop' of github.com:magento/magento2-phpstorm-…
anzin Mar 11, 2021
cc10d62
Merge pull request #504 from anzin/fix-bug-invalid-check-setup-version
Mar 11, 2021
6ac49c8
Merge branch '3.2.0-develop' of github.com:magento/magento2-phpstorm-…
Mar 11, 2021
2b618b8
3.1.4 Classes compatibility fixes
Mar 11, 2021
3aa6b63
Merge branch '3.2.0-develop' of github.com:magento/magento2-phpstorm-…
Mar 15, 2021
08f3c1b
Removed redundant annotation
Mar 15, 2021
3f8a8e7
Removed singleton
Mar 15, 2021
94cac05
Static fixes
Mar 15, 2021
4f31dc3
Merge pull request #439 from drpayyne/issue-423
coderimus Mar 15, 2021
5245e0c
Merge branch '3.2.0-develop' of github.com:magento/magento2-phpstorm-…
Mar 17, 2021
80eab67
Merge pull request #513 from magento/forward-port-3.1.3-develop->3.2.…
eduard13 Mar 17, 2021
f09939f
Error in the console (New Module Action)
iamdylanngo Mar 27, 2021
9fe8886
Fix static tests
iamdylanngo Mar 27, 2021
f612120
Merge pull request #519 from dylanngo95/issues-501
Mar 29, 2021
35eee16
Php file generators refactoring - model, resource model, collection, …
bohdan-harniuk Mar 31, 2021
33bf56d
Merge branch 'mainline-entity-manager' of github.com:magento/magento2…
bohdan-harniuk Mar 31, 2021
4ba56b8
Merge branch '3.2.0-develop' of github.com:magento/magento2-phpstorm-…
bohdan-harniuk Mar 31, 2021
58f5762
Additional changes after branch updating
bohdan-harniuk Mar 31, 2021
22d7358
Generators adjustments and critical bugs fixing
bohdan-harniuk Mar 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* See COPYING.txt for license details.
*/
-->
<idea-plugin>
<idea-plugin require-restart="true">
<id>com.magento.idea.magento2plugin</id>
<name>Magento PhpStorm</name>
<version>3.2.0</version>
Expand Down Expand Up @@ -66,6 +66,7 @@
<action id="MagentoCreateAViewModel" class="com.magento.idea.magento2plugin.actions.generation.NewViewModelAction" />
<action id="MagentoCreateAGraphQlResolver" class="com.magento.idea.magento2plugin.actions.generation.NewGraphQlResolverAction" />
<action id="MagentoCreateCLICommand" class="com.magento.idea.magento2plugin.actions.generation.NewCLICommandAction" />
<action id="MagentoCreateEmailTemplate" class="com.magento.idea.magento2plugin.actions.generation.NewEmailTemplateAction" />
<action id="MagentoCreateUiComponentGrid" class="com.magento.idea.magento2plugin.actions.generation.NewUiComponentGridAction" />
<action id="MagentoCreateUiComponentForm" class="com.magento.idea.magento2plugin.actions.generation.NewUiComponentFormAction" />
<action id="NewModelsAction" class="com.magento.idea.magento2plugin.actions.generation.NewModelsAction" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<template id="${ID}" label="${LABEL}" file="${FILE_NAME}.html" type="${TYPE}" module="${MODULE}" area="${AREA}"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!--
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<html>
<body>
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
<tr>
<td>
<font face="verdana" size="-1">Email templates configuration.</font>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
<tr>
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${ID}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Email template ID.</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${LABEL}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Email Template Label.</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${FILE_NAME}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Email template file name.</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${TYPE}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Email template type. (HTML or TEXT)</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${MODULE}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Module's name.</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${AREA}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Email template area. (Adminhtml or Frontend)</font></td>
</tr>
</table>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--@subject {{trans "${SUBJECT}"}} @-->
<!--@vars {} @-->

#if (${HTML_TYPE}){{template config_path="design/email/header_template"}}#end

<!-- @todo: implement ${TYPE} template -->
#if (${HTML_TYPE}){{template config_path="design/email/footer_template"}}#end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!--
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<html>
<body>
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
<tr>
<td>
<font face="verdana" size="-1">Email template.</font>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
<tr>
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${SUBJECT}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Email subject.</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${HTML_TYPE}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Defines if it's HTML type template.</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${TYPE}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Email template type. (HTML or TEXT)</font></td>
</tr>
</table>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
</config>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<html>
<body>
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
<tr>
<td>
<font face="verdana" size="-1">Email templates configurations.</font>
</td>
</tr>
</table>
</body>
</html>
5 changes: 5 additions & 0 deletions resources/magento2/common.properties
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,8 @@ common.addToolbarFullTextSearch=Add Toolbar Full Text Search
common.addToolbarColumnsControl=Add Toolbar Columns Control
common.addToolbarBookmarks=Add Toolbar Bookmarks
common.argument=Argument name
common.template.id=Template ID
common.template.label=Template Label
common.template.filename=Template File Name
common.template.subject=Email Subject
common.template.type=Email Type
24 changes: 19 additions & 5 deletions src/com/magento/idea/magento2plugin/actions/CopyMagentoPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.magento.idea.magento2plugin.util.magento.GetModuleNameByDirectoryUtil;
import org.jetbrains.annotations.NotNull;
Expand All @@ -24,13 +25,15 @@ public class CopyMagentoPath extends CopyPathProvider {
private final String[] templatePaths = {
"view/frontend/templates/",
"view/adminhtml/templates/",
"view/base/templates/"
"view/base/templates/",
"templates/"
};

@Override
public void update(@NotNull final AnActionEvent event) {
final VirtualFile virtualFile = event.getData(PlatformDataKeys.VIRTUAL_FILE);
if (virtualFile != null && virtualFile.isDirectory()) {
if (virtualFile != null && virtualFile.isDirectory()
|| virtualFile != null && !PHTML.equals(virtualFile.getExtension())) {
event.getPresentation().setVisible(false);
}
}
Expand All @@ -42,11 +45,22 @@ public String getPathToElement(
@Nullable final VirtualFile virtualFile,
@Nullable final Editor editor
) {
final PsiDirectory directory
= PsiManager.getInstance(project).findFile(virtualFile).getContainingDirectory();
if (virtualFile == null) {
return null;
}
final PsiFile file
= PsiManager.getInstance(project).findFile(virtualFile);
if (file == null) {
return null;
}
final PsiDirectory directory = file.getContainingDirectory();
final String moduleName = GetModuleNameByDirectoryUtil.execute(directory, project);
if (moduleName == null) {
return null;
}
final StringBuilder fullPath = new StringBuilder(virtualFile.getPath());
final StringBuilder magentoPath
= new StringBuilder(GetModuleNameByDirectoryUtil.execute(directory, project));
= new StringBuilder(moduleName);
String path = fullPath.toString();

if (PHTML.equals(virtualFile.getExtension())) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.actions.generation;

import com.intellij.ide.IdeView;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDirectory;
import com.magento.idea.magento2plugin.MagentoIcons;
import com.magento.idea.magento2plugin.actions.generation.dialog.NewEmailTemplateDialog;

@SuppressWarnings({"PMD.OnlyOneReturn", "PMD.FieldNamingConventions"})
public class NewEmailTemplateAction extends AnAction {
public static final String ACTION_NAME = "Magento 2 Email Template";
public static final String ACTION_DESCRIPTION = "Create a new Magento 2 email template";

/**
* New email template action constructor.
*/
public NewEmailTemplateAction() {
super(ACTION_NAME, ACTION_DESCRIPTION, MagentoIcons.MODULE);
}

@Override
public void actionPerformed(final AnActionEvent event) {
final DataContext dataContext = event.getDataContext();
final IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext);

if (view == null) {
return;
}

final Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project == null) {
return;
}

final PsiDirectory directory = view.getOrChooseDirectory();
if (directory == null) {
return;
}

NewEmailTemplateDialog.open(project, directory);
}

@Override
public boolean isDumbAware() {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.actions.generation.data;

@SuppressWarnings({"PMD.DataClass"})
public class EmailTemplateHtmlData {
private final String module;
private final String fileName;
private final String area;
private final String subject;
private final String type;

/**
* Email template HTML data constructor.
*
* @param module String
* @param area String
* @param subject String
* @param type String
*/
public EmailTemplateHtmlData(
final String module,
final String fileName,
final String area,
final String subject,
final String type
) {
this.module = module;
this.fileName = fileName;
this.area = area;
this.subject = subject;
this.type = type;
}

/**
* Get module name.
*
* @return String
*/
public String getModule() {
return module;
}

/**
* Get file name.
*
* @return String
*/
public String getFileName() {
return fileName;
}

/**
* Get area.
*
* @return String
*/
public String getArea() {
return area;
}

/**
* Get subject.
*
* @return String
*/
public String getSubject() {
return subject;
}

/**
* Get type.
*
* @return String
*/
public String getType() {
return type;
}
}
Loading