Skip to content

Commit 82d0c9e

Browse files
author
Vitaliy
authored
Merge branch '3.1.0-develop' into 3.0.0-develop
2 parents b9b2aac + 695db83 commit 82d0c9e

33 files changed

+415
-155
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
66

77
## 3.1.0
88

9+
## 3.0.2
10+
11+
### Fixed
12+
13+
- Fixed the Inject a View Model dialog
14+
915
## 3.0.1
1016

1117
### Fixed

build.gradle

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,13 @@ idea {
103103
generatedSourceDirs += file('gen')
104104
}
105105
}
106+
107+
dependencies {
108+
testImplementation 'junit:junit:4.13'
109+
}
110+
111+
test {
112+
useJUnit()
113+
114+
maxHeapSize = '1G'
115+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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 Regular Class it is a php class which represents itself template for creating objects.
13+
</font><br>
14+
</td>
15+
</tr>
16+
<tr>
17+
<td><font face="verdana" size="-1">
18+
Link to documentation
19+
<a href="https://www.php.net/manual/en/language.oop5.basic.php">
20+
PHPDocs</a>.
21+
</font><br>
22+
</td>
23+
</tr>
24+
</table>
25+
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
26+
<tr>
27+
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
28+
</tr>
29+
<tr>
30+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
31+
<td width="10">&nbsp;</td>
32+
<td width="100%" valign="top"><font face="verdana" size="-1">A fully qualified name of the field namespace without a leading slash.
33+
</font>
34+
</td>
35+
</tr>
36+
<tr>
37+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${USE}</b></font></nobr></td>
38+
<td width="10">&nbsp;</td>
39+
<td width="100%" valign="top"><font face="verdana" size="-1">List of imports separated by comma.
40+
</font>
41+
</td>
42+
</tr>
43+
<tr>
44+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAME}</b></font></nobr></td>
45+
<td width="10">&nbsp;</td>
46+
<td width="100%" valign="top"><font face="verdana" size="-1">PHP Class name.
47+
</font>
48+
</td>
49+
</tr>
50+
<tr>
51+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${EXTENDS}</b></font></nobr></td>
52+
<td width="10">&nbsp;</td>
53+
<td width="100%" valign="top"><font face="verdana" size="-1">Name of PHP class that the Class extends.
54+
</font>
55+
</td>
56+
</tr>
57+
<tr>
58+
<td valign="top"><nobr><font face="verdana" size="-2"><b>${IMPLEMENTS}</b></font></nobr></td>
59+
<td width="10">&nbsp;</td>
60+
<td width="100%" valign="top"><font face="verdana" size="-1">Name of PHP class that the Class implements.
61+
</font>
62+
</td>
63+
</tr>
64+
</table>
65+
</body>
66+
</html>

resources/magento2/common.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,5 @@ common.addToolbarListingPaging=Add Toolbar Listing Paging
6262
common.addToolbarListingFilters=Add Toolbar Listing Filters
6363
common.addToolbarFullTextSearch=Add Toolbar Full Text Search
6464
common.addToolbarColumnsControl=Add Toolbar Columns Control
65-
common.addToolbarBookmarks=Add Toolbar Bookmarks
65+
common.addToolbarBookmarks=Add Toolbar Bookmarks
66+
common.argument=Argument name

resources/magento2/inspection.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ inspection.plugin.error.redundantParameter=Redundant parameter
1515
inspection.plugin.error.typeIncompatibility=Possible type incompatibility. Consider changing the parameter according to the target method.
1616
inspection.observer.duplicateInSameFile=The observer name already used in this file. For more details see Inspection Description.
1717
inspection.observer.duplicateInOtherPlaces=The observer name "{0}" for event "{1}" is already used in the module "{2}" ({3} scope). For more details see Inspection Description.
18+
inspection.observer.disabledObserverDoesNotExist=This observer does not exist to be disabled. For more details, see Inspection Description.
1819
inspection.cache.disabledCache=Cacheable false attribute on the default layout will disable cache site-wide
1920
inspection.moduleDeclaration.warning.wrongModuleName=Provided module name "{0}" does not match expected "{1}"
2021
inspection.moduleDeclaration.fix=Fix module name

resources/magento2/validation.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ validator.startWithNumberOrCapitalLetter=The {0} field must start with a number
1010
validator.onlyNumbers=The {0} field must contain numbers only
1111
validator.mustNotBeNegative={0} must not be negative
1212
validator.identifier=The {0} field must contain letters, numbers, dashes, and underscores only
13+
validator.identifier.colon=The {0} field must contain letters, numbers, colons, dashes, and underscores only
1314
validator.class.isNotValid=The {0} field does not contain a valid class name
1415
validator.fqn.isNotValid=The {0} field does not contain a valid fully qualified class name
1516
validator.class.shouldBeUnique=Duplicated class {0}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.annotation.RuleRegistry;
1616
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.BoxNotEmptyRule;
1717
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.DirectoryRule;
18-
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.IdentifierRule;
18+
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.IdentifierWithColonRule;
1919
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.NotEmptyRule;
2020
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.NumericRule;
2121
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.PhpClassRule;
@@ -88,8 +88,8 @@ public class CreateAPluginDialog extends AbstractDialog {
8888

8989
@FieldValidation(rule = RuleRegistry.NOT_EMPTY,
9090
message = {NotEmptyRule.MESSAGE, PLUGIN_NAME})
91-
@FieldValidation(rule = RuleRegistry.IDENTIFIER,
92-
message = {IdentifierRule.MESSAGE, PLUGIN_NAME})
91+
@FieldValidation(rule = RuleRegistry.IDENTIFIER_WITH_COLON,
92+
message = {IdentifierWithColonRule.MESSAGE, PLUGIN_NAME})
9393
private JTextField pluginName;
9494

9595
private JLabel pluginDirectoryName;//NOPMD

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
import com.magento.idea.magento2plugin.actions.generation.data.ObserverFileData;
1313
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.annotation.FieldValidation;
1414
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.annotation.RuleRegistry;
15-
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.AlphanumericWithUnderscoreRule;
1615
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.BoxNotEmptyRule;
1716
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.DirectoryRule;
17+
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.IdentifierWithColonRule;
1818
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.NotEmptyRule;
1919
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.PhpClassRule;
2020
import com.magento.idea.magento2plugin.actions.generation.generator.ObserverClassGenerator;
@@ -82,8 +82,8 @@ public class CreateAnObserverDialog extends AbstractDialog {
8282

8383
@FieldValidation(rule = RuleRegistry.NOT_EMPTY,
8484
message = {NotEmptyRule.MESSAGE, OBSERVER_NAME})
85-
@FieldValidation(rule = RuleRegistry.ALPHANUMERIC_WITH_UNDERSCORE,
86-
message = {AlphanumericWithUnderscoreRule.MESSAGE, OBSERVER_NAME})
85+
@FieldValidation(rule = RuleRegistry.IDENTIFIER_WITH_COLON,
86+
message = {IdentifierWithColonRule.MESSAGE, OBSERVER_NAME})
8787
private JTextField observerName;
8888

8989
/**

src/com/magento/idea/magento2plugin/actions/generation/dialog/validator/annotation/RuleRegistry.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.CronScheduleRule;
1717
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.DirectoryRule;
1818
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.IdentifierRule;
19+
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.IdentifierWithColonRule;
1920
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.Lowercase;
2021
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.NotEmptyRule;
2122
import com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule.NumericRule;
@@ -39,6 +40,7 @@ public enum RuleRegistry {
3940
DIRECTORY(DirectoryRule.class),
4041
PHP_DIRECTORY(PhpDirectoryRule.class),
4142
IDENTIFIER(IdentifierRule.class),
43+
IDENTIFIER_WITH_COLON(IdentifierWithColonRule.class),
4244
PHP_NAMESPACE_NAME(PhpNamespaceNameRule.class),
4345
START_WITH_NUMBER_OR_CAPITAL_LETTER(StartWithNumberOrCapitalLetterRule.class),
4446
ACL_RESOURCE_ID(AclResourceIdRule.class),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.magento.idea.magento2plugin.actions.generation.dialog.validator.rule;
2+
3+
import com.magento.idea.magento2plugin.util.RegExUtil;
4+
5+
public class IdentifierWithColonRule implements ValidationRule {
6+
public static final String MESSAGE = "validator.identifier.colon";
7+
private static final ValidationRule INSTANCE = new IdentifierWithColonRule();
8+
9+
@Override
10+
public boolean check(final String value) {
11+
return value.matches(RegExUtil.IDENTIFIER_WITH_COLON);
12+
}
13+
14+
public static ValidationRule getInstance() {
15+
return INSTANCE;
16+
}
17+
}

0 commit comments

Comments
 (0)