diff --git a/src/app/fake-db/dashboard-project.ts b/src/app/fake-db/dashboard-project.ts index 8ca46d0b..6c3d7131 100644 --- a/src/app/fake-db/dashboard-project.ts +++ b/src/app/fake-db/dashboard-project.ts @@ -1622,7 +1622,7 @@ export class ProjectDashboardDb [ { 'value' : 'Wireframing', - 'classes': 'mat-primary-bg', + 'classes': 'primary', 'icon' : '' }, { @@ -1718,7 +1718,7 @@ export class ProjectDashboardDb [ { 'value' : 'Marketing', - 'classes': 'mat-accent-bg', + 'classes': 'accent', 'icon' : '' }, { diff --git a/src/app/fake-db/e-commerce.ts b/src/app/fake-db/e-commerce.ts index 76af9409..62ffe872 100644 --- a/src/app/fake-db/e-commerce.ts +++ b/src/app/fake-db/e-commerce.ts @@ -1,519 +1,5 @@ export class ECommerceFakeDb { - public static dashboard = { - 'widget1': { - 'ranges' : { - 'DY' : 'Yesterday', - 'DT' : 'Today', - 'DTM': 'Tomorrow' - }, - 'currentRange': 'DT', - 'data' : { - 'label': 'CONVERSION RATE', - 'count': { - 'DY' : 21, - 'DT' : 25, - 'DTM': 19 - }, - 'extra': { - 'label': 'Abandoned carts', - 'count': { - 'DY' : 3, - 'DT' : 7, - 'DTM': 8 - } - } - }, - 'detail' : 'You can show some detailed information about this widget in here.' - }, - 'widget2': { - 'title' : 'Average Order Value', - 'data' : { - 'label': '30 DAYS', - 'count': 21, - 'extra': { - 'label': 'Last year same time', - 'count': 14 - } - }, - 'detail': 'You can show some detailed information about this widget in here.' - }, - 'widget3': { - 'title' : 'Online Visitors', - 'data' : { - 'label': 'last 30 minutes', - 'count': 32, - 'extra': { - 'label': 'Total visitors today', - 'count': 998 - } - }, - 'detail': 'You can show some detailed information about this widget in here.' - }, - 'widget4': { - 'title' : 'Profit per Visitor', - 'data' : { - 'label': 'TODAY', - 'count': '3,7', - 'extra': { - 'label': 'Yesterday', - 'count': '2,90' - } - }, - 'detail': 'You can show some detailed information about this widget in here.' - }, - 'widget5': { - 'title' : 'Sales', - 'ranges' : { - 'TW': 'This Week', - 'LW': 'Last Week', - '2W': '2 Weeks Ago' - }, - 'mainChart': { - '2W': [ - { - 'name' : 'Mon', - 'series': [ - { - 'name' : 'Sales', - 'value': 9 - }, - { - 'name' : 'Abandoned Carts', - 'value': 37 - } - ] - }, - { - 'name' : 'Tue', - 'series': [ - { - 'name' : 'Sales', - 'value': 12 - }, - { - 'name' : 'Abandoned Carts', - 'value': 32 - } - ] - }, - { - 'name' : 'Wed', - 'series': [ - { - 'name' : 'Sales', - 'value': 9 - }, - { - 'name' : 'Abandoned Carts', - 'value': 39 - } - ] - }, - { - 'name' : 'Thu', - 'series': [ - { - 'name' : 'Sales', - 'value': 12 - }, - { - 'name' : 'Abandoned Carts', - 'value': 27 - } - ] - }, - { - 'name' : 'Fri', - 'series': [ - { - 'name' : 'Sales', - 'value': 7 - }, - { - 'name' : 'Abandoned Carts', - 'value': 18 - } - ] - }, - { - 'name' : 'Sat', - 'series': [ - { - 'name' : 'Sales', - 'value': 8 - }, - { - 'name' : 'Abandoned Carts', - 'value': 24 - } - ] - }, - { - 'name' : 'Sun', - 'series': [ - { - 'name' : 'Sales', - 'value': 16 - }, - { - 'name' : 'Abandoned Carts', - 'value': 20 - } - ] - } - ], - 'LW': [ - { - 'name' : 'Mon', - 'series': [ - { - 'name' : 'Sales', - 'value': 12 - }, - { - 'name' : 'Abandoned Carts', - 'value': 37 - } - ] - }, - { - 'name' : 'Tue', - 'series': [ - { - 'name' : 'Sales', - 'value': 8 - }, - { - 'name' : 'Abandoned Carts', - 'value': 24 - } - ] - }, - { - 'name' : 'Wed', - 'series': [ - { - 'name' : 'Sales', - 'value': 7 - }, - { - 'name' : 'Abandoned Carts', - 'value': 51 - } - ] - }, - { - 'name' : 'Thu', - 'series': [ - { - 'name' : 'Sales', - 'value': 13 - }, - { - 'name' : 'Abandoned Carts', - 'value': 31 - } - ] - }, - { - 'name' : 'Fri', - 'series': [ - { - 'name' : 'Sales', - 'value': 7 - }, - { - 'name' : 'Abandoned Carts', - 'value': 29 - } - ] - }, - { - 'name' : 'Sat', - 'series': [ - { - 'name' : 'Sales', - 'value': 6 - }, - { - 'name' : 'Abandoned Carts', - 'value': 17 - } - ] - }, - { - 'name' : 'Sun', - 'series': [ - { - 'name' : 'Sales', - 'value': 10 - }, - { - 'name' : 'Abandoned Carts', - 'value': 31 - } - ] - } - ], - 'TW': [ - { - 'name' : 'Mon', - 'series': [ - { - 'name' : 'Sales', - 'value': 11 - }, - { - 'name' : 'Abandoned Carts', - 'value': 42 - } - ] - }, - { - 'name' : 'Tue', - 'series': [ - { - 'name' : 'Sales', - 'value': 10 - }, - { - 'name' : 'Abandoned Carts', - 'value': 28 - } - ] - }, - { - 'name' : 'Wed', - 'series': [ - { - 'name' : 'Sales', - 'value': 8 - }, - { - 'name' : 'Abandoned Carts', - 'value': 43 - } - ] - }, - { - 'name' : 'Thu', - 'series': [ - { - 'name' : 'Sales', - 'value': 11 - }, - { - 'name' : 'Abandoned Carts', - 'value': 34 - } - ] - }, - { - 'name' : 'Fri', - 'series': [ - { - 'name' : 'Sales', - 'value': 8 - }, - { - 'name' : 'Abandoned Carts', - 'value': 20 - } - ] - }, - { - 'name' : 'Sat', - 'series': [ - { - 'name' : 'Sales', - 'value': 10 - }, - { - 'name' : 'Abandoned Carts', - 'value': 25 - } - ] - }, - { - 'name' : 'Sun', - 'series': [ - { - 'name' : 'Sales', - 'value': 17 - }, - { - 'name' : 'Abandoned Carts', - 'value': 22 - } - ] - } - ] - } - }, - 'widget6': { - 'title' : 'Top 5 Categories', - 'ranges' : { - 'TW': 'This Week', - 'LW': 'Last Week', - '2W': '2 Weeks Ago' - }, - 'mainChart' : { - '2W': [ - { - 'name' : 'Women Dresses', - 'value': 18 - }, - { - 'name' : 'Men Shoes', - 'value': 12 - }, - { - 'name' : 'Women Shoes', - 'value': 40 - }, - { - 'name' : 'Women Bags', - 'value': 20 - }, - { - 'name' : 'Men T-Shirts', - 'value': 10 - } - ], - 'LW': [ - { - 'name' : 'Women Dresses', - 'value': 17 - }, - { - 'name' : 'Men Shoes', - 'value': 14 - }, - { - 'name' : 'Women Shoes', - 'value': 36 - }, - { - 'name' : 'Women Bags', - 'value': 23 - }, - { - 'name' : 'Men T-Shirts', - 'value': 12 - } - ], - 'TW': [ - { - 'name' : 'Women Dresses', - 'value': 13 - }, - { - 'name' : 'Men Shoes', - 'value': 16 - }, - { - 'name' : 'Women Shoes', - 'value': 34 - }, - { - 'name' : 'Women Bags', - 'value': 23 - }, - { - 'name' : 'Men T-Shirts', - 'value': 14 - } - ] - }, - 'footerLeft' : { - 'title': 'Total Sales', - 'count': { - '2W': 487, - 'LW': 526, - 'TW': 594 - } - }, - 'footerRight': { - 'title': 'Sales From Top 5 Categories', - 'count': { - '2W': 193, - 'LW': 260, - 'TW': 287 - } - } - }, - 'widget7': { - 'title' : 'Latest Customers', - 'ranges' : { - 'T' : 'Today', - 'TM': 'Tomorrow' - }, - 'customers': { - 'T' : [ - { - 'name' : 'Abbott Keitch', - 'location': 'United States of America' - }, - { - 'name' : 'Arnold Matlock', - 'location': 'United States of America' - }, - { - 'name' : 'Barrera Bradbury', - 'location': 'England' - }, - { - 'name' : 'Blair Strangeway', - 'location': 'Germany' - }, - { - 'name' : 'Copeland Redcliff', - 'location': 'French' - }, - { - 'name' : 'Henderson Cambias', - 'location': 'Russia' - }, - { - 'name' : 'Lily Peasegood', - 'location': 'Mexico' - } - ], - 'TM': [ - { - 'name' : 'Boyle Winters', - 'location': 'United States of America' - }, - { - 'name' : 'Tyson Marshall', - 'location': 'United States of America' - }, - { - 'name' : 'Reyna Preece', - 'location': 'England' - }, - { - 'name' : 'Shauna Atherton', - 'location': 'Germany' - }, - { - 'name' : 'Tillman Lee', - 'location': 'French' - }, - { - 'name' : 'Velazquez Smethley', - 'location': 'Russia' - }, - { - 'name' : 'Helen Sheridan', - 'location': 'Mexico' - } - ] - } - } - }; - public static products = [ { 'id' : '1', diff --git a/src/app/fake-db/fake-db.service.ts b/src/app/fake-db/fake-db.service.ts index de47b4b6..3fc891cb 100644 --- a/src/app/fake-db/fake-db.service.ts +++ b/src/app/fake-db/fake-db.service.ts @@ -34,7 +34,6 @@ export class FakeDbService implements InMemoryDbService 'calendar': CalendarFakeDb.data, // E-Commerce - 'e-commerce-dashboard': ECommerceFakeDb.dashboard, 'e-commerce-products' : ECommerceFakeDb.products, 'e-commerce-orders' : ECommerceFakeDb.orders, diff --git a/src/app/main/apps/e-commerce/dashboard/dashboard.component.html b/src/app/main/apps/e-commerce/dashboard/dashboard.component.html deleted file mode 100644 index a3806502..00000000 --- a/src/app/main/apps/e-commerce/dashboard/dashboard.component.html +++ /dev/null @@ -1,338 +0,0 @@ -
- - -
- - -
- - - - - -
-
- - - - {{range.value}} - - - - -
- -
-
- {{widgets.widget1.data.count[widgets.widget1.currentRange]}} -
-
{{widgets.widget1.data.label}}
-
- -
- {{widgets.widget1.data.extra.label}}: - {{widgets.widget1.data.extra.count[widgets.widget1.currentRange]}} -
-
- - - -
- - -
- {{widgets.widget1.detail}} -
-
- - -
- - - - - - -
-
-
{{widgets.widget2.title}}
- - -
- -
-
- {{widgets.widget2.data.count}} -
-
{{widgets.widget2.data.label}}
-
- -
- {{widgets.widget2.data.extra.label}}: - {{widgets.widget2.data.extra.count}} -
-
- - - -
- - -
- {{widgets.widget2.detail}} -
-
- - -
- - - - - - -
-
-
{{widgets.widget3.title}}
- - -
- -
-
- {{widgets.widget3.data.count}} -
-
{{widgets.widget3.data.label}}
-
- -
- {{widgets.widget3.data.extra.label}}: - {{widgets.widget3.data.extra.count}} -
-
- - - -
- - -
- {{widgets.widget3.detail}} -
-
- - -
- - - - - - -
-
-
{{widgets.widget4.title}}
- - -
- -
-
{{widgets.widget4.data.count}} -
-
{{widgets.widget4.data.label}}
-
- -
- {{widgets.widget4.data.extra.label}}: - {{widgets.widget4.data.extra.count}} -
-
- - - -
- - -
- {{widgets.widget4.detail}} -
-
- - -
- - - - - - - -
- -
- -
{{widgets.widget5.title}}
- -
- -
-
- -
- - -
-
- - -
- - - - - - -
- -
-
{{widgets.widget6.title}}
- - - - {{range.value}} - - - -
- -
- - -
- -
-
- - {{widgets.widget6.footerLeft.count[widget6.currentRange]}} - - {{widgets.widget6.footerLeft.title}} -
- -
- - {{widgets.widget6.footerRight.count[widget6.currentRange]}} - - {{widgets.widget6.footerRight.title}} -
-
- -
- - -
- - - - - - -
- -
-
{{widgets.widget7.title}}
- - - - {{range.value}} - - - -
- -
-
-
{{customer.name}}
-
- {{customer.location}} -
-
- - -
- -
- - -
- - -
- - -
- - -
diff --git a/src/app/main/apps/e-commerce/dashboard/dashboard.component.scss b/src/app/main/apps/e-commerce/dashboard/dashboard.component.scss deleted file mode 100644 index 593372fc..00000000 --- a/src/app/main/apps/e-commerce/dashboard/dashboard.component.scss +++ /dev/null @@ -1,7 +0,0 @@ -#e-commerce-dashboard { - - .content { - flex: 1 0 auto; - } - -} diff --git a/src/app/main/apps/e-commerce/dashboard/dashboard.component.ts b/src/app/main/apps/e-commerce/dashboard/dashboard.component.ts deleted file mode 100644 index 684c021f..00000000 --- a/src/app/main/apps/e-commerce/dashboard/dashboard.component.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { Component, OnInit, ViewEncapsulation } from '@angular/core'; - -import { fuseAnimations } from '@fuse/animations'; - -import { EcommerceDashboardService } from 'app/main/apps/e-commerce/dashboard/dashboard.service'; - -@Component({ - selector : 'e-commerce-dashboard', - templateUrl : './dashboard.component.html', - styleUrls : ['./dashboard.component.scss'], - encapsulation: ViewEncapsulation.None, - animations : fuseAnimations -}) -export class EcommerceDashboardComponent implements OnInit -{ - projects: any[]; - selectedProject: any; - - widgets: any; - widget5: any = {}; - widget6: any = {}; - widget7: any = {}; - - constructor( - private _eCommerceDashboardService: EcommerceDashboardService - ) - { - /** - * Widget 5 - */ - this.widget5 = { - currentRange : 'TW', - xAxis : true, - yAxis : true, - gradient : false, - legend : false, - showXAxisLabel: false, - xAxisLabel : 'Days', - showYAxisLabel: false, - yAxisLabel : 'Isues', - scheme : { - domain: ['#42BFF7', '#C6ECFD', '#C7B42C', '#AAAAAA'] - }, - onSelect : (ev) => { - console.log(ev); - } - }; - - /** - * Widget 6 - */ - this.widget6 = { - currentRange : 'TW', - legend : false, - explodeSlices: false, - labels : true, - doughnut : true, - gradient : false, - scheme : { - domain: ['#f44336', '#9c27b0', '#03a9f4', '#e91e63'] - }, - onSelect : (ev) => { - console.log(ev); - } - }; - - /** - * Widget 7 - */ - this.widget7 = { - currentRange: 'T' - }; - - } - - // ----------------------------------------------------------------------------------------------------- - // @ Lifecycle hooks - // ----------------------------------------------------------------------------------------------------- - - /** - * On init - */ - ngOnInit(): void - { - this.projects = this._eCommerceDashboardService.projects; - this.selectedProject = this.projects[0]; - this.widgets = this._eCommerceDashboardService.widgets; - } -} diff --git a/src/app/main/apps/e-commerce/dashboard/dashboard.service.ts b/src/app/main/apps/e-commerce/dashboard/dashboard.service.ts deleted file mode 100644 index 625a215b..00000000 --- a/src/app/main/apps/e-commerce/dashboard/dashboard.service.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router'; -import { Observable } from 'rxjs'; - -@Injectable() -export class EcommerceDashboardService implements Resolve -{ - projects: any[]; - widgets: any[]; - - /** - * Constructor - * - * @param {HttpClient} _httpClient - */ - constructor( - private _httpClient: HttpClient - ) - { - } - - /** - * Resolver - * - * @param {ActivatedRouteSnapshot} route - * @param {RouterStateSnapshot} state - * @returns {Observable | Promise | any} - */ - resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable | Promise | any - { - return new Promise((resolve, reject) => { - - Promise.all([ - this.getProjects(), - this.getWidgets() - ]).then( - () => { - resolve(); - }, - reject - ); - }); - } - - /** - * Get projects - * - * @returns {Promise} - */ - getProjects(): Promise - { - return new Promise((resolve, reject) => { - this._httpClient.get('api/project-dashboard-projects') - .subscribe((response: any) => { - this.projects = response; - resolve(response); - }, reject); - }); - } - - /** - * Get widgets - * - * @returns {Promise} - */ - getWidgets(): Promise - { - return new Promise((resolve, reject) => { - this._httpClient.get('api/e-commerce-dashboard') - .subscribe((response: any) => { - this.widgets = response; - resolve(response); - }, reject); - }); - } -} diff --git a/src/app/main/apps/e-commerce/e-commerce.module.ts b/src/app/main/apps/e-commerce/e-commerce.module.ts index abd3f06e..d02ec632 100644 --- a/src/app/main/apps/e-commerce/e-commerce.module.ts +++ b/src/app/main/apps/e-commerce/e-commerce.module.ts @@ -7,8 +7,6 @@ import { AgmCoreModule } from '@agm/core'; import { FuseSharedModule } from '@fuse/shared.module'; import { FuseWidgetModule } from '@fuse/components/widget/widget.module'; -import { EcommerceDashboardComponent } from 'app/main/apps/e-commerce/dashboard/dashboard.component'; -import { EcommerceDashboardService } from 'app/main/apps/e-commerce/dashboard/dashboard.service'; import { EcommerceProductsComponent } from 'app/main/apps/e-commerce/products/products.component'; import { EcommerceProductsService } from 'app/main/apps/e-commerce/products/products.service'; import { EcommerceProductComponent } from 'app/main/apps/e-commerce/product/product.component'; @@ -19,13 +17,6 @@ import { EcommerceOrderComponent } from 'app/main/apps/e-commerce/order/order.co import { EcommerceOrderService } from 'app/main/apps/e-commerce/order/order.service'; const routes: Routes = [ - { - path : 'dashboard', - component: EcommerceDashboardComponent, - resolve : { - data: EcommerceDashboardService - } - }, { path : 'products', component: EcommerceProductsComponent, @@ -65,7 +56,6 @@ const routes: Routes = [ @NgModule({ declarations: [ - EcommerceDashboardComponent, EcommerceProductsComponent, EcommerceProductComponent, EcommerceOrdersComponent, @@ -93,10 +83,9 @@ const routes: Routes = [ }), FuseSharedModule, - FuseWidgetModule, + FuseWidgetModule ], providers : [ - EcommerceDashboardService, EcommerceProductsService, EcommerceProductService, EcommerceOrdersService,