Skip to content

Commit

Permalink
Feature/upgrade RC6 (#37)
Browse files Browse the repository at this point in the history
#### Breaking Changes
- Upgraded to `RC6`
- Upgrade material to `alpha.8-1`
- Added `hammerjs` dependency for material.
- Removed bootstrap and implemented everything with `NgModule` decorator.
- Changed `TdLoadingDirective`'s creation to be sync so it can be accessed in the `ngAfterViewInit` hook.
- Removed es6-shim and reflect-metadata and replaced with core-js library. (need to update angular-CLI, index.html and karma.conf.js)
- removed `md-content` and added `.md-content`
- Replaced Type with Type<any>
- Need to add angular2-material `core.css` and `overlay.css` as a workaround for ripple and menu into index.html angular/components#972

#### Features
- Added tooltip, slider, button-toggle and menu from angular-material.

#### Bug Fixes
- Changed code in animations since the angular classes used are no longer public and changed duration to 150ms so it doesnt look like its frozen in IE/Firefox (they dont support animations).
- Fixed file-upload select/drop events for Firefox and IE.

#### Internal
- Restructured imports in `docs` to remove the majority of the index.ts files and less explicit declarations in `system-config.ts`.
- Unit test `karma-test-shim` changes to set up test environment.
- Removed all unit tests (gonna start from scratch with each one).
- Unit tests changes to use `TestBed` and remove imports `describe`/`it`/`beforeEach` since they are taken as global.
- Removed depricated code all over the platform.
  • Loading branch information
emoralesb05 authored Sep 9, 2016
1 parent cf9e243 commit 6104b55
Show file tree
Hide file tree
Showing 219 changed files with 1,450 additions and 3,679 deletions.
15 changes: 8 additions & 7 deletions angular-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ module.exports = function(defaults) {
'systemjs/dist/system-polyfills.js',
'systemjs/dist/system.src.js',
'zone.js/dist/*.js',
'es6-shim/es6-shim.js',
'reflect-metadata/*.js',
'core-js/client/core.js',
'rxjs/**/*.js',
'hammerjs/*.min.js',
'@angular/**/*.js',
'@angular2-material/**/*.js',
'showdown/dist/showdown.js'
'@angular2-material/**/*.+(js|css)',
'showdown/dist/showdown.js',
],
polyfills: [
'vendor/es6-shim/es6-shim.js',
'vendor/reflect-metadata/Reflect.js',
'vendor/core-js/client/core.js',
'vendor/systemjs/dist/system.src.js',
'vendor/zone.js/dist/zone.js',
'vendor/showdown/dist/showdown.js'
'vendor/hammerjs/hammer.min.js',
'@angular2-material/**/*.css',
'vendor/showdown/dist/showdown.js',
]
});
};
36 changes: 8 additions & 28 deletions config/karma-test-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,22 @@ System.import('system-config.js').then(function() {
// Load and configure the TestComponentBuilder.
return Promise.all([
System.import('@angular/core/testing'),
System.import('@angular/platform-browser-dynamic/testing'),
System.import('@angular/router'),
System.import('@angular/http'),
System.import('@angular/forms'),
System.import('@angular/core'),
System.import('@angular2-material/icon'),
System.import('@angular/platform-browser-dynamic/testing')
]).then(function (providers) {
var testing = providers[0];
var testingBrowser = providers[1];
var testingRouter = providers[2];
var testingHttp = providers[3];
var testingForms = providers[4];
var testingCore = providers[5];
var testingIcon = providers[6];
testing.setBaseTestProviders(testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS
);
testing.beforeEach(function(){
testing.addProviders([
testingRouter.ROUTER_DIRECTIVES,
testingRouter.RouterOutletMap,
testingHttp.HTTP_PROVIDERS,
testingForms.disableDeprecatedForms(),
testingForms.provideForms(),
testingIcon.MdIconRegistry,
{ provide: testingRouter.Router, useValue: {} },
{ provide: testingRouter.ActivatedRoute, useValue: {} },
testingCore.ChangeDetectorRef,
]);
});

testing.TestBed.initTestEnvironment(
testingBrowser.BrowserDynamicTestingModule,
testingBrowser.platformBrowserDynamicTesting());
});
}).then(function() {
// Finally, load all spec files.
// This will run the tests directly.
return Promise.all(
allSpecFiles.map(function (moduleName) {
return System.import(moduleName);
return System.import(moduleName).then(function(module) {
return module;
});
}));
}).then(__karma__.start, __karma__.error);
91 changes: 54 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"postinstall": "npm run typings && webdriver-manager update",
"webdriver-update": "bash ./node_modules/.bin/webdriver-manager update",
"pretest": "rm -rf ./dist && ng build",
"test": "karma start ./config/karma.conf.js --single-run",
"test": "npm run karma",
"karma": "karma start ./config/karma.conf.js --single-run",
"bump-dev": "gulp bump-version",
"bump-patch": "gulp bump-version --ver patch",
"bump-minor": "gulp bump-version --ver minor",
Expand Down Expand Up @@ -48,40 +49,55 @@
"Jeremy Wilken <[email protected]>"
],
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/forms": "0.2.0",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.2",
"@angular2-material/button": "2.0.0-alpha.6-2",
"@angular2-material/card": "2.0.0-alpha.6-2",
"@angular2-material/checkbox": "2.0.0-alpha.6-2",
"@angular2-material/core": "2.0.0-alpha.6-2",
"@angular2-material/icon": "2.0.0-alpha.6-2",
"@angular2-material/input": "2.0.0-alpha.6-2",
"@angular2-material/list": "2.0.0-alpha.6-2",
"@angular2-material/menu": "2.0.0-alpha.6-2",
"@angular2-material/progress-bar": "2.0.0-alpha.6-2",
"@angular2-material/progress-circle": "2.0.0-alpha.6-2",
"@angular2-material/radio": "2.0.0-alpha.6-2",
"@angular2-material/sidenav": "2.0.0-alpha.6-2",
"@angular2-material/tabs": "2.0.0-alpha.6-2",
"@angular2-material/toolbar": "2.0.0-alpha.6-2",
"@angular2-material/grid-list": "2.0.0-alpha.6-2",
"@angular2-material/slide-toggle": "2.0.0-alpha.6-2",
"es6-shim": "0.35.1",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"@angular/common": "^2.0.0-rc.6",
"@angular/compiler": "^2.0.0-rc.6",
"@angular/core": "^2.0.0-rc.6",
"@angular/forms": "^2.0.0-rc.6",
"@angular/http": "^2.0.0-rc.6",
"@angular/platform-browser": "^2.0.0-rc.6",
"@angular/platform-browser-dynamic": "^2.0.0-rc.6",
"@angular/platform-server": "^2.0.0-rc.6",
"@angular/router": "^3.0.0-rc.2",
"@angular2-material/button": "^2.0.0-alpha.8-1",
"@angular2-material/button-toggle": "^2.0.0-alpha.8-1",
"@angular2-material/card": "^2.0.0-alpha.8-1",
"@angular2-material/checkbox": "^2.0.0-alpha.8-1",
"@angular2-material/core": "^2.0.0-alpha.8-1",
"@angular2-material/grid-list": "^2.0.0-alpha.8-1",
"@angular2-material/icon": "^2.0.0-alpha.8-1",
"@angular2-material/input": "^2.0.0-alpha.8-1",
"@angular2-material/list": "^2.0.0-alpha.8-1",
"@angular2-material/menu": "^2.0.0-alpha.8-1",
"@angular2-material/progress-bar": "^2.0.0-alpha.8-1",
"@angular2-material/progress-circle": "^2.0.0-alpha.8-1",
"@angular2-material/radio": "^2.0.0-alpha.8-1",
"@angular2-material/sidenav": "^2.0.0-alpha.8-1",
"@angular2-material/slider": "^2.0.0-alpha.8-1",
"@angular2-material/slide-toggle": "^2.0.0-alpha.8-1",
"@angular2-material/tabs": "^2.0.0-alpha.8-1",
"@angular2-material/toolbar": "^2.0.0-alpha.8-1",
"@angular2-material/tooltip": "^2.0.0-alpha.8-1",
"core-js": "^2.4.1",
"rxjs": "5.0.0-beta.11",
"systemjs": "0.19.31",
"zone.js": "^0.6.12",
"zone.js": "0.6.17",
"hammerjs": "^2.0.8",
"showdown": "1.4.2"
},
"devDependencies": {
"angular-cli": "1.0.0-beta.8",
"codelyzer": "0.0.25",
"@angular/compiler-cli": "0.6.0",
"@types/glob": "^5.0.29",
"@types/gulp": "^3.8.29",
"@types/hammerjs": "^2.0.30",
"@types/jasmine": "^2.2.31",
"@types/merge2": "0.0.28",
"@types/minimist": "^1.1.28",
"@types/node": "^6.0.34",
"@types/protractor": "^1.5.11-alpha",
"@types/run-sequence": "0.0.27",
"@types/selenium-webdriver": "^2.44.20-alpha",
"angular-cli": "1.0.0-beta.10",
"codelyzer": "0.0.26",
"del": "2.2.0",
"ember-cli-inject-live-reload": "1.4.0",
"gulp": "3.9.1",
Expand All @@ -92,22 +108,23 @@
"gulp-sourcemaps": "1.6.0",
"gulp-typescript": "2.13.6",
"gulp-util": "3.0.7",
"jasmine-core": "2.4.1",
"jasmine-core": "^2.4.1",
"jasmine-spec-reporter": "2.4.0",
"karma": "^1.1.1",
"karma-firefox-launcher": "1.0.0",
"karma-chrome-launcher": "^1.0.1",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "1.0.2",
"karma-phantomjs-launcher": "1.0.1",
"merge2": "1.0.2",
"minimist": "1.2.0",
"node-sass": "3.8.0",
"phantomjs-prebuilt": "2.1.7",
"protractor": "4.0.0",
"protractor": "4.0.5",
"require-dir": "0.3.0",
"semver": "5.2.0",
"ts-node": "0.9.3",
"tslint": "^3.13.0",
"typescript": "^1.8.10",
"typings": "1.3.1"
"tslint": "^3.14.0",
"typescript": "^2.0.2",
"typings": "1.3.3"
}
}
24 changes: 17 additions & 7 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ $md-warn: #C62828;
md-progress-circle,
md-spinner {
path {
stroke: $md-primary;
stroke: $md-primary !important;
}
&[color='accent'] {
path {
stroke: $md-accent;
stroke: $md-accent !important;
}
}
&[color='warn'] {
path {
stroke: $md-warn;
stroke: $md-warn !important;
}
}
}
Expand All @@ -113,24 +113,34 @@ $md-warn: #C62828;
md-slide-toggle {
&.md-checked {
.md-slide-toggle-thumb {
background-color: $md-accent;
background-color: $md-accent !important;
}
.md-slide-toggle-bar {
background-color: $md-accent-opacity;
background-color: $md-accent-opacity !important;
}
}
&.md-slide-toggle-focused {
.md-ink-ripple {
background-color: $md-accent-opacity;
background-color: $md-accent-opacity !important;
}
}
}
.md-slider-thumb::after {
background-color: $md-accent;
border-color: $md-accent;
}
.md-slider-track-fill {
background-color: $md-accent;
}
md-nav-list {
[md-list-item].active {
md-icon {
md-icon[md-list-avatar] {
background-color: $md-accent;
color: white;
}
md-icon[md-list-icon] {
color: $md-accent;
}
}
}
}
32 changes: 19 additions & 13 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import {
addProviders,
describe,
expect,
it,
TestBed,
inject,
ComponentFixture,
} from '@angular/core/testing';
import { DocsAppComponent } from '../app/app.component';

beforeEach(() => {
addProviders([
DocsAppComponent,
]);
});
import { DocsAppComponent } from './app.component';

describe('Component: App', () => {

TestBed.configureTestingModule({
providers: [
DocsAppComponent,
],
});

TestBed.compileComponents();

beforeEach(inject([], function(): void {

}));

describe('App: ', () => {
it('should create the app', inject([DocsAppComponent], (app: DocsAppComponent) => {
expect(app).toBeTruthy();
it('should create the component', inject([], () => {

}));
});
15 changes: 1 addition & 14 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import { Component } from '@angular/core';
import { ROUTER_DIRECTIVES } from '@angular/router';

import { MdIcon } from '@angular2-material/icon';
import { MD_LIST_DIRECTIVES } from '@angular2-material/list';

import { TdLayoutComponent, TD_LOADING_ENTRY_COMPONENTS } from '../platform/core';

@Component({
directives: [
ROUTER_DIRECTIVES,
MdIcon,
MD_LIST_DIRECTIVES,
TdLayoutComponent,
],
moduleId: module.id,
selector: 'td-docs-app',
selector: 'docs-covalent',
styleUrls: ['app.component.css'],
templateUrl: 'app.component.html',
precompile: [ TD_LOADING_ENTRY_COMPONENTS ],
})
export class DocsAppComponent {

Expand Down
42 changes: 42 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { NgModule } from '@angular/core';

import { DocsAppComponent } from './app.component';
import { HomeComponent } from './components/home/home.component';
import { ComponentsModule } from './components/components/';
import { DocsModule } from './components/docs/';
import { LayoutsModule } from './components/layouts/';
import { StyleGuideModule } from './components/style-guide/';
import { appRoutes, appRoutingProviders } from './app.routes';

import { CovalentCoreModule, TD_LOADING_ENTRY_COMPONENTS } from '../platform/core';
import { CovalentFileModule } from '../platform/file-upload';
import { CovalentHighlightModule } from '../platform/highlight';
import { CovalentMarkdownModule } from '../platform/markdown';
import { CovalentJsonFormatterModule } from '../platform/json-formatter';
import { CovalentChipsModule } from '../platform/chips';

@NgModule({
declarations: [
DocsAppComponent,
HomeComponent,
], // directives, components, and pipes owned by this NgModule
imports: [
ComponentsModule,
DocsModule,
LayoutsModule,
StyleGuideModule,
CovalentCoreModule.forRoot(),
CovalentFileModule.forRoot(),
CovalentHighlightModule,
CovalentMarkdownModule,
CovalentJsonFormatterModule,
CovalentChipsModule,
appRoutes,
], // modules needed to run this module
providers: [
appRoutingProviders,
], // additional providers needed for this module
entryComponents: [ TD_LOADING_ENTRY_COMPONENTS ],
bootstrap: [ DocsAppComponent ],
})
export class AppModule {}
Loading

0 comments on commit 6104b55

Please sign in to comment.