You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2020/09/13 17:01:56 UTC
[incubator-streampipes] branch rel/0.67.0 updated: Remove unused
dashboard widget
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch rel/0.67.0
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
The following commit(s) were added to refs/heads/rel/0.67.0 by this push:
new 1602d16 Remove unused dashboard widget
1602d16 is described below
commit 1602d161c31087da3694362c5dd5a26d3501183c
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Sun Sep 13 19:01:08 2020 +0200
Remove unused dashboard widget
---
.../components/widgets/pallet/pallet-config.ts | 43 ------------
.../components/widgets/pallet/pallet.component.css | 16 -----
.../widgets/pallet/pallet.component.html | 18 -----
.../components/widgets/pallet/pallet.component.ts | 78 --------------------
.../components/widgets/pallet/pallet_functions.ts | 82 ----------------------
ui/src/app/dashboard/dashboard.module.ts | 78 ++++++++++----------
ui/src/app/dashboard/registry/widget-registry.ts | 6 +-
7 files changed, 40 insertions(+), 281 deletions(-)
diff --git a/ui/src/app/dashboard/components/widgets/pallet/pallet-config.ts b/ui/src/app/dashboard/components/widgets/pallet/pallet-config.ts
deleted file mode 100644
index d3e3e22..0000000
--- a/ui/src/app/dashboard/components/widgets/pallet/pallet-config.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- *
- */
-
-import { WidgetConfigBuilder } from '../../../registry/widget-config-builder';
-import { EpRequirements } from '../../../sdk/ep-requirements';
-import { SchemaRequirementsBuilder } from '../../../sdk/schema-requirements-builder';
-import { WidgetConfig } from '../base/base-config';
-import {DashboardWidgetSettings} from "../../../../core-model/gen/streampipes-model";
-
-export class PalletConfig extends WidgetConfig {
-
- static readonly NUMBER_MAPPING_KEY: string = 'number-mapping';
-
- constructor() {
- super();
- }
-
- getConfig(): DashboardWidgetSettings {
- return WidgetConfigBuilder.createWithSelectableColorsAndTitlePanel('pallet', 'Pallet')
- .withDescription('Displays the data in the form of pallet')
- .requiredSchema(SchemaRequirementsBuilder
- .create()
- .requiredPropertyWithUnaryMapping(PalletConfig.NUMBER_MAPPING_KEY, 'Select property', '', EpRequirements.anyProperty())
- .build())
- .build();
- }
-
-}
diff --git a/ui/src/app/dashboard/components/widgets/pallet/pallet.component.css b/ui/src/app/dashboard/components/widgets/pallet/pallet.component.css
deleted file mode 100644
index 690bfd1..0000000
--- a/ui/src/app/dashboard/components/widgets/pallet/pallet.component.css
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * 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.
- */
\ No newline at end of file
diff --git a/ui/src/app/dashboard/components/widgets/pallet/pallet.component.html b/ui/src/app/dashboard/components/widgets/pallet/pallet.component.html
deleted file mode 100644
index e189369..0000000
--- a/ui/src/app/dashboard/components/widgets/pallet/pallet.component.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!--
- ~ 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.
- -->
-
-<div style="float: left; width: 640; height: 480; border:1px solid black;" id="canvas"></div>
diff --git a/ui/src/app/dashboard/components/widgets/pallet/pallet.component.ts b/ui/src/app/dashboard/components/widgets/pallet/pallet.component.ts
deleted file mode 100644
index 3a7d525..0000000
--- a/ui/src/app/dashboard/components/widgets/pallet/pallet.component.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.
- */
-
-import { Component, OnDestroy, OnInit } from '@angular/core';
-
-import { RxStompService } from '@stomp/ng2-stompjs';
-import { StaticPropertyExtractor } from '../../../sdk/extractor/static-property-extractor';
-import { DashboardService } from '../../../services/dashboard.service';
-import { ResizeService } from '../../../services/resize.service';
-import { BaseStreamPipesWidget } from '../base/base-widget';
-import { NumberConfig } from '../number/number-config';
-import { add_items, intialize_default } from './pallet_functions';
-
-declare function convert(packing_plan): any;
-declare function render_on_canvas(canvas_id, viewpoint, options_pref, boxes, pallet): any;
-declare function scale_pallet(x, y, z): any;
-
-
-
-@Component({
- selector: 'sp-pallet',
- templateUrl: './pallet.component.html',
- styleUrls: ['./pallet.component.css']
-})
-
-export class PalletComponent extends BaseStreamPipesWidget implements OnInit, OnDestroy {
-
- selectedProperty: string;
-
- constructor(rxStompService: RxStompService, dashboardService: DashboardService, resizeService: ResizeService) {
- super(rxStompService, dashboardService, resizeService, false);
- }
-
- pallet;
-
- ngOnInit(): void {
- super.ngOnInit();
- const data = intialize_default();
- const boxes = convert(data);
- this.pallet = scale_pallet(data.bin.size.width, data.bin.size.width / 8, data.bin.size.depth);
- render_on_canvas('canvas', 'rotate', {width: 640, height: 480}, boxes, this.pallet);
- }
-
- ngOnDestroy(): void {
- super.ngOnDestroy();
- }
-
- extractConfig(extractor: StaticPropertyExtractor) {
- this.selectedProperty = extractor.mappingPropertyValue(NumberConfig.NUMBER_MAPPING_KEY);
- }
-
- protected onEvent(event: any) {
-
- let data = intialize_default();
-
- data = add_items(data, event['pallet']);
- const boxes = convert(data);
- render_on_canvas('canvas', 'rotate', {width: 640, height: 480}, boxes, this.pallet);
- }
-
- protected onSizeChanged(width: number, height: number) {
- }
-
-}
diff --git a/ui/src/app/dashboard/components/widgets/pallet/pallet_functions.ts b/ui/src/app/dashboard/components/widgets/pallet/pallet_functions.ts
deleted file mode 100644
index e32cd3f..0000000
--- a/ui/src/app/dashboard/components/widgets/pallet/pallet_functions.ts
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-
-export function modify_bin(data_body, name, depth, height, width) {
- if (name != null) {
- data_body.name = name;
- }
- if (depth != null) {
- data_body.size.depth = depth;
- }
- if (height != null) {
- data_body.size.height = height;
- }
- if (width != null) {
- data_body.size.width = width;
- }
- return data_body;
-}
-
-export function add_items(data_body, items) {
- data_body.items = items;
- return data_body;
-}
-
-export function remove_item(data_body, item) {
- const index = data_body.items.indexOf(item);
- if (index > -1) {
- data_body.items.splice(index, 1);
- }
- return data_body;
-}
-
-export function create_item(index, name, position_x, position_y, position_z, depth, height, width, type) {
- const item = {
- 'index': index,
- 'name': name,
- 'position': {
- 'x': position_x,
- 'y': position_y,
- 'z': position_z
- },
- 'size': {
- 'depth': depth,
- 'height': height,
- 'width': width
- },
- 'type': type
- };
- return item;
-}
-
-export function intialize_default() {
- const renderer_data_body = {
- 'bin': {
- 'name': 'euro_pallet',
- 'size': {
- 'depth': 80,
- 'height': 300,
- 'width': 120
-
- }
- },
- 'items': [],
-
- 'timestamp': new Date
- };
- return renderer_data_body;
-}
diff --git a/ui/src/app/dashboard/dashboard.module.ts b/ui/src/app/dashboard/dashboard.module.ts
index e06def9..e483ae3 100644
--- a/ui/src/app/dashboard/dashboard.module.ts
+++ b/ui/src/app/dashboard/dashboard.module.ts
@@ -16,44 +16,43 @@
*
*/
-import {NgModule} from '@angular/core';
-import {CommonModule} from '@angular/common';
-import {FlexLayoutModule} from '@angular/flex-layout';
-import {GridsterModule} from 'angular-gridster2';
-import {DashboardComponent} from './dashboard.component';
-import {DashboardPanelComponent} from "./components/panel/dashboard-panel.component";
-import {MatTabsModule} from "@angular/material/tabs";
-import {DashboardWidgetComponent} from "./components/widget/dashboard-widget.component";
-import {CustomMaterialModule} from "../CustomMaterial/custom-material.module";
-import {FormsModule} from "@angular/forms";
-import {ColorPickerModule} from "ngx-color-picker";
-import {AddVisualizationDialogComponent} from "./dialogs/add-widget/add-visualization-dialog.component";
-import {MatGridListModule} from "@angular/material/grid-list";
-import {DashboardService} from "./services/dashboard.service";
-import {NumberWidgetComponent} from "./components/widgets/number/number-widget.component";
-import {streamPipesStompConfig} from "./services/websocket.config";
-import {InjectableRxStompConfig, RxStompService, rxStompServiceFactory} from "@stomp/ng2-stompjs";
-import {DashboardOverviewComponent} from "./components/overview/dashboard-overview.component";
-import {EditDashboardDialogComponent} from "./dialogs/edit-dashboard/edit-dashboard-dialog.component";
-import {DashboardGridComponent} from "./components/grid/dashboard-grid.component";
-import {LineWidgetComponent} from "./components/widgets/line/line-widget.component";
-import {NgxChartsModule} from "@swimlane/ngx-charts";
-import {ResizeService} from "./services/resize.service";
-import {TableWidgetComponent} from "./components/widgets/table/table-widget.component";
-import {CdkTableModule} from "@angular/cdk/table";
-import {RefreshDashboardService} from "./services/refresh-dashboard.service";
-import {SemanticTypeUtilsService} from '../core-services/semantic-type/semantic-type-utils.service';
-import {GaugeWidgetComponent} from "./components/widgets/gauge/gauge-widget.component";
-import {PalletComponent} from "./components/widgets/pallet/pallet.component";
-import {ImageWidgetComponent} from "./components/widgets/image/image-widget.component";
-import {AreaWidgetComponent} from "./components/widgets/area/area-widget.component";
-import {MapWidgetComponent} from "./components/widgets/map/map-widget.component";
-import {LeafletModule} from "@asymmetrik/ngx-leaflet";
-import {RawWidgetComponent} from "./components/widgets/raw/raw-widget.component";
-import {HtmlWidgetComponent} from "./components/widgets/html/html-widget.component";
-import {TrafficLightWidgetComponent} from "./components/widgets/trafficlight/traffic-light-widget.component";
-import {StandaloneDashboardComponent} from "./components/standalone/standalone-dashboard.component";
-import {CoreUiModule} from "../core-ui/core-ui.module";
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FlexLayoutModule } from '@angular/flex-layout';
+import { GridsterModule } from 'angular-gridster2';
+import { DashboardComponent } from './dashboard.component';
+import { DashboardPanelComponent } from './components/panel/dashboard-panel.component';
+import { MatTabsModule } from '@angular/material/tabs';
+import { DashboardWidgetComponent } from './components/widget/dashboard-widget.component';
+import { CustomMaterialModule } from '../CustomMaterial/custom-material.module';
+import { FormsModule } from '@angular/forms';
+import { ColorPickerModule } from 'ngx-color-picker';
+import { AddVisualizationDialogComponent } from './dialogs/add-widget/add-visualization-dialog.component';
+import { MatGridListModule } from '@angular/material/grid-list';
+import { DashboardService } from './services/dashboard.service';
+import { NumberWidgetComponent } from './components/widgets/number/number-widget.component';
+import { streamPipesStompConfig } from './services/websocket.config';
+import { InjectableRxStompConfig, RxStompService, rxStompServiceFactory } from '@stomp/ng2-stompjs';
+import { DashboardOverviewComponent } from './components/overview/dashboard-overview.component';
+import { EditDashboardDialogComponent } from './dialogs/edit-dashboard/edit-dashboard-dialog.component';
+import { DashboardGridComponent } from './components/grid/dashboard-grid.component';
+import { LineWidgetComponent } from './components/widgets/line/line-widget.component';
+import { NgxChartsModule } from '@swimlane/ngx-charts';
+import { ResizeService } from './services/resize.service';
+import { TableWidgetComponent } from './components/widgets/table/table-widget.component';
+import { CdkTableModule } from '@angular/cdk/table';
+import { RefreshDashboardService } from './services/refresh-dashboard.service';
+import { SemanticTypeUtilsService } from '../core-services/semantic-type/semantic-type-utils.service';
+import { GaugeWidgetComponent } from './components/widgets/gauge/gauge-widget.component';
+import { ImageWidgetComponent } from './components/widgets/image/image-widget.component';
+import { AreaWidgetComponent } from './components/widgets/area/area-widget.component';
+import { MapWidgetComponent } from './components/widgets/map/map-widget.component';
+import { LeafletModule } from '@asymmetrik/ngx-leaflet';
+import { RawWidgetComponent } from './components/widgets/raw/raw-widget.component';
+import { HtmlWidgetComponent } from './components/widgets/html/html-widget.component';
+import { TrafficLightWidgetComponent } from './components/widgets/trafficlight/traffic-light-widget.component';
+import { StandaloneDashboardComponent } from './components/standalone/standalone-dashboard.component';
+import { CoreUiModule } from '../core-ui/core-ui.module';
@NgModule({
imports: [
@@ -83,7 +82,6 @@ import {CoreUiModule} from "../core-ui/core-ui.module";
NumberWidgetComponent,
TableWidgetComponent,
GaugeWidgetComponent,
- PalletComponent,
ImageWidgetComponent,
MapWidgetComponent,
RawWidgetComponent,
@@ -121,4 +119,4 @@ export class DashboardModule {
constructor() {
}
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/dashboard/registry/widget-registry.ts b/ui/src/app/dashboard/registry/widget-registry.ts
index 17fea83..1ee3c15 100644
--- a/ui/src/app/dashboard/registry/widget-registry.ts
+++ b/ui/src/app/dashboard/registry/widget-registry.ts
@@ -24,7 +24,6 @@ import { ImageConfig } from '../components/widgets/image/image-config';
import { LineConfig } from '../components/widgets/line/line-config';
import { MapConfig } from '../components/widgets/map/map-config';
import { NumberConfig } from '../components/widgets/number/number-config';
-import { PalletConfig } from '../components/widgets/pallet/pallet-config';
import { RawConfig } from '../components/widgets/raw/raw-config';
import { TableConfig } from '../components/widgets/table/table-config';
import { TrafficLightConfig } from '../components/widgets/trafficlight/traffic-light-config';
@@ -32,7 +31,7 @@ import { SchemaMatch } from '../sdk/matching/schema-match';
import {
DashboardWidgetSettings, EventSchema,
VisualizablePipeline
-} from "../../core-model/gen/streampipes-model";
+} from '../../core-model/gen/streampipes-model';
export class WidgetRegistry {
@@ -46,8 +45,7 @@ export class WidgetRegistry {
new MapConfig(),
new RawConfig(),
new HtmlConfig(),
- new TrafficLightConfig(),
- new PalletConfig()
+ new TrafficLightConfig()
];
static getAvailableWidgetTemplates(): DashboardWidgetSettings[] {