This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 17d3c826f7 chore: Fix layout of static property groups (#3338)
17d3c826f7 is described below

commit 17d3c826f7418d50c28d2eedc6529d6b80cb7da5
Author: Dominik Riemer <[email protected]>
AuthorDate: Tue Nov 19 16:06:04 2024 +0100

    chore: Fix layout of static property groups (#3338)
    
    * chore: Fix layout of static property groups
    
    * Fix rendering
---
 .../generic/config/MetadataOptionGenerator.java    |  8 ++-
 .../generation/CompactPipelineConverter.java       |  2 +-
 .../static-one-of-input.component.html             | 79 ++++++++++++----------
 3 files changed, 50 insertions(+), 39 deletions(-)

diff --git 
a/streampipes-extensions/streampipes-connectors-plc/src/main/java/org/apache/streampipes/extensions/connectors/plc/adapter/generic/config/MetadataOptionGenerator.java
 
b/streampipes-extensions/streampipes-connectors-plc/src/main/java/org/apache/streampipes/extensions/connectors/plc/adapter/generic/config/MetadataOptionGenerator.java
index 8efe5bda0c..8ef93dee6f 100644
--- 
a/streampipes-extensions/streampipes-connectors-plc/src/main/java/org/apache/streampipes/extensions/connectors/plc/adapter/generic/config/MetadataOptionGenerator.java
+++ 
b/streampipes-extensions/streampipes-connectors-plc/src/main/java/org/apache/streampipes/extensions/connectors/plc/adapter/generic/config/MetadataOptionGenerator.java
@@ -68,19 +68,23 @@ public class MetadataOptionGenerator {
   }
 
   private static StaticProperty getRuntimeResolvableGroup(String labelId) {
-    return StaticProperties.runtimeResolvableGroupStaticProperty(
+    var group = StaticProperties.runtimeResolvableGroupStaticProperty(
         Labels.withId(labelId),
         List.of(Plc4xLabels.SUPPORTED_TRANSPORTS)
     );
+    group.setHorizontalRendering(false);
+    return group;
   }
 
   private StaticProperty getGroup(List<Option> options,
                                   String labelId) {
-    return StaticProperties.group(
+    var group = StaticProperties.group(
         Labels.withId(labelId),
         false,
         getOptions(options)
     );
+    group.setHorizontalRendering(false);
+    return group;
   }
 
   public StaticProperty[] getOptions(List<Option> options) {
diff --git 
a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/pipeline/compact/generation/CompactPipelineConverter.java
 
b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/pipeline/compact/generation/CompactPipelineConverter.java
index c3230822b3..a31360e0cc 100644
--- 
a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/pipeline/compact/generation/CompactPipelineConverter.java
+++ 
b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/pipeline/compact/generation/CompactPipelineConverter.java
@@ -111,6 +111,6 @@ public class CompactPipelineConverter {
   }
 
   private String replaceId(String id) {
-    return id.replaceAll(InvocablePipelineElementGenerator.ID_PREFIX, "");
+    return id != null ? 
id.replaceAll(InvocablePipelineElementGenerator.ID_PREFIX, "") : null;
   }
 }
diff --git 
a/ui/src/app/core-ui/static-properties/static-one-of-input/static-one-of-input.component.html
 
b/ui/src/app/core-ui/static-properties/static-one-of-input/static-one-of-input.component.html
index 5e56f24d4d..dc1e6742fe 100644
--- 
a/ui/src/app/core-ui/static-properties/static-one-of-input/static-one-of-input.component.html
+++ 
b/ui/src/app/core-ui/static-properties/static-one-of-input/static-one-of-input.component.html
@@ -17,47 +17,54 @@
   -->
 
 <div id="formWrapper" fxFlex="100" fxLayout="column">
-    <div *ngIf="!staticProperty.horizontalRendering" fxLayout="column">
-        <div fxFlex fxLayout="row">
-            <div fxLayout="column" style="margin-left: 10px">
-                <mat-radio-group class="radio-group" color="accent">
-                    <mat-radio-button
+    @if (
+        !staticProperty.horizontalRendering && staticProperty.options.length < 
5
+    ) {
+        <div fxLayout="column">
+            <div fxFlex fxLayout="row">
+                <div fxLayout="column" style="margin-left: 10px">
+                    <mat-radio-group class="radio-group" color="accent">
+                        <mat-radio-button
+                            *ngFor="let option of staticProperty.options"
+                            style="margin-top: -10px"
+                            [value]="option"
+                            (click)="select(option.elementId)"
+                            [checked]="option.selected"
+                            [attr.data-cy]="
+                                staticProperty.internalName
+                                    .split(' ')
+                                    .join('_')
+                                    .toLowerCase() +
+                                '-' +
+                                option.name.split(' ').join('_').toLowerCase()
+                            "
+                        >
+                            <label style="font-weight: normal">
+                                {{ option.name }}
+                            </label>
+                        </mat-radio-button>
+                    </mat-radio-group>
+                </div>
+            </div>
+        </div>
+    } @else {
+        <div>
+            <mat-form-field style="width: 100%" color="accent">
+                <mat-select
+                    [(value)]="selectedOption"
+                    [attr.data-cy]="fieldName"
+                >
+                    <mat-option
                         *ngFor="let option of staticProperty.options"
-                        style="margin-top: -10px"
-                        [value]="option"
+                        [value]="option.elementId"
                         (click)="select(option.elementId)"
-                        [checked]="option.selected"
-                        [attr.data-cy]="
-                            staticProperty.internalName
-                                .split(' ')
-                                .join('_')
-                                .toLowerCase() +
-                            '-' +
-                            option.name.split(' ').join('_').toLowerCase()
-                        "
                     >
                         <label style="font-weight: normal">
                             {{ option.name }}
                         </label>
-                    </mat-radio-button>
-                </mat-radio-group>
-            </div>
+                    </mat-option>
+                </mat-select>
+            </mat-form-field>
         </div>
-    </div>
-
-    <div *ngIf="staticProperty.horizontalRendering">
-        <mat-form-field style="width: 100%" color="accent">
-            <mat-select [(value)]="selectedOption" [attr.data-cy]="fieldName">
-                <mat-option
-                    *ngFor="let option of staticProperty.options"
-                    [value]="option.elementId"
-                    (click)="select(option.elementId)"
-                >
-                    <label style="font-weight: normal">
-                        {{ option.name }}
-                    </label>
-                </mat-option>
-            </mat-select>
-        </mat-form-field>
-    </div>
+    }
 </div>

Reply via email to