You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2023/01/02 18:46:16 UTC
[streampipes] 01/06: add linting to add module (#877)
This is an automated email from the ASF dual-hosted git repository.
bossenti pushed a commit to branch chore/ui-linting-a
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit cdfe45afe39cbf6bbd31bbd239836cc05114410d
Author: bossenti <bo...@posteo.de>
AuthorDate: Mon Jan 2 19:28:02 2023 +0100
add linting to add module (#877)
---
ui/.eslintignore | 1 -
ui/.prettierignore | 1 -
ui/src/app/add/add.component.html | 169 +++++++++----
ui/src/app/add/add.component.scss | 16 +-
ui/src/app/add/add.component.ts | 95 +++++---
ui/src/app/add/add.module.ts | 88 ++++---
ui/src/app/add/add.routes.ts | 10 +-
.../endpoint-item/endpoint-item.component.html | 116 +++++++--
.../endpoint-item/endpoint-item.component.scss | 30 +--
.../endpoint-item/endpoint-item.component.ts | 261 +++++++++++----------
.../add-endpoint/add-endpoint.component.html | 75 +++++-
.../add-endpoint/add-endpoint.component.scss | 2 +-
.../dialogs/add-endpoint/add-endpoint.component.ts | 34 ++-
.../endpoint-installation.component.html | 61 ++++-
.../endpoint-installation.component.scss | 2 +-
.../endpoint-installation.component.ts | 190 ++++++++-------
ui/src/app/add/filter/order-by.pipe.ts | 37 +--
.../pipeline-element-installation-status.pipe.ts | 19 +-
.../app/add/filter/pipeline-element-name.pipe.ts | 19 +-
.../app/add/filter/pipeline-element-type.pipe.ts | 17 +-
ui/src/app/add/services/add.service.ts | 74 ++++--
21 files changed, 804 insertions(+), 513 deletions(-)
diff --git a/ui/.eslintignore b/ui/.eslintignore
index 1c49c614c..4f9c372fb 100644
--- a/ui/.eslintignore
+++ b/ui/.eslintignore
@@ -22,7 +22,6 @@ projects
src/app/_enums
src/app/_guards
src/app/_models
-src/app/add
src/app/apidocs
src/app/app-asset-monitoring
src/app/app-overview
diff --git a/ui/.prettierignore b/ui/.prettierignore
index 920a48bda..e9b467842 100644
--- a/ui/.prettierignore
+++ b/ui/.prettierignore
@@ -22,7 +22,6 @@ projects
src/app/_enums
src/app/_guards
src/app/_models
-src/app/add
src/app/apidocs
src/app/app-asset-monitoring
src/app/app-overview
diff --git a/ui/src/app/add/add.component.html b/ui/src/app/add/add.component.html
index 0c7509465..1d30d5e63 100644
--- a/ui/src/app/add/add.component.html
+++ b/ui/src/app/add/add.component.html
@@ -17,55 +17,89 @@
-->
<sp-basic-view [showBackLink]="false" [padding]="true">
- <div nav fxFlex="100" fxLayoutAlign="start center" fxLayout="row" class="pl-10">
+ <div
+ nav
+ fxFlex="100"
+ fxLayoutAlign="start center"
+ fxLayout="row"
+ class="pl-10"
+ >
<div fxFlex="100" fxLayout="row">
- <button mat-button mat-raised-button color="accent" [disabled]="selectedEndpointItems.length === 0"
- (click)="installSelected()" class="mr-10">
+ <button
+ mat-button
+ mat-raised-button
+ color="accent"
+ [disabled]="selectedEndpointItems.length === 0"
+ (click)="installSelected()"
+ class="mr-10"
+ >
<i class="material-icons">cloud_download</i>
Install selected
</button>
- <button mat-button mat-raised-button color="accent" [disabled]="selectedEndpointItems.length === 0"
- (click)="uninstallSelected()" class="mr-10">
+ <button
+ mat-button
+ mat-raised-button
+ color="accent"
+ [disabled]="selectedEndpointItems.length === 0"
+ (click)="uninstallSelected()"
+ class="mr-10"
+ >
<i class="material-icons">delete</i>
Uninstall selected
</button>
- <button mat-button mat-icon-button color="accent" class="mr-10" (click)="selectAll(true)"
- matTooltip="Select all" matTooltipPosition="above">
+ <button
+ mat-button
+ mat-icon-button
+ color="accent"
+ class="mr-10"
+ (click)="selectAll(true)"
+ matTooltip="Select all"
+ matTooltipPosition="above"
+ >
<i class="material-icons">queue</i>
</button>
- <button mat-button mat-icon-button color="accent" class="mr-10" (click)="selectAll(false)"
- matTooltip="Select none" matTooltipPosition="above">
+ <button
+ mat-button
+ mat-icon-button
+ color="accent"
+ class="mr-10"
+ (click)="selectAll(false)"
+ matTooltip="Select none"
+ matTooltipPosition="above"
+ >
<i class="material-icons">filter_none</i>
</button>
</div>
<span fxFlex></span>
<div fxLayoutAlign="start center" fxLayout="row">
<mat-form-field color="accent">
- <mat-select [(value)]="selectedCategory"
- (selectionChange)="filterByCatergory($event)">
- <mat-option [value]="'all'">
- All
- </mat-option>
- <mat-option [value]="'set'">
- Sets
- </mat-option>
- <mat-option [value]="'stream'">
- Streams
- </mat-option>
- <mat-option [value]="'sepa'">
- Processors
- </mat-option>
- <mat-option [value]="'action'">
- Sinks
- </mat-option>
+ <mat-select
+ [(value)]="selectedCategory"
+ (selectionChange)="filterByCatergory($event)"
+ >
+ <mat-option [value]="'all'"> All </mat-option>
+ <mat-option [value]="'set'"> Sets </mat-option>
+ <mat-option [value]="'stream'"> Streams </mat-option>
+ <mat-option [value]="'sepa'"> Processors </mat-option>
+ <mat-option [value]="'action'"> Sinks </mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="ml-10" fxLayoutAlign="start center" fxLayout="row">
<mat-icon>search</mat-icon>
- <mat-form-field class="form-style" color="accent" floatLabel="never">
- <input matInput placeholder="Find Element" value="" [(ngModel)]="filterTerm" name="something">
+ <mat-form-field
+ class="form-style"
+ color="accent"
+ floatLabel="never"
+ >
+ <input
+ matInput
+ placeholder="Find Element"
+ value=""
+ [(ngModel)]="filterTerm"
+ name="something"
+ />
</mat-form-field>
</div>
<div fxLayoutAlign="start center" fxLayout="row" class="ml-10">
@@ -74,44 +108,79 @@
<mat-option [value]="'all'">
Available & Installed
</mat-option>
- <mat-option [value]="'installed'">
- Installed
- </mat-option>
- <mat-option [value]="'available'">
- Available
- </mat-option>
+ <mat-option [value]="'installed'"> Installed </mat-option>
+ <mat-option [value]="'available'"> Available </mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayoutAlign="start center" fxLayout="row" class="ml-10">
- <button mat-button mat-icon-button color="accent" (click)="getEndpointItems()" matTooltip="Reload items"
- matTooltipPosition="above">
+ <button
+ mat-button
+ mat-icon-button
+ color="accent"
+ (click)="getEndpointItems()"
+ matTooltip="Reload items"
+ matTooltipPosition="above"
+ >
<mat-icon>refresh</mat-icon>
</button>
</div>
- <button mat-button mat-icon-button color="accent" (click)="showManageRdfEndpointsDialog()"
- matTooltip="Manage Endpoints">
+ <button
+ mat-button
+ mat-icon-button
+ color="accent"
+ (click)="showManageRdfEndpointsDialog()"
+ matTooltip="Manage Endpoints"
+ >
<i class="material-icons">settings</i>
</button>
</div>
<div fxLayout="column" fxFlex="100">
-
-
- <div fxFlex="100" fxLayout="column" fxLayoutAlign="start start"
- *ngIf="endpointItemsLoadingComplete">
+ <div
+ fxFlex="100"
+ fxLayout="column"
+ fxLayoutAlign="start start"
+ *ngIf="endpointItemsLoadingComplete"
+ >
<div fxLayoutAlign="start start" fxLayout="column">
- <sp-basic-header-title-component title="Available Pipeline Elements"></sp-basic-header-title-component>
+ <sp-basic-header-title-component
+ title="Available Pipeline Elements"
+ ></sp-basic-header-title-component>
</div>
<div fxLayout="row wrap" class="w-100">
- <sp-endpoint-item fxFlex="33" [itemSelected]="endpointItem.selected" [item]="endpointItem"
- (triggerInstallation)="triggerInstallation($event)"
- *ngFor="let endpointItem of endpointItems | pipelineElementTypeFilter: selectedTab | pipelineElementNameFilter: filterTerm | pipelineElementInstallationStatusFilter: selectedInstallationStatus | orderBy: 'asc':'name'"
- class="p-15" (click)="toggleSelected(endpointItem)"></sp-endpoint-item>
+ <sp-endpoint-item
+ fxFlex="33"
+ [itemSelected]="endpointItem.selected"
+ [item]="endpointItem"
+ (triggerInstallation)="triggerInstallation($event)"
+ *ngFor="
+ let endpointItem of endpointItems
+ | pipelineElementTypeFilter : selectedTab
+ | pipelineElementNameFilter : filterTerm
+ | pipelineElementInstallationStatusFilter
+ : selectedInstallationStatus
+ | orderBy : 'asc' : 'name'
+ "
+ class="p-15"
+ (click)="toggleSelected(endpointItem)"
+ ></sp-endpoint-item>
</div>
</div>
- <div fxFlex="100" fxLayout="row" fxLayoutAlign="center center" *ngIf="!endpointItemsLoadingComplete">
- <mat-spinner [mode]="'indeterminate'" [diameter]="20" color="accent"></mat-spinner>
- <h4> Searching for available pipeline elements, please wait...</h4>
+ <div
+ fxFlex="100"
+ fxLayout="row"
+ fxLayoutAlign="center center"
+ *ngIf="!endpointItemsLoadingComplete"
+ >
+ <mat-spinner
+ [mode]="'indeterminate'"
+ [diameter]="20"
+ color="accent"
+ ></mat-spinner>
+ <h4>
+ Searching for available pipeline elements, please
+ wait...
+ </h4>
</div>
</div>
</sp-basic-view>
diff --git a/ui/src/app/add/add.component.scss b/ui/src/app/add/add.component.scss
index ffe023f99..0b12aa99b 100644
--- a/ui/src/app/add/add.component.scss
+++ b/ui/src/app/add/add.component.scss
@@ -19,27 +19,27 @@
@import '../../scss/variables';
.page-container-padding-inner {
- margin: 20px;
+ margin: 20px;
}
.p-15 {
- padding: 15px;
+ padding: 15px;
}
.mr-10 {
- margin-right: 10px;
+ margin-right: 10px;
}
.ml-10 {
- margin-left: 10px;
+ margin-left: 10px;
}
.add-options {
- padding:0px;
- border-bottom: 1px solid var(--color-bg-2);
+ padding: 0px;
+ border-bottom: 1px solid var(--color-bg-2);
}
.add-options-item {
- display: inline;
- margin-right: 10px;
+ display: inline;
+ margin-right: 10px;
}
diff --git a/ui/src/app/add/add.component.ts b/ui/src/app/add/add.component.ts
index 62e5e3f85..82e3f1f8d 100644
--- a/ui/src/app/add/add.component.ts
+++ b/ui/src/app/add/add.component.ts
@@ -18,7 +18,12 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { AddService } from './services/add.service';
-import { DialogRef, DialogService, PanelType, SpBreadcrumbService } from '@streampipes/shared-ui';
+import {
+ DialogRef,
+ DialogService,
+ PanelType,
+ SpBreadcrumbService,
+} from '@streampipes/shared-ui';
import { AddEndpointComponent } from './dialogs/add-endpoint/add-endpoint.component';
import { EndpointInstallationComponent } from './dialogs/endpoint-installation/endpoint-installation.component';
import { ExtensionsServiceEndpointItem } from '@streampipes/platform-services';
@@ -28,10 +33,9 @@ import { SpAddRoutes } from './add.routes';
@Component({
selector: 'sp-add',
templateUrl: './add.component.html',
- styleUrls: ['./add.component.scss']
+ styleUrls: ['./add.component.scss'],
})
export class AddComponent implements OnInit {
-
activeLink: string;
results: any[];
@@ -49,11 +53,13 @@ export class AddComponent implements OnInit {
_filterTerm = '';
_selectedInstallationStatus = 'all';
- constructor(private addService: AddService,
- private dialogService: DialogService,
- private changeDetectorRef: ChangeDetectorRef,
- private router: Router,
- private breadcrumbService: SpBreadcrumbService) {
+ constructor(
+ private addService: AddService,
+ private dialogService: DialogService,
+ private changeDetectorRef: ChangeDetectorRef,
+ private router: Router,
+ private breadcrumbService: SpBreadcrumbService,
+ ) {
this.results = [];
this.loading = false;
this.endpointItems = [];
@@ -61,15 +67,24 @@ export class AddComponent implements OnInit {
}
ngOnInit() {
- this.breadcrumbService.updateBreadcrumb(this.breadcrumbService.getRootLink(SpAddRoutes.BASE));
+ this.breadcrumbService.updateBreadcrumb(
+ this.breadcrumbService.getRootLink(SpAddRoutes.BASE),
+ );
this.getEndpointItems();
this.selectedTab = 'all';
}
toggleSelected(endpointItem) {
if (endpointItem.editable) {
- if (this.selectedEndpointItems.some(item => item === endpointItem.uri)) {
- this.selectedEndpointItems.splice(this.selectedEndpointItems.indexOf(endpointItem.uri), 1);
+ if (
+ this.selectedEndpointItems.some(
+ item => item === endpointItem.uri,
+ )
+ ) {
+ this.selectedEndpointItems.splice(
+ this.selectedEndpointItems.indexOf(endpointItem.uri),
+ 1,
+ );
} else {
this.selectedEndpointItems.push(endpointItem.uri);
}
@@ -95,7 +110,10 @@ export class AddComponent implements OnInit {
this.selectedEndpointItems = [];
this.endpointItems.forEach(item => {
if (item.editable) {
- if (item.type === this.selectedTab || this.selectedTab === 'all') {
+ if (
+ item.type === this.selectedTab ||
+ this.selectedTab === 'all'
+ ) {
(item as any).selected = selected;
if (selected) {
this.selectedEndpointItems.push(item.uri);
@@ -105,17 +123,15 @@ export class AddComponent implements OnInit {
});
this.changeDetectorRef.detectChanges();
}
-
showManageRdfEndpointsDialog() {
- const dialogRef: DialogRef<AddEndpointComponent> = this.dialogService.open(AddEndpointComponent, {
- panelType: PanelType.STANDARD_PANEL,
- title: 'Manage Endpoints',
- width: '70vw',
- data: {
-
- }
- });
+ const dialogRef: DialogRef<AddEndpointComponent> =
+ this.dialogService.open(AddEndpointComponent, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: 'Manage Endpoints',
+ width: '70vw',
+ data: {},
+ });
dialogRef.afterClosed().subscribe(data => {
if (data) {
this.getEndpointItems();
@@ -125,11 +141,10 @@ export class AddComponent implements OnInit {
getEndpointItems() {
this.endpointItemsLoadingComplete = false;
- this.addService.getRdfEndpointItems()
- .subscribe(endpointItems => {
- this.endpointItems = endpointItems;
- this.endpointItemsLoadingComplete = true;
- });
+ this.addService.getRdfEndpointItems().subscribe(endpointItems => {
+ this.endpointItems = endpointItems;
+ this.endpointItemsLoadingComplete = true;
+ });
}
installSelected() {
@@ -155,19 +170,23 @@ export class AddComponent implements OnInit {
}
triggerInstallation(installationInfo: any) {
- this.installElements(installationInfo.endpointItems, installationInfo.install);
+ this.installElements(
+ installationInfo.endpointItems,
+ installationInfo.install,
+ );
}
installElements(endpointItems, install) {
- const dialogRef: DialogRef<EndpointInstallationComponent> = this.dialogService.open(EndpointInstallationComponent, {
- panelType: PanelType.STANDARD_PANEL,
- title: 'Installation',
- width: '70vw',
- data: {
- 'install': install,
- 'endpointItemsToInstall': endpointItems
- }
- });
+ const dialogRef: DialogRef<EndpointInstallationComponent> =
+ this.dialogService.open(EndpointInstallationComponent, {
+ panelType: PanelType.STANDARD_PANEL,
+ title: 'Installation',
+ width: '70vw',
+ data: {
+ install: install,
+ endpointItemsToInstall: endpointItems,
+ },
+ });
dialogRef.afterClosed().subscribe(data => {
if (data) {
this.getEndpointItems();
@@ -194,7 +213,7 @@ export class AddComponent implements OnInit {
}
navigateTo(routeId: string): void {
- this.router.navigate(['add', routeId]);
- this.activeLink = routeId;
+ this.router.navigate(['add', routeId]);
+ this.activeLink = routeId;
}
}
diff --git a/ui/src/app/add/add.module.ts b/ui/src/app/add/add.module.ts
index 9c91e7dd7..f8b23d9e6 100644
--- a/ui/src/app/add/add.module.ts
+++ b/ui/src/app/add/add.module.ts
@@ -33,56 +33,50 @@ import { OrderByPipe } from './filter/order-by.pipe';
import { EndpointInstallationComponent } from './dialogs/endpoint-installation/endpoint-installation.component';
import { PipelineElementNameFilter } from './filter/pipeline-element-name.pipe';
import { PipelineElementInstallationStatusFilter } from './filter/pipeline-element-installation-status.pipe';
-import { RouterModule } from "@angular/router";
+import { RouterModule } from '@angular/router';
import { SharedUiModule } from '../../../projects/streampipes/shared-ui/src/lib/shared-ui.module';
-
@NgModule({
- imports: [
- CommonModule,
- FormsModule,
- MatTabsModule,
- FlexLayoutModule,
- CoreUiModule,
- CustomMaterialModule,
- MatProgressSpinnerModule,
- RouterModule.forChild([
- {
- path: 'add',
- children: [
- {
- path: '',
- component: AddComponent
- }
- ]
- }
- ]),
- SharedUiModule
- ],
- declarations: [
- AddComponent,
- AddEndpointComponent,
- EndpointInstallationComponent,
- EndpointItemComponent,
- OrderByPipe,
- PipelineElementNameFilter,
- PipelineElementInstallationStatusFilter,
- PipelineElementTypeFilter
- ],
- providers: [
- AddService,
- OrderByPipe,
- PipelineElementInstallationStatusFilter,
- PipelineElementNameFilter,
- PipelineElementTypeFilter
- ],
- exports: [
- AddComponent
- ]
+ imports: [
+ CommonModule,
+ FormsModule,
+ MatTabsModule,
+ FlexLayoutModule,
+ CoreUiModule,
+ CustomMaterialModule,
+ MatProgressSpinnerModule,
+ RouterModule.forChild([
+ {
+ path: 'add',
+ children: [
+ {
+ path: '',
+ component: AddComponent,
+ },
+ ],
+ },
+ ]),
+ SharedUiModule,
+ ],
+ declarations: [
+ AddComponent,
+ AddEndpointComponent,
+ EndpointInstallationComponent,
+ EndpointItemComponent,
+ OrderByPipe,
+ PipelineElementNameFilter,
+ PipelineElementInstallationStatusFilter,
+ PipelineElementTypeFilter,
+ ],
+ providers: [
+ AddService,
+ OrderByPipe,
+ PipelineElementInstallationStatusFilter,
+ PipelineElementNameFilter,
+ PipelineElementTypeFilter,
+ ],
+ exports: [AddComponent],
})
export class AddModule {
-
- constructor() {
- }
-
+ constructor() {}
}
diff --git a/ui/src/app/add/add.routes.ts b/ui/src/app/add/add.routes.ts
index a035fea7c..b6945d3bf 100644
--- a/ui/src/app/add/add.routes.ts
+++ b/ui/src/app/add/add.routes.ts
@@ -16,10 +16,12 @@
*
*/
-import { SpBreadcrumbItem, } from '@streampipes/shared-ui';
+import { SpBreadcrumbItem } from '@streampipes/shared-ui';
export class SpAddRoutes {
-
- static ADD_BASE_LINK = 'add';
- static BASE: SpBreadcrumbItem = {label: 'Install Pipeline Elements', link: [SpAddRoutes.ADD_BASE_LINK]};
+ static ADD_BASE_LINK = 'add';
+ static BASE: SpBreadcrumbItem = {
+ label: 'Install Pipeline Elements',
+ link: [SpAddRoutes.ADD_BASE_LINK],
+ };
}
diff --git a/ui/src/app/add/components/endpoint-item/endpoint-item.component.html b/ui/src/app/add/components/endpoint-item/endpoint-item.component.html
index 09ead1790..1a536414f 100644
--- a/ui/src/app/add/components/endpoint-item/endpoint-item.component.html
+++ b/ui/src/app/add/components/endpoint-item/endpoint-item.component.html
@@ -16,40 +16,104 @@
~
-->
-<div fxFlex="100" fxLayout="column" fxLayoutAlign="start start" class="pipeline-element-box"
- style="padding:5px;margin-bottom:10px;background:{{getSelectedBackground()}}" [ngStyle]="item.editable ? {opacity: 1} : {opacity: 0.5}">
+<div
+ fxFlex="100"
+ fxLayout="column"
+ fxLayoutAlign="start start"
+ class="pipeline-element-box"
+ style="padding:5px;margin-bottom:10px;background:{{
+ getSelectedBackground()
+ }}"
+ [ngStyle]="item.editable ? { opacity: 1 } : { opacity: 0.5 }"
+>
<div fxLayout="row" class="w-100">
- <i class="material-icons" [ngClass]="item.available ? 'endpoint-icon-available' : 'endpoint-icon-critical'">lens</i>
+ <i
+ class="material-icons"
+ [ngClass]="
+ item.available
+ ? 'endpoint-icon-available'
+ : 'endpoint-icon-critical'
+ "
+ >lens</i
+ >
<span fxFlex></span>
- <span class="{{itemTypeStyle}}" matTooltip="Endpoint {{item.available ? 'available' : 'not available'}}">{{itemTypeTitle}}</span>
+ <span
+ class="{{ itemTypeStyle }}"
+ matTooltip="Endpoint {{
+ item.available ? 'available' : 'not available'
+ }}"
+ >{{ itemTypeTitle }}</span
+ >
</div>
- <div fxFlex fxLayout="row" style="width:100%;">
- <div style="margin-right:10px;margin-left:10px;margin-top:10px;">
- <div *ngIf="!item.includesIcon || iconError" class="draggable-icon {{item.type}}">{{iconText(item.name)}}</div>
- <div *ngIf="item.includesIcon && iconReady" class="draggable-icon {{item.type}}">
- <img class="icon" [src]="image"></div>
+ <div fxFlex fxLayout="row" style="width: 100%">
+ <div style="margin-right: 10px; margin-left: 10px; margin-top: 10px">
+ <div
+ *ngIf="!item.includesIcon || iconError"
+ class="draggable-icon {{ item.type }}"
+ >
+ {{ iconText(item.name) }}
+ </div>
+ <div
+ *ngIf="item.includesIcon && iconReady"
+ class="draggable-icon {{ item.type }}"
+ >
+ <img class="icon" [src]="image" />
+ </div>
</div>
<div fxFlex fxLayout="column">
-
- <div class="ml-5"><small *ngIf="!(item.editable)">Internally managed by {{appConstants.APP_NAME}}</small></div>
+ <div class="ml-5">
+ <small *ngIf="!item.editable"
+ >Internally managed by {{ appConstants.APP_NAME }}</small
+ >
+ </div>
<div fxFlex fxLayoutAlign="start end" class="ml-5">
- <button class="small-button-add" mat-button mat-raised-button color="accent" [disabled]="!(item.editable)"
- (click)="installSingleElement($event, item)" *ngIf="!item.installed">
+ <button
+ class="small-button-add"
+ mat-button
+ mat-raised-button
+ color="accent"
+ [disabled]="!item.editable"
+ (click)="installSingleElement($event, item)"
+ *ngIf="!item.installed"
+ >
<span> Install</span>
</button>
- <button class="small-button-add-inverted" mat-button mat-raised-button [disabled]="!(item.editable)"
- (click)="uninstallSingleElement($event, item)" *ngIf="item.installed">
+ <button
+ class="small-button-add-inverted"
+ mat-button
+ mat-raised-button
+ [disabled]="!item.editable"
+ (click)="uninstallSingleElement($event, item)"
+ *ngIf="item.installed"
+ >
<span> Uninstall</span>
</button>
- <div *ngIf="item.installed" style="margin-left:5px;">
- <button class="small-button-add mat-basic no-min-width" [disabled]="!(item.editable)"
- mat-raised-button mat-button [matMenuTriggerFor]="menu"><span style="font-size:12px;">...</span></button>
+ <div *ngIf="item.installed" style="margin-left: 5px">
+ <button
+ class="small-button-add mat-basic no-min-width"
+ [disabled]="!item.editable"
+ mat-raised-button
+ mat-button
+ [matMenuTriggerFor]="menu"
+ >
+ <span style="font-size: 12px">...</span>
+ </button>
<mat-menu #menu="matMenu">
- <button mat-menu-item (click)="refresh(item.elementId)" [disabled]="!item.available">
+ <button
+ mat-menu-item
+ (click)="refresh(item.elementId)"
+ [disabled]="!item.available"
+ >
<mat-icon>refresh</mat-icon>
<span> Update</span>
</button>
- <button mat-menu-item (click)="showPermissionsDialog(item.elementId, item.name)" [disabled]="!item.available">
+ <button
+ mat-menu-item
+ (click)="
+ showPermissionsDialog(item.elementId, item.name)
+ "
+ [disabled]="!item.available"
+ >
<mat-icon>share</mat-icon>
<span> Manage permissions</span>
</button>
@@ -58,11 +122,17 @@
</div>
</div>
</div>
- <div fxFlex="100" fxLayout="column" style="padding-left:10px;margin-top:10px;">
+ <div
+ fxFlex="100"
+ fxLayout="column"
+ style="padding-left: 10px; margin-top: 10px"
+ >
<div fxLayout="column">
<div fxFlex fxLayout="column">
- <h3><b>{{item.name}}</b></h3>
- <p>{{item.description}}</p>
+ <h3>
+ <b>{{ item.name }}</b>
+ </h3>
+ <p>{{ item.description }}</p>
</div>
</div>
</div>
diff --git a/ui/src/app/add/components/endpoint-item/endpoint-item.component.scss b/ui/src/app/add/components/endpoint-item/endpoint-item.component.scss
index 26ab5fd71..12731c0b1 100644
--- a/ui/src/app/add/components/endpoint-item/endpoint-item.component.scss
+++ b/ui/src/app/add/components/endpoint-item/endpoint-item.component.scss
@@ -17,37 +17,37 @@
*/
.pipeline-element-box {
- height: 100%;
- box-shadow: 1px 1px 2px #555;
- border: 1px solid gray;
- cursor: pointer;
- padding: 10px;
+ height: 100%;
+ box-shadow: 1px 1px 2px #555;
+ border: 1px solid gray;
+ cursor: pointer;
+ padding: 10px;
}
.small-icon {
- font-size:12px;
+ font-size: 12px;
}
.ml-5 {
- margin-left:5px;
+ margin-left: 5px;
}
.no-min-width {
- min-width: 0;
+ min-width: 0;
}
.icon {
- height: 50px;
- margin-top: -5px;
- width: 50px;
+ height: 50px;
+ margin-top: -5px;
+ width: 50px;
}
.endpoint-icon-available {
- cursor: default;
- color: #4CAF50;
+ cursor: default;
+ color: #4caf50;
}
.endpoint-icon-critical {
- cursor: default;
- color: #F44336;
+ cursor: default;
+ color: #f44336;
}
diff --git a/ui/src/app/add/components/endpoint-item/endpoint-item.component.ts b/ui/src/app/add/components/endpoint-item/endpoint-item.component.ts
index 0b15e0eed..639c20791 100644
--- a/ui/src/app/add/components/endpoint-item/endpoint-item.component.ts
+++ b/ui/src/app/add/components/endpoint-item/endpoint-item.component.ts
@@ -20,143 +20,154 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { MatSnackBar } from '@angular/material/snack-bar';
import { AddService } from '../../services/add.service';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
-import { ExtensionsServiceEndpointItem, PipelineElementEndpointService } from '@streampipes/platform-services';
+import {
+ ExtensionsServiceEndpointItem,
+ PipelineElementEndpointService,
+} from '@streampipes/platform-services';
import { AppConstants } from '../../../services/app.constants';
import { ObjectPermissionDialogComponent } from '../../../core-ui/object-permission-dialog/object-permission-dialog.component';
import { PanelType, DialogService } from '@streampipes/shared-ui';
@Component({
- selector: 'sp-endpoint-item',
- templateUrl: './endpoint-item.component.html',
- styleUrls: ['./endpoint-item.component.scss']
+ selector: 'sp-endpoint-item',
+ templateUrl: './endpoint-item.component.html',
+ styleUrls: ['./endpoint-item.component.scss'],
})
export class EndpointItemComponent implements OnInit {
+ @Input()
+ item: ExtensionsServiceEndpointItem;
+
+ itemTypeTitle: string;
+ itemTypeStyle: string;
+
+ @Input()
+ itemSelected: boolean;
+
+ image: SafeUrl;
+ iconReady = false;
+ iconError = false;
+
+ @Output()
+ triggerInstallation: EventEmitter<any> = new EventEmitter<any>();
+
+ constructor(
+ private snackBar: MatSnackBar,
+ private pipelineElementEndpointService: PipelineElementEndpointService,
+ private addService: AddService,
+ private sanitizer: DomSanitizer,
+ public appConstants: AppConstants,
+ private dialogService: DialogService,
+ ) {}
+
+ ngOnInit(): void {
+ this.findItemTypeTitle();
+ this.findItemStyle();
+ if (this.item.includesIcon) {
+ this.addService.getRdfEndpointIcon(this.item).subscribe(
+ blob => {
+ const objectURL = URL.createObjectURL(blob);
+ this.image =
+ this.sanitizer.bypassSecurityTrustUrl(objectURL);
+ this.iconReady = true;
+ },
+ () => (this.iconError = true),
+ );
+ }
+ }
+
+ iconText(s) {
+ let result = '';
+ if (s.length <= 4) {
+ result = s;
+ } else {
+ const words = s.split(' ');
+ words.forEach((word, i) => {
+ if (i < 4) {
+ result += word.charAt(0);
+ }
+ });
+ }
+ return result.toUpperCase();
+ }
+
+ getSelectedBackground() {
+ if (this.itemSelected) {
+ return 'var(--color-bg-2)';
+ } else {
+ return 'var(--color-bg-1)';
+ }
+ }
- @Input()
- item: ExtensionsServiceEndpointItem;
-
- itemTypeTitle: string;
- itemTypeStyle: string;
-
- @Input()
- itemSelected: boolean;
-
- image: SafeUrl;
- iconReady = false;
- iconError = false;
-
- @Output()
- triggerInstallation: EventEmitter<any> = new EventEmitter<any>();
-
- constructor(private snackBar: MatSnackBar,
- private pipelineElementEndpointService: PipelineElementEndpointService,
- private addService: AddService,
- private sanitizer: DomSanitizer,
- public appConstants: AppConstants,
- private dialogService: DialogService) {
-
- }
-
- ngOnInit(): void {
- this.findItemTypeTitle();
- this.findItemStyle();
- if (this.item.includesIcon) {
- this.addService.getRdfEndpointIcon(this.item).subscribe(blob => {
- const objectURL = URL.createObjectURL(blob);
- this.image = this.sanitizer.bypassSecurityTrustUrl(objectURL);
- this.iconReady = true;
- }, () => this.iconError = true);
- }
- }
-
- iconText(s) {
- let result = '';
- if (s.length <= 4) {
- result = s;
- } else {
- const words = s.split(' ');
- words.forEach((word, i) => {
- if (i < 4) {
- result += word.charAt(0);
+ findItemTypeTitle() {
+ if (this.item.type === 'stream') {
+ this.itemTypeTitle = 'Data Stream';
+ } else if (this.item.type === 'set') {
+ this.itemTypeTitle = 'Data Set';
+ } else if (this.item.type === 'sepa') {
+ this.itemTypeTitle = 'Data Processor';
+ } else {
+ this.itemTypeTitle = 'Data Sink';
}
- });
}
- return result.toUpperCase();
- }
-
- getSelectedBackground() {
- if (this.itemSelected) {
- return 'var(--color-bg-2)';
- } else {
- return 'var(--color-bg-1)';
+
+ findItemStyle() {
+ const baseType = 'pe-label ';
+ if (this.item.type === 'stream') {
+ this.itemTypeStyle = baseType + 'stream-label';
+ } else if (this.item.type === 'set') {
+ this.itemTypeStyle = baseType + 'set-label';
+ } else if (this.item.type === 'sepa') {
+ this.itemTypeStyle = baseType + 'processor-label';
+ } else {
+ this.itemTypeStyle = baseType + 'sink-label';
+ }
+ }
+
+ installSingleElement(event: Event, endpointItem) {
+ const endpointItems = [];
+ endpointItems.push(endpointItem);
+ this.triggerInstallation.emit({ endpointItems, install: true });
+ event.stopPropagation();
}
- }
-
- findItemTypeTitle() {
- if (this.item.type === 'stream') {
- this.itemTypeTitle = 'Data Stream';
- } else if (this.item.type === 'set') {
- this.itemTypeTitle = 'Data Set';
- } else if (this.item.type === 'sepa') {
- this.itemTypeTitle = 'Data Processor';
- } else {
- this.itemTypeTitle = 'Data Sink';
+
+ uninstallSingleElement(event: Event, endpointItem) {
+ const endpointItems = [];
+ endpointItems.push(endpointItem);
+ this.triggerInstallation.emit({ endpointItems, install: false });
+ event.stopPropagation();
}
- }
-
- findItemStyle() {
- const baseType = 'pe-label ';
- if (this.item.type === 'stream') {
- this.itemTypeStyle = baseType + 'stream-label';
- } else if (this.item.type === 'set') {
- this.itemTypeStyle = baseType + 'set-label';
- } else if (this.item.type === 'sepa') {
- this.itemTypeStyle = baseType + 'processor-label';
- } else {
- this.itemTypeStyle = baseType + 'sink-label';
+
+ refresh(elementId: string) {
+ this.pipelineElementEndpointService
+ .update(elementId)
+ .subscribe(msg => {
+ this.snackBar.open(msg.notifications[0].title, 'Ok', {
+ duration: 2000,
+ });
+ })
+ .add(() => {
+ // this.loadCurrentElements(type);
+ });
}
- }
-
- installSingleElement(event: Event, endpointItem) {
- const endpointItems = [];
- endpointItems.push(endpointItem);
- this.triggerInstallation.emit({endpointItems, install: true});
- event.stopPropagation();
- }
-
- uninstallSingleElement(event: Event, endpointItem) {
- const endpointItems = [];
- endpointItems.push(endpointItem);
- this.triggerInstallation.emit({endpointItems, install: false});
- event.stopPropagation();
- }
-
- refresh(elementId: string) {
- this.pipelineElementEndpointService.update(elementId)
- .subscribe(msg => {
- this.snackBar.open(msg.notifications[0].title, 'Ok', {
- duration: 2000
- });
- })
- .add(() => {
- // this.loadCurrentElements(type);
+
+ showPermissionsDialog(elementId: string, elementName: string) {
+ const dialogRef = this.dialogService.open(
+ ObjectPermissionDialogComponent,
+ {
+ panelType: PanelType.SLIDE_IN_PANEL,
+ title: 'Manage permissions',
+ width: '50vw',
+ data: {
+ objectInstanceId: elementId,
+ headerTitle:
+ 'Manage permissions for pipeline element ' +
+ elementName,
+ },
+ },
+ );
+
+ dialogRef.afterClosed().subscribe(refresh => {
+ console.log(refresh);
});
- }
-
- showPermissionsDialog(elementId: string,
- elementName: string) {
- const dialogRef = this.dialogService.open(ObjectPermissionDialogComponent, {
- panelType: PanelType.SLIDE_IN_PANEL,
- title: 'Manage permissions',
- width: '50vw',
- data: {
- 'objectInstanceId': elementId,
- 'headerTitle': 'Manage permissions for pipeline element ' + elementName
- }
- });
-
- dialogRef.afterClosed().subscribe(refresh => {
- console.log(refresh);
- });
- }
+ }
}
diff --git a/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.html b/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.html
index 2b9c7cf53..441127227 100644
--- a/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.html
+++ b/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.html
@@ -20,13 +20,34 @@
<div class="sp-dialog-content p-15">
<h5><b>Existing Endpoints</b></h5>
<div>
- <div *ngFor="let rdfEndpoint of rdfEndpoints | orderBy: 'asc':'endpointUrl'">
- <div layout="row" class="md-with-secondary" *ngIf="rdfEndpoint._id !== undefined">
- <div class="md-list-item-text" fxFlex="80" fxLayout="column">
- {{rdfEndpoint.endpointUrl}}
+ <div
+ *ngFor="
+ let rdfEndpoint of rdfEndpoints
+ | orderBy : 'asc' : 'endpointUrl'
+ "
+ >
+ <div
+ layout="row"
+ class="md-with-secondary"
+ *ngIf="rdfEndpoint._id !== undefined"
+ >
+ <div
+ class="md-list-item-text"
+ fxFlex="80"
+ fxLayout="column"
+ >
+ {{ rdfEndpoint.endpointUrl }}
</div>
- <div class="md-list-item-text" fxFlex="20" fxLayout="column">
- <button mat-button mat-flat-button (click)="removeRdfEndpoint(rdfEndpoint._id)">
+ <div
+ class="md-list-item-text"
+ fxFlex="20"
+ fxLayout="column"
+ >
+ <button
+ mat-button
+ mat-flat-button
+ (click)="removeRdfEndpoint(rdfEndpoint._id)"
+ >
<mat-icon color="accent">delete</mat-icon>
</button>
</div>
@@ -35,27 +56,55 @@
<mat-divider></mat-divider>
<div *ngIf="addSelected">
<div fxLayout="row" class="md-with-secondary">
- <div class="md-list-item-text" fxFlex="80" fxLayout="column">
+ <div
+ class="md-list-item-text"
+ fxFlex="80"
+ fxLayout="column"
+ >
<mat-form-field>
<mat-label>Endpoint URL</mat-label>
- <input matInput type="text" [(ngModel)]="newEndpoint.endpointUrl">
+ <input
+ matInput
+ type="text"
+ [(ngModel)]="newEndpoint.endpointUrl"
+ />
</mat-form-field>
</div>
- <div class="md-list-item-text" fxFlex="20" fxlayout="column">
- <button mat-button mat-flat-button (click)="addRdfEndpoint(newEndpoint)">
+ <div
+ class="md-list-item-text"
+ fxFlex="20"
+ fxlayout="column"
+ >
+ <button
+ mat-button
+ mat-flat-button
+ (click)="addRdfEndpoint(newEndpoint)"
+ >
<mat-icon>save</mat-icon>
</button>
</div>
</div>
</div>
</div>
- <div style="margin-top:10px;">
- <button mat-button mat-raised-button color="accent" (click)="showAddInput()">Add Endpoint</button>
+ <div style="margin-top: 10px">
+ <button
+ mat-button
+ mat-raised-button
+ color="accent"
+ (click)="showAddInput()"
+ >
+ Add Endpoint
+ </button>
</div>
</div>
<mat-divider></mat-divider>
<div class="sp-dialog-actions actions-align-right">
- <button mat-button mat-raised-button class="mat-basic" (click)="close()">
+ <button
+ mat-button
+ mat-raised-button
+ class="mat-basic"
+ (click)="close()"
+ >
Close
</button>
</div>
diff --git a/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.scss b/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.scss
index 0a776e5ff..fddade7bf 100644
--- a/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.scss
+++ b/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.scss
@@ -16,4 +16,4 @@
*
*/
-@import '../../../../scss/sp/sp-dialog.scss';
\ No newline at end of file
+@import '../../../../scss/sp/sp-dialog.scss';
diff --git a/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.ts b/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.ts
index 5976d4aee..d8d52bbd0 100644
--- a/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.ts
+++ b/ui/src/app/add/dialogs/add-endpoint/add-endpoint.component.ts
@@ -23,18 +23,19 @@ import { DialogRef } from '@streampipes/shared-ui';
@Component({
selector: 'sp-add-endpoint-dialog',
templateUrl: './add-endpoint.component.html',
- styleUrls: ['./add-endpoint.component.scss']
+ styleUrls: ['./add-endpoint.component.scss'],
})
export class AddEndpointComponent implements OnInit {
-
rdfEndpoints: any;
addSelected: any;
newEndpoint: any;
endpointsChanged = false;
- constructor(private addService: AddService,
- private dialogRef: DialogRef<AddEndpointComponent>) {
+ constructor(
+ private addService: AddService,
+ private dialogRef: DialogRef<AddEndpointComponent>,
+ ) {
this.rdfEndpoints = [];
this.addSelected = false;
this.newEndpoint = {};
@@ -49,27 +50,24 @@ export class AddEndpointComponent implements OnInit {
}
loadRdfEndpoints() {
- this.addService.getRdfEndpoints()
- .subscribe(rdfEndpoints => {
- this.rdfEndpoints = rdfEndpoints;
- });
+ this.addService.getRdfEndpoints().subscribe(rdfEndpoints => {
+ this.rdfEndpoints = rdfEndpoints;
+ });
}
addRdfEndpoint(rdfEndpoint) {
console.log(rdfEndpoint);
- this.addService.addRdfEndpoint(rdfEndpoint)
- .subscribe(() => {
- this.loadRdfEndpoints();
- this.endpointsChanged = true;
- });
+ this.addService.addRdfEndpoint(rdfEndpoint).subscribe(() => {
+ this.loadRdfEndpoints();
+ this.endpointsChanged = true;
+ });
}
removeRdfEndpoint(rdfEndpointId) {
- this.addService.removeRdfEndpoint(rdfEndpointId)
- .subscribe(() => {
- this.loadRdfEndpoints();
- this.endpointsChanged = true;
- });
+ this.addService.removeRdfEndpoint(rdfEndpointId).subscribe(() => {
+ this.loadRdfEndpoints();
+ this.endpointsChanged = true;
+ });
}
close() {
diff --git a/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.html b/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.html
index 4edf8181f..be98dddc3 100644
--- a/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.html
+++ b/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.html
@@ -16,24 +16,43 @@
~
-->
-
<div class="sp-dialog-container">
<div class="sp-dialog-content p-15">
- <div fxFlex="100" class="md-dialog-content" style="padding:20px;" *ngIf="page == 'preview'">
- <h4>You are about to {{install ? 'install' : 'uninstall'}} the following elements:</h4>
+ <div
+ fxFlex="100"
+ class="md-dialog-content"
+ style="padding: 20px"
+ *ngIf="page === 'preview'"
+ >
+ <h4>
+ You are about to {{ install ? 'install' : 'uninstall' }} the
+ following elements:
+ </h4>
<div *ngFor="let endpointItem of endpointItemsToInstall">
- <h5>{{endpointItem.name}}</h5>
+ <h5>{{ endpointItem.name }}</h5>
</div>
<h5><b>Press 'Next' to start the process.</b></h5>
</div>
- <div fxFlex="100" class="md-dialog-content" style="padding:20px;" *ngIf="page == 'installation'">
+ <div
+ fxFlex="100"
+ class="md-dialog-content"
+ style="padding: 20px"
+ *ngIf="page === 'installation'"
+ >
<div *ngFor="let status of installationStatus">
- <h4>{{install ? 'Installing' : 'Uninstalling'}} {{status.id + 1}} of {{endpointItemsToInstall.length}}
- ({{status.name}})...{{status.status}}</h4>
+ <h4>
+ {{ install ? 'Installing' : 'Uninstalling' }}
+ {{ status.id + 1 }} of
+ {{ endpointItemsToInstall.length }} ({{ status.name }})...{{
+ status.status
+ }}
+ </h4>
<div>
<div fxFlex fxLayout="column" *ngIf="status.details">
<b>More Details:</b>
- <div class="md-padding"><i class="fa fa-terminal">{{status.details}}</i></div>
+ <div class="md-padding">
+ <i class="fa fa-terminal">{{ status.details }}</i>
+ </div>
</div>
</div>
</div>
@@ -41,12 +60,30 @@
</div>
<mat-divider></mat-divider>
<div class="sp-dialog-actions actions-align-right">
- <mat-checkbox class="mr-15" [(ngModel)]="installAsPublicElement" *ngIf="install">Make available to all users with appropriate role</mat-checkbox>
- <button mat-button mat-raised-button class="mat-basic" (click)="close()" style="margin-right: 10px;" *ngIf="nextButton !== 'Close'">
+ <mat-checkbox
+ class="mr-15"
+ [(ngModel)]="installAsPublicElement"
+ *ngIf="install"
+ >Make available to all users with appropriate role</mat-checkbox
+ >
+ <button
+ mat-button
+ mat-raised-button
+ class="mat-basic"
+ (click)="close()"
+ style="margin-right: 10px"
+ *ngIf="nextButton !== 'Close'"
+ >
Close
</button>
- <button mat-button mat-raised-button color="accent" (click)="next()" [disabled]="installationRunning">
- {{nextButton}}
+ <button
+ mat-button
+ mat-raised-button
+ color="accent"
+ (click)="next()"
+ [disabled]="installationRunning"
+ >
+ {{ nextButton }}
</button>
</div>
</div>
diff --git a/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.scss b/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.scss
index 0a776e5ff..fddade7bf 100644
--- a/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.scss
+++ b/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.scss
@@ -16,4 +16,4 @@
*
*/
-@import '../../../../scss/sp/sp-dialog.scss';
\ No newline at end of file
+@import '../../../../scss/sp/sp-dialog.scss';
diff --git a/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.ts b/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.ts
index c52945ff7..c05b24360 100644
--- a/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.ts
+++ b/ui/src/app/add/dialogs/endpoint-installation/endpoint-installation.component.ts
@@ -21,104 +21,126 @@ import { DialogRef } from '@streampipes/shared-ui';
import { PipelineElementEndpointService } from '@streampipes/platform-services';
@Component({
- selector: 'sp-endpoint-installation-dialog',
- templateUrl: './endpoint-installation.component.html',
- styleUrls: ['./endpoint-installation.component.scss']
+ selector: 'sp-endpoint-installation-dialog',
+ templateUrl: './endpoint-installation.component.html',
+ styleUrls: ['./endpoint-installation.component.scss'],
})
export class EndpointInstallationComponent {
+ endpointItems: any;
- endpointItems: any;
+ @Input()
+ install: boolean;
- @Input()
- install: boolean;
+ @Input()
+ endpointItemsToInstall: any;
- @Input()
- endpointItemsToInstall: any;
+ installedItemsChanged = false;
- installedItemsChanged = false;
+ installationStatus: any;
+ installationFinished: boolean;
+ page: string;
+ nextButton: string;
+ installationRunning: boolean;
- installationStatus: any;
- installationFinished: boolean;
- page: string;
- nextButton: string;
- installationRunning: boolean;
+ installAsPublicElement = true;
- installAsPublicElement = true;
-
- constructor(private dialogRef: DialogRef<EndpointInstallationComponent>,
- private pipelineElementEndpointService: PipelineElementEndpointService) {
- this.installationStatus = [];
- this.installationFinished = false;
- this.page = 'preview';
- this.nextButton = 'Next';
- this.installationRunning = false;
- }
+ constructor(
+ private dialogRef: DialogRef<EndpointInstallationComponent>,
+ private pipelineElementEndpointService: PipelineElementEndpointService,
+ ) {
+ this.installationStatus = [];
+ this.installationFinished = false;
+ this.page = 'preview';
+ this.nextButton = 'Next';
+ this.installationRunning = false;
+ }
- close() {
- this.dialogRef.close(this.installedItemsChanged);
- }
+ close() {
+ this.dialogRef.close(this.installedItemsChanged);
+ }
- next() {
- if (this.page === 'installation') {
- this.close();
- } else {
- this.page = 'installation';
- this.initiateInstallation(this.endpointItemsToInstall[0], 0);
+ next() {
+ if (this.page === 'installation') {
+ this.close();
+ } else {
+ this.page = 'installation';
+ this.initiateInstallation(this.endpointItemsToInstall[0], 0);
+ }
}
- }
- initiateInstallation(endpointUri, index) {
- this.installationRunning = true;
- this.installationStatus.push({'name': endpointUri.name, 'id': index, 'status': 'waiting'});
- if (this.install) {
- this.installElement(endpointUri, index);
- } else {
- this.uninstallElement(endpointUri, index);
+ initiateInstallation(endpointUri, index) {
+ this.installationRunning = true;
+ this.installationStatus.push({
+ name: endpointUri.name,
+ id: index,
+ status: 'waiting',
+ });
+ if (this.install) {
+ this.installElement(endpointUri, index);
+ } else {
+ this.uninstallElement(endpointUri, index);
+ }
}
- }
- installElement(endpointUri, index) {
- endpointUri = encodeURIComponent(endpointUri.uri);
+ installElement(endpointUri, index) {
+ endpointUri = encodeURIComponent(endpointUri.uri);
- this.pipelineElementEndpointService.add(endpointUri, this.installAsPublicElement)
- .subscribe(data => {
- if (data.success) {
- this.installationStatus[index].status = 'success';
- } else {
- this.installationStatus[index].status = 'error';
- this.installationStatus[index].details = data.notifications[0].additionalInformation;
- }
- }, () => {
- this.installationStatus[index].status = 'error';
- })
- .add(() => {
- if (index < this.endpointItemsToInstall.length - 1) {
- index++;
- this.initiateInstallation(this.endpointItemsToInstall[index], index);
- } else {
- this.installedItemsChanged = true;
- this.nextButton = 'Close';
- this.installationRunning = false;
- }
- });
- }
+ this.pipelineElementEndpointService
+ .add(endpointUri, this.installAsPublicElement)
+ .subscribe(
+ data => {
+ if (data.success) {
+ this.installationStatus[index].status = 'success';
+ } else {
+ this.installationStatus[index].status = 'error';
+ this.installationStatus[index].details =
+ data.notifications[0].additionalInformation;
+ }
+ },
+ () => {
+ this.installationStatus[index].status = 'error';
+ },
+ )
+ .add(() => {
+ if (index < this.endpointItemsToInstall.length - 1) {
+ index++;
+ this.initiateInstallation(
+ this.endpointItemsToInstall[index],
+ index,
+ );
+ } else {
+ this.installedItemsChanged = true;
+ this.nextButton = 'Close';
+ this.installationRunning = false;
+ }
+ });
+ }
- uninstallElement(endpointUri, index) {
- this.pipelineElementEndpointService.del(endpointUri.elementId)
- .subscribe(data => {
- this.installationStatus[index].status = data.success ? 'success' : 'error';
- }, () => {
- this.installationStatus[index].status = 'error';
- })
- .add(() => {
- if (index < this.endpointItemsToInstall.length - 1) {
- index++;
- this.initiateInstallation(this.endpointItemsToInstall[index], index);
- } else {
- this.nextButton = 'Close';
- this.installationRunning = false;
- this.installedItemsChanged = true;
- }
- });
- }
+ uninstallElement(endpointUri, index) {
+ this.pipelineElementEndpointService
+ .del(endpointUri.elementId)
+ .subscribe(
+ data => {
+ this.installationStatus[index].status = data.success
+ ? 'success'
+ : 'error';
+ },
+ () => {
+ this.installationStatus[index].status = 'error';
+ },
+ )
+ .add(() => {
+ if (index < this.endpointItemsToInstall.length - 1) {
+ index++;
+ this.initiateInstallation(
+ this.endpointItemsToInstall[index],
+ index,
+ );
+ } else {
+ this.nextButton = 'Close';
+ this.installationRunning = false;
+ this.installedItemsChanged = true;
+ }
+ });
+ }
}
diff --git a/ui/src/app/add/filter/order-by.pipe.ts b/ui/src/app/add/filter/order-by.pipe.ts
index 28ab2ec7a..b73352efb 100644
--- a/ui/src/app/add/filter/order-by.pipe.ts
+++ b/ui/src/app/add/filter/order-by.pipe.ts
@@ -18,24 +18,25 @@
import { Pipe, PipeTransform } from '@angular/core';
-@Pipe({name: 'orderBy'})
+@Pipe({ name: 'orderBy' })
export class OrderByPipe implements PipeTransform {
-
- transform(value: any[], order = '', column: string = ''): any[] {
- if (!value || order === '' || !order) {
- return value;
- }
- if (value.length <= 1) {
- return value;
- }
- if (!column || column === '') {
- if (order === 'asc') {
- return value.sort();
- } else {
- return value.sort().reverse();
- }
+ transform(value: any[], order = '', column: string = ''): any[] {
+ if (!value || order === '' || !order) {
+ return value;
+ }
+ if (value.length <= 1) {
+ return value;
+ }
+ if (!column || column === '') {
+ if (order === 'asc') {
+ return value.sort();
+ } else {
+ return value.sort().reverse();
+ }
+ }
+ const sortedValues = value.sort((a, b) =>
+ a[column].localeCompare(b[column]),
+ );
+ return order === 'asc' ? sortedValues : sortedValues.reverse();
}
- const sortedValues = value.sort((a, b) => a[column].localeCompare(b[column]));
- return order === 'asc' ? sortedValues : sortedValues.reverse();
- }
}
diff --git a/ui/src/app/add/filter/pipeline-element-installation-status.pipe.ts b/ui/src/app/add/filter/pipeline-element-installation-status.pipe.ts
index ad029b477..3c88f5c56 100644
--- a/ui/src/app/add/filter/pipeline-element-installation-status.pipe.ts
+++ b/ui/src/app/add/filter/pipeline-element-installation-status.pipe.ts
@@ -19,17 +19,16 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
- name: 'pipelineElementInstallationStatusFilter',
- pure: false
+ name: 'pipelineElementInstallationStatusFilter',
+ pure: false,
})
export class PipelineElementInstallationStatusFilter implements PipeTransform {
-
- transform(values: any[], filterTerm: string): any[] {
- if (filterTerm === 'all') {
- return values;
- } else {
- const installed = filterTerm === 'installed';
- return values.filter(v => v.installed === installed);
+ transform(values: any[], filterTerm: string): any[] {
+ if (filterTerm === 'all') {
+ return values;
+ } else {
+ const installed = filterTerm === 'installed';
+ return values.filter(v => v.installed === installed);
+ }
}
- }
}
diff --git a/ui/src/app/add/filter/pipeline-element-name.pipe.ts b/ui/src/app/add/filter/pipeline-element-name.pipe.ts
index d11f6301c..5a650aa20 100644
--- a/ui/src/app/add/filter/pipeline-element-name.pipe.ts
+++ b/ui/src/app/add/filter/pipeline-element-name.pipe.ts
@@ -19,16 +19,17 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
- name: 'pipelineElementNameFilter',
- pure: false
+ name: 'pipelineElementNameFilter',
+ pure: false,
})
export class PipelineElementNameFilter implements PipeTransform {
-
- transform(values: any[], filterTerm: string): any[] {
- if (filterTerm === '') {
- return values;
- } else {
- return values.filter(v => v.name.toLowerCase().includes(filterTerm.toLowerCase()));
+ transform(values: any[], filterTerm: string): any[] {
+ if (filterTerm === '') {
+ return values;
+ } else {
+ return values.filter(v =>
+ v.name.toLowerCase().includes(filterTerm.toLowerCase()),
+ );
+ }
}
- }
}
diff --git a/ui/src/app/add/filter/pipeline-element-type.pipe.ts b/ui/src/app/add/filter/pipeline-element-type.pipe.ts
index d305c5b9b..98ecf9bea 100644
--- a/ui/src/app/add/filter/pipeline-element-type.pipe.ts
+++ b/ui/src/app/add/filter/pipeline-element-type.pipe.ts
@@ -19,16 +19,15 @@
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
- name: 'pipelineElementTypeFilter',
- pure: false
+ name: 'pipelineElementTypeFilter',
+ pure: false,
})
export class PipelineElementTypeFilter implements PipeTransform {
-
- transform(value: any[], type: string): any[] {
- if (type === 'all') {
- return value;
- } else {
- return value.filter(v => v.type === type);
+ transform(value: any[], type: string): any[] {
+ if (type === 'all') {
+ return value;
+ } else {
+ return value.filter(v => v.type === type);
+ }
}
- }
}
diff --git a/ui/src/app/add/services/add.service.ts b/ui/src/app/add/services/add.service.ts
index cfebaca4e..225db527e 100644
--- a/ui/src/app/add/services/add.service.ts
+++ b/ui/src/app/add/services/add.service.ts
@@ -18,40 +18,62 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
-import { PlatformServicesCommons, ExtensionsServiceEndpointItem } from '@streampipes/platform-services';
+import {
+ PlatformServicesCommons,
+ ExtensionsServiceEndpointItem,
+} from '@streampipes/platform-services';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
@Injectable()
export class AddService {
+ constructor(
+ private http: HttpClient,
+ private platformServicesCommons: PlatformServicesCommons,
+ ) {}
- constructor(private http: HttpClient,
- private platformServicesCommons: PlatformServicesCommons) {
- }
+ getRdfEndpoints(): Observable<any> {
+ return this.http.get(
+ this.platformServicesCommons.apiBasePath + '/rdfendpoints',
+ );
+ }
- getRdfEndpoints(): Observable<any> {
- return this.http.get(this.platformServicesCommons.apiBasePath + '/rdfendpoints');
- }
+ getRdfEndpointItems(): Observable<ExtensionsServiceEndpointItem[]> {
+ return this.http
+ .get(
+ this.platformServicesCommons.apiBasePath +
+ '/rdfendpoints/items',
+ )
+ .pipe(
+ map(response => {
+ return (response as any[]).map(item =>
+ ExtensionsServiceEndpointItem.fromData(item),
+ );
+ }),
+ );
+ }
- getRdfEndpointItems(): Observable<ExtensionsServiceEndpointItem[]> {
- return this
- .http
- .get(this.platformServicesCommons.apiBasePath + '/rdfendpoints/items')
- .pipe(map(response => {
- return (response as any[]).map(item => ExtensionsServiceEndpointItem.fromData(item));
- }));
- }
+ addRdfEndpoint(rdfEndpoint): Observable<any> {
+ return this.http.post(
+ this.platformServicesCommons.apiBasePath + '/rdfendpoints',
+ rdfEndpoint,
+ );
+ }
- addRdfEndpoint(rdfEndpoint): Observable<any> {
- return this.http.post(this.platformServicesCommons.apiBasePath + '/rdfendpoints', rdfEndpoint);
- }
+ removeRdfEndpoint(rdfEndpointId): Observable<any> {
+ return this.http.delete(
+ this.platformServicesCommons.apiBasePath +
+ '/rdfendpoints/' +
+ rdfEndpointId,
+ );
+ }
- removeRdfEndpoint(rdfEndpointId): Observable<any> {
- return this.http.delete(this.platformServicesCommons.apiBasePath + '/rdfendpoints/' + rdfEndpointId);
- }
-
- getRdfEndpointIcon(item: ExtensionsServiceEndpointItem): Observable<any> {
- return this.http.post(this.platformServicesCommons.apiBasePath
- + '/rdfendpoints/items/icon', item, {responseType: 'blob'});
- }
+ getRdfEndpointIcon(item: ExtensionsServiceEndpointItem): Observable<any> {
+ return this.http.post(
+ this.platformServicesCommons.apiBasePath +
+ '/rdfendpoints/items/icon',
+ item,
+ { responseType: 'blob' },
+ );
+ }
}