You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@streampipes.apache.org by GitBox <gi...@apache.org> on 2023/01/18 10:37:07 UTC

[GitHub] [streampipes] aamirxshaikh opened a new pull request, #1120: [#877] Format and lint core-ui module

aamirxshaikh opened a new pull request, #1120:
URL: https://github.com/apache/streampipes/pull/1120

   <!--
     ~ Licensed to the Apache Software Foundation (ASF) under one or more
     ~ contributor license agreements.  See the NOTICE file distributed with
     ~ this work for additional information regarding copyright ownership.
     ~ The ASF licenses this file to You under the Apache License, Version 2.0
     ~ (the "License"); you may not use this file except in compliance with
     ~ the License.  You may obtain a copy of the License at
     ~
     ~    http://www.apache.org/licenses/LICENSE-2.0
     ~
     ~ Unless required by applicable law or agreed to in writing, software
     ~ distributed under the License is distributed on an "AS IS" BASIS,
     ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     ~ See the License for the specific language governing permissions and
     ~ limitations under the License.
     ~
     -->
     
     <!--
   Thanks for contributing! Here are some tips you can follow to help us incorporate your contribution quickly and easily:
   1. If this is your first time, please read our contributor guidelines:
       - https://streampipes.apache.org/getinvolved.html
       - https://cwiki.apache.org/confluence/display/STREAMPIPES/Getting+Started
   2. Make sure the PR title is formatted like: `[#<GitHub issue id>] PR title ...`
   3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., `[WIP][#<GitHub issue id>] PR title ...`.
   4. Please write your PR title to summarize what this PR proposes/fixes.
   5. Link the PR to the corresponding GitHub issue (if present) in the `Development` section in the right menu bar. 
   6. Be sure to keep the PR description updated to reflect all changes.
   7. If possible, provide a concise example to reproduce the issue for a faster review.
   8. Make sure tests pass via `mvn clean install`.
   9. (Optional) If the contribution is large, please file an Apache ICLA
       - http://apache.org/licenses/icla.pdf
   -->
   
   ### Purpose
   <!--
   Please clarify what changes you are proposing and describe how those changes will address the issue.
   Furthermore, describe potential consequences the changes might have.
   -->
   
   Applying UI linting and formatting to the `core-ui` module. Removing the `core-ui` module from `ui/.eslintignore` and `ui/.prettierignore` and fixing formatting and linting. Optimize unused imports.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] tenthe merged pull request #1120: [#877] Format and lint core-ui module

Posted by "tenthe (via GitHub)" <gi...@apache.org>.
tenthe merged PR #1120:
URL: https://github.com/apache/streampipes/pull/1120


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] aamirxshaikh commented on a diff in pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
aamirxshaikh commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1081505304


##########
ui/src/app/core-ui/static-properties/static-property.component.css:
##########
@@ -17,25 +17,25 @@
  */
 
 .example-full-width {
-  width: 100%;
+    width: 100%;
 }
 .staticProperty {
-  /* display: block !important;
+    /* display: block !important;

Review Comment:
   @dominikriemer Are you referring to the entire staticProperty selector?
   
   ```
   .staticProperty {
       /* display: block !important;
     width: 100%;
     height: 100%;
     margin-right: 10px; */
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] tenthe commented on pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
tenthe commented on PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#issuecomment-1387729146

   With the comment above I refer only to classes and functions. You can delete the commented out code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] aamirxshaikh commented on a diff in pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
aamirxshaikh commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1081303000


##########
ui/src/app/core-ui/static-properties/static-property.component.css:
##########
@@ -17,25 +17,25 @@
  */
 
 .example-full-width {
-  width: 100%;
+    width: 100%;
 }
 .staticProperty {
-  /* display: block !important;
+    /* display: block !important;

Review Comment:
   Could you please confirm this? @dominikriemer @smlabt 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] bossenti commented on a diff in pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
bossenti commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1074046284


##########
ui/src/app/core-ui/image/image-labeling/image-labeling.component.ts:
##########
@@ -34,243 +33,358 @@ import { Label } from '@streampipes/platform-services';
 import { LabelService } from '../../labels/services/label.service';
 
 @Component({
-  selector: 'sp-image-labeling',
-  templateUrl: './image-labeling.component.html',
-  styleUrls: ['./image-labeling.component.css']
+    selector: 'sp-image-labeling',
+    templateUrl: './image-labeling.component.html',
+    styleUrls: ['./image-labeling.component.css'],
 })
 export class ImageLabelingComponent implements OnInit {
+    // label
+    public labels;
+    public selectedLabel: Label;
+
+    public _imagesRoutes;
+    @Input()
+    set imagesRoutes(routes) {
+        this._imagesRoutes = routes;
+        this.getCocoFile(this._imagesRoutes, 0);
+    }
 
-  // label
-  public labels;
-  public selectedLabel: Label;
-
-  public _imagesRoutes;
-  @Input()
-  set imagesRoutes(routes) {
-   this._imagesRoutes = routes;
-   this.getCocoFile(this._imagesRoutes, 0);
-  }
-
-  public imagesIndex = 0;
-
-  public cocoFile: CocoFormat;
-
-  public isHoverComponent;
-  public brushSize: number;
+    public imagesIndex = 0;
 
-  public isDrawing = false;
+    public cocoFile: CocoFormat;
 
-  @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
+    public isHoverComponent;
+    public brushSize: number;
 
-  constructor(private reactLabelingService: ReactLabelingService,
-              private polygonLabelingService: PolygonLabelingService,
-              private brushLabelingService: BrushLabelingService,
-              private snackBar: MatSnackBar,
-              private cocoFormatService: CocoFormatService,
-              private labelService: LabelService,
-              public labelingMode: LabelingModeService) { }
+    public isDrawing = false;
 
-  ngOnInit(): void {
-    this.isHoverComponent = false;
-    this.brushSize = 5;
-    this.labelService.getAllLabels().subscribe(res => {
-       this.labels = res;
-    });
-    // this.labels = this.restService.getLabels();
-  }
+    @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
 
-  handleImageIndexChange(index) {
-    this.save(this.imagesIndex);
-    this.getCocoFile(this._imagesRoutes, index);
-  }
+    constructor(
+        private reactLabelingService: ReactLabelingService,
+        private polygonLabelingService: PolygonLabelingService,
+        private brushLabelingService: BrushLabelingService,
+        private snackBar: MatSnackBar,
+        private cocoFormatService: CocoFormatService,
+        private labelService: LabelService,
+        public labelingMode: LabelingModeService,
+    ) {}
 
-  getCocoFile(routes, index) {
-      // This is relevant for coco
-      // this.restService.getCocoFileForImage(routes[index]).subscribe(
-      //   coco => {
-      //     if (coco === null) {
-      //       const cocoFile = new CocoFormat();
-      //       this.cocoFormatService.addImage(cocoFile, (routes[index]));
-      //       this.cocoFile = cocoFile;
-      //     } else {
-      //       this.cocoFile = coco as CocoFormat;
-      //     }
-      //     this.imagesIndex = index;
-      //   }
-      // );
-  }
+    ngOnInit(): void {
+        this.isHoverComponent = false;
+        this.brushSize = 5;
+        this.labelService.getAllLabels().subscribe(res => {
+            this.labels = res;
+        });
+        // this.labels = this.restService.getLabels();
+    }
 
-  /* sp-image-view handler */
-  handleMouseDownLeft(layer: Konva.Layer, shift: ICoordinates, position: ICoordinates) {
-    if (this.labelingEnabled()) {
-      switch (this.labelingMode.getMode()) {
-        case LabelingMode.ReactLabeling: this.reactLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.PolygonLabeling: this.polygonLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.BrushLabeling: this.brushLabelingService.startLabeling(position, this.brushSize);
-      }
+    handleImageIndexChange(index) {
+        this.save(this.imagesIndex);
+        this.getCocoFile(this._imagesRoutes, index);
     }
-  }
 
-  handleMouseMove(layer: Konva.Layer, shift: ICoordinates, position: ICoordinates) {
-    switch (this.labelingMode.getMode()) {
-      case LabelingMode.PolygonLabeling: {
-        this.polygonLabelingService.executeLabeling(position);
-        this.polygonLabelingService.tempDraw(layer, shift, this.selectedLabel);
-      }
+    getCocoFile(routes, index) {
+        // This is relevant for coco

Review Comment:
   I was mainly refering to the commented code and not the entire class
   But we can also do the cleanup seperately



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] aamirxshaikh commented on pull request #1120: [#877] Format and lint core-ui module

Posted by "aamirxshaikh (via GitHub)" <gi...@apache.org>.
aamirxshaikh commented on PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#issuecomment-1398817370

   I have removed the commented code and updated the PR. @bossenti 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] aamirxshaikh commented on a diff in pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
aamirxshaikh commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1080957300


##########
ui/src/app/core-ui/data-download-dialog/components/select-data/select-data-range/select-data-range.component.html:
##########
@@ -19,73 +19,83 @@
 <h5>Data Range</h5>
 <mat-radio-group
     class="sp-radio-group"
-    [(ngModel)]="dataExportConfig.dataRangeConfiguration">
-  <mat-radio-button
-      value="visible"
-      class="sp-radio-button"
-      data-cy="download-configuration-visible"
-      *ngIf="dataExplorerDataConfig">
-    Currently configured query
-  </mat-radio-button>
-  <!--  <div fxLayout="column"-->
-  <!--       fxLayoutAlign="start start"-->
-  <!--       class="ml-35 mb-10"-->
-  <!--       *ngIf="dataExportConfig.dataRangeConfiguration === 'visible' && dataExplorerDataConfig && dataExplorerDataConfig.sourceConfigs.length > 1">-->
-  <!--    <h5>Select source (only one source can be exported in a single file)</h5>-->
-  <!--    <mat-radio-group-->
-  <!--        class="sp-radio-group"-->
-  <!--        fxLayout="column">-->
-  <!--      &lt;!&ndash;        [ngModel]="ngModel_1"&ndash;&gt;-->
-  <!--      &lt;!&ndash;        (ngModelChange)="ngModel_1Change.emit($event)"&ndash;&gt;-->
-  <!--      <mat-radio-button-->
-  <!--          class="p-5"-->
-  <!--          [value]="i"-->
-  <!--          *ngFor="let sourceConfig of dataExplorerDataConfig.sourceConfigs; let i = index">-->
-  <!--        {{sourceConfig.measureName}}-->
-  <!--      </mat-radio-button>-->
-  <!--    </mat-radio-group>-->
-  <!--  </div>-->
-  <mat-radio-button
-      value="all"
-      class="sp-radio-button"
-      data-cy="download-configuration-all">
-    All data in database
-  </mat-radio-button>
-  <mat-radio-button
-      value="customInterval"
-      class="sp-radio-button"
-      data-cy="download-configuration-customInterval">
-    All data in custom time interval
-  </mat-radio-button>
+    [(ngModel)]="dataExportConfig.dataRangeConfiguration"
+>
+    <mat-radio-button
+        value="visible"
+        class="sp-radio-button"
+        data-cy="download-configuration-visible"
+        *ngIf="dataExplorerDataConfig"
+    >
+        Currently configured query
+    </mat-radio-button>
+    <!--  <div fxLayout="column"-->

Review Comment:
   Sure @bossenti 👍



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] dominikriemer commented on a diff in pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
dominikriemer commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1081319913


##########
ui/src/app/core-ui/static-properties/static-property.component.css:
##########
@@ -17,25 +17,25 @@
  */
 
 .example-full-width {
-  width: 100%;
+    width: 100%;
 }
 .staticProperty {
-  /* display: block !important;
+    /* display: block !important;

Review Comment:
   @aamirxshaikh the uncommented section can be removed, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] aamirxshaikh commented on pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
aamirxshaikh commented on PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#issuecomment-1396625289

   > @aamirxshaikh I've discovered some dead code while reviewing your PR and it would be awesome if we could include removing it within this PR. If you spot some more, feel free to remove it as well.
   
   Sure @bossenti I'll try to find any dead code and remove it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] bossenti commented on a diff in pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
bossenti commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1074002829


##########
ui/src/app/core-ui/data-download-dialog/components/select-data/select-data-range/select-data-range.component.html:
##########
@@ -19,73 +19,83 @@
 <h5>Data Range</h5>
 <mat-radio-group
     class="sp-radio-group"
-    [(ngModel)]="dataExportConfig.dataRangeConfiguration">
-  <mat-radio-button
-      value="visible"
-      class="sp-radio-button"
-      data-cy="download-configuration-visible"
-      *ngIf="dataExplorerDataConfig">
-    Currently configured query
-  </mat-radio-button>
-  <!--  <div fxLayout="column"-->
-  <!--       fxLayoutAlign="start start"-->
-  <!--       class="ml-35 mb-10"-->
-  <!--       *ngIf="dataExportConfig.dataRangeConfiguration === 'visible' && dataExplorerDataConfig && dataExplorerDataConfig.sourceConfigs.length > 1">-->
-  <!--    <h5>Select source (only one source can be exported in a single file)</h5>-->
-  <!--    <mat-radio-group-->
-  <!--        class="sp-radio-group"-->
-  <!--        fxLayout="column">-->
-  <!--      &lt;!&ndash;        [ngModel]="ngModel_1"&ndash;&gt;-->
-  <!--      &lt;!&ndash;        (ngModelChange)="ngModel_1Change.emit($event)"&ndash;&gt;-->
-  <!--      <mat-radio-button-->
-  <!--          class="p-5"-->
-  <!--          [value]="i"-->
-  <!--          *ngFor="let sourceConfig of dataExplorerDataConfig.sourceConfigs; let i = index">-->
-  <!--        {{sourceConfig.measureName}}-->
-  <!--      </mat-radio-button>-->
-  <!--    </mat-radio-group>-->
-  <!--  </div>-->
-  <mat-radio-button
-      value="all"
-      class="sp-radio-button"
-      data-cy="download-configuration-all">
-    All data in database
-  </mat-radio-button>
-  <mat-radio-button
-      value="customInterval"
-      class="sp-radio-button"
-      data-cy="download-configuration-customInterval">
-    All data in custom time interval
-  </mat-radio-button>
+    [(ngModel)]="dataExportConfig.dataRangeConfiguration"
+>
+    <mat-radio-button
+        value="visible"
+        class="sp-radio-button"
+        data-cy="download-configuration-visible"
+        *ngIf="dataExplorerDataConfig"
+    >
+        Currently configured query
+    </mat-radio-button>
+    <!--  <div fxLayout="column"-->

Review Comment:
   Would be great if you could remove this commented code @aamirxshaikh 
   Let's get rid of some dead wood 😉 



##########
ui/src/app/core-ui/labels/services/label.service.ts:
##########
@@ -17,77 +17,89 @@
  */
 
 import { Injectable } from '@angular/core';
-import { Category, Label, PlatformServicesCommons } from '@streampipes/platform-services';
+import {
+    Category,
+    Label,
+    PlatformServicesCommons,
+} from '@streampipes/platform-services';
 import { HttpClient } from '@angular/common/http';
 import { Observable, ReplaySubject } from 'rxjs';
 
 @Injectable({
-  providedIn: 'root'
+    providedIn: 'root',
 })
 export class LabelService {
-  private bufferedLabels = [];
-
-  urlBase() {
-    return this.platformServicesCommons.apiBasePath;
-  }
-
-  constructor(
-    private platformServicesCommons: PlatformServicesCommons,
-    private $http: HttpClient) { }
-
-  getCategories(): Observable<any> {
-    return this.$http.get(this.urlBase() + '/labeling/category');
-  }
-
-  getLabelsOfCategory(category: Category): Observable<any> {
-    return this.$http.get(this.urlBase() + '/labeling/label/category/' + category._id);
-  }
-
-  addCategory(c: Category) {
-    return this.$http.post(this.urlBase() + '/labeling/category', c);
-  }
-
-  updateCategory(c: Category) {
-    return this.$http.put(this.urlBase() + '/labeling/category/' + c._id, c);
-  }
-
-  deleteCategory(c: Category) {
-    return this.$http.delete(this.urlBase() + '/labeling/category/' + c._id);
-  }
-
-  getAllLabels() {
-    return this.$http.get(this.urlBase() + '/labeling/label/');
-  }
-
-  getLabel(labelId: string) {
-    return this.$http.get(this.urlBase() + '/labeling/label/' + labelId);
-  }
-
-  getBufferedLabel(labelId: string) {
-    // this.bufferedLabels
-    const result = new ReplaySubject(1);
-
-    if (this.bufferedLabels[labelId] !== undefined) {
-     result.next(this.bufferedLabels[labelId]);
-    } else {
-      this.getLabel(labelId).subscribe(label => {
-        this.bufferedLabels.push({labelId: label});
-        result.next(label);
-      });
+    private bufferedLabels = [];
+
+    urlBase() {
+        return this.platformServicesCommons.apiBasePath;
+    }
+
+    constructor(
+        private platformServicesCommons: PlatformServicesCommons,
+        private $http: HttpClient,
+    ) {}
+
+    getCategories(): Observable<any> {
+        return this.$http.get(this.urlBase() + '/labeling/category');
+    }
+
+    getLabelsOfCategory(category: Category): Observable<any> {
+        return this.$http.get(
+            this.urlBase() + '/labeling/label/category/' + category._id,
+        );
+    }
+
+    addCategory(c: Category) {
+        return this.$http.post(this.urlBase() + '/labeling/category', c);
+    }
+
+    updateCategory(c: Category) {
+        return this.$http.put(
+            this.urlBase() + '/labeling/category/' + c._id,
+            c,
+        );
+    }
+
+    deleteCategory(c: Category) {
+        return this.$http.delete(
+            this.urlBase() + '/labeling/category/' + c._id,
+        );
+    }
+
+    getAllLabels() {
+        return this.$http.get(this.urlBase() + '/labeling/label/');
     }
 
-    return result;
-  }
+    getLabel(labelId: string) {
+        return this.$http.get(this.urlBase() + '/labeling/label/' + labelId);
+    }
+
+    getBufferedLabel(labelId: string) {
+        // this.bufferedLabels

Review Comment:
   can be removed



##########
ui/src/app/core-ui/image/image-labeling/image-labeling.component.ts:
##########
@@ -34,243 +33,358 @@ import { Label } from '@streampipes/platform-services';
 import { LabelService } from '../../labels/services/label.service';
 
 @Component({
-  selector: 'sp-image-labeling',
-  templateUrl: './image-labeling.component.html',
-  styleUrls: ['./image-labeling.component.css']
+    selector: 'sp-image-labeling',
+    templateUrl: './image-labeling.component.html',
+    styleUrls: ['./image-labeling.component.css'],
 })
 export class ImageLabelingComponent implements OnInit {
+    // label
+    public labels;
+    public selectedLabel: Label;
+
+    public _imagesRoutes;
+    @Input()
+    set imagesRoutes(routes) {
+        this._imagesRoutes = routes;
+        this.getCocoFile(this._imagesRoutes, 0);
+    }
 
-  // label
-  public labels;
-  public selectedLabel: Label;
-
-  public _imagesRoutes;
-  @Input()
-  set imagesRoutes(routes) {
-   this._imagesRoutes = routes;
-   this.getCocoFile(this._imagesRoutes, 0);
-  }
-
-  public imagesIndex = 0;
-
-  public cocoFile: CocoFormat;
-
-  public isHoverComponent;
-  public brushSize: number;
+    public imagesIndex = 0;
 
-  public isDrawing = false;
+    public cocoFile: CocoFormat;
 
-  @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
+    public isHoverComponent;
+    public brushSize: number;
 
-  constructor(private reactLabelingService: ReactLabelingService,
-              private polygonLabelingService: PolygonLabelingService,
-              private brushLabelingService: BrushLabelingService,
-              private snackBar: MatSnackBar,
-              private cocoFormatService: CocoFormatService,
-              private labelService: LabelService,
-              public labelingMode: LabelingModeService) { }
+    public isDrawing = false;
 
-  ngOnInit(): void {
-    this.isHoverComponent = false;
-    this.brushSize = 5;
-    this.labelService.getAllLabels().subscribe(res => {
-       this.labels = res;
-    });
-    // this.labels = this.restService.getLabels();
-  }
+    @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
 
-  handleImageIndexChange(index) {
-    this.save(this.imagesIndex);
-    this.getCocoFile(this._imagesRoutes, index);
-  }
+    constructor(
+        private reactLabelingService: ReactLabelingService,
+        private polygonLabelingService: PolygonLabelingService,
+        private brushLabelingService: BrushLabelingService,
+        private snackBar: MatSnackBar,
+        private cocoFormatService: CocoFormatService,
+        private labelService: LabelService,
+        public labelingMode: LabelingModeService,
+    ) {}
 
-  getCocoFile(routes, index) {
-      // This is relevant for coco
-      // this.restService.getCocoFileForImage(routes[index]).subscribe(
-      //   coco => {
-      //     if (coco === null) {
-      //       const cocoFile = new CocoFormat();
-      //       this.cocoFormatService.addImage(cocoFile, (routes[index]));
-      //       this.cocoFile = cocoFile;
-      //     } else {
-      //       this.cocoFile = coco as CocoFormat;
-      //     }
-      //     this.imagesIndex = index;
-      //   }
-      // );
-  }
+    ngOnInit(): void {
+        this.isHoverComponent = false;
+        this.brushSize = 5;
+        this.labelService.getAllLabels().subscribe(res => {
+            this.labels = res;
+        });
+        // this.labels = this.restService.getLabels();
+    }
 
-  /* sp-image-view handler */
-  handleMouseDownLeft(layer: Konva.Layer, shift: ICoordinates, position: ICoordinates) {
-    if (this.labelingEnabled()) {
-      switch (this.labelingMode.getMode()) {
-        case LabelingMode.ReactLabeling: this.reactLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.PolygonLabeling: this.polygonLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.BrushLabeling: this.brushLabelingService.startLabeling(position, this.brushSize);
-      }
+    handleImageIndexChange(index) {
+        this.save(this.imagesIndex);
+        this.getCocoFile(this._imagesRoutes, index);
     }
-  }
 
-  handleMouseMove(layer: Konva.Layer, shift: ICoordinates, position: ICoordinates) {
-    switch (this.labelingMode.getMode()) {
-      case LabelingMode.PolygonLabeling: {
-        this.polygonLabelingService.executeLabeling(position);
-        this.polygonLabelingService.tempDraw(layer, shift, this.selectedLabel);
-      }
+    getCocoFile(routes, index) {
+        // This is relevant for coco

Review Comment:
   Again some dead wood...
   We can probably remobe the whole method?! @tenthe @smlabt 



##########
ui/src/app/core-ui/pipeline-element-template-config/pipeline-element-template-config.component.html:
##########
@@ -21,28 +21,50 @@
         <h4>Basics</h4>
         <mat-form-field fxFlex color="accent">
             <mat-label>Template name</mat-label>
-            <input [(ngModel)]="template.templateName" matInput name="templateName" class="sp" required/>
+            <input
+                [(ngModel)]="template.templateName"
+                matInput
+                name="templateName"
+                class="sp"
+                required
+            />
         </mat-form-field>
         <mat-form-field fxFlex color="accent">
             <mat-label>Template description</mat-label>
-            <input [(ngModel)]="template.templateDescription" matInput name="templateDescription" class="sp"
-                   required/>
+            <input
+                [(ngModel)]="template.templateDescription"
+                matInput
+                name="templateDescription"
+                class="sp"
+                required
+            />
         </mat-form-field>
         <!--        <mat-checkbox class="sp" color="accent">Make available as pipeline element</mat-checkbox>-->
         <mat-divider class="divider"></mat-divider>
         <h4>Configuration</h4>
-        <mat-hint style="margin-bottom: 10px;">(dynamic options cannot be saved and are hidden)</mat-hint>
-        <div fxLayout="column" *ngFor="let config of staticProperties | pipelineElementTemplatePipe"
-             class="static-property-panel static-property-panel-border">
+        <mat-hint style="margin-bottom: 10px"
+            >(dynamic options cannot be saved and are hidden)</mat-hint
+        >
+        <div
+            fxLayout="column"
+            *ngFor="
+                let config of staticProperties | pipelineElementTemplatePipe
+            "
+            class="static-property-panel static-property-panel-border"
+        >
             <div fxLayout="row">
                 <div fxFlex="50">
-                    {{config.label}}
+                    {{ config.label }}
                 </div>
                 <div fxFlex="50">
                     <div fxLayout="column">
-                        <mat-checkbox [checked]="templateConfigs.has(config.internalName)"
-                                      (change)="handleSelection(config)" name="store" class="sp" color="accent">Store
-                            as template
+                        <mat-checkbox
+                            [checked]="templateConfigs.has(config.internalName)"
+                            (change)="handleSelection(config)"
+                            name="store"
+                            class="sp"
+                            color="accent"
+                            >Store as template
                         </mat-checkbox>
                         <!--                        <mat-checkbox *ngIf="templateConfigs.has(config.internalName)"-->

Review Comment:
   some more...



##########
ui/src/app/core-ui/static-properties/static-property.component.css:
##########
@@ -17,25 +17,25 @@
  */
 
 .example-full-width {
-  width: 100%;
+    width: 100%;
 }
 .staticProperty {
-  /* display: block !important;
+    /* display: block !important;

Review Comment:
   can be removed?! @dominikriemer @smlabt 



##########
ui/src/app/core-ui/static-properties/static-property-util.service.ts:
##########
@@ -93,21 +94,32 @@ export class StaticPropertyUtilService {
         } else if (val instanceof CollectionStaticProperty) {
             clone = new CollectionStaticProperty();
             clone.elementId = id;
-            clone.staticPropertyTemplate = this.clone(val.staticPropertyTemplate);
+            clone.staticPropertyTemplate = this.clone(
+                val.staticPropertyTemplate,
+            );
             clone.members = val.members.map(elem => this.clone(elem));
             clone.memberType = val.memberType;
-        } else if (val instanceof RuntimeResolvableAnyStaticProperty ||  val instanceof RuntimeResolvableOneOfStaticProperty) {
-            val instanceof RuntimeResolvableAnyStaticProperty ? clone = new RuntimeResolvableAnyStaticProperty() :
-              clone = new RuntimeResolvableOneOfStaticProperty();
+        } else if (
+            val instanceof RuntimeResolvableAnyStaticProperty ||
+            val instanceof RuntimeResolvableOneOfStaticProperty
+        ) {
+            val instanceof RuntimeResolvableAnyStaticProperty
+                ? (clone = new RuntimeResolvableAnyStaticProperty())
+                : (clone = new RuntimeResolvableOneOfStaticProperty());
 
             clone.elementId = id;
             clone.dependsOn = val.dependsOn;
             // clone.value = val.value;
             // clone.requiredDomainProperty = val.requiredDomainProperty;
             clone.options = val.options.map(option => this.cloneOption(option));
             clone.horizontalRendering = val.horizontalRendering;
-        } else if (val instanceof AnyStaticProperty || val instanceof OneOfStaticProperty) {
-            val instanceof AnyStaticProperty ? clone = new AnyStaticProperty() : clone = new OneOfStaticProperty();
+        } else if (
+            val instanceof AnyStaticProperty ||
+            val instanceof OneOfStaticProperty
+        ) {
+            val instanceof AnyStaticProperty
+                ? (clone = new AnyStaticProperty())
+                : (clone = new OneOfStaticProperty());
 
             clone.elementId = id;
             // clone.value = val.value;

Review Comment:
   here and below are some more



##########
ui/src/app/core-ui/image/services/PolygonLabeling.service.ts:
##########
@@ -25,244 +25,300 @@ import { Label } from '@streampipes/platform-services';
 
 @Injectable()
 export class PolygonLabelingService {
+    private points: number[];
+    private tmpPoints: number[];
 
-  private points: number[];
-  private tmpPoints: number[];
+    private isLabeling: boolean;
 
-  private isLabeling: boolean;
-
-  constructor(private colorService: ColorService,
-              private labelingMode: LabelingModeService) {
-    this.isLabeling = false;
-  }
+    constructor(
+        private colorService: ColorService,
+        private labelingMode: LabelingModeService,
+    ) {
+        this.isLabeling = false;
+    }
 
-  static buildAnchors(layer, annotation, imageView, poly) {
-    this.removeAnchors(layer, annotation.id);
-    const anchorGroup = new Konva.Group({name: 'anchor_group_' + annotation.id})
+    static buildAnchors(layer, annotation, imageView, poly) {
+        this.removeAnchors(layer, annotation.id);
+        const anchorGroup = new Konva.Group({
+            name: 'anchor_group_' + annotation.id,
+        });
 
-    for (let i = 0; i < annotation.segmentation[0].length; i += 2) {
-      PolygonLabelingService.buildAnchor(layer, annotation, i, imageView, poly, anchorGroup);
+        for (let i = 0; i < annotation.segmentation[0].length; i += 2) {
+            PolygonLabelingService.buildAnchor(
+                layer,
+                annotation,
+                i,
+                imageView,
+                poly,
+                anchorGroup,
+            );
+        }
+        layer.add(anchorGroup);
     }
-    layer.add(anchorGroup);
-  }
-
-  static buildAnchor(layer, annotation, index, imageView, poly, anchorGroup) {
-    const shift: ICoordinates = imageView.getShift();
-
-    const xx = annotation.segmentation[0][index] + shift.x;
-    const yy = annotation.segmentation[0][index + 1] + shift.y;
-    const anchor = new Konva.Circle({
-      name: 'anchor_' + annotation.id,
-      x: xx,
-      y: yy,
-      radius: 10,
-      fill: 'white',
-      stroke: 'green',
-      strokeWidth: 4,
-      draggable: true,
-    });
-    anchorGroup.add(anchor);
-
-    anchor.on('mouseover', function() {
-      annotation.isHovered = true;
-    });
-
-    anchor.on('mouseout', function() {
-      annotation.isHovered = false;
-    });
-
-    /*    let offset: ICoordinates;
+
+    static buildAnchor(layer, annotation, index, imageView, poly, anchorGroup) {
+        const shift: ICoordinates = imageView.getShift();
+
+        const xx = annotation.segmentation[0][index] + shift.x;
+        const yy = annotation.segmentation[0][index + 1] + shift.y;
+        const anchor = new Konva.Circle({
+            name: 'anchor_' + annotation.id,
+            x: xx,
+            y: yy,
+            radius: 10,
+            fill: 'white',
+            stroke: 'green',
+            strokeWidth: 4,
+            draggable: true,
+        });
+        anchorGroup.add(anchor);
+
+        anchor.on('mouseover', function () {
+            annotation.isHovered = true;
+        });
+
+        anchor.on('mouseout', function () {
+            annotation.isHovered = false;
+        });
+
+        /*    let offset: ICoordinates;
 
     anchor.on('dragstart', function() {

Review Comment:
   some more dead code to remove...



##########
ui/src/app/core-ui/static-properties/static-property-util.service.ts:
##########
@@ -93,21 +94,32 @@ export class StaticPropertyUtilService {
         } else if (val instanceof CollectionStaticProperty) {
             clone = new CollectionStaticProperty();
             clone.elementId = id;
-            clone.staticPropertyTemplate = this.clone(val.staticPropertyTemplate);
+            clone.staticPropertyTemplate = this.clone(
+                val.staticPropertyTemplate,
+            );
             clone.members = val.members.map(elem => this.clone(elem));
             clone.memberType = val.memberType;
-        } else if (val instanceof RuntimeResolvableAnyStaticProperty ||  val instanceof RuntimeResolvableOneOfStaticProperty) {
-            val instanceof RuntimeResolvableAnyStaticProperty ? clone = new RuntimeResolvableAnyStaticProperty() :
-              clone = new RuntimeResolvableOneOfStaticProperty();
+        } else if (
+            val instanceof RuntimeResolvableAnyStaticProperty ||
+            val instanceof RuntimeResolvableOneOfStaticProperty
+        ) {
+            val instanceof RuntimeResolvableAnyStaticProperty
+                ? (clone = new RuntimeResolvableAnyStaticProperty())
+                : (clone = new RuntimeResolvableOneOfStaticProperty());
 
             clone.elementId = id;
             clone.dependsOn = val.dependsOn;
             // clone.value = val.value;

Review Comment:
   here again



##########
ui/src/app/core-ui/static-properties/static-property.component.ts:
##########
@@ -21,151 +21,151 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
 import { XsService } from '../../NS/xs.service';
 import { ConfigurationInfo } from '../../connect/model/ConfigurationInfo';
 import {
-  AnyStaticProperty,
-  CodeInputStaticProperty,
-  CollectionStaticProperty,
-  ColorPickerStaticProperty,
-  EventSchema,
-  FileStaticProperty,
-  FreeTextStaticProperty,
-  MappingPropertyNary,
-  MappingPropertyUnary,
-  OneOfStaticProperty,
-  RuntimeResolvableAnyStaticProperty,
-  RuntimeResolvableOneOfStaticProperty, RuntimeResolvableTreeInputStaticProperty,
-  SecretStaticProperty, SlideToggleStaticProperty,
-  StaticProperty,
-  StaticPropertyAlternatives,
-  StaticPropertyGroup
+    AnyStaticProperty,
+    CodeInputStaticProperty,
+    CollectionStaticProperty,
+    ColorPickerStaticProperty,
+    EventSchema,
+    FileStaticProperty,
+    FreeTextStaticProperty,
+    MappingPropertyNary,
+    MappingPropertyUnary,
+    OneOfStaticProperty,
+    RuntimeResolvableAnyStaticProperty,
+    RuntimeResolvableOneOfStaticProperty,
+    RuntimeResolvableTreeInputStaticProperty,
+    SecretStaticProperty,
+    SlideToggleStaticProperty,
+    StaticProperty,
+    StaticPropertyAlternatives,
+    StaticPropertyGroup,
 } from '@streampipes/platform-services';
 import { UntypedFormGroup } from '@angular/forms';
 import { InvocablePipelineElementUnion } from '../../editor/model/editor.model';
 
 @Component({
-  selector: 'app-static-property',
-  templateUrl: './static-property.component.html',
-  styleUrls: ['./static-property.component.css'],
-  providers: [XsService]
+    selector: 'sp-app-static-property',
+    templateUrl: './static-property.component.html',
+    styleUrls: ['./static-property.component.css'],
+    providers: [XsService],
 })
 export class StaticPropertyComponent implements OnInit {
+    @Input()
+    staticProperty: StaticProperty;
 
-  @Input()
-  staticProperty: StaticProperty;
+    @Input()
+    staticProperties: StaticProperty[];
 
-  @Input()
-  staticProperties: StaticProperty[];
+    @Input()
+    adapterId: string;
 
-  @Input()
-  adapterId: string;
+    @Output()
+    validateEmitter: EventEmitter<any> = new EventEmitter<any>();
 
-  @Output()
-  validateEmitter: EventEmitter<any> = new EventEmitter<any>();
+    @Output()
+    updateEmitter: EventEmitter<ConfigurationInfo> = new EventEmitter();
 
-  @Output()
-  updateEmitter: EventEmitter<ConfigurationInfo> = new EventEmitter();
+    @Input()
+    eventSchemas: EventSchema[];
 
-  @Input()
-  eventSchemas: EventSchema[];
+    @Input()
+    completedStaticProperty: ConfigurationInfo;
 
-  @Input()
-  completedStaticProperty: ConfigurationInfo;
+    @Input()
+    parentForm: UntypedFormGroup;
 
-  @Input()
-  parentForm: UntypedFormGroup;
+    @Input()
+    fieldName: string;
 
-  @Input()
-  fieldName: string;
+    @Input()
+    displayRecommended: boolean;
 
-  @Input()
-  displayRecommended: boolean;
+    @Input()
+    pipelineElement: InvocablePipelineElementUnion;
 
-  @Input()
-  pipelineElement: InvocablePipelineElementUnion;
+    showLabel = true;
 
-  showLabel = true;
+    @Input()
+    showBorder = true;
 
-  @Input()
-  showBorder = true;
+    constructor() {}
 
-  constructor() {
-  }
+    ngOnInit() {
+        this.showLabel =
+            !(this.staticProperty instanceof StaticPropertyGroup) ||
+            (this.staticProperty as StaticPropertyGroup).showLabel;
+    }
 
-  ngOnInit() {
-    this.showLabel = !(this.staticProperty instanceof StaticPropertyGroup) ||
-      (this.staticProperty as StaticPropertyGroup).showLabel;
-  }
+    isCodeInputStaticProperty(val) {
+        return val instanceof CodeInputStaticProperty;
+    }
 
-  isCodeInputStaticProperty(val) {
-    return val instanceof CodeInputStaticProperty;
-  }
+    isFreeTextStaticProperty(val) {
+        return val instanceof FreeTextStaticProperty;
+    }
 
-  isFreeTextStaticProperty(val) {
-    return val instanceof FreeTextStaticProperty;
-  }
+    isFileStaticProperty(val) {
+        return val instanceof FileStaticProperty;
+    }
 
-  isFileStaticProperty(val) {
-    return val instanceof FileStaticProperty;
-  }
+    isAnyStaticProperty(val) {
+        return val instanceof AnyStaticProperty;
+    }
 
+    isMappingPropertyUnary(val) {
+        return val instanceof MappingPropertyUnary;
+    }
 
-  isAnyStaticProperty(val) {
-    return val instanceof AnyStaticProperty;
-  }
+    isOneOfStaticProperty(val) {
+        return val instanceof OneOfStaticProperty;
+    }
 
-  isMappingPropertyUnary(val) {
-    return val instanceof MappingPropertyUnary;
-  }
+    isMappingNaryProperty(val) {
+        return val instanceof MappingPropertyNary;
+    }
 
-  isOneOfStaticProperty(val) {
-    return val instanceof OneOfStaticProperty;
-  }
+    isRuntimeResolvableOneOfStaticProperty(val) {
+        return val instanceof RuntimeResolvableOneOfStaticProperty;
+    }
 
-  isMappingNaryProperty(val) {
-    return val instanceof MappingPropertyNary;
-  }
+    isSecretStaticProperty(val) {
+        return val instanceof SecretStaticProperty;
+    }
 
-  isRuntimeResolvableOneOfStaticProperty(val) {
-    return val instanceof RuntimeResolvableOneOfStaticProperty;
-  }
+    isColorPickerStaticProperty(val) {
+        return val instanceof ColorPickerStaticProperty;
+    }
 
-  isSecretStaticProperty(val) {
-    return val instanceof SecretStaticProperty;
-  }
+    isRuntimeResolvableAnyStaticProperty(val) {
+        return val instanceof RuntimeResolvableAnyStaticProperty;
+    }
 
-  isColorPickerStaticProperty(val) {
-    return val instanceof ColorPickerStaticProperty;
-  }
+    isGroupStaticProperty(val) {
+        return val instanceof StaticPropertyGroup;
+    }
 
-  isRuntimeResolvableAnyStaticProperty(val) {
-    return val instanceof RuntimeResolvableAnyStaticProperty;
-  }
+    isAlternativesStaticProperty(val) {
+        return val instanceof StaticPropertyAlternatives;
+    }
 
-  isGroupStaticProperty(val) {
-    return val instanceof StaticPropertyGroup;
-  }
+    isCollectionStaticProperty(val) {
+        return val instanceof CollectionStaticProperty;
+    }
 
-  isAlternativesStaticProperty(val) {
-    return val instanceof StaticPropertyAlternatives;
-  }
+    isSlideToggleStaticProperty(val) {
+        return val instanceof SlideToggleStaticProperty;
+    }
 
-  isCollectionStaticProperty(val) {
-    return val instanceof CollectionStaticProperty;
-  }
+    isTreeInputStaticProperty(val) {
+        return val instanceof RuntimeResolvableTreeInputStaticProperty;
+    }
 
-  isSlideToggleStaticProperty(val) {
-    return val instanceof SlideToggleStaticProperty;
-  }
+    valueChange(hasInput) {
+        // this.staticProperty.isValid = hasInput;

Review Comment:
   here again



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] bossenti commented on pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
bossenti commented on PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#issuecomment-1396722396

   @aamirxshaikh 
   I have already marked some places with comments :) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] tenthe commented on a diff in pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
tenthe commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1080552084


##########
ui/src/app/core-ui/image/image-labeling/image-labeling.component.ts:
##########
@@ -34,243 +33,358 @@ import { Label } from '@streampipes/platform-services';
 import { LabelService } from '../../labels/services/label.service';
 
 @Component({
-  selector: 'sp-image-labeling',
-  templateUrl: './image-labeling.component.html',
-  styleUrls: ['./image-labeling.component.css']
+    selector: 'sp-image-labeling',
+    templateUrl: './image-labeling.component.html',
+    styleUrls: ['./image-labeling.component.css'],
 })
 export class ImageLabelingComponent implements OnInit {
+    // label
+    public labels;
+    public selectedLabel: Label;
+
+    public _imagesRoutes;
+    @Input()
+    set imagesRoutes(routes) {
+        this._imagesRoutes = routes;
+        this.getCocoFile(this._imagesRoutes, 0);
+    }
 
-  // label
-  public labels;
-  public selectedLabel: Label;
-
-  public _imagesRoutes;
-  @Input()
-  set imagesRoutes(routes) {
-   this._imagesRoutes = routes;
-   this.getCocoFile(this._imagesRoutes, 0);
-  }
-
-  public imagesIndex = 0;
-
-  public cocoFile: CocoFormat;
-
-  public isHoverComponent;
-  public brushSize: number;
+    public imagesIndex = 0;
 
-  public isDrawing = false;
+    public cocoFile: CocoFormat;
 
-  @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
+    public isHoverComponent;
+    public brushSize: number;
 
-  constructor(private reactLabelingService: ReactLabelingService,
-              private polygonLabelingService: PolygonLabelingService,
-              private brushLabelingService: BrushLabelingService,
-              private snackBar: MatSnackBar,
-              private cocoFormatService: CocoFormatService,
-              private labelService: LabelService,
-              public labelingMode: LabelingModeService) { }
+    public isDrawing = false;
 
-  ngOnInit(): void {
-    this.isHoverComponent = false;
-    this.brushSize = 5;
-    this.labelService.getAllLabels().subscribe(res => {
-       this.labels = res;
-    });
-    // this.labels = this.restService.getLabels();
-  }
+    @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
 
-  handleImageIndexChange(index) {
-    this.save(this.imagesIndex);
-    this.getCocoFile(this._imagesRoutes, index);
-  }
+    constructor(
+        private reactLabelingService: ReactLabelingService,
+        private polygonLabelingService: PolygonLabelingService,
+        private brushLabelingService: BrushLabelingService,
+        private snackBar: MatSnackBar,
+        private cocoFormatService: CocoFormatService,
+        private labelService: LabelService,
+        public labelingMode: LabelingModeService,
+    ) {}
 
-  getCocoFile(routes, index) {
-      // This is relevant for coco
-      // this.restService.getCocoFileForImage(routes[index]).subscribe(
-      //   coco => {
-      //     if (coco === null) {
-      //       const cocoFile = new CocoFormat();
-      //       this.cocoFormatService.addImage(cocoFile, (routes[index]));
-      //       this.cocoFile = cocoFile;
-      //     } else {
-      //       this.cocoFile = coco as CocoFormat;
-      //     }
-      //     this.imagesIndex = index;
-      //   }
-      // );
-  }
+    ngOnInit(): void {
+        this.isHoverComponent = false;
+        this.brushSize = 5;
+        this.labelService.getAllLabels().subscribe(res => {
+            this.labels = res;
+        });
+        // this.labels = this.restService.getLabels();
+    }
 
-  /* sp-image-view handler */
-  handleMouseDownLeft(layer: Konva.Layer, shift: ICoordinates, position: ICoordinates) {
-    if (this.labelingEnabled()) {
-      switch (this.labelingMode.getMode()) {
-        case LabelingMode.ReactLabeling: this.reactLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.PolygonLabeling: this.polygonLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.BrushLabeling: this.brushLabelingService.startLabeling(position, this.brushSize);
-      }
+    handleImageIndexChange(index) {
+        this.save(this.imagesIndex);
+        this.getCocoFile(this._imagesRoutes, index);
     }
-  }
 
-  handleMouseMove(layer: Konva.Layer, shift: ICoordinates, position: ICoordinates) {
-    switch (this.labelingMode.getMode()) {
-      case LabelingMode.PolygonLabeling: {
-        this.polygonLabelingService.executeLabeling(position);
-        this.polygonLabelingService.tempDraw(layer, shift, this.selectedLabel);
-      }
+    getCocoFile(routes, index) {
+        // This is relevant for coco

Review Comment:
   ah ok, sorry, I thought you meant the whole class ;)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] smlabt commented on a diff in pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
smlabt commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1081636909


##########
ui/src/app/core-ui/static-properties/static-property.component.css:
##########
@@ -17,25 +17,25 @@
  */
 
 .example-full-width {
-  width: 100%;
+    width: 100%;
 }
 .staticProperty {
-  /* display: block !important;
+    /* display: block !important;

Review Comment:
   @aamirxshaikh Yes in this case you can remove the entire class ".staticProperty", because otherwise it would be empty afterwards



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [streampipes] tenthe commented on a diff in pull request #1120: [#877] Format and lint core-ui module

Posted by GitBox <gi...@apache.org>.
tenthe commented on code in PR #1120:
URL: https://github.com/apache/streampipes/pull/1120#discussion_r1074033902


##########
ui/src/app/core-ui/image/image-labeling/image-labeling.component.ts:
##########
@@ -34,243 +33,358 @@ import { Label } from '@streampipes/platform-services';
 import { LabelService } from '../../labels/services/label.service';
 
 @Component({
-  selector: 'sp-image-labeling',
-  templateUrl: './image-labeling.component.html',
-  styleUrls: ['./image-labeling.component.css']
+    selector: 'sp-image-labeling',
+    templateUrl: './image-labeling.component.html',
+    styleUrls: ['./image-labeling.component.css'],
 })
 export class ImageLabelingComponent implements OnInit {
+    // label
+    public labels;
+    public selectedLabel: Label;
+
+    public _imagesRoutes;
+    @Input()
+    set imagesRoutes(routes) {
+        this._imagesRoutes = routes;
+        this.getCocoFile(this._imagesRoutes, 0);
+    }
 
-  // label
-  public labels;
-  public selectedLabel: Label;
-
-  public _imagesRoutes;
-  @Input()
-  set imagesRoutes(routes) {
-   this._imagesRoutes = routes;
-   this.getCocoFile(this._imagesRoutes, 0);
-  }
-
-  public imagesIndex = 0;
-
-  public cocoFile: CocoFormat;
-
-  public isHoverComponent;
-  public brushSize: number;
+    public imagesIndex = 0;
 
-  public isDrawing = false;
+    public cocoFile: CocoFormat;
 
-  @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
+    public isHoverComponent;
+    public brushSize: number;
 
-  constructor(private reactLabelingService: ReactLabelingService,
-              private polygonLabelingService: PolygonLabelingService,
-              private brushLabelingService: BrushLabelingService,
-              private snackBar: MatSnackBar,
-              private cocoFormatService: CocoFormatService,
-              private labelService: LabelService,
-              public labelingMode: LabelingModeService) { }
+    public isDrawing = false;
 
-  ngOnInit(): void {
-    this.isHoverComponent = false;
-    this.brushSize = 5;
-    this.labelService.getAllLabels().subscribe(res => {
-       this.labels = res;
-    });
-    // this.labels = this.restService.getLabels();
-  }
+    @ViewChild(ImageContainerComponent) imageView: ImageContainerComponent;
 
-  handleImageIndexChange(index) {
-    this.save(this.imagesIndex);
-    this.getCocoFile(this._imagesRoutes, index);
-  }
+    constructor(
+        private reactLabelingService: ReactLabelingService,
+        private polygonLabelingService: PolygonLabelingService,
+        private brushLabelingService: BrushLabelingService,
+        private snackBar: MatSnackBar,
+        private cocoFormatService: CocoFormatService,
+        private labelService: LabelService,
+        public labelingMode: LabelingModeService,
+    ) {}
 
-  getCocoFile(routes, index) {
-      // This is relevant for coco
-      // this.restService.getCocoFileForImage(routes[index]).subscribe(
-      //   coco => {
-      //     if (coco === null) {
-      //       const cocoFile = new CocoFormat();
-      //       this.cocoFormatService.addImage(cocoFile, (routes[index]));
-      //       this.cocoFile = cocoFile;
-      //     } else {
-      //       this.cocoFile = coco as CocoFormat;
-      //     }
-      //     this.imagesIndex = index;
-      //   }
-      // );
-  }
+    ngOnInit(): void {
+        this.isHoverComponent = false;
+        this.brushSize = 5;
+        this.labelService.getAllLabels().subscribe(res => {
+            this.labels = res;
+        });
+        // this.labels = this.restService.getLabels();
+    }
 
-  /* sp-image-view handler */
-  handleMouseDownLeft(layer: Konva.Layer, shift: ICoordinates, position: ICoordinates) {
-    if (this.labelingEnabled()) {
-      switch (this.labelingMode.getMode()) {
-        case LabelingMode.ReactLabeling: this.reactLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.PolygonLabeling: this.polygonLabelingService.startLabeling(position);
-          break;
-        case LabelingMode.BrushLabeling: this.brushLabelingService.startLabeling(position, this.brushSize);
-      }
+    handleImageIndexChange(index) {
+        this.save(this.imagesIndex);
+        this.getCocoFile(this._imagesRoutes, index);
     }
-  }
 
-  handleMouseMove(layer: Konva.Layer, shift: ICoordinates, position: ICoordinates) {
-    switch (this.labelingMode.getMode()) {
-      case LabelingMode.PolygonLabeling: {
-        this.polygonLabelingService.executeLabeling(position);
-        this.polygonLabelingService.tempDraw(layer, shift, this.selectedLabel);
-      }
+    getCocoFile(routes, index) {
+        // This is relevant for coco

Review Comment:
   Yes, this is an old class that we don't need anymore. But my suggestion would be to do it in a separate PR. If something breaks, it will be harder to find the reason. So my suggestion would be to do that in a different PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@streampipes.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org