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/08/05 19:19:59 UTC

[incubator-streampipes] branch STREAMPIPES-145 updated: [STREAMPIPES-191] Remove MyElements view

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 e965177  [STREAMPIPES-191] Remove MyElements view
e965177 is described below

commit e965177004ed35827502d60d97dbc338628e5509
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Wed Aug 5 21:19:45 2020 +0200

    [STREAMPIPES-191] Remove MyElements view
---
 ui/deployment/dev/config.yml                       |   1 -
 ui/deployment/modules.yml                          |  14 --
 ui/deployment/rel/config.yml                       |   2 +-
 .../myelements/dialog/jsonldDialog.controller.ts   |  48 ----
 .../app/myelements/dialog/jsonldDialog.tmpl.html   |  43 ----
 ui/src/app/myelements/my-elements.controller.ts    | 250 ---------------------
 ui/src/app/myelements/my-elements.module.ts        |  25 ---
 ui/src/app/myelements/myelements.html              | 108 ---------
 8 files changed, 1 insertion(+), 490 deletions(-)

diff --git a/ui/deployment/dev/config.yml b/ui/deployment/dev/config.yml
index 9f2edef..ea0ca38 100644
--- a/ui/deployment/dev/config.yml
+++ b/ui/deployment/dev/config.yml
@@ -25,5 +25,4 @@ modules:
   - spDataExplorer
   - spAppOverview
   - spAdd
-  - spMyElements
   - spConfiguration
diff --git a/ui/deployment/modules.yml b/ui/deployment/modules.yml
index 80f36b5..d8cf60f 100644
--- a/ui/deployment/modules.yml
+++ b/ui/deployment/modules.yml
@@ -83,20 +83,6 @@ spAdd:
   icon: 'file:ic_cloud_download_24px'
   homeImage: '/assets/img/home/add.png'
   admin: True
-spMyElements:
-  ng5: False
-  ng1_templateUrl: '../myelements/myelements.html'
-  ng5_moduleName: ''
-  ng5_component: ''
-  ng5_componentPath: ''
-  path: './myelements/my-elements.module'
-  link: 'streampipes.myelements'
-  url: '/myelements'
-  title: 'My Elements'
-  description: 'My Elements'
-  icon: 'image:ic_portrait_24px'
-  homeImage: '/assets/img/home/myelements.png'
-  admin: True
 spConfiguration:
   ng5: True
   ng1_templateUrl: ''
diff --git a/ui/deployment/rel/config.yml b/ui/deployment/rel/config.yml
index 72dbae7..361f3cb 100644
--- a/ui/deployment/rel/config.yml
+++ b/ui/deployment/rel/config.yml
@@ -22,7 +22,7 @@ modules:
   - spPipelines
   - spConnect
   - spDashboard
+  - spDataExplorer
   - spAppOverview
   - spAdd
-  - spMyElements
   - spConfiguration
\ No newline at end of file
diff --git a/ui/src/app/myelements/dialog/jsonldDialog.controller.ts b/ui/src/app/myelements/dialog/jsonldDialog.controller.ts
deleted file mode 100644
index 808ac2b..0000000
--- a/ui/src/app/myelements/dialog/jsonldDialog.controller.ts
+++ /dev/null
@@ -1,48 +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 class JsonLdDialogController {
-
-    $mdDialog: any;
-    $timeout: any;
-    title: any;
-    content: any;
-    loadingCompleted: any;
-
-    constructor($mdDialog, $timeout, title, content) {
-        this.$mdDialog = $mdDialog;
-        this.$timeout = $timeout;
-        this.title = title;
-        this.content = content;
-    }
-
-    $onInit() {
-        this.$timeout(() => {
-            this.loadingCompleted = true;
-        });
-    }
-
-    hide() {
-        this.$mdDialog.hide();
-    };
-    cancel() {
-        this.$mdDialog.cancel();
-    };
-}
-
-JsonLdDialogController.$inject = ['$mdDialog', '$timeout', 'title', 'content'];
\ No newline at end of file
diff --git a/ui/src/app/myelements/dialog/jsonldDialog.tmpl.html b/ui/src/app/myelements/dialog/jsonldDialog.tmpl.html
deleted file mode 100644
index cd28a2a..0000000
--- a/ui/src/app/myelements/dialog/jsonldDialog.tmpl.html
+++ /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.
-  ~
-  -->
-
-<md-dialog aria-label="Pipeline Status">
-    <form>
-        <md-toolbar>
-            <div class="md-toolbar-tools">
-                <h2>{{ctrl.title}}</h2>
-                <span flex></span>
-                <md-button class="md-icon-button" ng-click="ctrl.cancel()">
-                    <md-icon md-svg-icon="navigation:ic_close_24px" aria-label="Close dialog"></md-icon>
-                </md-button>
-            </div>
-        </md-toolbar>
-        <md-dialog-content flex="100" class="md-dialog-content">
-            <div>
-                <pre nag-prism source="{{ctrl.content}}" class="language-json line-numbers"
-                     ng-if="ctrl.loadingCompleted"></pre>
-                <!--<pre pretty-json="content"></pre>-->
-            </div>
-        </md-dialog-content>
-        <md-dialog-actions layout="row">
-            <sp-button sp-button-gray ng-click="ctrl.hide()">
-                Close
-            </sp-button>
-        </md-dialog-actions>
-    </form>
-</md-dialog>
\ No newline at end of file
diff --git a/ui/src/app/myelements/my-elements.controller.ts b/ui/src/app/myelements/my-elements.controller.ts
deleted file mode 100644
index 8f49f22..0000000
--- a/ui/src/app/myelements/my-elements.controller.ts
+++ /dev/null
@@ -1,250 +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 * as angular from 'angular';
-
-import {JsonLdDialogController} from "./dialog/jsonldDialog.controller";
-
-declare const require: any;
-
-export class MyElementsCtrl {
-
-    RestApi: any;
-    $mdToast: any;
-    $mdDialog: any;
-    currentElements: any;
-    tabs: any;
-    currentTabType: any;
-    status: any;
-
-    constructor(RestApi, $mdToast, $mdDialog) {
-        this.RestApi = RestApi;
-        this.$mdToast = $mdToast;
-        this.$mdDialog = $mdDialog;
-        this.currentElements = [];
-        this.tabs = [
-            {
-                title: 'Data Sources',
-                type: 'source'
-            },
-            {
-                title: 'Data Processors',
-                type: 'sepa'
-            },
-            {
-                title: 'Data Sinks',
-                type: 'action'
-            }
-        ];
-        this.currentTabType = this.tabs[0].type;
-    }
-
-    getElementId(element) {
-        if (this.currentTabType === 'source') {
-            return element.elementId;
-        } else {
-            return element.belongsTo;
-        }
-    }
-
-    loadCurrentElements(type) {
-        if (type === 'source') {
-            this.loadOwnSources();
-        }
-        else if (type === 'sepa') {
-            this.loadOwnSepas();
-        }
-        else if (type === 'action') {
-            this.loadOwnActions();
-        }
-        this.currentTabType = type;
-    }
-
-    loadOwnActions() {
-        this.RestApi.getOwnActions()
-            .then(actions => {
-                this.currentElements = actions.data;
-            }, error => {
-                this.status = 'Unable to load actions: ' + error.message;
-            });
-    }
-
-    loadOwnSepas() {
-        this.RestApi.getOwnSepas()
-            .then(sepas => {
-                this.currentElements = sepas.data;
-            }, error => {
-                this.status = 'Unable to load sepas: ' + error.message;
-            });
-    }
-
-    loadOwnSources() {
-        this.RestApi.getOwnSources()
-            .then(sources => {
-                this.currentElements = sources.data;
-            }, error => {
-                this.status = 'Unable to load sepas: ' + error.message;
-            });
-    }
-
-    elementTextIcon(string) {
-        let result = "";
-        if (string.length <= 4) {
-            result = string;
-        } else {
-            let words = string.split(" ");
-            words.forEach((word, i) => {
-                result += word.charAt(0);
-            });
-        }
-        return result.toUpperCase();
-    }
-
-    toggleFavorite(element, type) {
-        if (type === 'action') this.toggleFavoriteAction(element, type);
-        else if (type === 'source') this.toggleFavoriteSource(element, type);
-        else if (type === 'sepa') this.toggleFavoriteSepa(element, type);
-    }
-
-    refresh(elementUri, type) {
-        this.RestApi.update(elementUri)
-            .then(msg => {
-                this.showToast(msg.data.notifications[0].title);
-            })
-            .then(() => {
-                this.loadCurrentElements(type);
-            });
-    }
-
-    remove(elementUri, type) {
-        this.RestApi.del(elementUri)
-            .then(msg => {
-                this.showToast(msg.data.notifications[0].title);
-                this.loadCurrentElements(type);
-            });
-    }
-
-    jsonld(event, elementUri) {
-        this.RestApi.jsonld(elementUri)
-            .then(msg => {
-                this.showAlert(event, elementUri, msg.data);
-            });
-    }
-
-    toggleFavoriteAction(action, type) {
-        if (action.favorite) {
-            this.RestApi.removePreferredAction(action.elementId)
-                .then(msg => {
-                    this.showToast(msg.data.notifications[0].title);
-                }, error => {
-                    this.showToast(error.data.name);
-                })
-                .then(() => {
-                    this.loadCurrentElements(type);
-                });
-        }
-        else {
-            this.RestApi.addPreferredAction(action.elementId)
-                .then(msg => {
-                    this.showToast(msg.data.notifications[0].title);
-                }, error => {
-                    this.showToast(error.notifications[0].title);
-                })
-                .then(() => {
-                    this.loadCurrentElements(type);
-                });
-        }
-    }
-
-    toggleFavoriteSepa(sepa, type) {
-        if (sepa.favorite) {
-            this.RestApi.removePreferredSepa(sepa.elementId)
-                .then(msg => {
-                    this.showToast(msg.data.notifications[0].title);
-                }, error => {
-                    this.showToast(error.data.notifications[0].title);
-                })
-                .then(() => {
-                    this.loadCurrentElements(type);
-                });
-        }
-        else {
-            this.RestApi.addPreferredSepa(sepa.elementId)
-                .then(msg => {
-                    this.showToast(msg.data.notifications[0].title);
-                }, error => {
-                    this.showToast(error.data.notifications[0].title);
-                })
-                .then(() => {
-                    this.loadCurrentElements(type);
-                });
-        }
-    }
-
-    toggleFavoriteSource(source, type) {
-        if (source.favorite) {
-            this.RestApi.removePreferredSource(source.elementId)
-                .then(msg => {
-                    this.showToast(msg.data.notifications[0].title);
-                }, error => {
-                    this.showToast(error.data.notifications[0].title);
-                })
-                .then(() => {
-                    this.loadCurrentElements(type);
-                });
-        }
-        else {
-            this.RestApi.addPreferredSource(source.elementId)
-                .then(msg => {
-                    this.showToast(msg.data.notifications[0].title);
-                }, error => {
-                    this.showToast(error.data.notifications[0].title);
-                })
-                .then(() => {
-                    this.loadCurrentElements(type);
-                });
-        }
-    }
-
-    showToast(string) {
-        this.$mdToast.show(
-            this.$mdToast.simple()
-                .content(string)
-                .position("right")
-                .hideDelay(3000)
-        );
-    }
-
-    showAlert(ev, title, content) {
-        this.$mdDialog.show({
-            controller: JsonLdDialogController,
-            controllerAs: 'ctrl',
-            template: require('./dialog/jsonldDialog.tmpl.html'),
-            parent: angular.element(document.body),
-            clickOutsideToClose: true,
-            locals: {
-                content: content,
-                title: title
-            },
-            bindToController: true
-        });
-    }
-
-}
-
-MyElementsCtrl.$inject = ['RestApi', '$mdToast', '$mdDialog'];
\ No newline at end of file
diff --git a/ui/src/app/myelements/my-elements.module.ts b/ui/src/app/myelements/my-elements.module.ts
deleted file mode 100644
index 587d0f0..0000000
--- a/ui/src/app/myelements/my-elements.module.ts
+++ /dev/null
@@ -1,25 +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 * as angular from 'angular';
-
-import {MyElementsCtrl} from './my-elements.controller'
-
-export default angular.module('sp.myElements', [])
-	.controller('MyElementsCtrl', MyElementsCtrl)
-	.name;
diff --git a/ui/src/app/myelements/myelements.html b/ui/src/app/myelements/myelements.html
deleted file mode 100644
index 8e567ac..0000000
--- a/ui/src/app/myelements/myelements.html
+++ /dev/null
@@ -1,108 +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 flex class="page-container page-container-padding" ng-controller="MyElementsCtrl as ctrl">
-    <div flex="100" layout="row" style="padding:0px;background-color:#f6f6f6">
-        <div layout-fill>
-            <md-tabs md-dynamic-height md-border-bottom>
-
-                <md-tab ng-repeat="tab in ctrl.tabs"
-                        label="{{tab.title}}"
-                        md-on-select="ctrl.loadCurrentElements(tab.type)">
-                    <md-tab-label>
-                        {{tab.title}}
-                    </md-tab-label>
-                    <md-content layout-padding class="md-whiteframe-z2">
-
-
-                    </md-content>
-                </md-tab>
-            </md-tabs>
-        </div>
-    </div>
-    <div style="margin-top:30px;">
-        <md-list>
-            <md-list-item ng-repeat="item in ctrl.currentElements | orderBy:'+name'">
-
-                <div flex="100" layout="row"
-                     style="border:1px solid darkblue;margin-bottom:10px;background:white;margin-left:30px;margin-right:30px;">
-                    <div flex="20" layout="row" layout-align="start center" style="margin:10px;">
-                        <img ng-src="{{item.iconUrl}}" class="md-card-image draggable-icon {{ctrl.currentTabType}}"
-                             alt="{{item.name}}"
-                             ng-show="(item.iconUrl != null && item.iconUrl != 'http://localhost:8080/img')"/>
-                        <span class="draggable-icon {{ctrl.currentTabType}}"
-                              ng-show="(item.iconUrl == null || item.iconUrl == 'http://localhost:8080/img')">{{ctrl.elementTextIcon(item.name)}}</span>
-                        </span>
-                    </div>
-                    <div flex="80" layout="row">
-                        <div flex="100" layout="column" layout-align="left">
-                            <div flex="70" layout="row">
-                                <div flex="100" layout="column">
-                                    <h2 class="md-title">{{item.name}}</h2>
-                                    <p>{{item.description}}</p>
-                                </div>
-                                <div flex="100" layout="column" layout-align="end top">
-                                    <div ng-show="item.favorite" class="top right">
-                                        <md-icon md-svg-icon="action:ic_favorite_24px" aria-label="Action"
-                                                 class="md-accent" style="width: 36px; height: 36px"></md-icon>
-                                    </div>
-                                </div>
-                            </div>
-                            <div flex="30" layout="row" layout-align="right" style="margin-top:10px;">
-                                <div>
-                                    <sp-button aria-label="As Favorite" sp-button-blue
-                                               ng-click="ctrl.toggleFavorite(ctrl.getElementId(item), ctrl.currentTabType)">
-                                        <i class="material-icons">star</i> As Favorite
-                                    </sp-button>
-                                </div>
-                                <div>
-                                    <sp-button aria-label="JSON-LD" sp-button-blue
-                                               ng-click="ctrl.jsonld($event, ctrl.getElementId(item))">
-                                        <i class="material-icons">search</i> View Json-LD
-                                    </sp-button>
-                                </div>
-                                <div>
-                                    <sp-button aria-label="Refresh" sp-button-blue
-                                               ng-click="ctrl.refresh(ctrl.getElementId(item), ctrl.currentTabType)">
-                                        <i class="material-icons">autorenew</i> Update
-                                    </sp-button>
-                                </div>
-                                <div ng-show="ctrl.currentTabType == 'source'">
-                                    <sp-button aria-label="Remove" sp-button-blue
-                                               ng-click="ctrl.remove(item.uri, ctrl.currentTabType)">
-                                        <i class="material-icons">clear</i>
-                                        Delete
-                                    </sp-button>
-                                </div>
-                                <div ng-show="(ctrl.currentTabType == 'sepa') || (ctrl.currentTabType == 'action')">
-                                    <sp-button aria-label="Remove" sp-button-blue
-                                               ng-click="ctrl.remove(item.belongsTo, ctrl.currentTabType)">
-                                        <i class="material-icons">clear</i>
-                                        Delete
-                                    </sp-button>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <md-divider/>
-            </md-list-item>
-        </md-list>
-    </div>
-</div>
-