Skip to content

Commit

Permalink
feat(angular): update to angular 2.0.0-rc.6
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveVanOpstal committed Sep 13, 2016
1 parent 5926295 commit 8d5c599
Show file tree
Hide file tree
Showing 32 changed files with 91 additions and 149 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@
"release": "./node_modules/.bin/standard-version && npm run reddit-release"
},
"dependencies": {
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/http": "2.0.0-rc.5",
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",
"@angular/common": "2.0.0-rc.6",
"@angular/compiler": "2.0.0-rc.6",
"@angular/core": "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/router": "3.0.0-rc.2",
"angular2-cookie": "1.2.2",
"angular2-jwt": "0.1.22",
"async": "2.0.1",
Expand All @@ -103,7 +103,7 @@
"es6-shim": "0.35.1",
"lru-cache": "4.0.1",
"reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.6",
"rxjs": "5.0.0-beta.11",
"typescript": "2.0.2",
"zone.js": "0.6.17"
},
Expand Down
2 changes: 0 additions & 2 deletions src/client/actions.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {NgIf} from '@angular/common';
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';

Expand All @@ -7,7 +6,6 @@ import {AuthService} from './services/auth.service';
@Component({
selector: 'actions',
providers: [AuthService],
directives: [NgIf],
template: `
<button [routerLink]="['login']" *ngIf="active()"><span class="align-center">Login</span></button>
<button [routerLink]="['signup']" *ngIf="active()"><span class="align-center">Sign up</span></button>`
Expand Down
82 changes: 78 additions & 4 deletions src/client/boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

import {CommonModule} from '@angular/common';
import {enableProdMode, NgModule} from '@angular/core';
import {HttpModule} from '@angular/http';
import {BrowserModule} from '@angular/platform-browser';
Expand All @@ -27,11 +28,44 @@ import {RouterModule} from '@angular/router';
import {ActionsComponent} from './actions.component';
import {AppComponent} from './app.component';
import {ROUTES} from './app.routes';
import {IconErrorComponent} from './assets/icon-error.component';
import {IconEyeComponent} from './assets/icon-eye.component';
import {IconLoadComponent} from './assets/icon-load.component';
import {IconRankComponent} from './assets/icon-rank.component';
import {IconRefreshComponent} from './assets/icon-refresh.component';
import {BuildComponent} from './build/build.component';
import {AbilitySequenceComponent} from './build/graph/ability-sequence.component';
import {GraphComponent} from './build/graph/graph.component';
import {LegendComponent} from './build/graph/legend.component';
import {ItemSlotComponent} from './build/items/item-slot.component';
import {ItemComponent} from './build/items/item.component';
import {ItemsComponent} from './build/items/items.component';
import {MasteriesComponent} from './build/masteries/masteries.component';
import {MasteryCategoryComponent} from './build/masteries/mastery-category.component';
import {MasteryTierComponent} from './build/masteries/mastery-tier.component';
import {MasteryComponent} from './build/masteries/mastery.component';
import {ChampionPipe} from './build/shop/pipes/champion.pipe';
import {HidePipe} from './build/shop/pipes/hide.pipe';
import {MapPipe} from './build/shop/pipes/map.pipe';
import {TranslatePipe} from './build/shop/pipes/translate.pipe';
import {ItemsFromComponent} from './build/shop/preview/items-from.component';
import {PreviewComponent} from './build/shop/preview/preview.component';
import {ShopComponent} from './build/shop/shop.component';
import {BarComponent} from './champions/bar/bar.component';
import {ChampionsComponent} from './champions/champions.component';
import {FiltersComponent} from './champions/filters/filters.component';
import {NamePipe} from './champions/pipes/name.pipe';
import {SortPipe} from './champions/pipes/sort.pipe';
import {TagsPipe} from './champions/pipes/tags.pipe';
import {LoginComponent} from './login/login.component';
import {MainComponent} from './main/main.component';
import {RegionsComponent} from './region/region.component';
import {CapitalizePipe} from './misc/capitalize.pipe';
import {DDragonDirective} from './misc/ddragon.directive';
import {ErrorComponent} from './misc/error.component';
import {LoadingComponent} from './misc/loading.component';
import {RetryComponent} from './misc/retry.component';
import {ToIterablePipe} from './misc/to-iterable.pipe';
import {RegionComponent} from './region/region.component';
import {SignupComponent} from './signup/signup.component';
import {SummonerComponent} from './summoner/summoner.component';

Expand All @@ -41,10 +75,50 @@ if (ENV === 'production') {

@NgModule({
declarations: [
AppComponent, ActionsComponent, BuildComponent, ChampionsComponent,
RegionsComponent, SummonerComponent, MainComponent, LoginComponent, SignupComponent
AppComponent,
ActionsComponent,
BuildComponent,
ChampionsComponent,
RegionComponent,
SummonerComponent,
MainComponent,
LoginComponent,
SignupComponent,
DDragonDirective,
GraphComponent,
MasteriesComponent,
ItemsComponent,
ShopComponent,
LoadingComponent,
RetryComponent,
FiltersComponent,
TagsPipe,
SortPipe,
NamePipe,
CapitalizePipe,
ToIterablePipe,
BarComponent,
ErrorComponent,
LegendComponent,
AbilitySequenceComponent,
MasteryCategoryComponent,
MasteryTierComponent,
ItemComponent,
MasteryComponent,
ItemSlotComponent,
IconErrorComponent,
IconEyeComponent,
IconLoadComponent,
IconRankComponent,
IconRefreshComponent,
ChampionPipe,
HidePipe,
MapPipe,
TranslatePipe,
PreviewComponent,
ItemsFromComponent
],
imports: [BrowserModule, RouterModule.forRoot(ROUTES), HttpModule],
imports: [BrowserModule, CommonModule, RouterModule.forRoot(ROUTES), HttpModule],
bootstrap: [AppComponent, ActionsComponent]
})
class AppModule {
Expand Down
14 changes: 0 additions & 14 deletions src/client/build/build.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,12 @@ import {Component, OnInit, ViewEncapsulation} from '@angular/core';
import {ActivatedRoute} from '@angular/router';

import {settings} from '../../../config/settings';
import {DDragonDirective} from '../misc/ddragon.directive';
import {LoadingComponent} from '../misc/loading.component';
import {RetryComponent} from '../misc/retry.component';
import {LolApiService} from '../services/lolapi.service';

import {GraphComponent} from './graph/graph.component';
import {Item} from './item';
import {ItemsComponent} from './items/items.component';
import {MasteriesComponent} from './masteries/masteries.component';
import {Samples} from './samples';
import {BuildService} from './services/build.service';
import {StatsService} from './services/stats.service';
import {ShopComponent} from './shop/shop.component';

@Component({
providers: [BuildService, StatsService, LolApiService],
directives: [
GraphComponent, ItemsComponent, MasteriesComponent, ShopComponent, DDragonDirective,
LoadingComponent, RetryComponent
],
encapsulation: ViewEncapsulation.None,
styles: [require('./build.css').toString()],
template: `
Expand Down
3 changes: 0 additions & 3 deletions src/client/build/graph/ability-sequence.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import {NgClass, NgFor} from '@angular/common';
import {Component, Input} from '@angular/core';

import {DDragonDirective} from '../../misc/ddragon.directive';
import {tim} from '../../misc/tim';

@Component({
selector: 'g[ability-sequence]',
directives: [NgFor, NgClass, DDragonDirective],
template: `
<svg:g xmlns="http://www.w3.org/2000/svg" version="1.1" class="ability" [ngClass]="{ult : i == 3}" *ngFor="let spell of champion?.spells; let i = index">
<g fill="gray">
Expand Down
8 changes: 1 addition & 7 deletions src/client/build/graph/graph.component.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import {NgClass, NgFor} from '@angular/common';
import {AfterContentChecked, ChangeDetectionStrategy, Component, ElementRef, Inject, Input, OnInit, SimpleChanges} from '@angular/core';
import {AfterContentChecked, ChangeDetectionStrategy, Component, ElementRef, Inject, Input, OnInit} from '@angular/core';
import {select} from 'd3-selection';
import {curveStepAfter, Line, line} from 'd3-shape';

import {settings} from '../../../../config/settings';
import {Item} from '../item';
import {Samples} from '../samples';
import {BuildService} from '../services/build.service';

import {AbilitySequenceComponent} from './ability-sequence.component';
import {DataAxis, LevelAxisLine, LevelAxisText, TimeAxis} from './axes';
import {config} from './config';
import {LegendComponent} from './legend.component';
import {DataScale, LevelScale, TimeScale} from './scales';

export interface Path {
Expand All @@ -24,7 +20,6 @@ export interface Path {
@Component({
selector: 'graph',
changeDetection: ChangeDetectionStrategy.OnPush,
directives: [LegendComponent, AbilitySequenceComponent, NgFor, NgClass],
template: `
<legend [paths]="paths"></legend>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" [attr.viewBox]="'0 0 ' + config.width + ' ' + config.height">
Expand Down Expand Up @@ -166,5 +161,4 @@ export class GraphComponent implements OnInit, AfterContentChecked {
.attr('type', 'checkbox');
}
}

}
3 changes: 0 additions & 3 deletions src/client/build/graph/legend.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import {NgClass, NgFor} from '@angular/common';
import {Component, Input} from '@angular/core';

import {Item} from '../item';
import {Path} from './graph.component';

@Component({
selector: 'legend',
directives: [NgFor, NgClass],
template: `
<ul (mouseleave)="mouseLeave()">
<li *ngFor="let path of paths">
Expand Down
4 changes: 0 additions & 4 deletions src/client/build/items/item-slot.component.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import {NgClass} from '@angular/common';
import {Component, Input, OnInit} from '@angular/core';

import {settings} from '../../../../config/settings';
import {Item} from '../item';
import {Samples} from '../samples';
import {BuildService} from '../services/build.service';

import {ItemComponent} from './item.component';

@Component({
selector: 'item-slot',
directives: [NgClass, ItemComponent],
template: `
<template ngFor let-item [ngForOf]="items">
<item [item]="item" [ngClass]="{disabled: item.disabled}" (contextmenu)="rightClicked(item)"></item>
Expand Down
3 changes: 0 additions & 3 deletions src/client/build/items/item.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import {NgIf} from '@angular/common';
import {Component, ElementRef, Input, OnInit} from '@angular/core';

import {DDragonDirective} from '../../misc/ddragon.directive';
import {TimeScale} from '../graph/scales';
import {Item} from '../item';

@Component({
selector: 'item',
directives: [NgIf, DDragonDirective],
template: `
<img [ddragon]="'item/' + item.image.full">
<p *ngIf="item.bundle > 1" class="bundle">x{{item.bundle}}</p>
Expand Down
1 change: 0 additions & 1 deletion src/client/build/items/items.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {ItemSlotComponent} from './item-slot.component';

@Component({
selector: 'items',
directives: [ItemSlotComponent],
template: `
<item-slot [id]="0"></item-slot>
<item-slot [id]="1"></item-slot>
Expand Down
5 changes: 0 additions & 5 deletions src/client/build/masteries/masteries.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {NgFor} from '@angular/common';
import {Component, OnInit, QueryList, ViewChildren} from '@angular/core';

import {LoadingComponent} from '../../misc/loading.component';
import {RetryComponent} from '../../misc/retry.component';
import {LolApiService} from '../../services/lolapi.service';

import {MasteryCategoryComponent} from './mastery-category.component';
Expand All @@ -11,8 +8,6 @@ import {MasteryComponent} from './mastery.component';

@Component({
selector: 'masteries',
providers: [LolApiService],
directives: [NgFor, MasteryCategoryComponent, LoadingComponent, RetryComponent],
template: `
<mastery-category [class]="category.name + ' noselect'" [data]="category" *ngFor="let category of data" (rankAdded)="rankAdd($event)" (rankRemoved)="rankRemove($event)"></mastery-category>
<loading [loading]="loading"></loading>
Expand Down
2 changes: 0 additions & 2 deletions src/client/build/masteries/mastery-category.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {NgFor} from '@angular/common';
import {Component, EventEmitter, Input, Output, QueryList, ViewChildren} from '@angular/core';

import {MasteryTierComponent} from './mastery-tier.component';
Expand All @@ -11,7 +10,6 @@ type EventData = {

@Component({
selector: 'mastery-category',
directives: [NgFor, MasteryTierComponent],
template: `
<mastery-tier [data]="tier" [index]="i" *ngFor="let tier of data.tiers; let i = index" (rankAdded)="rankAdd($event)" (rankRemoved)="rankRemove($event)"></mastery-tier>
<p class="total">{{data.name + ': ' + totalRank}}</p>`
Expand Down
2 changes: 0 additions & 2 deletions src/client/build/masteries/mastery-tier.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {NgFor} from '@angular/common';
import {Component, EventEmitter, Input, Output, QueryList, ViewChildren} from '@angular/core';

import {MasteryComponent} from './mastery.component';
Expand All @@ -10,7 +9,6 @@ type EventData = {

@Component({
selector: 'mastery-tier',
directives: [NgFor, MasteryComponent],
template: `
<mastery [data]="mastery" [enabled]="index == 0" *ngFor="let mastery of data" (rankAdded)="rankAdd($event)" (rankRemoved)="rankRemove($event)"></mastery>`
})
Expand Down
5 changes: 1 addition & 4 deletions src/client/build/masteries/mastery.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import {NgClass, NgIf} from '@angular/common';
import {Component, EventEmitter, Input, OnChanges, Output} from '@angular/core';

import {Colors, IconRankComponent} from '../../assets/icon-rank.component';
import {DDragonDirective} from '../../misc/ddragon.directive';
import {Colors} from '../../assets/icon-rank.component';

@Component({
selector: 'mastery',
directives: [NgIf, NgClass, DDragonDirective, IconRankComponent],
template: `
<div *ngIf="data" [ngClass]="{enabled: enabled, active: active}" (click)="clicked()" (contextmenu)="rightClicked()" (dragend)="dragEnd()">
<icon-rank [rank]="rank" [maxRank]="data.ranks" [color]="color"></icon-rank>
Expand Down
4 changes: 0 additions & 4 deletions src/client/build/services/stats.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,6 @@ export class StatsService {
}

addStat(stats: Array<any>, stat: Stat, time: number, flat: boolean) {
let statSample = stats[stat.name].find((s) => {
return s.time === time;
});

for (let index in stats[stat.name]) {
let sample = stats[stat.name][index];
if (sample.time === time) {
Expand Down
3 changes: 0 additions & 3 deletions src/client/build/shop/item.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import {Component, Input} from '@angular/core';

import {DDragonDirective} from '../../misc/ddragon.directive';

@Component({
selector: 'item',
directives: [DDragonDirective],
template: `
<img [ddragon]="'item/' + item.image.full">
<div>
Expand Down
2 changes: 0 additions & 2 deletions src/client/build/shop/preview/item.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import {Component, EventEmitter, Input, Output} from '@angular/core';

import {DDragonDirective} from '../../../misc/ddragon.directive';
import {Item} from '../../item';

@Component({
selector: 'item',
directives: [DDragonDirective],
template: `
<img [ddragon]="'item/' + item?.image?.full" (click)="selectItem(item)" (contextmenu)="pickItem(item)">
<p class="gold" (click)="selectItem(item)" (contextmenu)="pickItem(item)">{{item?.gold?.total ? item?.gold?.total : ''}}</p>`
Expand Down
3 changes: 0 additions & 3 deletions src/client/build/shop/preview/items-from.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import {NgFor, NgIf} from '@angular/common';
import {Component, EventEmitter, Input, Output} from '@angular/core';

import {ItemBundle} from './item-bundle';
import {ItemComponent} from './item.component';

@Component({
selector: 'items-from',
directives: [NgFor, NgIf, ItemComponent, ItemsFromComponent],
template: `
<div *ngFor="let bundle of items">
<hr class="up">
Expand Down
5 changes: 0 additions & 5 deletions src/client/build/shop/preview/preview.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
import {NgIf} from '@angular/common';
import {Component, EventEmitter, Input, OnChanges, Output} from '@angular/core';

import {Item} from '../../item';

import {ItemBundle} from './item-bundle';
import {ItemComponent} from './item.component';
import {ItemsFromComponent} from './items-from.component';

@Component({
selector: 'preview',
directives: [NgIf, ItemComponent, ItemsFromComponent],
template: `
<div class="into">
<template ngFor let-item [ngForOf]="itemsInto">
Expand Down
Loading

0 comments on commit 8d5c599

Please sign in to comment.