Skip to content

Commit

Permalink
refactored(): updated project dependencies and upgrade to covalent@be…
Browse files Browse the repository at this point in the history
…ta.4 (#64)

* Core(): updated dependencies

* Updated to latest flexlayout/material packages
* Updated @covalent packages
* Updated angular cli version
* Updated d3/ngx charts

* Fixed(themes): fixed import

* Fixed import of material theming

* Refactored(routing): added routing module

* Added a routing module for the application to capsulate the configuration of the RouterModule

* Feat(): added shared module

* Added a shared module that contains all the elements that are shared across the different application modules

* Refactored(app module): changed how the module is configurated

* Moved import of routed components into app-routing.module
* Moved styling modules into shared module
* Others

* Refactored(templates component): changes in html template

* Added button directive to nav links
* Refactored div elements into routed links in the covalent templates section

* Core(): added missing script command

* Added ng serve on start command

* Fixed(editor component): added missing directive in html template

* Added flex layout align directive

* Fixed(shared module): added missing imports

* Core(): updated dependencies

* Updated to latest flexlayout/material packages
* Updated @covalent packages
* Updated angular cli version
* Updated d3/ngx charts

Fixed(themes): fixed import

* Fixed import of material theming

Refactored(routing): added routing module

* Added a routing module for the application to capsulate the configuration of the RouterModule

Feat(): added shared module

* Added a shared module that contains all the elements that are shared across the different application modules

Refactored(app module): changed how the module is configurated

* Moved import of routed components into app-routing.module
* Moved styling modules into shared module
* Others

Refactored(templates component): changes in html template

* Added button directive to nav links
* Refactored div elements into routed links in the covalent templates section

Core(): added missing script command

* Added ng serve on start command

Fixed(editor component): added missing directive in html template

* Added flex layout align directive

Fixed(shared module): added missing imports

* Refactored(shared module): fixed tslint warnings

* Refactored(app routing module): minor changes

* Fixed(karma config): added injection of material theme

* Check angular/components#4056

* Fixed(): imports on component specs
  • Loading branch information
jotatoledo authored and emoralesb05 committed May 30, 2017
1 parent 4466e3f commit d6bc3c2
Show file tree
Hide file tree
Showing 12 changed files with 1,371 additions and 1,053 deletions.
3 changes: 2 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ module.exports = function (config) {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
files: [
{ pattern: './src/test.ts', watched: false }
{ pattern: './src/test.ts', watched: false },
{ pattern: './node_modules/@angular/material/prebuilt-themes/indigo-pink.css', included: true, watched: true },
],
preprocessors: {
'./src/test.ts': ['@angular/cli']
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"reusable"
],
"scripts": {
"start": "ng serve",
"e2e": "ng e2e",
"lint": "ng lint",
"reinstall": "rm -rf node_modules tmp deploy dist && npm i",
Expand Down Expand Up @@ -39,30 +40,30 @@
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/flex-layout": "2.0.0-beta.7",
"@angular/flex-layout": "2.0.0-beta.8",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/material": "2.0.0-beta.2",
"@angular/material": "2.0.0-beta.6",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/platform-server": "^4.0.0",
"@angular/router": "^4.0.0",
"@covalent/core": "1.0.0-beta.3",
"@covalent/dynamic-forms": "1.0.0-beta.3",
"@covalent/highlight": "1.0.0-beta.3",
"@covalent/http": "1.0.0-beta.3",
"@covalent/markdown": "1.0.0-beta.3",
"@swimlane/ngx-charts": "^5.0.0",
"@covalent/core": "1.0.0-beta.4",
"@covalent/dynamic-forms": "1.0.0-beta.4",
"@covalent/highlight": "1.0.0-beta.4",
"@covalent/http": "1.0.0-beta.4",
"@covalent/markdown": "1.0.0-beta.4",
"@swimlane/ngx-charts": "^5.3.0",
"core-js": "^2.4.1",
"d3": "^4.6.0",
"d3": "^4.9.0",
"hammerjs": "^2.0.8",
"highlight.js": "9.10.0",
"rxjs": "^5.2.0",
"rxjs": "^5.4.0",
"showdown": "1.6.4",
"zone.js": "^0.8.5"
},
"devDependencies": {
"@angular/cli": "1.0.0",
"@angular/cli": "1.0.3",
"@angular/compiler-cli": "^4.0.0",
"@types/hammerjs": "2.0.30",
"@types/jasmine": "2.5.38",
Expand All @@ -87,4 +88,4 @@
"optionalDependencies": {
"@covalent/data": "0.4.0"
}
}
}
144 changes: 144 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { MainComponent } from './main/main.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { DashboardProductComponent } from './dashboard-product/dashboard-product.component';
import { ProductOverviewComponent } from './dashboard-product/overview/overview.component';
import { ProductStatsComponent } from './dashboard-product/stats/stats.component';
import { ProductFeaturesComponent } from './dashboard-product/features/features.component';
import { FeaturesFormComponent } from './dashboard-product/features/form/form.component';
import { UsersComponent } from './users/users.component';
import { UsersFormComponent } from './users/form/form.component';
import { LogsComponent } from './logs/logs.component';
import { DetailComponent } from './detail/detail.component';
import { LoginComponent } from './login/login.component';
import { FormComponent } from './form/form.component';
import { TemplatesComponent } from './templates/templates.component';
import { DashboardTemplateComponent } from './templates/dashboard/dashboard.component';
import { EmailTemplateComponent } from './templates/email/email.component';
import { EditorTemplateComponent } from './templates/editor/editor.component';

const routes: Routes = [
{
path: 'login',
component: LoginComponent
},
{
path: '',
component: MainComponent,
children: [
{
component: DashboardComponent,
path: '',
},
{
path: 'product',
component: DashboardProductComponent,
children: [
{
path: '',
component: ProductOverviewComponent
},
{
path: 'stats',
component: ProductStatsComponent
},
{
path: 'features',
children: [
{
path: '',
component: ProductFeaturesComponent
},
{
path: 'add',
component: FeaturesFormComponent
},
{
path: ':id/delete',
component: FeaturesFormComponent
},
{
path: ':id/edit',
component: FeaturesFormComponent
},
]
},
]
},
{
path: 'item/:id',
component: DetailComponent
},
{
path: 'logs',
component: LogsComponent
},
{
path: 'form',
component: FormComponent
},
{
path: 'users',
children: [
{
path: '',
component: UsersComponent
},
{
path: 'add',
component: UsersFormComponent
},
{
path: ':id/delete',
component: UsersFormComponent
},
{
path: ':id/edit',
component: UsersFormComponent
},
]
},
{
path: 'templates',
children: [
{
path: '',
component: TemplatesComponent
},
{
path: 'dashboard',
component: DashboardTemplateComponent
},
{
path: 'email',
component: EmailTemplateComponent
},
{
path: 'editor',
component: EditorTemplateComponent
},
]
},
]
},
];

@NgModule({
imports: [
RouterModule.forRoot(routes, { useHash: true }),
],
exports: [
RouterModule,
]
})
export class AppRoutingModule { }
export const routedComponents: any[] = [
MainComponent, LoginComponent,
TemplatesComponent, EditorTemplateComponent, EmailTemplateComponent, DashboardTemplateComponent,
UsersComponent, UsersFormComponent,
DashboardComponent, DashboardProductComponent,
FormComponent, LogsComponent, DetailComponent,
FeaturesFormComponent, ProductFeaturesComponent, ProductOverviewComponent, ProductStatsComponent,
];
48 changes: 6 additions & 42 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,16 @@ import { NgModule, Type } from '@angular/core';
import { BrowserModule, Title } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { CovalentCoreModule } from '@covalent/core';
import { CovalentHttpModule, IHttpInterceptor } from '@covalent/http';
import { CovalentHighlightModule } from '@covalent/highlight';
import { CovalentMarkdownModule } from '@covalent/markdown';

import { AppComponent } from './app.component';
import { MainComponent } from './main/main.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { UsersComponent } from './users/users.component';
import { UsersFormComponent } from './users/form/form.component';
import { LogsComponent } from './logs/logs.component';
import { FormComponent } from './form/form.component';
import { DetailComponent } from './detail/detail.component';
import { LoginComponent } from './login/login.component';
import { DashboardProductComponent } from './dashboard-product/dashboard-product.component';
import { ProductOverviewComponent } from './dashboard-product/overview/overview.component';
import { ProductStatsComponent } from './dashboard-product/stats/stats.component';
import { ProductFeaturesComponent } from './dashboard-product/features/features.component';
import { FeaturesFormComponent } from './dashboard-product/features/form/form.component';
import { TemplatesComponent } from './templates/templates.component';
import { DashboardTemplateComponent } from './templates/dashboard/dashboard.component';
import { EmailTemplateComponent } from './templates/email/email.component';
import { EditorTemplateComponent } from './templates/editor/editor.component';
import { appRoutes, appRoutingProviders } from './app.routes';

import { RequestInterceptor } from '../config/interceptors/request.interceptor';

import { NgxChartsModule } from '@swimlane/ngx-charts';
import { routedComponents, AppRoutingModule } from './app-routing.module';

import { SharedModule } from './shared/shared.module';

const httpInterceptorProviders: Type<any>[] = [
RequestInterceptor,
Expand All @@ -38,40 +20,22 @@ const httpInterceptorProviders: Type<any>[] = [
@NgModule({
declarations: [
AppComponent,
MainComponent,
DashboardComponent,
DashboardProductComponent,
ProductOverviewComponent,
ProductStatsComponent,
ProductFeaturesComponent,
FeaturesFormComponent,
UsersComponent,
UsersFormComponent,
LogsComponent,
FormComponent,
DetailComponent,
LoginComponent,
TemplatesComponent,
DashboardTemplateComponent,
EmailTemplateComponent,
EditorTemplateComponent,
routedComponents,
], // directives, components, and pipes owned by this NgModule
imports: [
AppRoutingModule,
BrowserModule,
BrowserAnimationsModule,
CovalentCoreModule,
SharedModule,
CovalentHttpModule.forRoot({
interceptors: [{
interceptor: RequestInterceptor, paths: ['**'],
}],
}),
CovalentHighlightModule,
CovalentMarkdownModule,
appRoutes,
NgxChartsModule,
], // modules needed to run this module
providers: [
appRoutingProviders,
httpInterceptorProviders,
Title,
], // additional providers needed for this module
Expand Down
59 changes: 0 additions & 59 deletions src/app/app.routes.ts

This file was deleted.

5 changes: 3 additions & 2 deletions src/app/dashboard-product/dashboard-product.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
} from '@angular/core/testing';
import {APP_BASE_HREF} from '@angular/common';
import { RouterTestingModule } from '@angular/router/testing';
import { CovalentCoreModule, TdMediaService } from '@covalent/core';
import { SharedModule } from '../shared/shared.module';
import { TdMediaService } from '@covalent/core';
import { DashboardProductComponent } from './dashboard-product.component';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';

Expand All @@ -19,7 +20,7 @@ describe('Component: DashboardProduct', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
CovalentCoreModule,
SharedModule,
RouterTestingModule,
NoopAnimationsModule,
],
Expand Down
5 changes: 3 additions & 2 deletions src/app/dashboard-product/overview/overview.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { RouterTestingModule } from '@angular/router/testing';
import { XHRBackend, Response, ResponseOptions } from '@angular/http';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MockBackend } from '@angular/http/testing';
import { CovalentCoreModule, TdLoadingService } from '@covalent/core';
import { SharedModule } from '../../shared/shared.module';
import { TdLoadingService } from '@covalent/core';
import { CovalentHttpModule } from '@covalent/http';

import { ProductOverviewComponent } from './overview.component';
Expand All @@ -33,7 +34,7 @@ describe('Component: ProductOverview', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
CovalentCoreModule,
SharedModule,
CovalentHttpModule.forRoot(),
RouterTestingModule,
NgxChartsModule,
Expand Down
Loading

0 comments on commit d6bc3c2

Please sign in to comment.