File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
resources/fileTemplates/code
src/com/magento/idea/magento2plugin
actions/generation/dialog
magento/packages/uiComponent Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 99 <label translate="true">${LABEL}</label>
1010 <dataScope>${NAME}</dataScope>
1111 </settings>
12+ #if(${FORM_ELEMENT} == 'checkbox')
13+ <formElements>
14+ <checkbox>
15+ <settings>
16+ <valueMap>
17+ <map name="false" xsi:type="number">0</map>
18+ <map name="true" xsi:type="number">1</map>
19+ </valueMap>
20+ <prefer>toggle</prefer>
21+ </settings>
22+ </checkbox>
23+ </formElements>
24+ #end
1225</field>
Original file line number Diff line number Diff line change @@ -271,6 +271,7 @@ public void windowClosing(final WindowEvent event) {
271271 );
272272
273273 entityName .getDocument ().addDocumentListener (new DocumentAdapter () {
274+ @ SuppressWarnings ("PMD.AccessorMethodGeneration" )
274275 @ Override
275276 protected void textChanged (final @ NotNull DocumentEvent event ) {
276277 autoCompleteIdentifiers ();
@@ -805,7 +806,10 @@ public List<UiComponentFormFieldData> getFields() {
805806 final String name = model .getValueAt (count , 0 ).toString ();
806807 final String dataType = model .getValueAt (count , 1 ).toString ();
807808
808- final String label = model .getValueAt (count , 0 ).toString (); //todo: convert
809+ final String label = Arrays .stream (name .split ("_" )).map (
810+ string -> string .substring (0 , 1 ).toUpperCase (Locale .getDefault ())
811+ + string .substring (1 )).collect (Collectors .joining (" " )
812+ );
809813 final String sortOrder = String .valueOf (count ).concat ("0" );
810814 final String fieldset = "general" ;
811815
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public static FormElementType getDefaultForProperty(final @NotNull PropertiesTyp
7878 case STRING :
7979 return FormElementType .INPUT ;
8080 case BOOL :
81- return FormElementType .BOOLEAN ;
81+ return FormElementType .CHECKBOX ;
8282 case FLOAT :
8383 return FormElementType .PRICE ;
8484 default :
You can’t perform that action at this time.
0 commit comments