File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/com/magento/idea/magento2plugin/actions/generation/dialog Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ public class NewModuleDialog extends AbstractDialog implements ListSelectionList
107
107
private final ModuleIndex moduleIndex ;
108
108
private final CamelCaseToHyphen camelCaseToHyphen ;
109
109
private static final String MAGENTO_BEFORE_DECLARATIVE_SCHEMA_VERSION = "2.2.11" ;
110
+ private static final String DEFAULT_MODULE_PREFIX = "module" ;
110
111
111
112
/**
112
113
* Constructor.
@@ -246,7 +247,18 @@ public String getPackageName() {
246
247
}
247
248
248
249
public String getModuleName () {
249
- return this .moduleName .getText ().trim ();
250
+ return this .removeSubstringFormString (DEFAULT_MODULE_PREFIX , this .moduleName .getText ().trim ());
251
+ }
252
+
253
+ /**
254
+ *
255
+ * @param target String
256
+ * @param replacement String
257
+ * @return String
258
+ */
259
+ private String removeSubstringFormString (@ NotNull String target , @ NotNull String replacement ) {
260
+ String moduleRegex = "(?i)" + target ;
261
+ return replacement .replaceAll (moduleRegex , "" );
250
262
}
251
263
252
264
/**
@@ -332,6 +344,7 @@ public static void open(
332
344
private String getComposerPackageName () {
333
345
return camelCaseToHyphen .convert (getPackageName ())
334
346
.concat ("/" )
347
+ .concat (DEFAULT_MODULE_PREFIX + "-" )
335
348
.concat (camelCaseToHyphen .convert (getModuleName ()));
336
349
}
337
350
You can’t perform that action at this time.
0 commit comments