feat: add app shell (angular-material)
Add app shell built using angular-material and flex-layout. Refractor code due to configuration changes. Fixes #52
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class="fluid-container">
|
||||
<!-- <div class="fluid-container">
|
||||
<div class="container">
|
||||
<div class="row mt-5">
|
||||
<div class="col-sm-4">
|
||||
@@ -96,18 +96,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-sm-4 ">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="ngx-charts">
|
||||
<ngx-charts-pie-chart
|
||||
[view]="view"
|
||||
[scheme]="colorScheme"
|
||||
[results]="single"></ngx-charts-pie-chart>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
|
||||
.ngx-charts {
|
||||
position: relative;
|
||||
|
||||
}
|
||||
// .ngx-charts {
|
||||
// position: relative;
|
||||
// }
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/* tslint:disable:no-unused-variable */
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { DebugElement } from '@angular/core';
|
||||
|
||||
import { DashboardComponent } from './dashboard.component';
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NgxChartsModule } from '@swimlane/ngx-charts';
|
||||
|
||||
import { single } from './data';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
selector: 'mifosx-dashboard',
|
||||
templateUrl: './dashboard.component.html',
|
||||
styleUrls: ['./dashboard.component.scss']
|
||||
})
|
||||
export class DashboardComponent implements OnInit {
|
||||
|
||||
single: any[];
|
||||
multi: any[];
|
||||
|
||||
view: any[] = [600, 350];
|
||||
|
||||
// options
|
||||
@@ -26,11 +26,12 @@ export class DashboardComponent implements OnInit {
|
||||
colorScheme = {
|
||||
domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA']
|
||||
};
|
||||
|
||||
constructor() {
|
||||
Object.assign(this, { single });
|
||||
}
|
||||
ngOnInit() {
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,58 +1,58 @@
|
||||
export const single = [
|
||||
{
|
||||
'name': 'Germany',
|
||||
'value': 89400001
|
||||
},
|
||||
{
|
||||
'name': 'USA',
|
||||
'value': 5000000
|
||||
},
|
||||
{
|
||||
'name': 'France',
|
||||
'value': 7200000
|
||||
}
|
||||
{
|
||||
'name': 'Germany',
|
||||
'value': 89400001
|
||||
},
|
||||
{
|
||||
'name': 'USA',
|
||||
'value': 5000000
|
||||
},
|
||||
{
|
||||
'name': 'France',
|
||||
'value': 7200000
|
||||
}
|
||||
];
|
||||
|
||||
export const multi = [
|
||||
{
|
||||
'name': 'Germany',
|
||||
'series': [
|
||||
{
|
||||
'name': '2010',
|
||||
'value': 7300000
|
||||
},
|
||||
{
|
||||
'name': '2011',
|
||||
'value': 8940000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'Germany',
|
||||
'series': [
|
||||
{
|
||||
'name': '2010',
|
||||
'value': 7300000
|
||||
},
|
||||
{
|
||||
'name': '2011',
|
||||
'value': 8940000
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
'name': 'USA',
|
||||
'series': [
|
||||
{
|
||||
'name': '2010',
|
||||
'value': 7870000
|
||||
},
|
||||
{
|
||||
'name': '2011',
|
||||
'value': 8270000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
'name': 'USA',
|
||||
'series': [
|
||||
{
|
||||
'name': '2010',
|
||||
'value': 7870000
|
||||
},
|
||||
{
|
||||
'name': '2011',
|
||||
'value': 8270000
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
'name': 'France',
|
||||
'series': [
|
||||
{
|
||||
'name': '2010',
|
||||
'value': 5000002
|
||||
},
|
||||
{
|
||||
'name': '2011',
|
||||
'value': 5800000
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
'name': 'France',
|
||||
'series': [
|
||||
{
|
||||
'name': '2010',
|
||||
'value': 5000002
|
||||
},
|
||||
{
|
||||
'name': '2011',
|
||||
'value': 5800000
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,15 +1,27 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { Route, extract } from '../../app/core';
|
||||
import { Route, extract } from '../core';
|
||||
import { HomeComponent } from './home.component';
|
||||
import { DashboardComponent } from './dashboard/dashboard.component';
|
||||
|
||||
const routes: Routes = [
|
||||
Route.withShell([
|
||||
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
||||
{ path: 'home', component: HomeComponent, data: { title: extract('Home') } },
|
||||
{ path: 'home/dashboard', component: DashboardComponent}
|
||||
{
|
||||
path: '',
|
||||
redirectTo: '/home',
|
||||
pathMatch: 'full'
|
||||
},
|
||||
{
|
||||
path: 'home',
|
||||
component: HomeComponent,
|
||||
data: { title: extract('Home') }
|
||||
},
|
||||
{
|
||||
path: 'home/dashboard',
|
||||
component: DashboardComponent,
|
||||
data: { title: extract('Dashboard') }
|
||||
}
|
||||
])
|
||||
];
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<div class="container-fluid">
|
||||
<!-- <div class="container-fluid">
|
||||
<div class="text-center mt-5">
|
||||
<img class="logo" src="assets/images/mifos_lg-logo.jpg"/>
|
||||
<!-- <app-loader [isLoading]="isLoading"></app-loader>
|
||||
<q [hidden]="isLoading">{{quote}}</q> -->
|
||||
<app-loader [isLoading]="isLoading"></app-loader>
|
||||
<q [hidden]="isLoading">{{quote}}</q>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<img class="logo" src="assets/images/mifos_lg-logo.jpg"/>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.logo {
|
||||
width: 500px;
|
||||
}
|
||||
// .logo {
|
||||
// width: 500px;
|
||||
// }
|
||||
|
||||
q {
|
||||
font-style: italic;
|
||||
font-size: 1.2rem;
|
||||
quotes: "« " " »";
|
||||
}
|
||||
// q {
|
||||
// font-style: italic;
|
||||
// font-size: 1.2rem;
|
||||
// quotes: "« " " »";
|
||||
// }
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
import { CoreModule } from '@app/core';
|
||||
import { SharedModule } from '@app/shared';
|
||||
import { CoreModule } from '../core';
|
||||
import { SharedModule } from '../shared';
|
||||
import { HomeComponent } from './home.component';
|
||||
import { QuoteService } from './quote.service';
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
import { finalize } from 'rxjs/operators';
|
||||
|
||||
import { QuoteService } from './quote.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
selector: 'mifosx-home',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.scss']
|
||||
})
|
||||
@@ -17,9 +18,9 @@ export class HomeComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.isLoading = true;
|
||||
this.quoteService.getRandomQuote({ category: 'dev' })
|
||||
.pipe(finalize(() => { this.isLoading = false; }))
|
||||
.subscribe((quote: string) => { this.quote = quote; });
|
||||
// this.quoteService.getRandomQuote({ category: 'dev' })
|
||||
// .pipe(finalize(() => { this.isLoading = false; }))
|
||||
// .subscribe((quote: string) => { this.quote = quote; });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { NgxChartsModule } from '@swimlane/ngx-charts';
|
||||
|
||||
import { CoreModule } from '../../app/core';
|
||||
import { SharedModule } from '../../app/shared';
|
||||
import { SharedModule } from '../shared';
|
||||
import { HomeRoutingModule } from './home-routing.module';
|
||||
import { HomeComponent } from './home.component';
|
||||
import { QuoteService } from './quote.service';
|
||||
@@ -15,14 +15,13 @@ import { DashboardComponent } from './dashboard/dashboard.component';
|
||||
CommonModule,
|
||||
TranslateModule,
|
||||
NgxChartsModule,
|
||||
CoreModule,
|
||||
SharedModule,
|
||||
HomeRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
HomeComponent,
|
||||
DashboardComponent
|
||||
],
|
||||
],
|
||||
providers: [
|
||||
QuoteService
|
||||
]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { TestBed, inject, async } from '@angular/core/testing';
|
||||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
||||
|
||||
import { CoreModule, HttpCacheService } from '@app/core';
|
||||
import { CoreModule, HttpCacheService } from '../core';
|
||||
import { QuoteService } from './quote.service';
|
||||
|
||||
describe('QuoteService', () => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { map, catchError } from 'rxjs/operators';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user