You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2020/02/18 16:27:58 UTC

[incubator-streampipes] 03/04: STREAMPIPES-58: Add presets to color picker

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/incubator-streampipes.git

commit 7684697fdaa90096b5fd4e46463dd62c17671742
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Tue Feb 18 13:32:44 2020 +0100

    STREAMPIPES-58: Add presets to color picker
---
 .../static-color-picker/static-color-picker.component.html     | 10 ++++++++--
 .../static-color-picker/static-color-picker.component.ts       |  2 ++
 .../static-mapping-unary/static-mapping-unary.component.html   |  2 +-
 ui/src/app/dashboard-v2/registry/widget-config-builder.ts      |  4 ++--
 4 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/ui/src/app/connect/static-properties/static-color-picker/static-color-picker.component.html b/ui/src/app/connect/static-properties/static-color-picker/static-color-picker.component.html
index c4dffe7..f271259 100644
--- a/ui/src/app/connect/static-properties/static-color-picker/static-color-picker.component.html
+++ b/ui/src/app/connect/static-properties/static-color-picker/static-color-picker.component.html
@@ -15,16 +15,22 @@
   ~ limitations under the License.
   ~
   -->
-Color
 <div id="formWrapper">
+    <div fxFlex="100">
+        <p>{{staticProperty.label}}: <br>
+            <mat-hint class="description">{{staticProperty.description}}</mat-hint>
+        </p>
+    </div>
+    <div fxFlex="100" fxLayout="row">
     <form [formGroup]="colorPickerForm">
         <mat-form-field>
             <input matInput id="{{ 'input-' + staticProperty.label.toLowerCase() }}"
                    [(colorPicker)]="staticPropertyUtil.asColorPickerStaticProperty(staticProperty).selectedColor"
                    formControlName="colorPickerStaticProperty"
                    [style.background]="staticPropertyUtil.asColorPickerStaticProperty(staticProperty).selectedColor" required
-                   (blur)="emitUpdate()"/>
+                   (blur)="emitUpdate()" [cpPresetColors] = "presetColors"/>
         </mat-form-field>
     </form>
+    </div>
 </div>
 
diff --git a/ui/src/app/connect/static-properties/static-color-picker/static-color-picker.component.ts b/ui/src/app/connect/static-properties/static-color-picker/static-color-picker.component.ts
index a266000..3c9b1bc 100644
--- a/ui/src/app/connect/static-properties/static-color-picker/static-color-picker.component.ts
+++ b/ui/src/app/connect/static-properties/static-color-picker/static-color-picker.component.ts
@@ -42,6 +42,8 @@ export class StaticColorPickerComponent implements OnInit {
     hasInput: Boolean;
     colorPickerForm: FormGroup;
 
+    presetColors: Array<any> = ["#39B54A", "#1B1464", "#f44336", "#4CAF50", "#FFEB3B", "#FFFFFF", "#000000"];
+
     ngOnInit() {
         this.colorPickerForm = new FormGroup({
             'colorPickerStaticProperty': new FormControl(this.inputValue, [
diff --git a/ui/src/app/connect/static-properties/static-mapping-unary/static-mapping-unary.component.html b/ui/src/app/connect/static-properties/static-mapping-unary/static-mapping-unary.component.html
index 48b39db..67c453d 100644
--- a/ui/src/app/connect/static-properties/static-mapping-unary/static-mapping-unary.component.html
+++ b/ui/src/app/connect/static-properties/static-mapping-unary/static-mapping-unary.component.html
@@ -16,7 +16,7 @@
   ~
   -->
 
-<div id="formWrapper" fxFlex="100" fxLayout="column">
+<div id="formWrapper">
     <div fxFlex="100">
         <p>{{staticProperty.label}}: <br>
             <mat-hint class="description">{{staticProperty.description}}</mat-hint>
diff --git a/ui/src/app/dashboard-v2/registry/widget-config-builder.ts b/ui/src/app/dashboard-v2/registry/widget-config-builder.ts
index 3817609..ed9a5f8 100644
--- a/ui/src/app/dashboard-v2/registry/widget-config-builder.ts
+++ b/ui/src/app/dashboard-v2/registry/widget-config-builder.ts
@@ -39,9 +39,9 @@ export class WidgetConfigBuilder {
         this.widget.config = [];
         if (withColors) {
         this.requiredColorParameter(WidgetConfigBuilder.BACKGROUND_COLOR_KEY, "Background color", "The background" +
-            " color", "#000000");
+            " color", "#1B1464");
         this.requiredColorParameter(WidgetConfigBuilder.PRIMARY_TEXT_COLOR_KEY, "Primary text color", "The" +
-                " primary text color", "#707070");
+                " primary text color", "#FFFFFF");
         this.requiredColorParameter(WidgetConfigBuilder.SECONDARY_TEXT_COLOR_KEY, "Secondary text color", "The" +
             " secondary text" +
             " color", "#bebebe")