From 363760455db6cc1718a80493d50516ba5603d671 Mon Sep 17 00:00:00 2001 From: Ted Jones Date: Fri, 23 Mar 2018 11:13:01 -0500 Subject: [PATCH] teiidtools-347: Updated connections page empty state to pfng. --- .../connections/connections.component.html | 19 +++++--------- .../app/connections/connections.component.ts | 26 ++++++++++++++++++- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ngapp/src/app/connections/connections.component.html b/ngapp/src/app/connections/connections.component.html index a6bb61ed..71d7de61 100644 --- a/ngapp/src/app/connections/connections.component.html +++ b/ngapp/src/app/connections/connections.component.html @@ -36,19 +36,12 @@

Connections

-
-
-
- -
-

No Connections Found

-

- No Connections were found - please click below to create a new Connection! -

-
- +
+
+
+
diff --git a/ngapp/src/app/connections/connections.component.ts b/ngapp/src/app/connections/connections.component.ts index 2146f303..69cb3941 100644 --- a/ngapp/src/app/connections/connections.component.ts +++ b/ngapp/src/app/connections/connections.component.ts @@ -26,7 +26,7 @@ import { WizardService } from "@dataservices/shared/wizard.service"; import { AbstractPageComponent } from "@shared/abstract-page.component"; import { ConfirmDeleteComponent } from "@shared/confirm-delete/confirm-delete.component"; import { LayoutType } from "@shared/layout-type.enum"; -import { Filter } from "patternfly-ng"; +import { ActionConfig, EmptyStateConfig, Filter } from "patternfly-ng"; import { FilterConfig } from "patternfly-ng"; import { FilterField } from "patternfly-ng"; import { FilterEvent } from "patternfly-ng"; @@ -56,6 +56,7 @@ export class ConnectionsComponent extends AbstractPageComponent implements OnIni private filteredConns: Connection[] = []; private selectedConns: Connection[] = []; private router: Router; + private noConnectionsConfig: EmptyStateConfig; private appSettingsService: AppSettingsService; private connectionService: ConnectionService; private wizardService: WizardService; @@ -105,6 +106,29 @@ export class ConnectionsComponent extends AbstractPageComponent implements OnIni } as SortConfig; } + public get noConnectionsEmptyConfig(): EmptyStateConfig { + if ( !this.noConnectionsConfig ) { + const actionConfig = { + primaryActions: [ + { + id: "createConnectionActionId", + title: "Add Connection", + tooltip: "Add a connection" + } + ] + } as ActionConfig; + + this.noConnectionsConfig = { + actions: actionConfig, + iconStyleClass: "pficon-warning-triangle-o", + info: "No Connections were found. Please click below to create a connection. ", + title: "No Connections Available" + } as EmptyStateConfig; + } + + return this.noConnectionsConfig; + } + public loadAsyncPageData(): void { const self = this;