Skip to content

Commit 64b36dc

Browse files
861: Reverted breaking changes
1 parent ea2a3d1 commit 64b36dc

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

src/com/magento/idea/magento2plugin/actions/context/xml/NewRoutesXmlAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected boolean isVisible(
4343
);
4444

4545
return allowedDirectories.contains(targetDirectory.getName())
46-
&& moduleData.getType().equals(ComponentType.MODULE);
46+
&& moduleData.getType().equals(ComponentType.module);
4747
}
4848

4949
@Override

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ private boolean isOverrideAllowed(final VirtualFile file, final Project project)
6666
GetComponentNameByDirectoryUtil.execute(psiFile.getContainingDirectory(), project)
6767
);
6868

69-
if (componentType.equals(ComponentType.MODULE.toString())) {
69+
if (componentType.equals(ComponentType.module.toString())) {
7070
isAllowed = file.getPath().contains(Package.moduleViewDir);
71-
} else if (componentType.equals(ComponentType.THEME.toString())) {
71+
} else if (componentType.equals(ComponentType.theme.toString())) {
7272
isAllowed = true;
7373
}
7474

src/com/magento/idea/magento2plugin/actions/generation/generator/OverrideInThemeGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void execute(final PsiFile baseFile, final String themeName, final boolea
4949
.execute(baseFile.getContainingDirectory(), project));
5050

5151
List<String> pathComponents;
52-
if (componentType.equals(ComponentType.MODULE.toString())) {
52+
if (componentType.equals(ComponentType.module.toString())) {
5353
pathComponents = getModulePathComponents(
5454
baseFile,
5555
GetComponentNameByDirectoryUtil.execute(
@@ -61,7 +61,7 @@ public void execute(final PsiFile baseFile, final String themeName, final boolea
6161
pathComponents.add("override");
6262
pathComponents.add("base");
6363
}
64-
} else if (componentType.equals(ComponentType.THEME.toString())) {
64+
} else if (componentType.equals(ComponentType.theme.toString())) {
6565
pathComponents = getThemePathComponents(baseFile);
6666
} else {
6767
return;

src/com/magento/idea/magento2plugin/magento/packages/ComponentType.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77

88
import org.jetbrains.annotations.NotNull;
99

10+
@SuppressWarnings({"PMD.FieldNamingConventions"})
1011
public enum ComponentType {
11-
MODULE,
12-
THEME;
12+
module,
13+
theme;
1314

1415
/**
1516
* Get component type by value.

src/com/magento/idea/magento2plugin/util/magento/GetComponentTypeByNameUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ private GetComponentTypeByNameUtil(){}
2525
public static String execute(final String componentName) {
2626
String componentType = null;
2727
if (isModule(componentName)) {
28-
componentType = ComponentType.MODULE.toString();
28+
componentType = ComponentType.module.toString();
2929
} else if (isTheme(componentName)) {
30-
componentType = ComponentType.THEME.toString();
30+
componentType = ComponentType.theme.toString();
3131
}
3232

3333
return componentType;

0 commit comments

Comments
 (0)