From c0fc801208705196f02ad7881709eadfaae41f09 Mon Sep 17 00:00:00 2001 From: mustafahlvc Date: Thu, 17 Aug 2017 10:31:04 +0300 Subject: [PATCH] Code inspections. --- .../shortcuts/shortcuts.component.ts | 2 +- .../theme-options.component.html | 2 +- .../theme-options.component.scss | 1 - .../theme-options/theme-options.component.ts | 2 +- .../widget/widget-toggle.directive.ts | 2 +- src/app/core/fuseUtils.ts | 6 +--- src/app/core/scss/partials/_page-layouts.scss | 2 +- src/app/core/services/match-media.service.ts | 2 -- .../apps/calendar/calendar.component.ts | 9 ++--- .../sidenavs/left/chats/chats.component.html | 1 - .../contact-form/contact-form.component.ts | 2 +- .../dashboards/project/project.component.ts | 1 - .../file-list/file-list.component.ts | 1 - .../todo-details/todo-details.component.ts | 35 ++++++++++--------- .../todo-list-item.component.ts | 8 +++-- .../main/content/apps/todo/todo.service.ts | 2 +- .../login-2/login-2.component.scss | 3 +- .../register-2/register-2.component.scss | 3 +- 18 files changed, 38 insertions(+), 46 deletions(-) diff --git a/src/app/core/components/shortcuts/shortcuts.component.ts b/src/app/core/components/shortcuts/shortcuts.component.ts index e3e1df37..be1a9ab0 100644 --- a/src/app/core/components/shortcuts/shortcuts.component.ts +++ b/src/app/core/components/shortcuts/shortcuts.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, ViewChild, ViewChildren } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; import { FuseNavigationService } from '../navigation/navigation.service'; @Component({ diff --git a/src/app/core/components/theme-options/theme-options.component.html b/src/app/core/components/theme-options/theme-options.component.html index 5ecd290b..53de31c8 100644 --- a/src/app/core/components/theme-options/theme-options.component.html +++ b/src/app/core/components/theme-options/theme-options.component.html @@ -1,4 +1,4 @@ - diff --git a/src/app/core/components/theme-options/theme-options.component.scss b/src/app/core/components/theme-options/theme-options.component.scss index 86339431..b7ff8746 100644 --- a/src/app/core/components/theme-options/theme-options.component.scss +++ b/src/app/core/components/theme-options/theme-options.component.scss @@ -26,7 +26,6 @@ position: absolute; top: 0; left: -48px; - z-index: 998; width: 48px; height: 48px; line-height: 48px; diff --git a/src/app/core/components/theme-options/theme-options.component.ts b/src/app/core/components/theme-options/theme-options.component.ts index 3c0d9a82..c4a172cb 100644 --- a/src/app/core/components/theme-options/theme-options.component.ts +++ b/src/app/core/components/theme-options/theme-options.component.ts @@ -1,5 +1,5 @@ import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; -import { style, animate, sequence, AnimationBuilder, AnimationPlayer } from '@angular/animations'; +import { style, animate, AnimationBuilder, AnimationPlayer } from '@angular/animations'; import { Subscription } from 'rxjs/Subscription'; import { FuseLayoutService } from '../../services/layout.service'; diff --git a/src/app/core/components/widget/widget-toggle.directive.ts b/src/app/core/components/widget/widget-toggle.directive.ts index b15d6def..f777c588 100644 --- a/src/app/core/components/widget/widget-toggle.directive.ts +++ b/src/app/core/components/widget/widget-toggle.directive.ts @@ -1,4 +1,4 @@ -import { AfterViewInit, ContentChild, Directive, ElementRef, OnInit, ViewChild } from '@angular/core'; +import { AfterViewInit, Directive, ElementRef, OnInit } from '@angular/core'; @Directive({ selector: '[fuseWidgetToggle]' diff --git a/src/app/core/fuseUtils.ts b/src/app/core/fuseUtils.ts index fcacfa09..110ce790 100644 --- a/src/app/core/fuseUtils.ts +++ b/src/app/core/fuseUtils.ts @@ -78,11 +78,7 @@ export class FuseUtils public static searchInSting(value, searchText) { - if ( value.toLowerCase().includes(searchText) ) - { - return true; - } - return false; + return value.toLowerCase().includes(searchText); } public static genearateGUID() diff --git a/src/app/core/scss/partials/_page-layouts.scss b/src/app/core/scss/partials/_page-layouts.scss index c13de244..60675e91 100644 --- a/src/app/core/scss/partials/_page-layouts.scss +++ b/src/app/core/scss/partials/_page-layouts.scss @@ -248,7 +248,7 @@ $carded-header-height-without-toolbar-sm: $carded-header-height-sm - $carded-too &.md-is-locked-open { ~ .mat-sidenav-content { - margin-right: 0px !important; + margin-right: 0 !important; .center { margin-right: 0; diff --git a/src/app/core/services/match-media.service.ts b/src/app/core/services/match-media.service.ts index d84dac0e..b7ab8ece 100644 --- a/src/app/core/services/match-media.service.ts +++ b/src/app/core/services/match-media.service.ts @@ -1,6 +1,4 @@ import { MediaChange, ObservableMedia } from '@angular/flex-layout'; -import { Observable } from 'rxjs/Observable'; -import { Observer } from 'rxjs/Observer'; import { EventEmitter, Injectable } from '@angular/core'; @Injectable() diff --git a/src/app/main/content/apps/calendar/calendar.component.ts b/src/app/main/content/apps/calendar/calendar.component.ts index 55e025d8..15202791 100644 --- a/src/app/main/content/apps/calendar/calendar.component.ts +++ b/src/app/main/content/apps/calendar/calendar.component.ts @@ -1,5 +1,5 @@ import { startOfDay, endOfDay, subDays, addDays, endOfMonth, isSameDay, isSameMonth, addHours } from 'date-fns'; -import { ChangeDetectionStrategy, Component, OnInit, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core'; +import { ChangeDetectionStrategy, Component, OnInit, ViewEncapsulation } from '@angular/core'; import { Subject } from 'rxjs/Subject'; import { MdDialog, MdDialogRef } from '@angular/material'; import { EventFormDialogComponent } from './event-form/event-form.component'; @@ -41,8 +41,10 @@ export class CalendarComponent implements OnInit selectedDay: any; - constructor(public dialog: MdDialog, - public calendarService: CalendarService) + constructor( + public dialog: MdDialog, + public calendarService: CalendarService + ) { this.view = 'month'; this.viewDate = new Date(); @@ -124,7 +126,6 @@ export class CalendarComponent implements OnInit } - /** * Day clicked * @param {MonthViewDay} day diff --git a/src/app/main/content/apps/chat/sidenavs/left/chats/chats.component.html b/src/app/main/content/apps/chat/sidenavs/left/chats/chats.component.html index 83b0b320..be018d5c 100644 --- a/src/app/main/content/apps/chat/sidenavs/left/chats/chats.component.html +++ b/src/app/main/content/apps/chat/sidenavs/left/chats/chats.component.html @@ -127,7 +127,6 @@
{{contacts |getById:chat.contactId:'name'}}
-

{{chat.lastMessage}}

diff --git a/src/app/main/content/apps/contacts/contact-form/contact-form.component.ts b/src/app/main/content/apps/contacts/contact-form/contact-form.component.ts index 9243399c..7d0e2f10 100644 --- a/src/app/main/content/apps/contacts/contact-form/contact-form.component.ts +++ b/src/app/main/content/apps/contacts/contact-form/contact-form.component.ts @@ -1,7 +1,7 @@ import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core'; import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material'; import { CalendarEvent } from 'angular-calendar'; -import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup } from '@angular/forms'; import 'rxjs/Rx'; import { Contact } from '../contact.model'; diff --git a/src/app/main/content/apps/dashboards/project/project.component.ts b/src/app/main/content/apps/dashboards/project/project.component.ts index ade96d03..500b0067 100644 --- a/src/app/main/content/apps/dashboards/project/project.component.ts +++ b/src/app/main/content/apps/dashboards/project/project.component.ts @@ -1,5 +1,4 @@ import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; -import { FuseLayoutService } from '../../../../../core/services/layout.service'; import { ProjectsDashboardService } from './projects.service'; import * as shape from 'd3-shape'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; diff --git a/src/app/main/content/apps/file-manager/file-list/file-list.component.ts b/src/app/main/content/apps/file-manager/file-list/file-list.component.ts index cf53245d..1efd7919 100644 --- a/src/app/main/content/apps/file-manager/file-list/file-list.component.ts +++ b/src/app/main/content/apps/file-manager/file-list/file-list.component.ts @@ -1,5 +1,4 @@ import { Component, OnInit } from '@angular/core'; -import { Http } from '@angular/http'; import { FileManagerService } from '../file-manager.service'; import { DataSource } from '@angular/cdk'; import { Observable } from 'rxjs/Observable'; diff --git a/src/app/main/content/apps/todo/todo-details/todo-details.component.ts b/src/app/main/content/apps/todo/todo-details/todo-details.component.ts index 2cdf31ed..96f7030b 100644 --- a/src/app/main/content/apps/todo/todo-details/todo-details.component.ts +++ b/src/app/main/content/apps/todo/todo-details/todo-details.component.ts @@ -1,8 +1,8 @@ -import { AfterViewInit, Component, OnDestroy, OnInit, ViewChildren } from '@angular/core'; +import { Component, OnDestroy, OnInit, ViewChildren } from '@angular/core'; import { TodoService } from '../todo.service'; import { Todo } from '../todo.model'; import { Subscription } from 'rxjs/Subscription'; -import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup } from '@angular/forms'; import { FuseUtils } from '../../../../../core/fuseUtils'; @Component({ @@ -23,8 +23,10 @@ export class TodoDetailsComponent implements OnInit, OnDestroy onTagsChanged: Subscription; onNewTodoClicked: Subscription; - constructor(private todoService: TodoService, - private formBuilder: FormBuilder) + constructor( + private todoService: TodoService, + private formBuilder: FormBuilder + ) { } @@ -45,11 +47,11 @@ export class TodoDetailsComponent implements OnInit, OnDestroy this.todoForm = this.createTodoForm(); this.onFormChange = this.todoForm.valueChanges - .debounceTime(500) - .distinctUntilChanged() - .subscribe(data => { - this.todoService.updateTodo(data); - }); + .debounceTime(500) + .distinctUntilChanged() + .subscribe(data => { + this.todoService.updateTodo(data); + }); } }); @@ -62,13 +64,13 @@ export class TodoDetailsComponent implements OnInit, OnDestroy // Subscribe to update on tag change this.onNewTodoClicked = this.todoService.onNewTodoClicked - .subscribe(() => { - this.todo = new Todo({}); - this.todo.id = FuseUtils.genearateGUID(); - this.formType = 'new'; - this.todoForm = this.createTodoForm(); - this.focusTitleField(); - }); + .subscribe(() => { + this.todo = new Todo({}); + this.todo.id = FuseUtils.genearateGUID(); + this.formType = 'new'; + this.todoForm = this.createTodoForm(); + this.focusTitleField(); + }); } focusTitleField() @@ -94,7 +96,6 @@ export class TodoDetailsComponent implements OnInit, OnDestroy }); } - toggleStar(event) { event.stopPropagation(); diff --git a/src/app/main/content/apps/todo/todo-list/todo-list-item/todo-list-item.component.ts b/src/app/main/content/apps/todo/todo-list/todo-list-item/todo-list-item.component.ts index a14c445f..324f4cac 100644 --- a/src/app/main/content/apps/todo/todo-list/todo-list-item/todo-list-item.component.ts +++ b/src/app/main/content/apps/todo/todo-list/todo-list-item/todo-list-item.component.ts @@ -2,7 +2,7 @@ import { Component, HostBinding, Input, OnDestroy, OnInit, ViewEncapsulation } f import { Todo } from '../../todo.model'; import { TodoService } from '../../todo.service'; import { Subscription } from 'rxjs/Subscription'; -import { ActivatedRoute, ActivatedRouteSnapshot, Route, Router } from '@angular/router'; +import { ActivatedRoute } from '@angular/router'; @Component({ selector : 'fuse-todo-list-item', @@ -21,8 +21,10 @@ export class TodoListItemComponent implements OnInit, OnDestroy onSelectedTodosChanged: Subscription; onTagsChanged: Subscription; - constructor(private todoService: TodoService, - private route: ActivatedRoute) + constructor( + private todoService: TodoService, + private route: ActivatedRoute + ) { // Disable move if path is not /all if ( route.snapshot.url[0].path !== 'all' ) diff --git a/src/app/main/content/apps/todo/todo.service.ts b/src/app/main/content/apps/todo/todo.service.ts index ccc32d23..ecf6ffed 100644 --- a/src/app/main/content/apps/todo/todo.service.ts +++ b/src/app/main/content/apps/todo/todo.service.ts @@ -391,7 +391,7 @@ export class TodoService implements Resolve /** * Update the todo - * @param todo + * @param todos * @returns {Promise} */ updateTodos(todos) diff --git a/src/app/main/content/pages/authentication/login-2/login-2.component.scss b/src/app/main/content/pages/authentication/login-2/login-2.component.scss index e4d3d520..f63666af 100644 --- a/src/app/main/content/pages/authentication/login-2/login-2.component.scss +++ b/src/app/main/content/pages/authentication/login-2/login-2.component.scss @@ -4,7 +4,6 @@ #login { width: 100%; - overflow: auto; overflow: hidden; background: url('/assets/images/backgrounds/march.jpg') no-repeat; background-size: cover; @@ -213,4 +212,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/app/main/content/pages/authentication/register-2/register-2.component.scss b/src/app/main/content/pages/authentication/register-2/register-2.component.scss index 2f14b1cb..e583e60c 100644 --- a/src/app/main/content/pages/authentication/register-2/register-2.component.scss +++ b/src/app/main/content/pages/authentication/register-2/register-2.component.scss @@ -4,7 +4,6 @@ #register { width: 100%; - overflow: auto; overflow: hidden; background: url('/assets/images/backgrounds/march.jpg') no-repeat; background-size: cover; @@ -193,4 +192,4 @@ } } } -} \ No newline at end of file +}