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

[incubator-streampipes] branch STREAMPIPES-145 updated: [STREAMPIPES-145] Migrate tutorial dialog

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

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


The following commit(s) were added to refs/heads/STREAMPIPES-145 by this push:
     new 145fbda  [STREAMPIPES-145] Migrate tutorial dialog
145fbda is described below

commit 145fbda4f7248d34e73348c903ee076296de6cf4
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Tue Jun 16 12:48:45 2020 +0200

    [STREAMPIPES-145] Migrate tutorial dialog
---
 .../missing-elements-for-tutorial.component.html   | 37 ++++++++++++++++++++
 .../missing-elements-for-tutorial.component.scss   | 19 ++++++++++
 .../missing-elements-for-tutorial.component.ts     | 40 ++++++++++++++++++++++
 ui/src/app/editor-v2/editor.component.ts           | 17 ++++++---
 ui/src/app/editor-v2/editor.module.ts              |  2 ++
 5 files changed, 110 insertions(+), 5 deletions(-)

diff --git a/ui/src/app/editor-v2/dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component.html b/ui/src/app/editor-v2/dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component.html
new file mode 100644
index 0000000..c80e76c
--- /dev/null
+++ b/ui/src/app/editor-v2/dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component.html
@@ -0,0 +1,37 @@
+<!--
+  ~ 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 class="sp-dialog-container">
+    <div class="sp-dialog-content p-15">
+        <div fxFlex="100" fxLayout="column">
+            <div fxFlex="100" fxLayout="column">
+                <h4>The tutorial requires pipeline elements that are not yet installed.</h4>
+                <h5>Install the following pipeline elements and start the tutorial again:</h5>
+                <div *ngFor="let missingElement of missingElementsForTutorial">
+                    <li><b>{{missingElement.name}}</b> <i>({{missingElement.appId}})</i></li>
+                </div>
+            </div>
+        </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()">
+            Close
+        </button>
+    </div>
+</div>
\ No newline at end of file
diff --git a/ui/src/app/editor-v2/dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component.scss b/ui/src/app/editor-v2/dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component.scss
new file mode 100644
index 0000000..0a776e5
--- /dev/null
+++ b/ui/src/app/editor-v2/dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component.scss
@@ -0,0 +1,19 @@
+/*
+ * 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 '../../../../scss/sp/sp-dialog.scss';
\ No newline at end of file
diff --git a/ui/src/app/editor-v2/dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component.ts b/ui/src/app/editor-v2/dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component.ts
new file mode 100644
index 0000000..ffe176c
--- /dev/null
+++ b/ui/src/app/editor-v2/dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component.ts
@@ -0,0 +1,40 @@
+/*
+ * 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, Input} from "@angular/core";
+import {DialogRef} from "../../../core-ui/dialog/base-dialog/dialog-ref";
+
+@Component({
+  selector: 'missing-elements-for-tutorial',
+  templateUrl: './missing-elements-for-tutorial.component.html',
+  styleUrls: ['./missing-elements-for-tutorial.component.scss']
+})
+export class MissingElementsForTutorialComponent {
+
+
+  @Input()
+  missingElementsForTutorial: any[];
+
+  constructor(private DialogRef: DialogRef<MissingElementsForTutorialComponent>) {
+
+  }
+
+  close() {
+    this.DialogRef.close();
+  };
+}
\ No newline at end of file
diff --git a/ui/src/app/editor-v2/editor.component.ts b/ui/src/app/editor-v2/editor.component.ts
index bb52f53..04e09f3 100644
--- a/ui/src/app/editor-v2/editor.component.ts
+++ b/ui/src/app/editor-v2/editor.component.ts
@@ -36,6 +36,7 @@ import {AuthStatusService} from "../services/auth-status.service";
 import {PanelType} from "../core-ui/dialog/base-dialog/base-dialog.model";
 import {WelcomeTourComponent} from "./dialog/welcome-tour/welcome-tour.component";
 import {DialogService} from "../core-ui/dialog/base-dialog/base-dialog.service";
+import {MissingElementsForTutorialComponent} from "./dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component";
 
 @Component({
     selector: 'editor',
@@ -182,13 +183,19 @@ export class EditorComponent implements OnInit {
                 this.missingElementsForTutorial.push({"name" : "Flow Rate 1", "appId" : this.requiredStreamForTutorialAppId });
             }
             if (!this.requiredProcessorForTourPresent()) {
-                this.missingElementsForTutorial.push({"name" : "Field Hasher", "appId" : this.requiredProcessorForTutorialAppId});
+                this.missingElementsForTutorial.push({"name" : "Numerical Filter", "appId" : this.requiredProcessorForTutorialAppId});
             }
             if (!this.requiredSinkForTourPresent()) {
                 this.missingElementsForTutorial.push({"name" : "Dashboard Sink", "appId" : this.requiredSinkForTutorialAppId});
             }
 
-            //this.EditorDialogManager.showMissingElementsForTutorialDialog(this.missingElementsForTutorial);
+            this.dialogService.open(MissingElementsForTutorialComponent, {
+                panelType: PanelType.STANDARD_PANEL,
+                title: "Tutorial requires pipeline elements",
+                data: {
+                    "missingElementsForTutorial": this.missingElementsForTutorial
+                }
+            });
         }
     }
 
@@ -199,17 +206,17 @@ export class EditorComponent implements OnInit {
     }
 
     requiredStreamForTourPresent() {
-        return this.requiredPeForTourPresent(this.allElements["stream"],
+        return this.requiredPeForTourPresent(this.allElements,
             this.requiredStreamForTutorialAppId);
     }
 
     requiredProcessorForTourPresent() {
-        return this.requiredPeForTourPresent(this.allElements["sepa"],
+        return this.requiredPeForTourPresent(this.allElements,
             this.requiredProcessorForTutorialAppId);
     }
 
     requiredSinkForTourPresent() {
-        return this.requiredPeForTourPresent(this.allElements["action"],
+        return this.requiredPeForTourPresent(this.allElements,
             this.requiredSinkForTutorialAppId);
     }
 
diff --git a/ui/src/app/editor-v2/editor.module.ts b/ui/src/app/editor-v2/editor.module.ts
index 353010d..21d5964 100644
--- a/ui/src/app/editor-v2/editor.module.ts
+++ b/ui/src/app/editor-v2/editor.module.ts
@@ -55,6 +55,7 @@ import {ShowdownModule} from 'ngx-showdown';
 import {SafeCss} from "./utils/style-sanitizer";
 import {MatchingErrorComponent} from "./dialog/matching-error/matching-error.component";
 import {WelcomeTourComponent} from "./dialog/welcome-tour/welcome-tour.component";
+import {MissingElementsForTutorialComponent} from "./dialog/missing-elements-for-tutorial/missing-elements-for-tutorial.component";
 
 @NgModule({
     imports: [
@@ -78,6 +79,7 @@ import {WelcomeTourComponent} from "./dialog/welcome-tour/welcome-tour.component
         EditorComponent,
         HelpComponent,
         MatchingErrorComponent,
+        MissingElementsForTutorialComponent,
         PipelineAssemblyComponent,
         PipelineElementComponent,
         PipelineElementDocumentationComponent,