Skip to content

Commit ed4893b

Browse files
committed
Merge branch 'issues-305' of github.com:dylanngo95/magento2-phpstorm-plugin into issues-305
2 parents fad472a + 3500d75 commit ed4893b

Some content is hidden

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

48 files changed

+723
-2418
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ If applicable, add screenshots to help explain your problem.
3939

4040
**Please complete the following information:** (*)
4141

42-
- OS: [e.g. iOS]
43-
- PhpStorm/Intellij version [e.g. 2019.3.3]
44-
- Version [e.g. 1.0.0]
42+
- OS: [e.g. MacOS or Ubuntu Linux 20.04]
43+
- PhpStorm/Intellij version: [e.g. 2019.3.3]
44+
- Plugin Version: [e.g. 1.0.0]
4545

4646
**Additional context**
4747

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
If relevant, please provide a list of fixed issues in the format magento/magento2-phpstorm-plugin#<issue_number>.
2121
There could be 1 or more issues linked here and it will help us find some more information about the reasoning behind this change.
2222
-->
23-
1. magento/magento2-phpstorm-plugin#<issue_number>: Issue title
23+
1. Fixes magento/magento2-phpstorm-plugin#<issue_number>
2424

2525
**Questions or comments**
2626
<!---

.github/workflows/gradle.yml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ name: Run automated tests
55

66
on:
77
pull_request:
8-
branches: [ master, 2.0.0-develop, 2.0.1-develop ]
8+
branches: [ master, 2.0.1-develop, 2.1.0-develop ]
99

1010
jobs:
1111
build-linux:
12-
1312
runs-on: ubuntu-latest
1413

1514
steps:
@@ -18,6 +17,14 @@ jobs:
1817
uses: actions/setup-java@v1
1918
with:
2019
java-version: 1.8
20+
- uses: actions/cache@v2
21+
with:
22+
path: |
23+
~/.gradle/caches
24+
~/.gradle/wrapper
25+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
26+
restore-keys: |
27+
${{ runner.os }}-gradle-
2128
- name: Gradle wrapper
2229
run: gradle wrapper
2330
- name: Grant execute permission for gradlew
@@ -26,7 +33,6 @@ jobs:
2633
run: ./gradlew test -i --no-daemon
2734

2835
build-windows:
29-
3036
runs-on: windows-latest
3137

3238
steps:
@@ -35,6 +41,14 @@ jobs:
3541
uses: actions/setup-java@v1
3642
with:
3743
java-version: 1.8
44+
- uses: actions/cache@v2
45+
with:
46+
path: |
47+
~/.gradle/caches
48+
~/.gradle/wrapper
49+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
50+
restore-keys: |
51+
${{ runner.os }}-gradle-
3852
- name: Gradle wrapper
3953
run: gradle wrapper
4054
- name: Grant execute permission for gradlew
@@ -43,7 +57,6 @@ jobs:
4357
run: ./gradlew test -i --no-daemon
4458

4559
build-macos:
46-
4760
runs-on: macos-latest
4861

4962
steps:
@@ -52,6 +65,14 @@ jobs:
5265
uses: actions/setup-java@v1
5366
with:
5467
java-version: 1.8
68+
- uses: actions/cache@v2
69+
with:
70+
path: |
71+
~/.gradle/caches
72+
~/.gradle/wrapper
73+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
74+
restore-keys: |
75+
${{ runner.os }}-gradle-
5576
- name: Gradle wrapper
5677
run: gradle wrapper
5778
- name: Grant execute permission for gradlew
@@ -60,7 +81,6 @@ jobs:
6081
run: ./gradlew test -i --no-daemon
6182

6283
static-tests:
63-
6484
runs-on: ubuntu-latest
6585

6686
steps:
@@ -69,6 +89,14 @@ jobs:
6989
uses: actions/setup-java@v1
7090
with:
7191
java-version: 1.8
92+
- uses: actions/cache@v2
93+
with:
94+
path: |
95+
~/.gradle/caches
96+
~/.gradle/wrapper
97+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
98+
restore-keys: |
99+
${{ runner.os }}-gradle-
72100
- name: Gradle wrapper
73101
run: gradle wrapper
74102
- name: Grant execute permission for gradlew

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repositories {
1515
}
1616

1717
group 'com.magento.idea'
18-
version '2.0.1'
18+
version '2.1.0'
1919

2020
apply plugin: 'org.jetbrains.intellij'
2121
apply plugin: 'java'

resources/fileTemplates/internal/Magento Php Preference Class.php.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Read more About the preferences in the <a href="https://devdocs.magento.com/guides/v2.3/extension-dev-guide/build/di-xml-file.html#abstraction-implementation-mappings">DevDocs</a>.
2121
</font><br>
2222
</td>
23-
</tr
23+
</tr>
2424
</table>
2525
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
2626
<tr>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!--
2+
/*
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<html>
8+
<body>
9+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
10+
<tr>
11+
<td><font face="verdana" size="-1">
12+
The routes.xml file maps which module to use for a URL with a specific frontName and area.
13+
The location of the routes.xml file in a module, either etc/frontend or etc/adminhtml, specifies where those routes are active.
14+
</font><br>
15+
</td>
16+
</tr>
17+
<tr>
18+
<td><font face="verdana" size="-1">
19+
Read more About the routes.xml in the
20+
<a href="https://devdocs.magento.com/guides/v2.4/extension-dev-guide/routing.html#routesxml">
21+
DevDocs</a>.
22+
</font><br>
23+
</td>
24+
</tr>
25+
</table>
26+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
27+
<tr>
28+
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
29+
</tr>
30+
<tr>
31+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${ROUTER_ID}</b></font></nobr></td>
32+
<td width="10">&nbsp;</td>
33+
<td width="100%" valign="top"><font face="verdana" size="-1">specifies the name of the router in Magento.
34+
See the reference tables in the
35+
<a href="https://devdocs.magento.com/guides/v2.4/extension-dev-guide/routing.html#router-class">
36+
Router class section
37+
</a>.
38+
</font>
39+
</td>
40+
</tr>
41+
</table>
42+
</body>
43+
</html>

resources/magento2/common.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ common.httpMethod=HTTP Method
88
common.controller.name=Controller Name
99
common.controller.inheritAction=Inherit Action Class
1010
common.controller.backend.acl=Admin Resource ACL
11-
common.controller.action=Controller Action
11+
common.controller.action=Action Name
1212
common.ok=OK
1313
common.yes=Yes
1414
common.no=No
@@ -23,6 +23,7 @@ common.theme.target=Target Theme
2323
common.area.target=Target Area
2424
common.name=Name
2525
common.className=Class Name
26+
common.pluginName=Plugin Name
2627
common.directoryPath=Directory Path
2728
common.methodType=Method Type
2829
common.sortOrder=Sort Order

resources/magento2/validation.properties

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
validator.notEmpty=The {0} field must not be empty
2+
validator.box.notEmpty=The {0} field must contain a valid selection from the dropdown
23
validator.package.validPath=Please specify a valid Magento 2 installation path
3-
validator.alphaNumericCharacters={0} must contain letters and numbers only
4+
validator.alphaNumericCharacters=The {0} field must contain letters and numbers only
45
validator.alphaNumericAndUnderscoreCharacters={0} must contain letters, numbers and underscores only
5-
validator.alreadyDeclared={0} is already declared in the {1} module.
6-
validator.startWithNumberOrCapitalLetter={0} must start from a number or a capital letter
7-
validator.onlyNumbers={0} must contain numbers only
6+
validator.alreadyDeclared={0} is already declared in the {1} module
7+
validator.startWithNumberOrCapitalLetter=The {0} field must start with a number or a capital letter
8+
validator.onlyNumbers=The {0} field must contain numbers only
89
validator.mustNotBeNegative={0} must not be negative
9-
validator.identifier={0} must contain letters, numbers, dashes, and underscores only
10-
validator.class.isNotValid={0} is not valid class name
10+
validator.identifier=The {0} field must contain letters, numbers, dashes, and underscores only
11+
validator.class.isNotValid=The {0} field does not contain a valid class name
1112
validator.class.shouldBeUnique=Duplicated class {0}
12-
validator.namespace.isNotValid={0} is not valid namespace name
13-
validator.directory.isNotValid={0} is not valid
13+
validator.namespace.isNotValid=The {0} field does not contain a valid namespace
14+
validator.directory.isNotValid=The {0} field does not contain a valid directory
15+
validator.directory.php.isNotValid=The {0} field does not contain a valid PHP directory
16+
validator.command.isNotValid=The {0} field does not contain a valid Magento 2 CLI command
1417
validator.module.noSuchModule=No such module {0}
1518
validator.file.alreadyExists={0} already exists
1619
validator.file.cantBeCreated={0} can't be created
@@ -19,8 +22,8 @@ validator.file.noDocumentAssociations={0} file is binary or has no document asso
1922
validator.class.alreadyDeclared={0} already declared in the target module
2023
validator.magentoVersionInvalid=Please specify valid Magento version or use 'any' keyword as default
2124
validator.class.targetClassNotFound=Target class is not found. Check the di.xml file
22-
validator.cronSchedule.invalidExpression={0} has invalid cron schedule expression (e.g. * * * * *)
23-
validator.configPath.invalidFormat={0} has invalid config path format (e.g. section/group/field)
25+
validator.cronSchedule.invalidExpression=The {0} field has does not contain a valid cron schedule expression (e.g. * * * * *)
26+
validator.configPath.invalidFormat=The {0} field has does not contain a valid config path format (e.g. section/group/field)
2427
validator.moduleNameIsTheSameAsPackage=Module name must be different from the package name
2528
validator.mustNotBeEmptyShouldContainLettersOrNumbers=Must not be empty, should contain letters or numbers
2629
validator.magentoRouteIdInvalid=The route id is invalid

src/com/magento/idea/magento2plugin/actions/generation/dialog/AbstractDialog.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import javax.swing.JComponent;
2727
import javax.swing.JDialog;
2828
import javax.swing.JOptionPane;
29+
import javax.swing.JTextArea;
2930
import javax.swing.JTextField;
3031

3132
/**
@@ -182,9 +183,15 @@ private void addFieldValidationRuleMessageAssociation(
182183

183184
private String resolveFieldValueByComponentType(final Object field) {
184185
if (field instanceof JTextField) {
185-
return ((JTextField) field).getText();
186+
return ((JTextField) field).isEditable() ? ((JTextField) field).getText() : null;
186187
} else if (field instanceof JComboBox) {
187-
return ((JComboBox) field).getSelectedItem().toString();
188+
if (((JComboBox<?>) field).getSelectedIndex() == -1) {
189+
return "";
190+
} else {
191+
return ((JComboBox) field).getSelectedItem().toString();
192+
}
193+
} else if (field instanceof JTextArea) {
194+
return ((JTextArea) field).getText();
188195
}
189196
return null;
190197
}

src/com/magento/idea/magento2plugin/actions/generation/dialog/CreateAPluginDialog.form

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
109109
</constraints>
110110
<properties>
111-
<text resource-bundle="magento2/common" key="common.name"/>
111+
<text resource-bundle="magento2/common" key="common.pluginName"/>
112112
</properties>
113113
</component>
114114
<component id="9431c" class="javax.swing.JTextField" binding="pluginName">

0 commit comments

Comments
 (0)