Skip to content

Commit

Permalink
HIPCMS-424 deleted unused directives imports
Browse files Browse the repository at this point in the history
added workaround for weired ripple effect (angular/components#972)
  • Loading branch information
maltehol committed Aug 30, 2016
1 parent 35ee45d commit ce8133a
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 46 deletions.
8 changes: 3 additions & 5 deletions app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import { TranslateModule } from 'ng2-translate';
import { ContactComponent } from './contact/contact.component';
import { AboutComponent } from './about/about.component';
import { HelpComponent } from './help/help.component';
import { NewTopicComponent } from './topics/new-topic/new-topic.component';
import { MyTopicsComponent } from './topics/my-topics-list/my-topics-list.component';
import { AdminComponent } from './admin/admin.component';
import { MdIconModule } from '@angular2-material/icon';
import { MdInputModule } from '@angular2-material/input';
Expand All @@ -29,6 +27,7 @@ import { MdListModule } from '@angular2-material/list';
import { MdCoreModule, MdRippleModule } from '@angular2-material/core';
import { MdToolbarModule } from '@angular2-material/toolbar';
import { MdSidenavModule } from '@angular2-material/sidenav';
import { TopicModule } from './topics/topics.module';


@NgModule({
Expand All @@ -48,7 +47,8 @@ import { MdSidenavModule } from '@angular2-material/sidenav';
MdToolbarModule,
MdSidenavModule,
MdRippleModule,
routing
routing,
TopicModule
],
declarations: [
AppComponent,
Expand All @@ -60,8 +60,6 @@ import { MdSidenavModule } from '@angular2-material/sidenav';
ContactComponent,
AboutComponent,
HelpComponent,
NewTopicComponent,
MyTopicsComponent,
AdminComponent
],
providers: [
Expand Down
10 changes: 0 additions & 10 deletions app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ const appRoutes: Routes = [
component: DashboardComponent,
canActivate: [AuthGuard]
},
{
path: 'my-topics',
component: MyTopicsComponent,
canActivate: [AuthGuard]
},
{
path: 'new-topic',
component: NewTopicComponent,
canActivate: [AuthGuard, SupervisorGuard]
},
{
path: 'admin',
component: AdminComponent,
Expand Down
11 changes: 1 addition & 10 deletions app/shared/sidenav/sidenav.component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Component, NgZone, OnInit } from '@angular/core';
import { ROUTER_DIRECTIVES, Router } from '@angular/router';
import { MdButton } from '@angular2-material/button';
import { MdList, MD_LIST_DIRECTIVES } from '@angular2-material/list';
import { MdSidenav, MdSidenavLayout } from '@angular2-material/sidenav';
import { Router } from '@angular/router';

import { DashboardComponent } from '../../dashboard/dashboard.component';
import { ToolbarComponent } from './../toolbar/toolbar.component';
Expand All @@ -18,16 +15,10 @@ import { TranslateService } from '../translate/translate.service';
templateUrl: './app/shared/sidenav/sidenav.component.html',
styleUrls: ['./app/shared/sidenav/sidenav.component.css'],
directives: [
MdButton,
MdList,
MD_LIST_DIRECTIVES,
MdSidenav,
MdSidenavLayout,
DashboardComponent,
ToolbarComponent,
FooterComponent,
AdminComponent,
ROUTER_DIRECTIVES,
ToasterContainerComponent
],
providers: [ToasterService, TranslateService]
Expand Down
2 changes: 1 addition & 1 deletion app/shared/toolbar/toolbar.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<md-toolbar color="primary">
<div class="margin-right" *ngIf="!loggedIn"></div>
<button md-button #mybutton (click)="start.toggle()" *ngIf="(!sidenavOpened && loggedIn)">
<button md-button #mybutton (click)="start.toggle()" *ngIf="(!sidenavOpened && loggedIn)" [disableRipple]="true">
<md-icon class="menu-button">menu</md-icon>
</button>
<a href="/" class="logo"><span> </span></a>
Expand Down
8 changes: 2 additions & 6 deletions app/shared/toolbar/toolbar.component.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import {Component, Input, OnInit} from '@angular/core';
import { MdIcon, MdIconRegistry } from '@angular2-material/icon';
import { MdSidenav } from '@angular2-material/sidenav';
import { MdToolbar } from '@angular2-material/toolbar';
import { Router, ROUTER_DIRECTIVES } from '@angular/router';
import { Router } from '@angular/router';

import { AuthService } from '../auth/auth.service';
import { CmsApiService } from '../api/cms-api.service';
import { UserService } from '../user/user.service';
import { User } from '../user/user.model';
import { TranslateService } from '../translate';
import { MdSidenav } from '@angular2-material/sidenav';

@Component({
selector: 'hip-toolbar',
viewProviders: [MdIconRegistry],
templateUrl: './app/shared/toolbar/toolbar.component.html',
styleUrls: ['./app/shared/toolbar/toolbar.component.css'],
directives: [MdToolbar, MdIcon, ROUTER_DIRECTIVES],
providers: [UserService, CmsApiService]
})
export class ToolbarComponent implements OnInit {
Expand Down
6 changes: 1 addition & 5 deletions app/topics/my-topics-list/my-topics-list.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { MdCard } from '@angular2-material/card';
import { MdList, MD_LIST_DIRECTIVES } from '@angular2-material/list';
import { MdIcon, MdIconRegistry } from '@angular2-material/icon';

import { ShowTopicComponent } from '../show-topic/show-topic.component';
import { TopicTitleComponent } from '../shared/topic-title.component';
Expand All @@ -15,8 +12,7 @@ import { UserService } from '../../shared/user/user.service';
selector: 'hip-my-topics',
templateUrl: './app/topics/my-topics-list/my-topics-list.component.html',
styleUrls: ['./app/topics/my-topics-list/my-topics-list.component.css'],
directives: [MdCard, MdIcon, MdList, MD_LIST_DIRECTIVES, ShowTopicComponent, TopicTitleComponent],
viewProviders: [MdIconRegistry],
directives: [ShowTopicComponent, TopicTitleComponent],
providers: [TopicService, CmsApiService, UserService]
})
export class MyTopicsComponent implements OnInit {
Expand Down
6 changes: 1 addition & 5 deletions app/topics/new-topic/new-topic.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import { Component } from '@angular/core';

import { TopicTitleComponent } from '../shared/topic-title.component';
import { ShowTopicComponent } from '../show-topic/show-topic.component';

@Component({
selector: 'hip-new-topic',
templateUrl: './app/topics/new-topic/new-topic.component.html',
// directives: [TopicTitleComponent, ShowTopicComponent]
templateUrl: './app/topics/new-topic/new-topic.component.html'
})
export class NewTopicComponent {
}
4 changes: 1 addition & 3 deletions app/topics/shared/topic-title.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Component, Input } from '@angular/core';
import { MdCard } from '@angular2-material/card';

@Component({
selector: 'hip-topic-title',
templateUrl: './app/topics/shared/topic-title.component.html',
styleUrls: ['./app/topics/shared/topic-title.component.css'],
directives: [MdCard]
styleUrls: ['./app/topics/shared/topic-title.component.css']
})
export class TopicTitleComponent {
@Input() title: string = 'No Title';
Expand Down
2 changes: 1 addition & 1 deletion app/topics/show-topic/show-topic.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ShowTopicComponent implements OnInit {
}
this.userService.getCurrent().then(
user => {
this.disableEditing = (user.role !== 'Supervisor' || user.role !== 'Administrator');
this.disableEditing = (user.role !== 'Supervisor' && user.role !== 'Administrator');
}
);
console.log(this.topic);
Expand Down

0 comments on commit ce8133a

Please sign in to comment.