diff --git a/src/app/@core/data/data.module.ts b/src/app/@core/data/data.module.ts index 2d3d978b..c1c0cf25 100644 --- a/src/app/@core/data/data.module.ts +++ b/src/app/@core/data/data.module.ts @@ -4,11 +4,13 @@ import { CommonModule } from '@angular/common'; import { UserService } from './users.service'; import { ElectricityService } from './electricity.service'; import { StateService } from './state.service'; +import { SmartTableService } from './smart-table.service'; const SERVICES = [ UserService, ElectricityService, StateService, + SmartTableService, ]; @NgModule({ diff --git a/src/app/pages/tables/smart-table/smart-table.service.ts b/src/app/@core/data/smart-table.service.ts similarity index 88% rename from src/app/pages/tables/smart-table/smart-table.service.ts rename to src/app/@core/data/smart-table.service.ts index e4ca295f..56f1087b 100644 --- a/src/app/pages/tables/smart-table/smart-table.service.ts +++ b/src/app/@core/data/smart-table.service.ts @@ -425,59 +425,7 @@ export class SmartTableService { 'age': 16, }]; - metricsTableData = [{ - image: 'app/browsers/chrome.svg', - browser: 'Google Chrome', - visits: '10,392', - isVisitsUp: true, - purchases: '4,214', - isPurchasesUp: true, - percent: '45%', - isPercentUp: true, - }, { - image: 'app/browsers/firefox.svg', - browser: 'Mozilla Firefox', - visits: '7,873', - isVisitsUp: true, - purchases: '3,031', - isPurchasesUp: false, - percent: '28%', - isPercentUp: true, - }, { - image: 'app/browsers/ie.svg', - browser: 'Internet Explorer', - visits: '5,890', - isVisitsUp: false, - purchases: '2,102', - isPurchasesUp: false, - percent: '17%', - isPercentUp: false, - }, { - image: 'app/browsers/safari.svg', - browser: 'Safari', - visits: '4,001', - isVisitsUp: false, - purchases: '1,001', - isPurchasesUp: false, - percent: '14%', - isPercentUp: true, - }, { - image: 'app/browsers/opera.svg', - browser: 'Opera', - visits: '1,833', - isVisitsUp: true, - purchases: '83', - isPurchasesUp: true, - percent: '5%', - isPercentUp: false, - }]; - - getData(): Promise { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(this.data); - }, 2000); - }); + getData() { + return this.data; } - } diff --git a/src/app/pages/dashboard/electricity/electricity.component.scss b/src/app/pages/dashboard/electricity/electricity.component.scss index c34d5d92..efbdcaff 100644 --- a/src/app/pages/dashboard/electricity/electricity.component.scss +++ b/src/app/pages/dashboard/electricity/electricity.component.scss @@ -1,5 +1,6 @@ @import '../../../@theme/styles/variables'; @import '~@akveo/nga-theme/components/card/card.component.theme'; +@import '~@akveo/nga-theme/styles/global/typography/typography'; @include nga-install-component() { diff --git a/src/app/pages/tables/smart-table/smart-table.component.html b/src/app/pages/tables/smart-table/smart-table.component.html index e4e40cef..65ee1ce7 100644 --- a/src/app/pages/tables/smart-table/smart-table.component.html +++ b/src/app/pages/tables/smart-table/smart-table.component.html @@ -1,10 +1,10 @@ -
-
- - Smart Table - - - - -
-
+ + + Smart Table + + + + + + + diff --git a/src/app/pages/tables/smart-table/smart-table.component.ts b/src/app/pages/tables/smart-table/smart-table.component.ts index 5663d725..f44a325a 100644 --- a/src/app/pages/tables/smart-table/smart-table.component.ts +++ b/src/app/pages/tables/smart-table/smart-table.component.ts @@ -1,7 +1,7 @@ import { Component } from '@angular/core'; import { LocalDataSource } from 'ng2-smart-table'; -import { SmartTableService } from './smart-table.service'; +import { SmartTableService } from '../../../@core/data/smart-table.service'; @Component({ selector: 'ngx-smart-table', @@ -9,11 +9,9 @@ import { SmartTableService } from './smart-table.service'; }) export class SmartTableComponent { - query: string = ''; - settings = { add: { - addButtonContent: '', + addButtonContent: '', createButtonContent: '', cancelButtonContent: '', }, @@ -23,7 +21,7 @@ export class SmartTableComponent { cancelButtonContent: '', }, delete: { - deleteButtonContent: '', + deleteButtonContent: '', confirmDelete: true, }, columns: { @@ -57,9 +55,8 @@ export class SmartTableComponent { source: LocalDataSource = new LocalDataSource(); constructor(private service: SmartTableService) { - this.service.getData().then((data) => { - this.source.load(data); - }); + let data = this.service.getData(); + this.source.load(data); } onDeleteConfirm(event): void { @@ -69,5 +66,4 @@ export class SmartTableComponent { event.confirm.reject(); } } - } diff --git a/src/app/pages/tables/tables.module.ts b/src/app/pages/tables/tables.module.ts index 0416322e..c2c30671 100644 --- a/src/app/pages/tables/tables.module.ts +++ b/src/app/pages/tables/tables.module.ts @@ -4,7 +4,7 @@ import { Ng2SmartTableModule } from 'ng2-smart-table'; import { SharedModule } from '../../shared.module'; import { TablesRoutingModule, routedComponents } from './tables-routing.module'; -import { SmartTableService } from './smart-table/smart-table.service'; +import { SmartTableService } from '../../@core/data/smart-table.service'; @NgModule({ imports: [