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 2022/07/13 16:22:08 UTC

[incubator-streampipes] branch STREAMPIPES-558 updated: [STREAMPIPES-537] Improve layout of empty views

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

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


The following commit(s) were added to refs/heads/STREAMPIPES-558 by this push:
     new d00179144 [STREAMPIPES-537] Improve layout of empty views
d00179144 is described below

commit d00179144657b990446bae50f6d2932be8ba0f20
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Wed Jul 13 18:21:55 2022 +0200

    [STREAMPIPES-537] Improve layout of empty views
---
 .../existing-adapters/existing-adapters.component.html     | 14 +++++++-------
 .../components/overview/dashboard-overview.component.html  |  8 +++++++-
 .../data-explorer-dashboard-overview.component.html        |  9 +++++++--
 .../overview/data-explorer-dashboard-overview.component.ts |  4 +++-
 4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
index 6f92c7656..1eb64195b 100644
--- a/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
+++ b/ui/src/app/connect/components/existing-adapters/existing-adapters.component.html
@@ -42,7 +42,7 @@
         <sp-basic-header-title-component title="My adapters"></sp-basic-header-title-component>
         <div fxFlex="100" fxLayout="row" fxLayoutAlign="center start">
             <sp-basic-inner-panel [showTitle]="false" innerPadding="0" outerMargin="0" fxFlex="90" [hideToolbar]="true">
-                <div fxFlex="100" fxLayout="column">
+                <div fxFlex="100" fxLayout="column" *ngIf="filteredAdapters.length > 0">
                     <div fxFlex="100" fxLayout="column">
                         <table fxFlex="100" mat-table [dataSource]="dataSource" style="width: 100%;" matSort>
                             <ng-container matColumnDef="start">
@@ -144,12 +144,12 @@
                                        color="accent">
                         </mat-paginator>
                     </div>
-                    <div fxFlex="100"
-                         fxLayout="column"
-                         fxLayoutAlign="center center"
-                         *ngIf="existingAdapters.length == 0">
-                        <h5>(no adapters available)</h5>
-                    </div>
+                </div>
+                <div fxFlex="100"
+                     fxLayout="column"
+                     fxLayoutAlign="center center"
+                     *ngIf="existingAdapters.length == 0">
+                    <h5>(no adapters available)</h5>
                 </div>
             </sp-basic-inner-panel>
         </div>
diff --git a/ui/src/app/dashboard/components/overview/dashboard-overview.component.html b/ui/src/app/dashboard/components/overview/dashboard-overview.component.html
index b1f3d51ad..054a420ea 100644
--- a/ui/src/app/dashboard/components/overview/dashboard-overview.component.html
+++ b/ui/src/app/dashboard/components/overview/dashboard-overview.component.html
@@ -32,7 +32,7 @@
         <sp-basic-header-title-component title="My Dashboards"></sp-basic-header-title-component>
         <div fxFlex="100" fxLayout="row" fxLayoutAlign="center start">
             <sp-basic-inner-panel [showTitle]="false" innerPadding="0" outerMargin="0" fxFlex="90" [hideToolbar]="true">
-                <div fxFlex="100" fxLayout="column" class="w-100">
+                <div fxFlex="100" fxLayout="column" class="w-100" *ngIf="dashboards.length > 0">
 
                     <table fxFlex="95" mat-table [dataSource]="dataSource" multiTemplateDataRows>
 
@@ -101,6 +101,12 @@
                         </tr>
                     </table>
                 </div>
+                <div fxFlex="100"
+                     fxLayout="column"
+                     fxLayoutAlign="center center"
+                     *ngIf="dashboards.length == 0">
+                    <h5>(no dashboards available)</h5>
+                </div>
             </sp-basic-inner-panel>
         </div>
     </div>
diff --git a/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.html b/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.html
index 7d5bc4a10..b7e869a83 100644
--- a/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.html
+++ b/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.html
@@ -32,7 +32,7 @@
         <sp-basic-header-title-component title="My Data Views"></sp-basic-header-title-component>
         <div fxFlex="100" fxLayout="row" fxLayoutAlign="center start">
             <sp-basic-inner-panel [showTitle]="false" innerPadding="0" outerMargin="0" fxFlex="90" [hideToolbar]="true">
-                <div fxFlex="100" fxLayout="column" class="w-100">
+                <div fxFlex="100" fxLayout="column" class="w-100" *ngIf="dashboards.length > 0">
                     <table mat-table [dataSource]="dataSource" multiTemplateDataRows>
 
                         <ng-container matColumnDef="name">
@@ -94,7 +94,12 @@
                         </tr>
                     </table>
                 </div>
-
+                <div fxFlex="100"
+                     fxLayout="column"
+                     fxLayoutAlign="center center"
+                     *ngIf="dashboards.length == 0">
+                    <h5>(no data views available)</h5>
+                </div>
             </sp-basic-inner-panel>
         </div>
     </div>
diff --git a/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.ts b/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.ts
index feaa1b683..7b20eb2b4 100644
--- a/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.ts
+++ b/ui/src/app/data-explorer/components/overview/data-explorer-dashboard-overview.component.ts
@@ -37,6 +37,7 @@ export class DataExplorerDashboardOverviewComponent implements OnInit {
 
   dataSource = new MatTableDataSource<Dashboard>();
   displayedColumns: string[] = [];
+  dashboards: Dashboard[] = [];
 
   isAdmin = false;
 
@@ -64,7 +65,8 @@ export class DataExplorerDashboardOverviewComponent implements OnInit {
 
   getDashboards() {
     this.dataViewService.getDataViews().subscribe(data => {
-      this.dataSource.data = data.sort((a, b) => a.name.localeCompare(b.name));
+      this.dashboards = data.sort((a, b) => a.name.localeCompare(b.name));
+      this.dataSource.data = this.dashboards;
     });
   }