diff --git a/src/app/app.routes.ts b/src/app/app-router.module.ts similarity index 51% rename from src/app/app.routes.ts rename to src/app/app-router.module.ts index 1896cb5..3627b30 100644 --- a/src/app/app.routes.ts +++ b/src/app/app-router.module.ts @@ -1,28 +1,31 @@ -import { ModuleWithProviders } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { NgModule } from "@angular/core"; +import { RouterModule } from "@angular/router"; -import { AuthGuard } from "./guards/auth.guard"; -import { LoginGuard } from "./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 { 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 { AdminPageComponent } from './profile/admin-page/admin-page.component'; +import { TutorialComponent } from './tutorial/tutorial.component'; -const APP_ROUTES: Routes = [ +import { AuthGuard } from "./shared/guards/auth.guard"; +import { LoginGuard } from "./shared/guards/login.guard"; + +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] }, @@ -35,7 +38,11 @@ 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: 'tutorial' , component: TutorialComponent, canActivate: [AuthGuard] } +]) -export const routes: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES); +@NgModule({ + imports: [ROUTES], + exports: [RouterModule] +}) +export class AppRouterModule {} 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 @@ -<header *ngIf="authService.userSignedIn()"> +<header> <app-navbar></app-navbar> <app-sidenav></app-sidenav> </header> diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 4a8666b..236960f 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -7,10 +7,10 @@ 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 './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..932e324 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,24 +3,24 @@ 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 { AuthGuard } from "./guards/auth.guard"; -import { LoginGuard } from "./guards/login.guard"; -import { AuthService } from "./services/auth.service"; +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"; 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 { SidenavComponent } from './sidenav/sidenav.component'; -import { NavbarComponent } from './navbar/navbar.component'; +import { FilterPipe } from './shared/pipes/filter.pipe'; +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'; @@ -32,6 +32,8 @@ 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'; +import { TutorialLoginComponent } from "./tutorial/tutorial-login/tutorial-login.component"; @NgModule({ declarations: [ @@ -54,8 +56,9 @@ import { AdminPageComponent } from './profile/admin-page/admin-pag ReferralPanelComponent, DailyLogPanelComponent, RecommendationPanelComponent, - AdminPageComponent - + AdminPageComponent, + TutorialComponent, + TutorialLoginComponent ], imports: [ HttpModule, @@ -64,7 +67,7 @@ import { AdminPageComponent } from './profile/admin-page/admin-pag OrderModule, ReactiveFormsModule, MaterializeModule, - routes + AppRouterModule ], providers: [ LoginGuard, 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 72% rename from src/app/navbar/navbar.component.html rename to src/app/header/navbar/navbar.component.html index 2d6befa..6eba42e 100644 --- a/src/app/navbar/navbar.component.html +++ b/src/app/header/navbar/navbar.component.html @@ -1,4 +1,4 @@ -<div class="navbar-fixed"> +<div *ngIf="authService.userSignedIn()" class="navbar-fixed"> <nav> <a [routerLink]="['']" class="brand-logo">IncluCare</a> <ul class="right"> 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 dc010fb..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 '../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 c935aa0..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 "../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 69% rename from src/app/sidenav/sidenav.component.html rename to src/app/header/sidenav/sidenav.component.html index 51db4c0..1dc3835 100644 --- a/src/app/sidenav/sidenav.component.html +++ b/src/app/header/sidenav/sidenav.component.html @@ -1,9 +1,9 @@ -<ul id="slide-out" class="side-nav fixed"> +<ul *ngIf="authService.userSignedIn()" id="slide-out" class="side-nav fixed"> <li class="li-hover mt-6"> <p class="ultra-small margin more-text">Alunos</p> </li> <li class="no-padding"> - <ul class="collapsible collapsible-accordion"> + <ul class="collapsible collapsible-accordion" materialize="collapsible"> <li class="bold"> <a class="collapsible-header waves-effect waves-cyan"> <i class="material-icons">class</i> @@ -37,7 +37,7 @@ <li class="bold"> <a class="collapsible-header waves-effect waves-cyan"> <i class="material-icons">account_circle</i> - <span class="nav-text" *ngIf='authTokenService.currentUserData'>{{authTokenService.currentUserData.name}}</span> + <span class="nav-text" *ngIf='authService.currentUserData()'>{{authService.currentUserData().name}}</span> </a> <div class="collapsible-body"> <ul> @@ -47,7 +47,7 @@ <span>Visitar Perfil</span> </a> </li> - <li *ngIf="authTokenService.currentUserData.admin == true "> + <li *ngIf="authService.userIsAdmin()"> <a href="javascript:void(0);" (click)="presentAuthDialog()"> <i class="material-icons">person_add</i> <span>Cadastrar Novo Membro</span> @@ -58,6 +58,24 @@ </li> </ul> </li> + <li class="no-padding"> + <ul class="collapsible collapsible-accordion"> + <li class="bold"> + <a class="collapsible-header waves-effect waves-cyan"> + <span class="nav-text" *ngIf='authTokenService.currentUserData'>Novo no sistema?</span> + </a> + <div class="collapsible-body"> + <ul> + <li> + <a [routerLink]="['/tutorial']"> + <span>Visitar Tutorial</span> + </a> + </li> + </ul> + </div> + </li> + </ul> + </li> </ul> -<app-register-form #registerForm ></app-register-form> +<app-register-form #registerForm></app-register-form> 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 94b2dd9..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 '../services/auth.service'; +import { AuthService } from '../../shared/services/auth.service'; describe('SidenavComponent', () => { let tokenMock = jasmine.createSpyObj('tokenMock', ['validateToken', 'subscribe']); diff --git a/src/app/header/sidenav/sidenav.component.ts b/src/app/header/sidenav/sidenav.component.ts new file mode 100644 index 0000000..16991ab --- /dev/null +++ b/src/app/header/sidenav/sidenav.component.ts @@ -0,0 +1,29 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { Router } from "@angular/router"; + +import { MaterializeDirective } from "angular2-materialize"; + +import { TeamMember } from "../../shared/models/team-member.model"; +import { AuthService } from "../../shared/services/auth.service"; +import { RegisterFormComponent } from "../../register/register-form/register-form.component"; + +@Component({ + selector: 'app-sidenav', + templateUrl: './sidenav.component.html', + styleUrls: ['./sidenav.component.css'] +}) +export class SidenavComponent implements OnInit { + @ViewChild('registerForm') registerForm: RegisterFormComponent; + + constructor( + public authService: AuthService, + private router: Router + ) {} + + ngOnInit() {} + + presentAuthDialog(){ + this.registerForm.openDialog(); + } + +} diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html index dff1cf0..f2909bf 100644 --- a/src/app/login/login.component.html +++ b/src/app/login/login.component.html @@ -20,4 +20,11 @@ <h5 class="login-title">Entrar</h5> </form> </div> </div> + <div class="fixed-action-btn"> + <a href="javascript:void(0);" (click)="openTutorial()" class="btn-floating cyan"> + <i class="material-icons">help_outline</i> + </a> + </div> </div> + +<app-tutorial-login #tutorialLogin ></app-tutorial-login> diff --git a/src/app/login/login.component.spec.ts b/src/app/login/login.component.spec.ts index cd6e204..707e06d 100644 --- a/src/app/login/login.component.spec.ts +++ b/src/app/login/login.component.spec.ts @@ -3,10 +3,12 @@ import { HttpModule } from '@angular/http'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; +import { MaterializeModule } from 'angular2-materialize'; import { Angular2TokenService } from 'angular2-token'; -import { AuthService } from "../services/auth.service"; +import { AuthService } from "../shared/services/auth.service"; import { LoginComponent } from './login.component'; +import { TutorialLoginComponent } from '../tutorial/tutorial-login/tutorial-login.component'; describe('LoginComponent', () => { let component: LoginComponent; @@ -17,10 +19,14 @@ describe('LoginComponent', () => { tokenMock.validateToken.and.returnValue(tokenMock); TestBed.configureTestingModule({ - declarations: [ LoginComponent ], + declarations: [ + LoginComponent, + TutorialLoginComponent + ], imports: [ HttpModule, FormsModule, + MaterializeModule, ReactiveFormsModule, RouterTestingModule ], diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 1b49115..f9aafe7 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -1,12 +1,13 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, ViewChild } from '@angular/core'; import { Router } from "@angular/router"; 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"; +import { TutorialLoginComponent } from "../tutorial/tutorial-login/tutorial-login.component"; @Component({ selector: 'app-login', @@ -18,16 +19,14 @@ export class LoginComponent implements OnInit { formUtils: FormUtils; public submitted: boolean; public formErrors: Array<string>; + @ViewChild('tutorialLogin') tutorialLogin: TutorialLoginComponent; constructor( private router: Router, private formBuilder: FormBuilder, - private authService: AuthService + private authService: AuthService, ) { this.setupForm(); - this.formUtils = new FormUtils(this.form); - this.submitted = false; - this.formErrors = null; } ngOnInit() {} @@ -48,10 +47,18 @@ export class LoginComponent implements OnInit { ); } + openTutorial(){ + this.tutorialLogin.openDialog(); + } + private setupForm(){ this.form = this.formBuilder.group({ email: [null, [Validators.required, Validators.email]], password: [null, [Validators.required, Validators.minLength(8)]] }); + + this.formUtils = new FormUtils(this.form); + this.submitted = false; + this.formErrors = null; } } diff --git a/src/app/profile/admin-page/admin-page.component.html b/src/app/profile/admin-page/admin-page.component.html index 6d3e659..5996d72 100644 --- a/src/app/profile/admin-page/admin-page.component.html +++ b/src/app/profile/admin-page/admin-page.component.html @@ -1,5 +1,5 @@ -<div *ngIf="authTokenService.currentUserData"> - <div *ngIf="authTokenService.currentUserData.nickname == 'admin'; else elseBlock "> +<div *ngIf="authService.currentUserData()"> + <div *ngIf="authService.currentUserData().nickname == 'admin'; else elseBlock "> <h3>Painel de Membros</h3> <table class="striped"> <thead> 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..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,11 +1,10 @@ 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 "../../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..b394ed8 100644 --- a/src/app/profile/admin-page/admin-page.component.ts +++ b/src/app/profile/admin-page/admin-page.component.ts @@ -1,33 +1,31 @@ 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/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 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/profile/profile.component.html b/src/app/profile/profile.component.html index 8cb7169..251ae2e 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -1,4 +1,4 @@ -<div id="showprofile" *ngIf="authTokenService.currentUserData"> +<div id="showprofile" *ngIf="authService.currentUserData()"> <div class="col l4 s12 center"> <br/> @@ -11,115 +11,79 @@ <h4 align="center"> Perfil </h4> <div class="row"> <div class="container"> <div class="card-action" align="right"> - <a (click)="editMode = !editMode" class="btn waves-effect waves-light gradient-inclucare" type="submit" name="action">Editar Dados + <a (click)="editMode = !editMode" class="btn waves-effect waves-light gradient-inclucare" type="submit" name="action"> + Editar Dados <i class="material-icons right">edit</i> </a> - <a href="/students" class="btn waves-effect waves-light gradient-inclucare" - type="button" name="action">Deletar Perfil + <a href="/students" class="btn waves-effect waves-light gradient-inclucare" type="button" name="action"> + Deletar Perfil <i class="material-icons right">delete</i> </a> - <a class="btn waves-effect waves-light gradient-inclucare" type="button" (click)="openNewPassawordModal()">Trocar Senha - <i class="material-icons right">lock</i> - </a> + <a class="btn waves-effect waves-light gradient-inclucare" type="button" (click)="openNewPassawordModal()"> + Trocar Senha + <i class="material-icons right">lock</i> + </a> </div> </div> - <div class="input-field col s6"> - <input - type="text" - id="name" - placeholder="" - [(ngModel)]="authTokenService.currentUserData.name" - name="name" - #name="ngModel" - [readonly]="!editMode" - > - <label class="active" for="name">Nome</label> - </div> - - <div class="input-field col s6"> - <input - type="email" - id="email" - placeholder="" - [(ngModel)]="authTokenService.currentUserData.email" - name='email' - #parent_email="ngModel" - [readonly]="!editMode" - > - <label class="active" for="email">Email</label> - </div> + <div class="input-field col s6"> + <input type="text" id="name" placeholder="" [(ngModel)]="authService.currentUserData().name" name="name" #name="ngModel" [readonly]="!editMode"> + <label class="active" for="name">Nome</label> + </div> - <div class="container"> - <div class="card-action" align="center"> - <button *ngIf="editMode" (click)="editMode = !editMode"class="btn waves-effect waves-light gradient-inclucare" - type="button" name="action">Cancelar - <i class="material-icons right">close</i> - </button> + <div class="input-field col s6"> + <input type="email" id="email" placeholder="" [(ngModel)]="authService.currentUserData().email" name='email' #parent_email="ngModel" [readonly]="!editMode"> + <label class="active" for="email">Email</label> + </div> - <a *ngIf="editMode" class="btn waves-effect waves-light gradient-inclucare" - type="button" name="action">Salvar alterações - <i class="material-icons right">send</i> - </a> + <div class="container"> + <div class="card-action" align="center"> + <button *ngIf="editMode" (click)="editMode = !editMode"class="btn waves-effect waves-light gradient-inclucare" type="button" name="action"> + Cancelar + <i class="material-icons right">close</i> + </button> + + <a *ngIf="editMode" class="btn waves-effect waves-light gradient-inclucare" type="button" name="action"> + Salvar alterações + <i class="material-icons right">send</i> + </a> - </div> - </div> -</div> + </div> + </div> + </div> </form> </div> -<div id="modal" class="modal" materialize="modal" [materializeActions]="modalActions"> + <div id="modal" class="modal" materialize="modal" [materializeActions]="modalActions"> <div class="modal-content"> <div class="col-md-6"> - <div class="card card-block"> - <h4 class="card-title">Trocar Senha</h4> - - <form #changePasswordForm="ngForm" (ngSubmit)="updatePassword()"> - - <div class="form-group"> - <label for="formGroupExampleInput">Senha Atual</label> - <input type="password" - class="form-control" - placeholder="Senha Atual" - required - [(ngModel)]="updatePasswordData.passwordCurrent" - name="current-password"> - </div> - - <div class="form-group"> - <label for="formGroupExampleInput">Nova Senha</label> - <input type="password" - class="form-control" - placeholder="Nova Senha" - required - [(ngModel)]="updatePasswordData.password" - name="password"> - </div> + <div class="card card-block"> + <h4 class="card-title">Trocar Senha</h4> + <form #changePasswordForm="ngForm" (ngSubmit)="updatePassword()"> + + <div class="form-group"> + <label for="formGroupExampleInput">Senha Atual</label> + <input type="password" class="form-control" placeholder="Senha Atual" required [(ngModel)]="updatePasswordData.passwordCurrent" name="current-password"> + </div> + <div class="form-group"> + <label for="formGroupExampleInput">Nova Senha</label> + <input type="password" class="form-control" placeholder="Nova Senha" required [(ngModel)]="updatePasswordData.password" name="password"> + </div> + <div class="form-group"> + <label for="formGroupExampleInput">Confirmação Nova Senha</label> + <input type="password" class="form-control" placeholder="Confirmação Nova Senha" required [(ngModel)]="updatePasswordData.passwordConfirmation" name="password-confirmation"> + </div> + <button type="submit" class="btn btn-primary right" [disabled]="!changePasswordForm.form.valid"> + Enviar + </button> + + </form> - <div class="form-group"> - <label for="formGroupExampleInput">Confirmação Nova Senha</label> - <input type="password" - class="form-control" - placeholder="Confirmação Nova Senha" - required - [(ngModel)]="updatePasswordData.passwordConfirmation" - name="password-confirmation"> - </div> - - <button - type="submit" - class="btn btn-primary right" - [disabled]="!changePasswordForm.form.valid"> - Enviar - </button> - -</form> - - </div> + </div> + </div> </div> </div> -</div> </div> 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..ed774b4 100644 --- a/src/app/profile/profile.component.ts +++ b/src/app/profile/profile.component.ts @@ -1,10 +1,10 @@ import { Component, OnInit, EventEmitter } from '@angular/core'; import { Router } from "@angular/router"; -import { Angular2TokenService, UpdatePasswordData } from "angular2-token"; +import { 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', @@ -12,12 +12,10 @@ import { AuthService } from "../services/auth.service"; styleUrls: ['./profile.component.css'] }) export class ProfileComponent implements OnInit { - updatePasswordData: UpdatePasswordData = <UpdatePasswordData>{}; modalActions = new EventEmitter<string|MaterializeAction>(); constructor( - public authTokenService: Angular2TokenService, public authService: AuthService, private router: Router ) {} @@ -35,9 +33,9 @@ export class ProfileComponent implements OnInit { updatePassword(){ this.authService.updatePassword(this.updatePasswordData).subscribe( res => { - this.updatePasswordData = <UpdatePasswordData>{}; + this.updatePasswordData = <UpdatePasswordData>{}; } ); } - + } 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 95% rename from src/app/shared/models.ts rename to src/app/shared/models/models.ts index 3995df7..bc63fb3 100644 --- a/src/app/shared/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/filter.pipe.spec.ts b/src/app/shared/pipes/filter.pipe.spec.ts similarity index 100% rename from src/app/shared/filter.pipe.spec.ts rename to src/app/shared/pipes/filter.pipe.spec.ts 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 65% rename from src/app/services/auth.service.spec.ts rename to src/app/shared/services/auth.service.spec.ts index ef2c82d..6515129 100644 --- a/src/app/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/services/auth.service.ts b/src/app/shared/services/auth.service.ts similarity index 58% rename from src/app/services/auth.service.ts rename to src/app/shared/services/auth.service.ts index 9479e3f..8c64a6f 100644 --- a/src/app/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 { Observable } from "rxjs/Observable"; -//import { TokenService } from "token.service"; +import 'rxjs/add/operator/map'; +import { Observable } from 'rxjs/Observable'; +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( + private http: Http, + public _tokenService: Angular2TokenService + ) {} public signIn(signInData: SignInData): Observable<Response>{ return this._tokenService.signIn(signInData) @@ -37,28 +39,37 @@ export class AuthService { .catch(this.handleErrors) } - public userSignedIn(): boolean{ + public deleteAccount(): Observable<Response>{ + return this._tokenService.deleteAccount(); + } + + public userSignedIn(): boolean { return this._tokenService.userSignedIn(); } - public deleteAccount(): Observable<Response>{ - return this._tokenService.deleteAccount(); + public userIsAdmin(): boolean { + var teamMember: TeamMember = this._tokenService.currentUserData as TeamMember; + if (teamMember !== undefined) return teamMember.admin; + } + + public currentUserData(): TeamMember{ + return this._tokenService.currentUserData as TeamMember; } - getTeamMembers(){ + 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/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..d484503 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 '../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.ts b/src/app/sidenav/sidenav.component.ts deleted file mode 100644 index 29426e2..0000000 --- a/src/app/sidenav/sidenav.component.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { Router } from "@angular/router"; - -import { MaterializeDirective } from "angular2-materialize"; -import { Angular2TokenService, UserData } from "angular2-token"; - -import { AuthService } from "../services/auth.service"; -import { RegisterFormComponent } from "../register/register-form/register-form.component"; - -@Component({ - selector: 'app-sidenav', - templateUrl: './sidenav.component.html', - styleUrls: ['./sidenav.component.css'] -}) -export class SidenavComponent implements OnInit { - memberData: UserData; - - @ViewChild('registerForm') registerForm: RegisterFormComponent; - - constructor( - public authService: AuthService, - public authTokenService: Angular2TokenService, - private router: Router - ) {} - - ngOnInit() {} - - refreshComponent(){ - this.ngOnInit(); - } - - presentAuthDialog(){ - this.registerForm.openDialog(); - } - - signOut(){ - this.authService.signOut() - .subscribe( - () => this.router.navigate(['/login']) - ) - } - -} 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..c7658b3 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,8 @@ import { HttpModule } from '@angular/http'; import { Angular2TokenService } from 'angular2-token'; import { DailyLogFormComponent } from './daily-log-form.component'; -import { StudentsService } from '../../services/students.service'; +import { AuthService } from '../../shared/services/auth.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('DailyLogFormComponent', () => { let component: DailyLogFormComponent; @@ -24,6 +25,7 @@ describe('DailyLogFormComponent', () => { ], declarations: [ DailyLogFormComponent ], providers: [ + AuthService, StudentsService, {provide: Angular2TokenService, useValue: tokenMock} ] 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..b3fc4c4 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,9 @@ 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 { AuthService } from '../../shared/services/auth.service'; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-daily-log-form', @@ -19,8 +20,8 @@ export class DailyLogFormComponent implements OnInit { constructor( private router: Router, private route: ActivatedRoute, - private studentsService: StudentsService, - public authTokenService: Angular2TokenService + private authService: AuthService, + private studentsService: StudentsService ) { } ngOnInit() { @@ -35,8 +36,8 @@ export class DailyLogFormComponent implements OnInit { var result; this.daily_log.student_id = this.id - this.daily_log.created_by = this.authTokenService.currentUserData.name - this.daily_log.updated_by = this.authTokenService.currentUserData.name + this.daily_log.created_by = this.authService.currentUserData().name + this.daily_log.updated_by = this.authService.currentUserData().name if (this.daily_log.id) result = this.studentsService.updateDailyLog(this.daily_log); 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..4dc1f8f 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,8 @@ import { HttpModule } from '@angular/http'; import { Angular2TokenService } from 'angular2-token'; -import { StudentsService } from '../../services/students.service' +import { StudentsService } from '../../shared/services/students.service' +import { AuthService } from '../../shared/services/auth.service'; import { RecommendationPanelComponent } from './recommendation-panel.component'; describe('RecommendationComponent', () => { @@ -25,6 +26,7 @@ describe('RecommendationComponent', () => { ], declarations: [ RecommendationPanelComponent ], providers: [ + AuthService, StudentsService, {provide: Angular2TokenService, useValue: tokenMock} ] diff --git a/src/app/students/recommendation-panel/recommendation-panel.component.ts b/src/app/students/recommendation-panel/recommendation-panel.component.ts index f62e32a..eec2640 100644 --- a/src/app/students/recommendation-panel/recommendation-panel.component.ts +++ b/src/app/students/recommendation-panel/recommendation-panel.component.ts @@ -4,8 +4,9 @@ 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'; +import { AuthService } from '../../shared/services/auth.service'; @Component({ selector: 'app-recommendation-panel', @@ -19,7 +20,7 @@ export class RecommendationPanelComponent implements OnInit { idAux: number; constructor( - public authTokenService: Angular2TokenService, + public authService: AuthService, private recommendationService: StudentsService, private router: Router, private route: ActivatedRoute @@ -41,7 +42,7 @@ export class RecommendationPanelComponent implements OnInit { } updateRecommendation(recommendation){ - this.recommendation.updated_by = this.authTokenService.currentUserData.name + this.recommendation.updated_by = this.authService.currentUserData().name var result; result = this.recommendationService.updateRecommendation(this.recommendation); result.subscribe(data => this.router.navigate(['/recommendation'])); @@ -52,8 +53,8 @@ export class RecommendationPanelComponent implements OnInit { createRecommendation(){ this.recommendation.id = this.idAux this.recommendation.student_id = this.idAux - this.recommendation.created_by = this.authTokenService.currentUserData.name - this.recommendation.updated_by = this.authTokenService.currentUserData.name + this.recommendation.created_by = this.authService.currentUserData().name + this.recommendation.updated_by = this.authService.currentUserData().name var result; result = this.recommendationService.createRecommendation(this.recommendation); result.subscribe(data => this.router.navigate(['/recommendation'])); 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..4746fa1 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,8 @@ import { HttpModule } from '@angular/http'; import { Angular2TokenService } from 'angular2-token'; import { ReferralFormComponent } from './referral-form.component'; -import { StudentsService } from '../../services/students.service'; +import { AuthService } from '../../shared/services/auth.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('ReferralFormComponent', () => { let component: ReferralFormComponent; @@ -25,6 +26,7 @@ describe('ReferralFormComponent', () => { ], declarations: [ ReferralFormComponent ], providers: [ + AuthService, StudentsService, {provide: Angular2TokenService, useValue: tokenMock} ] diff --git a/src/app/students/referral-form/referral-form.component.ts b/src/app/students/referral-form/referral-form.component.ts index bcc3370..0a43a5e 100644 --- a/src/app/students/referral-form/referral-form.component.ts +++ b/src/app/students/referral-form/referral-form.component.ts @@ -1,10 +1,9 @@ import { Component, OnInit } from '@angular/core'; 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 { AuthService } from '../../shared/services/auth.service'; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-referral-form', @@ -20,7 +19,7 @@ export class ReferralFormComponent implements OnInit { private router: Router, private route: ActivatedRoute, private studentsService: StudentsService, - public authTokenService: Angular2TokenService + public authService: AuthService ) { } ngOnInit() { @@ -35,8 +34,8 @@ export class ReferralFormComponent implements OnInit { var result; this.referral.student_id = this.id - this.referral.created_by = this.authTokenService.currentUserData.name - this.referral.updated_by = this.authTokenService.currentUserData.name + this.referral.created_by = this.authService.currentUserData().name + this.referral.updated_by = this.authService.currentUserData().name if (this.referral.id) result = this.studentsService.updateReferral(this.referral); diff --git a/src/app/students/referral-panel/logoGDF.png b/src/app/students/referral-panel/logoGDF.png deleted file mode 100644 index d73c47f..0000000 Binary files a/src/app/students/referral-panel/logoGDF.png and /dev/null differ diff --git a/src/app/students/referral-panel/referral-panel.component.html b/src/app/students/referral-panel/referral-panel.component.html index e4a5efb..469dcc9 100644 --- a/src/app/students/referral-panel/referral-panel.component.html +++ b/src/app/students/referral-panel/referral-panel.component.html @@ -1,95 +1,70 @@ -<div id="showprofile"> +<div class="container"> + <div class="row"> + <div class="col s10 m6 l6"> + <h5 class="mt-2 mb-0">Painel do Encaminhamento</h5> + </div> + <div class="col s2 m6 l6"> + <a (click)="generatePDFReferral(referral.student.name)" class="btn waves-effect waves-light blue right mt-2"> + Baixar PDF + <i class="material-icons">description</i> + </a> + </div> + </div> +</div> + +<div class="container"> <div class="card"> - <h4 align="center"> Painel do Encaminhamento </h4> - <form id="referral_data" role="form"> - <div class="row"> - <div class="row"> - <div class="card-action" align="right"> - <a (click)="editMode = !editMode" class="btn waves-effect waves-light gradient-inclucare" type="submit" name="action">Editar - <i class="material-icons right">edit</i> - </a> - <a (click)="deleteReferral(referral)" href="/referrals" class="btn waves-effect waves-light gradient-inclucare" - type="button" name="action">Deletar Encaminhamento - <i class="material-icons right">delete</i> - </a> - </div> - </div> - <div *ngIf = "referral?.student" class="container"> - <div *ngIf="!editMode" id="content" #content> - <h4 align="center">Dados do Estudante</h4> - <p>Estabelecimento de Ensino: Escola Classe 401</p> - <p>Nome: {{referral.student.name}}</p> - <p>Data de Nascimento: {{referral.student.birth_date}}</p> - <p>Ano: {{referral.student.year}}</p> - <p>Turno: {{referral.student.shift}}</p> - <p>Turma: {{referral.student.student_class}}</p> - <p>Naturalidade: {{referral.student.nationality}}</p> - <p>Sexo:</p> - <p>Filiação:</p> - <p>Endereço: {{referral.student.address}}</p> - <p>Telefone: {{referral.student.parent_telephone}}</p> + <form id="dailylog_data" role="form"> + <div class="card-content row"> + <div *ngIf = "referral?.student" id="content" #content> + <div *ngIf="!editMode"> + <h4>Dados do Estudante</h4> - <h4 align="center">{{referral.title}}</h4> - <div style="word-wrap: break-word; max-width: 1000px; white-space: pre-line;"> - {{referral.body}} - </div> - </div> - <div *ngIf="editMode" id="edit" #edit> - <div class="input-field"> - <label class="active" for="title">Título</label> - <input - type="text" - id="title" - placeholder="" - [(ngModel)]="referral.title" - name="title" - #title="ngModel" - [readonly]="!editMode" - > + <p>Estabelecimento de Ensino: Escola Classe 401</p> + <p>Nome: {{referral.student.name}}</p> + <p>Data de Nascimento: {{referral.student.birth_date}}</p> + <p>Ano: {{referral.student.year}}</p> + <p>Turno: {{referral.student.shift}}</p> + <p>Turma: {{referral.student.student_class}}</p> + <p>Naturalidade: {{referral.student.nationality}}</p> + <p>Filiação: {{referral.student.responsible}}</p> + <p>Endereço: {{referral.student.address}}</p> + <p>Telefone: {{referral.student.parent_telephone}}</p> + + <h4>{{referral.title}}</h4> + <div class="referral-text">{{referral.body}}</div> </div> - <div class="active input-field"> - <label class="active" for="body">Texto</label> - <textarea - id="body" - placeholder="" - [(ngModel)]="referral.body" - name='body' - #body="ngModel" - class="materialize-textarea" - [readonly]="!editMode" - ></textarea> + <div *ngIf="editMode"> + <div class="input-field"> + <label class="active" for="title">Título</label> + <input type="text" id="title" placeholder="" [(ngModel)]="referral.title" name="title" #title="ngModel" [readonly]="!editMode"> + </div> + <div class="active input-field"> + <label class="active" for="body">Texto</label> + <textarea id="body" placeholder="" [(ngModel)]="referral.body" name='body' #body="ngModel" class="materialize-textarea" [readonly]="!editMode"></textarea> + </div> </div> + </div> </div> + <div class="card-action" align="right"> + <button (click)="returnToList()" *ngIf="!editMode" class="waves-effect waves-light btn blue left">Voltar</button> + <button (click)="editMode = !editMode" *ngIf="!editMode" class="btn waves-effect waves-light" type="submit" name="action"> + Editar + <i class="material-icons right">edit</i> + </button> + <button *ngIf="editMode" (click)="deleteReferral(referral)" class="btn waves-effect waves-light red" type="button" name="action"> + Deletar Encaminhamento + <i class="material-icons right">delete</i> + </button> + <button *ngIf="editMode" (click)="editMode = !editMode"class="btn waves-effect waves-light" type="button" name="action"> + Cancelar + <i class="material-icons right">close</i> + </button> + <button *ngIf="editMode" (click)="updateReferral(referral)" class="btn waves-effect waves-light" type="button" name="action"> + Salvar alterações + <i class="material-icons right">send</i> + </button> </div> - <div class="row"> - <div class="input-field col s6"> - <button *ngIf="editMode" (click)="editMode = !editMode"class="btn waves-effect waves-light gradient-inclucare" - type="button" name="action">Cancelar - <i class="material-icons right">close</i> - </button> - </div> - <div class="input-field col s6"> - <a (click)="updateReferral(referral)" *ngIf="editMode" class="btn waves-effect waves-light gradient-inclucare" - type="button" name="action">Salvar alterações - <i class="material-icons right">send</i> - </a> - </div> - </div> - </div> </form> </div> </div> - -<table> - <td> - <tr> - <div id = "content" #content> - <div class="card-action"> - <a class="btn waves-effect waves-light gradient-inclucare" (click) = "generatePDFReferral()" >Gerar PDF - <i class="material-icons right">description</i> - </a> - </div> - </div> - </tr> - </td> -</table> 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..47b399f 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', @@ -12,16 +12,16 @@ import { StudentsService } from '../../services/students.service'; styleUrls: ['./referral-panel.component.css'] }) export class ReferralPanelComponent implements OnInit { - - @ViewChild( 'content' ) content: ElementRef; name: string; editMode: boolean; referral: Referral = new Referral(); + @ViewChild('content') content: ElementRef; + constructor( private studentsService: StudentsService, - private router: Router, - private route: ActivatedRoute + private route: ActivatedRoute, + private router: Router ) { } ngOnInit() { @@ -38,20 +38,25 @@ export class ReferralPanelComponent implements OnInit { }); } + returnToList() { + this.router.navigate(['/referrals', this.referral.student.id]); + } + deleteReferral(referral) { if (confirm("Você tem certeza que quer deletar o encaminhamento " + referral.id + "?")) { - this.studentsService.deleteReferral(referral.id).subscribe(null); + var stId = referral.student.id; + this.studentsService.deleteReferral(referral.id) + .subscribe(data => this.router.navigate(['/referrals', stId])); } } updateReferral(referral){ var result; result = this.studentsService.updateReferral(this.referral); - - result.subscribe(data => this.router.navigate(['/referrals'])); + result.subscribe(data => this.router.navigate(['/referrals', this.referral.student.id])); } - public generatePDFReferral(){ + public generatePDFReferral(name){ let doc = new jsPDF(); let specialElementHandlers = { @@ -67,7 +72,7 @@ export class ReferralPanelComponent implements OnInit { 'elementHandlers': specialElementHandlers }); - doc.save('teste.pdf'); + doc.save('encaminhamento_' + name + '.pdf'); } } 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..383ae2f 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,8 @@ import { HttpModule } from '@angular/http'; import { Angular2TokenService } from 'angular2-token'; import { ReportFormComponent } from './report-form.component'; -import { StudentsService } from '../../services/students.service'; +import { AuthService } from '../../shared/services/auth.service'; +import { StudentsService } from '../../shared/services/students.service'; describe('ReportFormComponent', () => { let component: ReportFormComponent; @@ -25,6 +26,7 @@ describe('ReportFormComponent', () => { ], declarations: [ ReportFormComponent ], providers: [ + AuthService, StudentsService, {provide: Angular2TokenService, useValue: tokenMock} ] diff --git a/src/app/students/report-form/report-form.component.ts b/src/app/students/report-form/report-form.component.ts index 569ae46..0be25a7 100644 --- a/src/app/students/report-form/report-form.component.ts +++ b/src/app/students/report-form/report-form.component.ts @@ -1,10 +1,9 @@ import { Component, OnInit } from '@angular/core'; 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 { AuthService } from '../../shared/services/auth.service'; +import { StudentsService } from '../../shared/services/students.service'; @Component({ selector: 'app-report-form', @@ -18,7 +17,7 @@ export class ReportFormComponent implements OnInit { student: Student = new Student(); idC: number; constructor( - public authTokenService: Angular2TokenService, + public authService: AuthService, private reportService: StudentsService, private router: Router, private route: ActivatedRoute @@ -59,8 +58,8 @@ export class ReportFormComponent implements OnInit { save() { var result; this.report.student_id = this.student.id - this.report.created_by = this.authTokenService.currentUserData.name - this.report.updated_by = this.authTokenService.currentUserData.name + this.report.created_by = this.authService.currentUserData().name + this.report.updated_by = this.authService.currentUserData().name if (this.report.id){ result = this.reportService.updateReport(this.report); } else { 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..7c4b043 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; @@ -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') }) } 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.html b/src/app/students/students.component.html index 94a6325..f7fe587 100644 --- a/src/app/students/students.component.html +++ b/src/app/students/students.component.html @@ -20,7 +20,7 @@ <h5 class="mt-2 mb-0">Relação de Alunos</h5> <input [(ngModel)]="filterStudent" type="text" placeholder="Pesquisar Aluno"> </div> <div class="input-field col s3"> - <select [(ngModel)]="filterClass" materialize="material_select" [materializeSelectOptions]="classes"> + <select [(ngModel)]="filterClass" materialize="material_select"> <option value="" selected>Filtrar Turma</option> <option *ngFor="let c of classes" [value]="c">{{c}}</option> </select> 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', diff --git a/src/app/tutorial/tutorial-login/tutorial-login.component.css b/src/app/tutorial/tutorial-login/tutorial-login.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/tutorial/tutorial-login/tutorial-login.component.html b/src/app/tutorial/tutorial-login/tutorial-login.component.html new file mode 100644 index 0000000..8f7fe3d --- /dev/null +++ b/src/app/tutorial/tutorial-login/tutorial-login.component.html @@ -0,0 +1,52 @@ +<div class="modal" materialize="modal" [materializeActions]="modalActions"> + <div class="container"> + <h5> Ajuda</h5> + <h6> Quem somos</h6> + <ul class="collapsible"> + <li> + <div class="collapsible-header"> + <i class="material-icons blue-text">class</i> + O que é o IncluCare? + </div> + <div class="collapsible-body"> + <span> + 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 e automatizados. + </span> + </div> + </li> + </ul> + <h6> Perguntas frequentes</h6> + <ul class="collapsible" materialize="collapsible"> + <li> + <div class="collapsible-header"> + <i class="material-icons blue-text">account_circle</i> + Como me cadastrar? + </div> + <div class="collapsible-body"> + <span> + Para que seja efetuado o seu cadastro no sistema, + deve-se entrar em contato com a direção da sua escola para ser encaminhado à equipe gestora + do IncluCare de sua instituição de ensino. + </span> + </div> + </li> + <li> + <div class="collapsible-header"> + <i class="material-icons blue-text">account_circle</i> + Como eu faço meu primeiro login no sistema? + </div> + <div class="collapsible-body"> + <span> + Assim que você for cadastrado no sistema, será lhe dado uma senha por um administrador para + ser utilizado no seu primeiro login. Você pode anotar essa senha para uso, ou alterá-la mais + tarde no seu perfil de usuário. + </span> + </div> + </li> + </ul> + </div> +</div> diff --git a/src/app/tutorial/tutorial-login/tutorial-login.component.spec.ts b/src/app/tutorial/tutorial-login/tutorial-login.component.spec.ts new file mode 100644 index 0000000..ffe6ada --- /dev/null +++ b/src/app/tutorial/tutorial-login/tutorial-login.component.spec.ts @@ -0,0 +1,46 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { HttpModule } from '@angular/http'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { RouterTestingModule } from '@angular/router/testing'; + +import { Angular2TokenService } from 'angular2-token'; + +import { AuthService } from "../../shared/services/auth.service"; +import { TutorialLoginComponent } from './tutorial-login.component'; + +describe('TutorialLoginComponent', () => { + let component: TutorialLoginComponent; + let fixture: ComponentFixture<TutorialLoginComponent>; + + beforeEach(async( () => { + let tokenMock = jasmine.createSpyObj('tokenMock', ['validateToken', 'subscribe']); + tokenMock.validateToken.and.returnValue(tokenMock); + + TestBed.configureTestingModule({ + declarations: [ TutorialLoginComponent ], + schemas: [NO_ERRORS_SCHEMA], + imports: [ + HttpModule, + FormsModule, + ReactiveFormsModule, + RouterTestingModule + ], + providers: [ + AuthService, + { provide: Angular2TokenService, useValue: tokenMock} + ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TutorialLoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/tutorial/tutorial-login/tutorial-login.component.ts b/src/app/tutorial/tutorial-login/tutorial-login.component.ts new file mode 100644 index 0000000..d8df38f --- /dev/null +++ b/src/app/tutorial/tutorial-login/tutorial-login.component.ts @@ -0,0 +1,26 @@ +import { Component, OnInit, EventEmitter } from '@angular/core'; + +import { MaterializeAction } from "angular2-materialize"; + +@Component({ + selector: 'app-tutorial-login', + templateUrl: './tutorial-login.component.html', + styleUrls: ['./tutorial-login.component.css'] +}) + +export class TutorialLoginComponent implements OnInit { + + modalActions = new EventEmitter<string|MaterializeAction>(); + + constructor() {} + + ngOnInit() {} + + openDialog(){ + this.modalActions.emit({action:"modal", params:['open']}); + } + + closeDialog(){ + this.modalActions.emit({action:"modal", params:['close']}); + } +} 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..26f85c5 --- /dev/null +++ b/src/app/tutorial/tutorial.component.html @@ -0,0 +1,83 @@ +<div class="container"> + <div class="row"> + <div class="col s10 m6 l6"> + <h5 class="mt-2 mb-0">Tutorial IncluCare</h5> + </div> + </div> +</div> + +<div class="tutorial_text"> + <div class="container"> + <div class="row"> + <p align="justify"> + Para acessar, digite seu email e sua senha.<br> + <!--Tela de login--> + <br> + Essa é a página da relação de todos os estudantes cadastrados no sistema.<br> + <img class="pagina-login" src="assets/images/tutorial/tabelaAluno.jpeg" width="1000" height="600"><br> + <br><b>Para cadastrar um novo estudante basta clicar no botão “ADICIONAR ALUNO” no canto superior direito da página.</b><br><br> + + <br><b>Essa será a página aberta</b><br> + <img class="pagina-login" src="assets/images/tutorial/addStudent.jpeg" width="1000" height="600"><br><br> + + <b>Pronto! Aluno Cadastrado</b><br> + + <br>São possíveis quatro ações com o estudante. Que são elas:<br> + Registros diários, Encaminhamentos, ver o relatório, e gerar recomendações.<br><br> + Para qualquer dessas ações, basta clicar na seta azul ao lado do estudante desejado.<br> + + <img class="pagina-login" src="assets/images/tutorial/tabelaAluno.jpeg" width="1000" height="600"><br> + + <br>Essa será a janela aberta!<br> + <img class="pagina-login" src="assets/images/tutorial/painelAluno.jpeg" width="1000" height="600"><br> + <br><br> + + Para adicionar um registro diário basta clicar no botão “REGISTROS DIÁRIOS”<br> + <br> + <img class="pagina-login" src="assets/images/tutorial/painelAluno.jpeg" width="1000" height="600"><br><br> + A seguinte tela irá ser exibida<br> + <img class="pagina-login" src="assets/images/tutorial/AdicionarREgistroDiario.jpeg" width="1000" height="600"><br> + Clique em “NOVO REGISTRO” e preencha os campos, depois só clicar em “ENVIAR”<br> + <br><br> + + <img class="pagina-login" src="assets/images/tutorial/tabelaAluno.jpeg" width="1000" height="600"><br> + <br> + + Para ir para encaminhamento basta clicar em "ENCAMINHAMENTOS"<br><br> + + A seguinte janela irá ser exibida<br> + <img class="pagina-login" src="assets/images/tutorial/encaminhamentos.jpeg" width="1000" height="600"><br><br> + + Clique em "NOVO ENCAMINHAMENTO"<br><br> + + Então preencha os campos conforme a figura a baixo:<br> + <img class="pagina-login" src="assets/images/tutorial/adicionarEncaminhamento.jpeg" width="1000" height="600"><br><br> + + <img class="pagina-login" src="assets/images/tutorial/painelAluno.jpeg" width="1000" height="600"><br><br> + + Para gerar um relatório, basta clicar em “RELATÓRIO”<br><br> + + Com a tela seguinte, preencha os campos e em seguida clique em ‘ENVIAR”<br> + <img class="pagina-login" src="assets/images/tutorial/relatorioAluno.jpeg" width="1000" height="600"><br><br> + + Para gerar recomendações basta clicar em “RECOMENDAÇÕES”<br> + + <img class="pagina-login" src="assets/images/tutorial/painelAluno.jpeg" width="1000" height="600"><br><br> + + Com a tela seguinte, preencha os campos e em seguida clique em ‘ENVIAR”<br> + <img class="pagina-login" src="assets/images/tutorial/painelRecomendacao.jpeg" width="1000" height="600"><br><br> + + <h4><b>Alterar Perfil</b></h4> + <br><br> + Para alterar seus dados no sistema, basta você clicar no seu usário, localizado no menu lateral esquerdo<br> + <img class="pagina-login" src="assets/images/tutorial/tabelaAluno.jpeg" width="1000" height="600"><br><br> + + E em seguida clicar em “Visitar Perfil”<br><br> + + A seguinte tela irá ser exibida<br> + <img class="pagina-login" src="assets/images/tutorial/perfilAdmin.jpeg" width="1000" height="600"><br> + Agora só editar as informações que queira e salvar!<br> + + </div> + </div> +</div> 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<TutorialComponent>; + + 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() { + } + +} diff --git a/src/assets/images/tutorial/AdicionarREgistroDiario.jpeg b/src/assets/images/tutorial/AdicionarREgistroDiario.jpeg new file mode 100644 index 0000000..3029746 Binary files /dev/null and b/src/assets/images/tutorial/AdicionarREgistroDiario.jpeg differ diff --git a/src/assets/images/tutorial/addStudent.jpeg b/src/assets/images/tutorial/addStudent.jpeg new file mode 100644 index 0000000..429830c Binary files /dev/null and b/src/assets/images/tutorial/addStudent.jpeg differ diff --git a/src/assets/images/tutorial/adicionarEncaminhamento.jpeg b/src/assets/images/tutorial/adicionarEncaminhamento.jpeg new file mode 100644 index 0000000..c3571ce Binary files /dev/null and b/src/assets/images/tutorial/adicionarEncaminhamento.jpeg differ diff --git a/src/assets/images/tutorial/encaminhamentos.jpeg b/src/assets/images/tutorial/encaminhamentos.jpeg new file mode 100644 index 0000000..aa89811 Binary files /dev/null and b/src/assets/images/tutorial/encaminhamentos.jpeg differ diff --git a/src/assets/images/tutorial/painelAluno.jpeg b/src/assets/images/tutorial/painelAluno.jpeg new file mode 100644 index 0000000..33040d1 Binary files /dev/null and b/src/assets/images/tutorial/painelAluno.jpeg differ diff --git a/src/assets/images/tutorial/painelRecomendacao.jpeg b/src/assets/images/tutorial/painelRecomendacao.jpeg new file mode 100644 index 0000000..da65ad6 Binary files /dev/null and b/src/assets/images/tutorial/painelRecomendacao.jpeg differ diff --git a/src/assets/images/tutorial/perfilAdmin.jpeg b/src/assets/images/tutorial/perfilAdmin.jpeg new file mode 100644 index 0000000..a47bdc8 Binary files /dev/null and b/src/assets/images/tutorial/perfilAdmin.jpeg differ diff --git a/src/assets/images/tutorial/relatorioAluno.jpeg b/src/assets/images/tutorial/relatorioAluno.jpeg new file mode 100644 index 0000000..773a36f Binary files /dev/null and b/src/assets/images/tutorial/relatorioAluno.jpeg differ diff --git a/src/assets/images/tutorial/relatorioDiario.jpeg b/src/assets/images/tutorial/relatorioDiario.jpeg new file mode 100644 index 0000000..33af904 Binary files /dev/null and b/src/assets/images/tutorial/relatorioDiario.jpeg differ diff --git a/src/assets/images/tutorial/tabelaAluno.jpeg b/src/assets/images/tutorial/tabelaAluno.jpeg new file mode 100644 index 0000000..17c610f Binary files /dev/null and b/src/assets/images/tutorial/tabelaAluno.jpeg differ