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 2021/06/14 09:53:26 UTC

[incubator-streampipes] 01/02: Remove format form component

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

zehnder pushed a commit to branch STREAMPIPES-380
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 4e49be0c0d688fe465a040306db6dafc5ccd9d6e
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Sat Jun 12 15:09:29 2021 +0200

    Remove format form component
---
 .../format-form/format-form.component.css          | 22 ------
 .../format-form/format-form.component.html         | 26 -------
 .../format-form/format-form.component.ts           | 79 ----------------------
 .../format-item.component.css}                     |  0
 .../format-item.component.html}                    |  0
 .../format-item.component.ts}                      |  8 +--
 .../format-list.component.html                     |  4 +-
 .../format-list-component/format-list.component.ts |  5 +-
 .../new-adapter/new-adapter.component.html         | 10 +--
 ui/src/app/connect/connect.module.ts               |  7 +-
 10 files changed, 16 insertions(+), 145 deletions(-)

diff --git a/ui/src/app/connect/components/format-form/format-form.component.css b/ui/src/app/connect/components/format-form/format-form.component.css
deleted file mode 100644
index bfd6d7f..0000000
--- a/ui/src/app/connect/components/format-form/format-form.component.css
+++ /dev/null
@@ -1,22 +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.
- *
- */
-
-.fullWidth {
-  width: 100%;
-  height: 100%;
-}
\ No newline at end of file
diff --git a/ui/src/app/connect/components/format-form/format-form.component.html b/ui/src/app/connect/components/format-form/format-form.component.html
deleted file mode 100644
index dfb6922..0000000
--- a/ui/src/app/connect/components/format-form/format-form.component.html
+++ /dev/null
@@ -1,26 +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.
-  ~
-  -->
-
-<sp-format-list
-        [allFormats]="allFormats"
-        [selectedFormat]="selectedFormat"
-        (selectedFormatEmitter)="formatSelected($event)"
-        (validateEmitter)="validateAll($event)">
-</sp-format-list>
-
-
diff --git a/ui/src/app/connect/components/format-form/format-form.component.ts b/ui/src/app/connect/components/format-form/format-form.component.ts
deleted file mode 100644
index 6cea4ea..0000000
--- a/ui/src/app/connect/components/format-form/format-form.component.ts
+++ /dev/null
@@ -1,79 +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, EventEmitter, Input, OnInit, Output } from '@angular/core';
-import { FormatDescription } from '../../../core-model/gen/streampipes-model';
-
-@Component({
-    selector: 'sp-format-form',
-    templateUrl: './format-form.component.html',
-    styleUrls: ['./format-form.component.css']
-})
-export class FormatFormComponent implements OnInit {
-
-    @Input() selectedFormat: FormatDescription;
-
-    @Output() selectedFormatChange = new EventEmitter<FormatDescription>();
-    @Output() inputValueChanged = new EventEmitter<boolean>();
-    @Output() selectedFormatEmitter = new EventEmitter();
-    @Input() allFormats: FormatDescription[];
-
-    showStaticProperty: boolean[] = [false]
-    hasInput: boolean[] = [false];
-
-    constructor() {
-    }
-
-    isSelected(f: FormatDescription): boolean {
-        if (this.selectedFormat === undefined) {
-            return false;
-        } else {
-            this.selectedFormatChange.emit(this.selectedFormat);
-            return f.name === this.selectedFormat.name;
-        }
-    }
-
-    ngOnInit() {
-        const selectedFormat = this.selectedFormat;
-
-        setTimeout(() => {
-            for (var i = 0; i < this.allFormats.length ; i++) {
-                if (selectedFormat && this.allFormats[i].name === selectedFormat.name) {
-                    this.showStaticProperty.push(true);
-                    this.hasInput.push(true);
-                } else {
-                    this.showStaticProperty.push(false);
-                    this.hasInput.push(false);
-                }
-
-            }
-        }, 30);
-
-    }
-
-    validateAll(allValid) {
-        this.inputValueChanged.emit(allValid);
-    }
-
-    formatSelected(selectedFormat) {
-        this.selectedFormat = selectedFormat;
-        this.selectedFormatEmitter.emit(this.selectedFormat)
-
-    }
-
-}
diff --git a/ui/src/app/connect/components/format-component/format.component.css b/ui/src/app/connect/components/format-item/format-item.component.css
similarity index 100%
rename from ui/src/app/connect/components/format-component/format.component.css
rename to ui/src/app/connect/components/format-item/format-item.component.css
diff --git a/ui/src/app/connect/components/format-component/format.component.html b/ui/src/app/connect/components/format-item/format-item.component.html
similarity index 100%
rename from ui/src/app/connect/components/format-component/format.component.html
rename to ui/src/app/connect/components/format-item/format-item.component.html
diff --git a/ui/src/app/connect/components/format-component/format.component.ts b/ui/src/app/connect/components/format-item/format-item.component.ts
similarity index 93%
rename from ui/src/app/connect/components/format-component/format.component.ts
rename to ui/src/app/connect/components/format-item/format-item.component.ts
index 47e7716..6d3e793 100644
--- a/ui/src/app/connect/components/format-component/format.component.ts
+++ b/ui/src/app/connect/components/format-item/format-item.component.ts
@@ -21,11 +21,11 @@ import { ShepherdService } from '../../../services/tour/shepherd.service';
 import { FormatDescription } from '../../../core-model/gen/streampipes-model';
 
 @Component({
-  selector: 'sp-format',
-  templateUrl: './format.component.html',
-  styleUrls: ['./format.component.css'],
+  selector: 'sp-format-item',
+  templateUrl: './format-item.component.html',
+  styleUrls: ['./format-item.component.css'],
 })
-export class FormatComponent {
+export class FormatItemComponent {
   @Input()
   format: FormatDescription;
   @Input()
diff --git a/ui/src/app/connect/components/format-list-component/format-list.component.html b/ui/src/app/connect/components/format-list-component/format-list.component.html
index a7d441b..d1e731d 100644
--- a/ui/src/app/connect/components/format-list-component/format-list.component.html
+++ b/ui/src/app/connect/components/format-list-component/format-list.component.html
@@ -18,10 +18,10 @@
 
 <div fxLayout="row wrap" fxLayoutAlign="start stretch">
     <div fxFlex="33" *ngFor="let format of allFormats">
-        <sp-format [format]="format" (validateEmitter)="validateAll($event)"
+        <sp-format-item [format]="format" (validateEmitter)="validateAll($event)"
         (editableEmitter)="formatEditable($event)"
         [selectedFormat]="selectedFormat"
         (selectedFormatEmitter)="formatSelected($event)">
-        </sp-format>
+        </sp-format-item>
     </div>
 </div>
\ No newline at end of file
diff --git a/ui/src/app/connect/components/format-list-component/format-list.component.ts b/ui/src/app/connect/components/format-list-component/format-list.component.ts
index 6ad0c35..4bd9a9a 100644
--- a/ui/src/app/connect/components/format-list-component/format-list.component.ts
+++ b/ui/src/app/connect/components/format-list-component/format-list.component.ts
@@ -27,10 +27,11 @@ import { FormatDescription } from '../../../core-model/gen/streampipes-model';
 
 export class FormatListComponent {
 
-    @Input() selectedFormat: FormatDescription;
+    @Input() public selectedFormat: FormatDescription;
     @Input() allFormats: FormatDescription[];
+
     @Output() validateEmitter = new EventEmitter();
-    @Output() selectedFormatEmitter = new EventEmitter();
+    @Output() public selectedFormatEmitter = new EventEmitter<FormatDescription>();
 
     constructor() {
     }
diff --git a/ui/src/app/connect/components/new-adapter/new-adapter.component.html b/ui/src/app/connect/components/new-adapter/new-adapter.component.html
index 4be9978..ab2c340 100644
--- a/ui/src/app/connect/components/new-adapter/new-adapter.component.html
+++ b/ui/src/app/connect/components/new-adapter/new-adapter.component.html
@@ -97,11 +97,11 @@
                         <h4>Select format</h4>
                     </div>
                     <div class="sp-blue-border padding">
-                        <sp-format-form fxFlex="100"
-                                         (selectedFormatEmitter)="formatSelected($event)"
-                                         [(selectedFormat)]="adapter.formatDescription"
-                                         [allFormats]="allFormats">
-                        </sp-format-form>
+                        <sp-format-list fxFlex="100"
+                                        [allFormats]="allFormats"
+                                        (selectedFormatEmitter)="formatSelected($event)"
+                                        [selectedFormat]="adapter.formatDescription">
+                        </sp-format-list>
                     </div>
 
                     <div class="assemblyOptions sp-blue-bg">
diff --git a/ui/src/app/connect/connect.module.ts b/ui/src/app/connect/connect.module.ts
index d27eb0d..14a0299 100644
--- a/ui/src/app/connect/connect.module.ts
+++ b/ui/src/app/connect/connect.module.ts
@@ -27,8 +27,6 @@ import {MatProgressSpinnerModule} from '@angular/material/progress-spinner';
 import {ConnectComponent} from './connect.component';
 import {NewAdapterComponent} from './components/new-adapter/new-adapter.component';
 
-import {FormatFormComponent} from './components/format-form/format-form.component';
-
 import {EditEventPropertyPrimitiveComponent} from './dialog/edit-event-property/components/edit-event-property-primitive/edit-event-property-primitive.component';
 import {EventSchemaComponent} from './components/schema-editor/event-schema/event-schema.component';
 
@@ -46,7 +44,7 @@ import {ConnectService} from './services/connect.service';
 import {AdapterDescriptionComponent} from './components/data-marketplace/adapter-description/adapter-description.component';
 import {DataMarketplaceComponent} from './components/data-marketplace/data-marketplace.component';
 import {DataMarketplaceService} from './services/data-marketplace.service';
-import {FormatComponent} from './components/format-component/format.component';
+import {FormatItemComponent} from './components/format-item/format-item.component';
 import {FormatListComponent} from './components/format-list-component/format-list.component';
 import {IconService} from './services/icon.service';
 import {UnitProviderService} from './services/unit-provider.service';
@@ -110,8 +108,7 @@ import {ExistingAdaptersComponent} from "./components/data-marketplace/existing-
         EventSchemaPreviewComponent,
         ExistingAdaptersComponent,
         FilterPipe,
-        FormatComponent,
-        FormatFormComponent,
+        FormatItemComponent,
         FormatListComponent,
         NewAdapterComponent,
         PipelineElementRuntimeInfoComponent,