From 2bdeb94f69b30792f2706835bce3efad10f358e3 Mon Sep 17 00:00:00 2001 From: Mota Date: Tue, 19 Jun 2018 10:53:12 -0300 Subject: [PATCH 01/20] creating tutorial page Co-authored-by: marcelo046 --- src/app/app.module.ts | 4 +++- src/app/app.routes.ts | 4 +++- src/app/tutorial/tutorial.component.css | 0 src/app/tutorial/tutorial.component.html | 3 +++ src/app/tutorial/tutorial.component.spec.ts | 25 +++++++++++++++++++++ src/app/tutorial/tutorial.component.ts | 15 +++++++++++++ 6 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/app/tutorial/tutorial.component.css create mode 100644 src/app/tutorial/tutorial.component.html create mode 100644 src/app/tutorial/tutorial.component.spec.ts create mode 100644 src/app/tutorial/tutorial.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ac87976..1a5472f 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -32,6 +32,7 @@ import { ReferralPanelComponent } from './students/referral-panel/refe import { DailyLogPanelComponent } from './students/daily-log-panel/daily-log-panel.component'; import { RecommendationPanelComponent } from './students/recommendation-panel/recommendation-panel.component'; import { AdminPageComponent } from './profile/admin-page/admin-page.component'; +import { TutorialComponent } from './tutorial/tutorial.component'; @NgModule({ declarations: [ @@ -54,7 +55,8 @@ import { AdminPageComponent } from './profile/admin-page/admin-pag ReferralPanelComponent, DailyLogPanelComponent, RecommendationPanelComponent, - AdminPageComponent + AdminPageComponent, + TutorialComponent ], imports: [ diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 1896cb5..6afa793 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -18,6 +18,7 @@ import { ReferralPanelComponent } from './students/referral-panel/referral import { DailyLogPanelComponent } from './students/daily-log-panel/daily-log-panel.component'; import { RecommendationPanelComponent } from './students/recommendation-panel/recommendation-panel.component'; import { AdminPageComponent } from './profile/admin-page/admin-page.component'; +import { TutorialComponent } from './tutorial/tutorial.component'; const APP_ROUTES: Routes = [ { path: '' , redirectTo: 'students' , pathMatch: 'full' }, @@ -35,7 +36,8 @@ const APP_ROUTES: Routes = [ { path: 'report/:id' , component: ReportFormComponent , canActivate: [AuthGuard] }, { path: 'reports' , component: ReportComponent , canActivate: [AuthGuard] }, { path: 'recommendation/:id', component: RecommendationPanelComponent, canActivate: [AuthGuard] }, - { path: 'admin' , component: AdminPageComponent, canActivate: [AuthGuard] } + { path: 'admin' , component: AdminPageComponent, canActivate: [AuthGuard] }, + { path: 'tutorial' , component: TutorialComponent, canActivate: [AuthGuard] } ]; export const routes: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); diff --git a/src/app/tutorial/tutorial.component.css b/src/app/tutorial/tutorial.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/tutorial/tutorial.component.html b/src/app/tutorial/tutorial.component.html new file mode 100644 index 0000000..7f0c9eb --- /dev/null +++ b/src/app/tutorial/tutorial.component.html @@ -0,0 +1,3 @@ +

+ tutorial works! +

diff --git a/src/app/tutorial/tutorial.component.spec.ts b/src/app/tutorial/tutorial.component.spec.ts new file mode 100644 index 0000000..094ad43 --- /dev/null +++ b/src/app/tutorial/tutorial.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TutorialComponent } from './tutorial.component'; + +describe('TutorialComponent', () => { + let component: TutorialComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TutorialComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TutorialComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/tutorial/tutorial.component.ts b/src/app/tutorial/tutorial.component.ts new file mode 100644 index 0000000..bbbff5c --- /dev/null +++ b/src/app/tutorial/tutorial.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-tutorial', + templateUrl: './tutorial.component.html', + styleUrls: ['./tutorial.component.css'] +}) +export class TutorialComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} From 083b62a2c0e4f0a2bcf5fb7189c629daa251134f Mon Sep 17 00:00:00 2001 From: Mota Date: Tue, 19 Jun 2018 10:53:12 -0300 Subject: [PATCH 02/20] creating tutorial page Co-authored-by: marcelo046 Co-authored-by: gitgabiru --- src/app/app.module.ts | 4 +++- src/app/app.routes.ts | 4 +++- src/app/tutorial/tutorial.component.css | 0 src/app/tutorial/tutorial.component.html | 3 +++ src/app/tutorial/tutorial.component.spec.ts | 25 +++++++++++++++++++++ src/app/tutorial/tutorial.component.ts | 15 +++++++++++++ 6 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/app/tutorial/tutorial.component.css create mode 100644 src/app/tutorial/tutorial.component.html create mode 100644 src/app/tutorial/tutorial.component.spec.ts create mode 100644 src/app/tutorial/tutorial.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ac87976..1a5472f 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -32,6 +32,7 @@ import { ReferralPanelComponent } from './students/referral-panel/refe import { DailyLogPanelComponent } from './students/daily-log-panel/daily-log-panel.component'; import { RecommendationPanelComponent } from './students/recommendation-panel/recommendation-panel.component'; import { AdminPageComponent } from './profile/admin-page/admin-page.component'; +import { TutorialComponent } from './tutorial/tutorial.component'; @NgModule({ declarations: [ @@ -54,7 +55,8 @@ import { AdminPageComponent } from './profile/admin-page/admin-pag ReferralPanelComponent, DailyLogPanelComponent, RecommendationPanelComponent, - AdminPageComponent + AdminPageComponent, + TutorialComponent ], imports: [ diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 1896cb5..6afa793 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -18,6 +18,7 @@ import { ReferralPanelComponent } from './students/referral-panel/referral import { DailyLogPanelComponent } from './students/daily-log-panel/daily-log-panel.component'; import { RecommendationPanelComponent } from './students/recommendation-panel/recommendation-panel.component'; import { AdminPageComponent } from './profile/admin-page/admin-page.component'; +import { TutorialComponent } from './tutorial/tutorial.component'; const APP_ROUTES: Routes = [ { path: '' , redirectTo: 'students' , pathMatch: 'full' }, @@ -35,7 +36,8 @@ const APP_ROUTES: Routes = [ { path: 'report/:id' , component: ReportFormComponent , canActivate: [AuthGuard] }, { path: 'reports' , component: ReportComponent , canActivate: [AuthGuard] }, { path: 'recommendation/:id', component: RecommendationPanelComponent, canActivate: [AuthGuard] }, - { path: 'admin' , component: AdminPageComponent, canActivate: [AuthGuard] } + { path: 'admin' , component: AdminPageComponent, canActivate: [AuthGuard] }, + { path: 'tutorial' , component: TutorialComponent, canActivate: [AuthGuard] } ]; export const routes: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); diff --git a/src/app/tutorial/tutorial.component.css b/src/app/tutorial/tutorial.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/tutorial/tutorial.component.html b/src/app/tutorial/tutorial.component.html new file mode 100644 index 0000000..7f0c9eb --- /dev/null +++ b/src/app/tutorial/tutorial.component.html @@ -0,0 +1,3 @@ +

+ tutorial works! +

diff --git a/src/app/tutorial/tutorial.component.spec.ts b/src/app/tutorial/tutorial.component.spec.ts new file mode 100644 index 0000000..094ad43 --- /dev/null +++ b/src/app/tutorial/tutorial.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TutorialComponent } from './tutorial.component'; + +describe('TutorialComponent', () => { + let component: TutorialComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TutorialComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TutorialComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/tutorial/tutorial.component.ts b/src/app/tutorial/tutorial.component.ts new file mode 100644 index 0000000..bbbff5c --- /dev/null +++ b/src/app/tutorial/tutorial.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-tutorial', + templateUrl: './tutorial.component.html', + styleUrls: ['./tutorial.component.css'] +}) +export class TutorialComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} From c0c2b8569ee64d0265c17a2beb54c2bfc613a917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Arag=C3=A3o?= Date: Wed, 20 Jun 2018 22:17:50 -0300 Subject: [PATCH 03/20] Organizing shared folder --- src/app/app.component.spec.ts | 2 +- src/app/app.component.ts | 2 +- src/app/app.module.ts | 10 +++++----- src/app/app.routes.ts | 4 ++-- src/app/login/login.component.spec.ts | 2 +- src/app/login/login.component.ts | 2 +- src/app/navbar/navbar.component.spec.ts | 2 +- src/app/navbar/navbar.component.ts | 2 +- .../profile/admin-page/admin-page.component.spec.ts | 2 +- src/app/profile/admin-page/admin-page.component.ts | 4 ++-- src/app/profile/profile.component.spec.ts | 2 +- src/app/profile/profile.component.ts | 2 +- .../register-form/register-form.component.spec.ts | 2 +- .../register/register-form/register-form.component.ts | 2 +- src/app/{ => shared}/guards/auth.guard.ts | 0 src/app/{ => shared}/guards/login.guard.ts | 0 src/app/shared/{ => models}/models.ts | 0 src/app/shared/{ => pipes}/filter.pipe.spec.ts | 2 +- src/app/shared/{ => pipes}/filter.pipe.ts | 0 src/app/{ => shared}/services/auth.service.spec.ts | 0 src/app/{ => shared}/services/auth.service.ts | 0 src/app/{ => shared}/services/students.service.spec.ts | 2 +- src/app/{ => shared}/services/students.service.ts | 0 src/app/sidenav/sidenav.component.spec.ts | 2 +- src/app/sidenav/sidenav.component.ts | 2 +- .../daily-log-form/daily-log-form.component.spec.ts | 2 +- .../daily-log-form/daily-log-form.component.ts | 4 ++-- .../daily-log-panel/daily-log-panel.component.spec.ts | 2 +- .../daily-log-panel/daily-log-panel.component.ts | 4 ++-- src/app/students/daily-log/daily-log.component.spec.ts | 2 +- src/app/students/daily-log/daily-log.component.ts | 4 ++-- .../recommendation-panel.component.spec.ts | 2 +- .../recommendation-panel.component.ts | 4 ++-- .../referral-form/referral-form.component.spec.ts | 2 +- .../students/referral-form/referral-form.component.ts | 4 ++-- .../referral-panel/referral-panel.component.spec.ts | 2 +- .../referral-panel/referral-panel.component.ts | 4 ++-- src/app/students/referral/referral.component.spec.ts | 2 +- src/app/students/referral/referral.component.ts | 4 ++-- .../students/report-form/report-form.component.spec.ts | 2 +- src/app/students/report-form/report-form.component.ts | 4 ++-- src/app/students/report/report.component.spec.ts | 2 +- src/app/students/report/report.component.ts | 4 ++-- .../student-form/student-form.component.spec.ts | 2 +- .../students/student-form/student-form.component.ts | 4 ++-- .../student-panel/student-panel.component.spec.ts | 2 +- .../students/student-panel/student-panel.component.ts | 4 ++-- src/app/students/students.component.spec.ts | 6 +++--- src/app/students/students.component.ts | 4 ++-- 49 files changed, 62 insertions(+), 62 deletions(-) rename src/app/{ => shared}/guards/auth.guard.ts (100%) rename src/app/{ => shared}/guards/login.guard.ts (100%) rename src/app/shared/{ => models}/models.ts (100%) rename src/app/shared/{ => pipes}/filter.pipe.spec.ts (97%) rename src/app/shared/{ => pipes}/filter.pipe.ts (100%) rename src/app/{ => shared}/services/auth.service.spec.ts (100%) rename src/app/{ => shared}/services/auth.service.ts (100%) rename src/app/{ => shared}/services/students.service.spec.ts (99%) rename src/app/{ => shared}/services/students.service.ts (100%) diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 4a8666b..7363c34 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -10,7 +10,7 @@ import { AppComponent } from './app.component'; import { NavbarComponent } from './navbar/navbar.component'; import { SidenavComponent } from './sidenav/sidenav.component'; import { RegisterFormComponent } from './register/register-form/register-form.component'; -import { AuthService } from './services/auth.service'; +import { AuthService } from './shared/services/auth.service'; describe('AppComponent', () => { let tokenMock = jasmine.createSpyObj('tokenMock', ['init', 'validateToken', 'subscribe']); diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c42443b..ac6a03e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,7 +3,7 @@ import { Component } from '@angular/core'; import { Angular2TokenService } from 'angular2-token'; import { environment } from '../environments/environment'; -import { AuthService } from './services/auth.service'; +import { AuthService } from './shared/services/auth.service'; @Component({ selector: 'app-root', diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ac87976..db40f29 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -9,16 +9,16 @@ import { OrderModule } from 'ngx-order-pipe'; import { AppComponent } from './app.component'; import { routes } from './app.routes'; -import { AuthGuard } from "./guards/auth.guard"; -import { LoginGuard } from "./guards/login.guard"; -import { AuthService } from "./services/auth.service"; +import { AuthGuard } from "./shared/guards/auth.guard"; +import { LoginGuard } from "./shared/guards/login.guard"; +import { AuthService } from "./shared/services/auth.service"; import { LoginComponent } from './login/login.component'; import { RegisterFormComponent } from './register/register-form/register-form.component'; import { ProfileComponent } from './profile/profile.component'; -import { StudentsService } from './services/students.service'; +import { StudentsService } from './shared/services/students.service'; import { StudentsComponent } from './students/students.component'; import { StudentFormComponent } from './students/student-form/student-form.component'; -import { FilterPipe } from './shared/filter.pipe'; +import { FilterPipe } from './shared/pipes/filter.pipe'; import { SidenavComponent } from './sidenav/sidenav.component'; import { NavbarComponent } from './navbar/navbar.component'; import { StudentPanelComponent } from './students/student-panel/student-panel.component'; diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 1896cb5..6467258 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,8 +1,8 @@ import { ModuleWithProviders } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { AuthGuard } from "./guards/auth.guard"; -import { LoginGuard } from "./guards/login.guard"; +import { AuthGuard } from "./shared/guards/auth.guard"; +import { LoginGuard } from "./shared/guards/login.guard"; import { LoginComponent } from "./login/login.component"; import { ProfileComponent } from "./profile/profile.component"; import { StudentsComponent } from './students/students.component'; diff --git a/src/app/login/login.component.spec.ts b/src/app/login/login.component.spec.ts index cd6e204..aeab135 100644 --- a/src/app/login/login.component.spec.ts +++ b/src/app/login/login.component.spec.ts @@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { Angular2TokenService } from 'angular2-token'; -import { AuthService } from "../services/auth.service"; +import { AuthService } from "../shared/services/auth.service"; import { LoginComponent } from './login.component'; describe('LoginComponent', () => { diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 1b49115..a61ad66 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -5,7 +5,7 @@ import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms" import { MaterializeAction } from "angular2-materialize"; import { RegisterData } from "angular2-token"; -import { AuthService } from "../services/auth.service"; +import { AuthService } from "../shared/services/auth.service"; import { FormUtils } from "../shared/form.utils"; @Component({ diff --git a/src/app/navbar/navbar.component.spec.ts b/src/app/navbar/navbar.component.spec.ts index dc010fb..7e4fefa 100644 --- a/src/app/navbar/navbar.component.spec.ts +++ b/src/app/navbar/navbar.component.spec.ts @@ -9,7 +9,7 @@ import { Angular2TokenService } from 'angular2-token'; import { NavbarComponent } from './navbar.component'; import { RegisterFormComponent } from '../register/register-form/register-form.component'; -import { AuthService } from '../services/auth.service'; +import { AuthService } from '../shared/services/auth.service'; describe('NavbarComponent', () => { let tokenMock = jasmine.createSpyObj('tokenMock', ['validateToken', 'subscribe']); diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts index c935aa0..4c8c9ad 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -4,7 +4,7 @@ import { Router } from "@angular/router"; import { MaterializeDirective } from "angular2-materialize"; import { Angular2TokenService } from "angular2-token"; -import { AuthService } from "../services/auth.service"; +import { AuthService } from "../shared/services/auth.service"; import { RegisterFormComponent } from "../register/register-form/register-form.component"; @Component({ diff --git a/src/app/profile/admin-page/admin-page.component.spec.ts b/src/app/profile/admin-page/admin-page.component.spec.ts index 2cd79a7..8f2913a 100644 --- a/src/app/profile/admin-page/admin-page.component.spec.ts +++ b/src/app/profile/admin-page/admin-page.component.spec.ts @@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing'; -import { AuthService } from "../../services/auth.service"; +import { AuthService } from "../../shared/services/auth.service"; import { AdminPageComponent } from './admin-page.component'; describe('AdminPageComponent', () => { diff --git a/src/app/profile/admin-page/admin-page.component.ts b/src/app/profile/admin-page/admin-page.component.ts index 5f3aa2c..4d60b58 100644 --- a/src/app/profile/admin-page/admin-page.component.ts +++ b/src/app/profile/admin-page/admin-page.component.ts @@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core'; import { Router } from "@angular/router"; import { Angular2TokenService} from "angular2-token"; -import { AuthService } from "../../services/auth.service"; -import { TeamMember } from "../../shared/models"; +import { AuthService } from "../../shared/services/auth.service"; +import { TeamMember } from "../../shared/models/models"; @Component({ selector: 'app-admin-page', templateUrl: './admin-page.component.html', diff --git a/src/app/profile/profile.component.spec.ts b/src/app/profile/profile.component.spec.ts index e2de8cf..f69498a 100644 --- a/src/app/profile/profile.component.spec.ts +++ b/src/app/profile/profile.component.spec.ts @@ -7,7 +7,7 @@ import { Angular2TokenService } from 'angular2-token'; import { MaterializeModule } from 'angular2-materialize'; import { ProfileComponent } from './profile.component'; -import { AuthService } from "../services/auth.service"; +import { AuthService } from "../shared/services/auth.service"; describe('ProfileComponent', () => { let component: ProfileComponent; diff --git a/src/app/profile/profile.component.ts b/src/app/profile/profile.component.ts index cce8b5d..9a6fea5 100644 --- a/src/app/profile/profile.component.ts +++ b/src/app/profile/profile.component.ts @@ -4,7 +4,7 @@ import { Router } from "@angular/router"; import { Angular2TokenService, UpdatePasswordData } from "angular2-token"; import { MaterializeAction } from "angular2-materialize" -import { AuthService } from "../services/auth.service"; +import { AuthService } from "../shared/services/auth.service"; @Component({ selector: 'app-profile', diff --git a/src/app/register/register-form/register-form.component.spec.ts b/src/app/register/register-form/register-form.component.spec.ts index e141dad..1efa9aa 100644 --- a/src/app/register/register-form/register-form.component.spec.ts +++ b/src/app/register/register-form/register-form.component.spec.ts @@ -6,7 +6,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { Angular2TokenService } from 'angular2-token'; -import { AuthService } from "../../services/auth.service"; +import { AuthService } from "../../shared/services/auth.service"; import { RegisterFormComponent } from './register-form.component'; describe('RegisterFormComponent', () => { diff --git a/src/app/register/register-form/register-form.component.ts b/src/app/register/register-form/register-form.component.ts index fcc106e..cef1b80 100644 --- a/src/app/register/register-form/register-form.component.ts +++ b/src/app/register/register-form/register-form.component.ts @@ -4,7 +4,7 @@ import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms" import { RegisterData } from "angular2-token"; import { MaterializeAction } from "angular2-materialize"; -import { AuthService } from "../../services/auth.service" +import { AuthService } from "../../shared/services/auth.service" import { FormUtils } from "../../shared/form.utils"; @Component({ diff --git a/src/app/guards/auth.guard.ts b/src/app/shared/guards/auth.guard.ts similarity index 100% rename from src/app/guards/auth.guard.ts rename to src/app/shared/guards/auth.guard.ts diff --git a/src/app/guards/login.guard.ts b/src/app/shared/guards/login.guard.ts similarity index 100% rename from src/app/guards/login.guard.ts rename to src/app/shared/guards/login.guard.ts diff --git a/src/app/shared/models.ts b/src/app/shared/models/models.ts similarity index 100% rename from src/app/shared/models.ts rename to src/app/shared/models/models.ts diff --git a/src/app/shared/filter.pipe.spec.ts b/src/app/shared/pipes/filter.pipe.spec.ts similarity index 97% rename from src/app/shared/filter.pipe.spec.ts rename to src/app/shared/pipes/filter.pipe.spec.ts index f41edce..479a1e6 100644 --- a/src/app/shared/filter.pipe.spec.ts +++ b/src/app/shared/pipes/filter.pipe.spec.ts @@ -1,4 +1,4 @@ -import { FilterPipe } from './filter.pipe'; +import { FilterPipe } from './pipes/filter.pipe'; describe('FilterPipe', () => { let filterPipe: FilterPipe; diff --git a/src/app/shared/filter.pipe.ts b/src/app/shared/pipes/filter.pipe.ts similarity index 100% rename from src/app/shared/filter.pipe.ts rename to src/app/shared/pipes/filter.pipe.ts diff --git a/src/app/services/auth.service.spec.ts b/src/app/shared/services/auth.service.spec.ts similarity index 100% rename from src/app/services/auth.service.spec.ts rename to src/app/shared/services/auth.service.spec.ts diff --git a/src/app/services/auth.service.ts b/src/app/shared/services/auth.service.ts similarity index 100% rename from src/app/services/auth.service.ts rename to src/app/shared/services/auth.service.ts diff --git a/src/app/services/students.service.spec.ts b/src/app/shared/services/students.service.spec.ts similarity index 99% rename from src/app/services/students.service.spec.ts rename to src/app/shared/services/students.service.spec.ts index 9577152..854c781 100644 --- a/src/app/services/students.service.spec.ts +++ b/src/app/shared/services/students.service.spec.ts @@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { HttpModule, XHRBackend, Response, ResponseOptions } from '@angular/http'; import { MockBackend, MockConnection } from '@angular/http/testing'; -import { Student, DailyLog, Report, Recommendation, Referral } from '../shared/models'; +import { Student, DailyLog, Report, Recommendation, Referral } from '../shared/models/models'; import { StudentsService } from './students.service'; describe('StudentsService', () => { diff --git a/src/app/services/students.service.ts b/src/app/shared/services/students.service.ts similarity index 100% rename from src/app/services/students.service.ts rename to src/app/shared/services/students.service.ts diff --git a/src/app/sidenav/sidenav.component.spec.ts b/src/app/sidenav/sidenav.component.spec.ts index 94b2dd9..868e2e3 100644 --- a/src/app/sidenav/sidenav.component.spec.ts +++ b/src/app/sidenav/sidenav.component.spec.ts @@ -9,7 +9,7 @@ import { Angular2TokenService } from 'angular2-token'; import { SidenavComponent } from './sidenav.component'; import { RegisterFormComponent } from '../register/register-form/register-form.component'; -import { AuthService } from '../services/auth.service'; +import { AuthService } from '../shared/services/auth.service'; describe('SidenavComponent', () => { let tokenMock = jasmine.createSpyObj('tokenMock', ['validateToken', 'subscribe']); diff --git a/src/app/sidenav/sidenav.component.ts b/src/app/sidenav/sidenav.component.ts index 29426e2..3461fde 100644 --- a/src/app/sidenav/sidenav.component.ts +++ b/src/app/sidenav/sidenav.component.ts @@ -4,7 +4,7 @@ import { Router } from "@angular/router"; import { MaterializeDirective } from "angular2-materialize"; import { Angular2TokenService, UserData } from "angular2-token"; -import { AuthService } from "../services/auth.service"; +import { AuthService } from "../shared/services/auth.service"; import { RegisterFormComponent } from "../register/register-form/register-form.component"; @Component({ diff --git a/src/app/students/daily-log-form/daily-log-form.component.spec.ts b/src/app/students/daily-log-form/daily-log-form.component.spec.ts index cd9cf34..c0e956a 100644 --- a/src/app/students/daily-log-form/daily-log-form.component.spec.ts +++ b/src/app/students/daily-log-form/daily-log-form.component.spec.ts @@ -6,7 +6,7 @@ import { HttpModule } from '@angular/http'; import { Angular2TokenService } from 'angular2-token'; import { DailyLogFormComponent } from './daily-log-form.component'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('DailyLogFormComponent', () => { let component: DailyLogFormComponent; diff --git a/src/app/students/daily-log-form/daily-log-form.component.ts b/src/app/students/daily-log-form/daily-log-form.component.ts index 9d0f6af..bfcfb6a 100644 --- a/src/app/students/daily-log-form/daily-log-form.component.ts +++ b/src/app/students/daily-log-form/daily-log-form.component.ts @@ -3,8 +3,8 @@ import { Router, ActivatedRoute } from '@angular/router'; import { Angular2TokenService } from "angular2-token"; -import { DailyLog } from "../../shared/models"; -import { StudentsService } from '../../services/students.service'; +import { DailyLog } from "../../shared/models/models"; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-daily-log-form', diff --git a/src/app/students/daily-log-panel/daily-log-panel.component.spec.ts b/src/app/students/daily-log-panel/daily-log-panel.component.spec.ts index 07aa000..a2966ae 100644 --- a/src/app/students/daily-log-panel/daily-log-panel.component.spec.ts +++ b/src/app/students/daily-log-panel/daily-log-panel.component.spec.ts @@ -4,7 +4,7 @@ import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { DailyLogPanelComponent } from './daily-log-panel.component'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('DailyLogPanelComponent', () => { let component: DailyLogPanelComponent; diff --git a/src/app/students/daily-log-panel/daily-log-panel.component.ts b/src/app/students/daily-log-panel/daily-log-panel.component.ts index 59f7977..78f7ed3 100644 --- a/src/app/students/daily-log-panel/daily-log-panel.component.ts +++ b/src/app/students/daily-log-panel/daily-log-panel.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit } from '@angular/core'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; -import { DailyLog } from "../../shared/models"; +import { DailyLog } from "../../shared/models/models"; import { Router, ActivatedRoute } from '@angular/router'; diff --git a/src/app/students/daily-log/daily-log.component.spec.ts b/src/app/students/daily-log/daily-log.component.spec.ts index 072f583..eef0742 100644 --- a/src/app/students/daily-log/daily-log.component.spec.ts +++ b/src/app/students/daily-log/daily-log.component.spec.ts @@ -6,7 +6,7 @@ import { HttpModule } from '@angular/http'; import { OrderPipe } from 'ngx-order-pipe'; import { DailyLogComponent } from './daily-log.component'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('DailyLogComponent', () => { let component: DailyLogComponent; diff --git a/src/app/students/daily-log/daily-log.component.ts b/src/app/students/daily-log/daily-log.component.ts index 68b3919..53f8b77 100644 --- a/src/app/students/daily-log/daily-log.component.ts +++ b/src/app/students/daily-log/daily-log.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; -import { Student, DailyLog } from "../../shared/models"; -import { StudentsService } from '../../services/students.service'; +import { Student, DailyLog } from "../../shared/models/models"; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-daily-log', diff --git a/src/app/students/recommendation-panel/recommendation-panel.component.spec.ts b/src/app/students/recommendation-panel/recommendation-panel.component.spec.ts index 870883c..3e0471b 100644 --- a/src/app/students/recommendation-panel/recommendation-panel.component.spec.ts +++ b/src/app/students/recommendation-panel/recommendation-panel.component.spec.ts @@ -5,7 +5,7 @@ import { HttpModule } from '@angular/http'; import { Angular2TokenService } from 'angular2-token'; -import { StudentsService } from '../../services/students.service' +import { StudentsService } from '../../shared/services/students.service' import { RecommendationPanelComponent } from './recommendation-panel.component'; describe('RecommendationComponent', () => { diff --git a/src/app/students/recommendation-panel/recommendation-panel.component.ts b/src/app/students/recommendation-panel/recommendation-panel.component.ts index f62e32a..244b478 100644 --- a/src/app/students/recommendation-panel/recommendation-panel.component.ts +++ b/src/app/students/recommendation-panel/recommendation-panel.component.ts @@ -4,8 +4,8 @@ import { Router, ActivatedRoute } from '@angular/router'; import { Angular2TokenService } from "angular2-token"; import * as jsPDF from 'jspdf'; -import { Recommendation } from "../../shared/models"; -import { StudentsService } from '../../services/students.service'; +import { Recommendation } from "../../shared/models/models"; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-recommendation-panel', diff --git a/src/app/students/referral-form/referral-form.component.spec.ts b/src/app/students/referral-form/referral-form.component.spec.ts index f49a176..50e1321 100644 --- a/src/app/students/referral-form/referral-form.component.spec.ts +++ b/src/app/students/referral-form/referral-form.component.spec.ts @@ -6,7 +6,7 @@ import { HttpModule } from '@angular/http'; import { Angular2TokenService } from 'angular2-token'; import { ReferralFormComponent } from './referral-form.component'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('ReferralFormComponent', () => { let component: ReferralFormComponent; diff --git a/src/app/students/referral-form/referral-form.component.ts b/src/app/students/referral-form/referral-form.component.ts index bcc3370..ae46ff5 100644 --- a/src/app/students/referral-form/referral-form.component.ts +++ b/src/app/students/referral-form/referral-form.component.ts @@ -3,8 +3,8 @@ import { Router, ActivatedRoute } from '@angular/router'; import { Angular2TokenService } from "angular2-token"; -import { Referral } from "../../shared/models"; -import { StudentsService } from '../../services/students.service'; +import { Referral } from "../../shared/models/models"; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-referral-form', diff --git a/src/app/students/referral-panel/referral-panel.component.spec.ts b/src/app/students/referral-panel/referral-panel.component.spec.ts index cc5e914..eab87a7 100644 --- a/src/app/students/referral-panel/referral-panel.component.spec.ts +++ b/src/app/students/referral-panel/referral-panel.component.spec.ts @@ -3,7 +3,7 @@ import { HttpModule } from '@angular/http'; import { RouterTestingModule } from '@angular/router/testing'; import { FormsModule } from '@angular/forms'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; import { ReferralPanelComponent } from './referral-panel.component'; diff --git a/src/app/students/referral-panel/referral-panel.component.ts b/src/app/students/referral-panel/referral-panel.component.ts index b908476..d574fa9 100644 --- a/src/app/students/referral-panel/referral-panel.component.ts +++ b/src/app/students/referral-panel/referral-panel.component.ts @@ -3,8 +3,8 @@ import { Router, ActivatedRoute } from '@angular/router'; import * as jsPDF from 'jspdf'; -import { Referral } from "../../shared/models"; -import { StudentsService } from '../../services/students.service'; +import { Referral } from "../../shared/models/models"; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-referral-panel', diff --git a/src/app/students/referral/referral.component.spec.ts b/src/app/students/referral/referral.component.spec.ts index 28754a3..5a8b96f 100644 --- a/src/app/students/referral/referral.component.spec.ts +++ b/src/app/students/referral/referral.component.spec.ts @@ -6,7 +6,7 @@ import { HttpModule } from '@angular/http'; import { OrderPipe } from 'ngx-order-pipe'; import { ReferralComponent } from './referral.component'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('ReferralComponent', () => { let component: ReferralComponent; diff --git a/src/app/students/referral/referral.component.ts b/src/app/students/referral/referral.component.ts index 5d7ee77..d57ecdb 100644 --- a/src/app/students/referral/referral.component.ts +++ b/src/app/students/referral/referral.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; -import { Student, Referral } from "../../shared/models"; -import { StudentsService } from '../../services/students.service'; +import { Student, Referral } from "../../shared/models/models"; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-referral', diff --git a/src/app/students/report-form/report-form.component.spec.ts b/src/app/students/report-form/report-form.component.spec.ts index 1ab922c..01dfd02 100644 --- a/src/app/students/report-form/report-form.component.spec.ts +++ b/src/app/students/report-form/report-form.component.spec.ts @@ -6,7 +6,7 @@ import { HttpModule } from '@angular/http'; import { Angular2TokenService } from 'angular2-token'; import { ReportFormComponent } from './report-form.component'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('ReportFormComponent', () => { let component: ReportFormComponent; diff --git a/src/app/students/report-form/report-form.component.ts b/src/app/students/report-form/report-form.component.ts index 569ae46..10de1cf 100644 --- a/src/app/students/report-form/report-form.component.ts +++ b/src/app/students/report-form/report-form.component.ts @@ -3,8 +3,8 @@ import { Router, ActivatedRoute } from '@angular/router'; import { Angular2TokenService } from "angular2-token"; -import { Report, Student } from "../../shared/models"; -import { StudentsService } from '../../services/students.service'; +import { Report, Student } from "../../shared/models/models"; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-report-form', diff --git a/src/app/students/report/report.component.spec.ts b/src/app/students/report/report.component.spec.ts index baadd57..5e21774 100644 --- a/src/app/students/report/report.component.spec.ts +++ b/src/app/students/report/report.component.spec.ts @@ -4,7 +4,7 @@ import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { ReportComponent } from './report.component'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('ReportComponent', () => { let component: ReportComponent; diff --git a/src/app/students/report/report.component.ts b/src/app/students/report/report.component.ts index bb711ef..440d912 100644 --- a/src/app/students/report/report.component.ts +++ b/src/app/students/report/report.component.ts @@ -6,8 +6,8 @@ import * as JSZip from 'jszip'; import * as JSZipUtils from 'jszip-utils'; import * as FileSaver from 'file-saver'; -import { Report } from "../../shared/models"; -import { StudentsService } from '../../services/students.service'; +import { Report } from "../../shared/models/models"; +import { StudentsService } from '../../shared/services/students.service'; declare const require: any; diff --git a/src/app/students/student-form/student-form.component.spec.ts b/src/app/students/student-form/student-form.component.spec.ts index b16a1b7..4eab89d 100644 --- a/src/app/students/student-form/student-form.component.spec.ts +++ b/src/app/students/student-form/student-form.component.spec.ts @@ -6,7 +6,7 @@ import { HttpModule } from '@angular/http'; import { MaterializeModule } from 'angular2-materialize'; import { StudentFormComponent } from './student-form.component'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('StudentFormComponent', () => { let component: StudentFormComponent; diff --git a/src/app/students/student-form/student-form.component.ts b/src/app/students/student-form/student-form.component.ts index 14f4276..ccb27ec 100644 --- a/src/app/students/student-form/student-form.component.ts +++ b/src/app/students/student-form/student-form.component.ts @@ -3,8 +3,8 @@ import { Router, ActivatedRoute } from '@angular/router'; import { MaterializeDirective } from 'angular2-materialize'; -import { Student } from '../../shared/models'; -import { StudentsService } from '../../services/students.service'; +import { Student } from '../../shared/models/models'; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-student-form', diff --git a/src/app/students/student-panel/student-panel.component.spec.ts b/src/app/students/student-panel/student-panel.component.spec.ts index 31ed294..e8ea056 100644 --- a/src/app/students/student-panel/student-panel.component.spec.ts +++ b/src/app/students/student-panel/student-panel.component.spec.ts @@ -4,7 +4,7 @@ import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { StudentPanelComponent } from './student-panel.component'; -import { StudentsService } from '../../services/students.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('StudentPanelComponent', () => { let component: StudentPanelComponent; diff --git a/src/app/students/student-panel/student-panel.component.ts b/src/app/students/student-panel/student-panel.component.ts index 4085730..9560616 100644 --- a/src/app/students/student-panel/student-panel.component.ts +++ b/src/app/students/student-panel/student-panel.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { Router, ActivatedRoute } from '@angular/router'; -import { Student } from "../../shared/models"; -import { StudentsService } from '../../services/students.service'; +import { Student } from "../../shared/models/models"; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-student-panel', diff --git a/src/app/students/students.component.spec.ts b/src/app/students/students.component.spec.ts index c9ef1c3..8892092 100644 --- a/src/app/students/students.component.spec.ts +++ b/src/app/students/students.component.spec.ts @@ -8,9 +8,9 @@ import { Angular2TokenService } from 'angular2-token'; import { MaterializeModule } from 'angular2-materialize'; import { StudentsComponent } from './students.component'; -import { AuthService } from "../services/auth.service"; -import { StudentsService } from '../services/students.service'; -import { FilterPipe } from "../shared/filter.pipe"; +import { AuthService } from "../shared/services/auth.service"; +import { StudentsService } from '../shared/services/students.service'; +import { FilterPipe } from "../shared/pipes/filter.pipe"; describe('StudentsComponent', () => { let component: StudentsComponent; diff --git a/src/app/students/students.component.ts b/src/app/students/students.component.ts index 384b81c..dd30108 100644 --- a/src/app/students/students.component.ts +++ b/src/app/students/students.component.ts @@ -5,8 +5,8 @@ import { FormsModule } from '@angular/forms'; import { MaterializeDirective } from 'angular2-materialize'; import { OrderPipe } from 'ngx-order-pipe'; -import { Student } from "../shared/models"; -import { StudentsService } from '../services/students.service'; +import { Student } from "../shared/models/models"; +import { StudentsService } from '../shared/services/students.service'; @Component({ selector: 'app-students', From 2f6d76dd89d9cf4ddaf74d18d0b1d186c2ae9223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Arag=C3=A3o?= Date: Wed, 20 Jun 2018 22:30:05 -0300 Subject: [PATCH 04/20] Organizing header folders --- src/app/app.component.spec.ts | 4 ++-- src/app/app.module.ts | 4 ++-- src/app/{ => header}/navbar/navbar.component.css | 0 src/app/{ => header}/navbar/navbar.component.html | 0 src/app/{ => header}/navbar/navbar.component.spec.ts | 4 ++-- src/app/{ => header}/navbar/navbar.component.ts | 4 ++-- src/app/{ => header}/sidenav/sidenav.component.css | 0 src/app/{ => header}/sidenav/sidenav.component.html | 0 .../{ => header}/sidenav/sidenav.component.spec.ts | 4 ++-- src/app/{ => header}/sidenav/sidenav.component.ts | 4 ++-- src/app/shared/pipes/filter.pipe.spec.ts | 2 +- src/app/shared/services/auth.service.spec.ts | 11 ++++++----- src/app/shared/services/students.service.spec.ts | 2 +- 13 files changed, 20 insertions(+), 19 deletions(-) rename src/app/{ => header}/navbar/navbar.component.css (100%) rename src/app/{ => header}/navbar/navbar.component.html (100%) rename src/app/{ => header}/navbar/navbar.component.spec.ts (88%) rename src/app/{ => header}/navbar/navbar.component.ts (79%) rename src/app/{ => header}/sidenav/sidenav.component.css (100%) rename src/app/{ => header}/sidenav/sidenav.component.html (100%) rename src/app/{ => header}/sidenav/sidenav.component.spec.ts (88%) rename src/app/{ => header}/sidenav/sidenav.component.ts (84%) diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 7363c34..236960f 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -7,8 +7,8 @@ import { MaterializeModule } from 'angular2-materialize'; import { Angular2TokenService } from 'angular2-token'; import { AppComponent } from './app.component'; -import { NavbarComponent } from './navbar/navbar.component'; -import { SidenavComponent } from './sidenav/sidenav.component'; +import { NavbarComponent } from './header/navbar/navbar.component'; +import { SidenavComponent } from './header/sidenav/sidenav.component'; import { RegisterFormComponent } from './register/register-form/register-form.component'; import { AuthService } from './shared/services/auth.service'; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index db40f29..4958e2e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -19,8 +19,8 @@ import { StudentsService } from './shared/services/students.ser import { StudentsComponent } from './students/students.component'; import { StudentFormComponent } from './students/student-form/student-form.component'; import { FilterPipe } from './shared/pipes/filter.pipe'; -import { SidenavComponent } from './sidenav/sidenav.component'; -import { NavbarComponent } from './navbar/navbar.component'; +import { SidenavComponent } from './header/sidenav/sidenav.component'; +import { NavbarComponent } from './header/navbar/navbar.component'; import { StudentPanelComponent } from './students/student-panel/student-panel.component'; import { DailyLogComponent } from './students/daily-log/daily-log.component'; import { DailyLogFormComponent } from './students/daily-log-form/daily-log-form.component'; diff --git a/src/app/navbar/navbar.component.css b/src/app/header/navbar/navbar.component.css similarity index 100% rename from src/app/navbar/navbar.component.css rename to src/app/header/navbar/navbar.component.css diff --git a/src/app/navbar/navbar.component.html b/src/app/header/navbar/navbar.component.html similarity index 100% rename from src/app/navbar/navbar.component.html rename to src/app/header/navbar/navbar.component.html diff --git a/src/app/navbar/navbar.component.spec.ts b/src/app/header/navbar/navbar.component.spec.ts similarity index 88% rename from src/app/navbar/navbar.component.spec.ts rename to src/app/header/navbar/navbar.component.spec.ts index 7e4fefa..23f2899 100644 --- a/src/app/navbar/navbar.component.spec.ts +++ b/src/app/header/navbar/navbar.component.spec.ts @@ -7,9 +7,9 @@ import { MaterializeModule } from 'angular2-materialize'; import { Angular2TokenService } from 'angular2-token'; import { NavbarComponent } from './navbar.component'; -import { RegisterFormComponent } from '../register/register-form/register-form.component'; +import { RegisterFormComponent } from '../../register/register-form/register-form.component'; -import { AuthService } from '../shared/services/auth.service'; +import { AuthService } from '../../shared/services/auth.service'; describe('NavbarComponent', () => { let tokenMock = jasmine.createSpyObj('tokenMock', ['validateToken', 'subscribe']); diff --git a/src/app/navbar/navbar.component.ts b/src/app/header/navbar/navbar.component.ts similarity index 79% rename from src/app/navbar/navbar.component.ts rename to src/app/header/navbar/navbar.component.ts index 4c8c9ad..30e3544 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/header/navbar/navbar.component.ts @@ -4,8 +4,8 @@ import { Router } from "@angular/router"; import { MaterializeDirective } from "angular2-materialize"; import { Angular2TokenService } from "angular2-token"; -import { AuthService } from "../shared/services/auth.service"; -import { RegisterFormComponent } from "../register/register-form/register-form.component"; +import { AuthService } from "../../shared/services/auth.service"; +import { RegisterFormComponent } from "../../register/register-form/register-form.component"; @Component({ selector: 'app-navbar', diff --git a/src/app/sidenav/sidenav.component.css b/src/app/header/sidenav/sidenav.component.css similarity index 100% rename from src/app/sidenav/sidenav.component.css rename to src/app/header/sidenav/sidenav.component.css diff --git a/src/app/sidenav/sidenav.component.html b/src/app/header/sidenav/sidenav.component.html similarity index 100% rename from src/app/sidenav/sidenav.component.html rename to src/app/header/sidenav/sidenav.component.html diff --git a/src/app/sidenav/sidenav.component.spec.ts b/src/app/header/sidenav/sidenav.component.spec.ts similarity index 88% rename from src/app/sidenav/sidenav.component.spec.ts rename to src/app/header/sidenav/sidenav.component.spec.ts index 868e2e3..fa425e9 100644 --- a/src/app/sidenav/sidenav.component.spec.ts +++ b/src/app/header/sidenav/sidenav.component.spec.ts @@ -7,9 +7,9 @@ import { MaterializeModule } from 'angular2-materialize'; import { Angular2TokenService } from 'angular2-token'; import { SidenavComponent } from './sidenav.component'; -import { RegisterFormComponent } from '../register/register-form/register-form.component'; +import { RegisterFormComponent } from '../../register/register-form/register-form.component'; -import { AuthService } from '../shared/services/auth.service'; +import { AuthService } from '../../shared/services/auth.service'; describe('SidenavComponent', () => { let tokenMock = jasmine.createSpyObj('tokenMock', ['validateToken', 'subscribe']); diff --git a/src/app/sidenav/sidenav.component.ts b/src/app/header/sidenav/sidenav.component.ts similarity index 84% rename from src/app/sidenav/sidenav.component.ts rename to src/app/header/sidenav/sidenav.component.ts index 3461fde..81e3d22 100644 --- a/src/app/sidenav/sidenav.component.ts +++ b/src/app/header/sidenav/sidenav.component.ts @@ -4,8 +4,8 @@ import { Router } from "@angular/router"; import { MaterializeDirective } from "angular2-materialize"; import { Angular2TokenService, UserData } from "angular2-token"; -import { AuthService } from "../shared/services/auth.service"; -import { RegisterFormComponent } from "../register/register-form/register-form.component"; +import { AuthService } from "../../shared/services/auth.service"; +import { RegisterFormComponent } from "../../register/register-form/register-form.component"; @Component({ selector: 'app-sidenav', diff --git a/src/app/shared/pipes/filter.pipe.spec.ts b/src/app/shared/pipes/filter.pipe.spec.ts index 479a1e6..f41edce 100644 --- a/src/app/shared/pipes/filter.pipe.spec.ts +++ b/src/app/shared/pipes/filter.pipe.spec.ts @@ -1,4 +1,4 @@ -import { FilterPipe } from './pipes/filter.pipe'; +import { FilterPipe } from './filter.pipe'; describe('FilterPipe', () => { let filterPipe: FilterPipe; diff --git a/src/app/shared/services/auth.service.spec.ts b/src/app/shared/services/auth.service.spec.ts index ef2c82d..6515129 100644 --- a/src/app/shared/services/auth.service.spec.ts +++ b/src/app/shared/services/auth.service.spec.ts @@ -1,9 +1,10 @@ -import { TestBed, inject, async, ComponentFixture } from '@angular/core/testing'; -import { Angular2TokenService } from 'angular2-token'; -import { AuthService } from './auth.service'; -import { HttpModule } from '@angular/http'; +import { TestBed, inject, async, ComponentFixture } from '@angular/core/testing'; +import { HttpModule } from '@angular/http'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { RouterTestingModule } from '@angular/router/testing'; +import { RouterTestingModule } from '@angular/router/testing'; + +import { Angular2TokenService } from 'angular2-token'; +import { AuthService } from './auth.service'; describe('AuthService', () => { beforeEach(async() => { diff --git a/src/app/shared/services/students.service.spec.ts b/src/app/shared/services/students.service.spec.ts index 854c781..d484503 100644 --- a/src/app/shared/services/students.service.spec.ts +++ b/src/app/shared/services/students.service.spec.ts @@ -4,7 +4,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { HttpModule, XHRBackend, Response, ResponseOptions } from '@angular/http'; import { MockBackend, MockConnection } from '@angular/http/testing'; -import { Student, DailyLog, Report, Recommendation, Referral } from '../shared/models/models'; +import { Student, DailyLog, Report, Recommendation, Referral } from '../models/models'; import { StudentsService } from './students.service'; describe('StudentsService', () => { From 0a9c086c940f01df32394cb921403d8b44598f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Arag=C3=A3o?= Date: Wed, 20 Jun 2018 23:57:55 -0300 Subject: [PATCH 05/20] Refactoring app-router.module --- .../{app.routes.ts => app-router.module.ts} | 49 ++++++++++--------- src/app/app.module.ts | 7 ++- src/app/header/sidenav/sidenav.component.html | 2 +- src/app/header/sidenav/sidenav.component.ts | 7 +-- .../admin-page/admin-page.component.spec.ts | 7 ++- .../admin-page/admin-page.component.ts | 24 ++++----- src/app/shared/models/models.ts | 7 --- src/app/shared/models/team-member.model.ts | 5 ++ src/app/shared/services/auth.service.ts | 33 ++++++++----- src/app/students/report/report.component.ts | 1 - 10 files changed, 72 insertions(+), 70 deletions(-) rename src/app/{app.routes.ts => app-router.module.ts} (54%) create mode 100644 src/app/shared/models/team-member.model.ts diff --git a/src/app/app.routes.ts b/src/app/app-router.module.ts similarity index 54% rename from src/app/app.routes.ts rename to src/app/app-router.module.ts index 6467258..fe7f29a 100644 --- a/src/app/app.routes.ts +++ b/src/app/app-router.module.ts @@ -1,28 +1,30 @@ -import { ModuleWithProviders } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { RouterModule } from "@angular/router"; + +import { LoginComponent } from "./login/login.component"; +import { ProfileComponent } from "./profile/profile.component"; +import { AdminPageComponent } from './profile/admin-page/admin-page.component'; +import { StudentsComponent } from './students/students.component'; +import { StudentFormComponent } from './students/student-form/student-form.component'; +import { StudentPanelComponent } from './students/student-panel/student-panel.component'; +import { DailyLogComponent } from './students/daily-log/daily-log.component'; +import { DailyLogFormComponent } from './students/daily-log-form/daily-log-form.component'; +import { DailyLogPanelComponent } from './students/daily-log-panel/daily-log-panel.component'; +import { ReferralComponent } from './students/referral/referral.component'; +import { ReferralFormComponent } from './students/referral-form/referral-form.component'; +import { ReferralPanelComponent } from './students/referral-panel/referral-panel.component'; +import { ReportComponent } from './students/report/report.component'; +import { ReportFormComponent } from './students/report-form/report-form.component'; +import { RecommendationPanelComponent } from './students/recommendation-panel/recommendation-panel.component'; import { AuthGuard } from "./shared/guards/auth.guard"; import { LoginGuard } from "./shared/guards/login.guard"; -import { LoginComponent } from "./login/login.component"; -import { ProfileComponent } from "./profile/profile.component"; -import { StudentsComponent } from './students/students.component'; -import { StudentFormComponent } from './students/student-form/student-form.component'; -import { StudentPanelComponent } from './students/student-panel/student-panel.component'; -import { DailyLogComponent } from './students/daily-log/daily-log.component'; -import { DailyLogFormComponent } from './students/daily-log-form/daily-log-form.component'; -import { ReportComponent } from './students/report/report.component'; -import { ReportFormComponent } from './students/report-form/report-form.component'; -import { ReferralComponent } from './students/referral/referral.component'; -import { ReferralFormComponent } from './students/referral-form/referral-form.component'; -import { ReferralPanelComponent } from './students/referral-panel/referral-panel.component'; -import { DailyLogPanelComponent } from './students/daily-log-panel/daily-log-panel.component'; -import { RecommendationPanelComponent } from './students/recommendation-panel/recommendation-panel.component'; -import { AdminPageComponent } from './profile/admin-page/admin-page.component'; -const APP_ROUTES: Routes = [ +const ROUTES = RouterModule.forRoot([ { path: '' , redirectTo: 'students' , pathMatch: 'full' }, { path: 'login' , component: LoginComponent , canActivate: [LoginGuard]}, { path: 'profile' , component: ProfileComponent , canActivate: [AuthGuard] }, + { path: 'admin' , component: AdminPageComponent , canActivate: [AuthGuard] }, { path: 'students' , component: StudentsComponent , pathMatch: 'full' , canActivate: [AuthGuard] }, { path: 'students/new' , component: StudentFormComponent , canActivate: [AuthGuard] }, { path: 'studentpanel/:id' , component: StudentPanelComponent , canActivate: [AuthGuard] }, @@ -34,8 +36,11 @@ const APP_ROUTES: Routes = [ { path: 'referralpanel/:id' , component: ReferralPanelComponent , canActivate: [AuthGuard] }, { path: 'report/:id' , component: ReportFormComponent , canActivate: [AuthGuard] }, { path: 'reports' , component: ReportComponent , canActivate: [AuthGuard] }, - { path: 'recommendation/:id', component: RecommendationPanelComponent, canActivate: [AuthGuard] }, - { path: 'admin' , component: AdminPageComponent, canActivate: [AuthGuard] } -]; + { path: 'recommendation/:id', component: RecommendationPanelComponent, canActivate: [AuthGuard] } +]) -export const routes: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); +@NgModule({ + imports: [ROUTES], + exports: [RouterModule] +}) +export class AppRouterModule {} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 4958e2e..40db7cd 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,12 +3,12 @@ import { HttpModule } from '@angular/http'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MaterializeModule } from 'angular2-materialize'; +import { MaterializeModule } from 'angular2-materialize'; import { Angular2TokenService } from 'angular2-token'; import { OrderModule } from 'ngx-order-pipe'; import { AppComponent } from './app.component'; -import { routes } from './app.routes'; +import { AppRouterModule } from "./app-router.module"; import { AuthGuard } from "./shared/guards/auth.guard"; import { LoginGuard } from "./shared/guards/login.guard"; import { AuthService } from "./shared/services/auth.service"; @@ -55,7 +55,6 @@ import { AdminPageComponent } from './profile/admin-page/admin-pag DailyLogPanelComponent, RecommendationPanelComponent, AdminPageComponent - ], imports: [ HttpModule, @@ -64,7 +63,7 @@ import { AdminPageComponent } from './profile/admin-page/admin-pag OrderModule, ReactiveFormsModule, MaterializeModule, - routes + AppRouterModule ], providers: [ LoginGuard, diff --git a/src/app/header/sidenav/sidenav.component.html b/src/app/header/sidenav/sidenav.component.html index 51db4c0..c3fa2c7 100644 --- a/src/app/header/sidenav/sidenav.component.html +++ b/src/app/header/sidenav/sidenav.component.html @@ -47,7 +47,7 @@ Visitar Perfil -
  • +
  • person_add Cadastrar Novo Membro diff --git a/src/app/header/sidenav/sidenav.component.ts b/src/app/header/sidenav/sidenav.component.ts index 81e3d22..f261c35 100644 --- a/src/app/header/sidenav/sidenav.component.ts +++ b/src/app/header/sidenav/sidenav.component.ts @@ -4,6 +4,7 @@ import { Router } from "@angular/router"; import { MaterializeDirective } from "angular2-materialize"; import { Angular2TokenService, UserData } from "angular2-token"; +import { TeamMember } from "../../shared/models/team-member.model"; import { AuthService } from "../../shared/services/auth.service"; import { RegisterFormComponent } from "../../register/register-form/register-form.component"; @@ -13,8 +14,6 @@ import { RegisterFormComponent } from "../../register/register-form/register-for styleUrls: ['./sidenav.component.css'] }) export class SidenavComponent implements OnInit { - memberData: UserData; - @ViewChild('registerForm') registerForm: RegisterFormComponent; constructor( @@ -25,10 +24,6 @@ export class SidenavComponent implements OnInit { ngOnInit() {} - refreshComponent(){ - this.ngOnInit(); - } - presentAuthDialog(){ this.registerForm.openDialog(); } diff --git a/src/app/profile/admin-page/admin-page.component.spec.ts b/src/app/profile/admin-page/admin-page.component.spec.ts index 8f2913a..473d44d 100644 --- a/src/app/profile/admin-page/admin-page.component.spec.ts +++ b/src/app/profile/admin-page/admin-page.component.spec.ts @@ -1,9 +1,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { Angular2TokenService } from 'angular2-token'; -import { HttpModule } from '@angular/http'; -import { RouterTestingModule } from '@angular/router/testing'; - +import { RouterTestingModule } from '@angular/router/testing'; +import { HttpModule } from '@angular/http'; +import { Angular2TokenService } from 'angular2-token'; import { AuthService } from "../../shared/services/auth.service"; import { AdminPageComponent } from './admin-page.component'; diff --git a/src/app/profile/admin-page/admin-page.component.ts b/src/app/profile/admin-page/admin-page.component.ts index 4d60b58..66f1416 100644 --- a/src/app/profile/admin-page/admin-page.component.ts +++ b/src/app/profile/admin-page/admin-page.component.ts @@ -3,31 +3,31 @@ import { Router } from "@angular/router"; import { Angular2TokenService} from "angular2-token"; import { AuthService } from "../../shared/services/auth.service"; -import { TeamMember } from "../../shared/models/models"; +import { TeamMember } from "../../shared/models/team-member.model"; @Component({ selector: 'app-admin-page', templateUrl: './admin-page.component.html', styleUrls: ['./admin-page.component.css'] }) export class AdminPageComponent implements OnInit { - -private teamMember: TeamMember[] = []; + private teamMember: TeamMember[] = []; + constructor( - public authTokenService: Angular2TokenService, - public authService: AuthService, - private router: Router + public authTokenService: Angular2TokenService, + public authService: AuthService, + private router: Router ) { } ngOnInit() { this.authService.getTeamMembers() - .subscribe( - data => this.teamMember = data, - response => {} - ); + .subscribe( + data => this.teamMember = data, + response => {} + ); } -getTeamMembers() { - return this.teamMember; + getTeamMembers() { + return this.teamMember; } deleteTeamMember(teamMember) { diff --git a/src/app/shared/models/models.ts b/src/app/shared/models/models.ts index 3995df7..bc63fb3 100644 --- a/src/app/shared/models/models.ts +++ b/src/app/shared/models/models.ts @@ -1,10 +1,3 @@ -export class TeamMember { - id: number; - name: string; - email: string; - admin: boolean; -} - export class Student { id: number; name: string; diff --git a/src/app/shared/models/team-member.model.ts b/src/app/shared/models/team-member.model.ts new file mode 100644 index 0000000..81aa32b --- /dev/null +++ b/src/app/shared/models/team-member.model.ts @@ -0,0 +1,5 @@ +import { UserData } from "angular2-token"; + +export interface TeamMember extends UserData { + admin: boolean; +} diff --git a/src/app/shared/services/auth.service.ts b/src/app/shared/services/auth.service.ts index 9479e3f..ccdf741 100644 --- a/src/app/shared/services/auth.service.ts +++ b/src/app/shared/services/auth.service.ts @@ -1,21 +1,23 @@ import { Injectable } from '@angular/core'; import { Response } from "@angular/http"; import { Http } from '@angular/http'; -//import { Subject, Observable } from "rxjs"; import { Subject } from "rxjs"; -import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/map'; import { Observable } from "rxjs/Observable"; -//import { TokenService } from "token.service"; +import { Angular2TokenService, UserData, SignInData, RegisterData, UpdatePasswordData} from "angular2-token"; -import { Angular2TokenService, SignInData, RegisterData, UpdatePasswordData} from "angular2-token"; +import { TeamMember } from "../models/team-member.model"; @Injectable() export class AuthService { private url: string = "http://localhost:3000/team_members"; - constructor(public _tokenService: Angular2TokenService,private http: Http) {} + constructor( + public _tokenService: Angular2TokenService, + private http: Http + ) {} public signIn(signInData: SignInData): Observable{ return this._tokenService.signIn(signInData) @@ -45,20 +47,25 @@ export class AuthService { return this._tokenService.deleteAccount(); } - getTeamMembers(){ + public userIsAdmin(): boolean { + var teamMember: TeamMember = this._tokenService.currentUserData as TeamMember; + return teamMember.admin; + } + + public getTeamMembers(){ return this.http.get(this.url) - .map(res => res.json()); + .map(res => res.json()); } - deleteTeamMember(id){ + public deleteTeamMember(id){ return this.http.delete(this.url + '/' + id) - .map(res => res.json()); + .map(res => res.json()); } - + //Handling Errors private handleErrors(error: Response){ - console.log("SALVANDO O ERRO NUM ARQUIVO DE LOG - DETALHES DO ERRO => ", error); - return Observable.throw(error); - } + console.log("SALVANDO O ERRO NUM ARQUIVO DE LOG - DETALHES DO ERRO => ", error); + return Observable.throw(error); +} } diff --git a/src/app/students/report/report.component.ts b/src/app/students/report/report.component.ts index 440d912..7c4b043 100644 --- a/src/app/students/report/report.component.ts +++ b/src/app/students/report/report.component.ts @@ -66,7 +66,6 @@ export class ReportComponent implements OnInit { type: 'blob', mimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' }) - FileSaver.saveAs(out, 'report_student_' + report.student_id + '.docx') }) } From 0a3478983585748dc28dbccdeeaed76f8bac4f82 Mon Sep 17 00:00:00 2001 From: Mota Date: Thu, 21 Jun 2018 10:55:48 -0300 Subject: [PATCH 06/20] Adding some FAQ and IncluCare description Co-authored-by: marcelo046 --- src/app/app.routes.ts | 2 +- src/app/tutorial/tutorial.component.html | 90 +++++++++++++++++++++++- 2 files changed, 89 insertions(+), 3 deletions(-) diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 6afa793..47f1edd 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -37,7 +37,7 @@ const APP_ROUTES: Routes = [ { path: 'reports' , component: ReportComponent , canActivate: [AuthGuard] }, { path: 'recommendation/:id', component: RecommendationPanelComponent, canActivate: [AuthGuard] }, { path: 'admin' , component: AdminPageComponent, canActivate: [AuthGuard] }, - { path: 'tutorial' , component: TutorialComponent, canActivate: [AuthGuard] } + { path: 'tutorial' , component: TutorialComponent, } ]; export const routes: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); diff --git a/src/app/tutorial/tutorial.component.html b/src/app/tutorial/tutorial.component.html index 7f0c9eb..c81fb9e 100644 --- a/src/app/tutorial/tutorial.component.html +++ b/src/app/tutorial/tutorial.component.html @@ -1,3 +1,89 @@ -

    - tutorial works! + +

      +
    • +

      Tutorial

      +
    • +
    • +
        +
      • + + class + O que e o IncluCare? + +
        +
          +

          + O IncluCare é uma aplicação para auxiliar a equipe educacional no acompanhamento e triagem de estudantes com dificuldade de aprendizagem. O objetivo do IncluCare é auxiliar a equipe educacional responsável, de escolas públicas, pela triagem e acompanhamento de estudantes que apresentam algum tipo de dificuldade de aprendizagem, facilitando e tornando estes processos mais rápidos. +

          +
        +
        +
      • +
      +
    • + +
    • +

      Perguntas frequentes

      +
    • +
    • +
        +
      • + + account_circle + Como me cadastrar? + +
        +
          +

          + Para que seja efetuado o seu cadastro no sistema, + deve-se entrar em contato com a direcao da sua escola para ser encaminhado a equipe gestora + do IncluCare de sua instituicao de ensino. +

          +
        +
        +
      • +
      +
    • +
    • + +
    • +
    • + +
    • +
    + + From 03e62a3665ab918c17455a5097cf207d8e59140e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Arag=C3=A3o?= Date: Thu, 21 Jun 2018 23:59:34 -0300 Subject: [PATCH 07/20] Refactoring AuthServices usage --- src/app/app.component.html | 2 +- src/app/header/navbar/navbar.component.html | 2 +- src/app/header/sidenav/sidenav.component.html | 6 +- src/app/header/sidenav/sidenav.component.ts | 23 ++- src/app/login/login.component.ts | 10 +- .../admin-page/admin-page.component.html | 4 +- .../admin-page/admin-page.component.ts | 4 +- src/app/profile/profile.component.html | 146 +++++++----------- src/app/profile/profile.component.ts | 8 +- src/app/shared/services/auth.service.ts | 20 ++- .../daily-log-form.component.ts | 9 +- .../recommendation-panel.component.ts | 3 +- 12 files changed, 101 insertions(+), 136 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 6424773..c768a10 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,4 +1,4 @@ -
    +
    diff --git a/src/app/header/navbar/navbar.component.html b/src/app/header/navbar/navbar.component.html index 2d6befa..6eba42e 100644 --- a/src/app/header/navbar/navbar.component.html +++ b/src/app/header/navbar/navbar.component.html @@ -1,4 +1,4 @@ -