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 9
9
<label translate="true">${LABEL}</label>
10
10
<dataScope>${NAME}</dataScope>
11
11
</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
12
25
</field>
Original file line number Diff line number Diff line change @@ -271,6 +271,7 @@ public void windowClosing(final WindowEvent event) {
271
271
);
272
272
273
273
entityName .getDocument ().addDocumentListener (new DocumentAdapter () {
274
+ @ SuppressWarnings ("PMD.AccessorMethodGeneration" )
274
275
@ Override
275
276
protected void textChanged (final @ NotNull DocumentEvent event ) {
276
277
autoCompleteIdentifiers ();
@@ -805,7 +806,10 @@ public List<UiComponentFormFieldData> getFields() {
805
806
final String name = model .getValueAt (count , 0 ).toString ();
806
807
final String dataType = model .getValueAt (count , 1 ).toString ();
807
808
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
+ );
809
813
final String sortOrder = String .valueOf (count ).concat ("0" );
810
814
final String fieldset = "general" ;
811
815
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public static FormElementType getDefaultForProperty(final @NotNull PropertiesTyp
78
78
case STRING :
79
79
return FormElementType .INPUT ;
80
80
case BOOL :
81
- return FormElementType .BOOLEAN ;
81
+ return FormElementType .CHECKBOX ;
82
82
case FLOAT :
83
83
return FormElementType .PRICE ;
84
84
default :
You can’t perform that action at this time.
0 commit comments