Skip to content

Commit

Permalink
Merge pull request #47 from fga-gpp-mds/development
Browse files Browse the repository at this point in the history
Pull Request Sprint
  • Loading branch information
roginaldosemog authored Jun 20, 2018
2 parents 507165a + 893d121 commit bf7d94f
Show file tree
Hide file tree
Showing 69 changed files with 4,614 additions and 3,228 deletions.
4,876 changes: 2,719 additions & 2,157 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"jszip": "^2.6.1",
"jszip-utils": "0.0.2",
"materialize-css": "^0.100.2",
"ngx-order-pipe": "^2.0.1",
"rxjs": "^5.5.10",
"zone.js": "^0.8.26"
},
Expand All @@ -47,6 +48,8 @@
"@types/jspdf": "^1.1.31",
"@types/node": "^6.0.106",
"codelyzer": "^4.0.1",
"eslint": "^4.19.1",
"eslint-plugin-angular": "^3.3.0",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
Expand Down
3 changes: 1 addition & 2 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
<router-outlet></router-outlet>
</main>

<footer>
</footer>
<footer></footer>
4 changes: 3 additions & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';

import { MaterializeModule } from 'angular2-materialize';
import { Angular2TokenService } from 'angular2-token';
Expand All @@ -27,7 +28,8 @@ describe('AppComponent', () => {
RouterTestingModule,
MaterializeModule,
FormsModule,
ReactiveFormsModule
ReactiveFormsModule,
HttpModule
],
providers: [
AuthService,
Expand Down
18 changes: 10 additions & 8 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';

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';
Expand All @@ -14,24 +15,23 @@ import { AuthService } from "./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 './services/students.service';
import { StudentsComponent } from './students/students.component';
import { StudentFormComponent } from './students/student-form/student-form.component';
import { FilterClassPipe } from './students/shared/filter-class.pipe';
import { FilterPipe } from './shared/filter.pipe';
import { SidenavComponent } from './sidenav/sidenav.component';
import { NavbarComponent } from './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';
import { ReportComponent } from './students/report/report.component';
import { ReportFormComponent } from './students/report-form/report-form.component';
import { ReferralService } from './students/shared/referral.service';
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 { RecommendationService } from './students/shared/recommendation.service';
import { AdminPageComponent } from './profile/admin-page/admin-page.component';

@NgModule({
declarations: [
Expand All @@ -48,17 +48,20 @@ import { RecommendationService } from './students/shared/recommendati
DailyLogFormComponent,
ReportComponent,
ReportFormComponent,
FilterClassPipe,
FilterPipe,
ReferralComponent,
ReferralFormComponent,
ReferralPanelComponent,
DailyLogPanelComponent,
RecommendationPanelComponent,
AdminPageComponent

],
imports: [
HttpModule,
BrowserModule,
FormsModule,
OrderModule,
ReactiveFormsModule,
MaterializeModule,
routes
Expand All @@ -67,10 +70,9 @@ import { RecommendationService } from './students/shared/recommendati
LoginGuard,
AuthGuard,
AuthService,
FilterPipe,
Angular2TokenService,
StudentsService,
ReferralService,
RecommendationService
StudentsService
],
bootstrap: [ AppComponent ]
})
Expand Down
34 changes: 17 additions & 17 deletions src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ import { ReferralFormComponent } from './students/referral-form/referral-
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 = [
{ path: '' , redirectTo: 'students' , pathMatch: 'full' },
{ path: 'login' , component: LoginComponent , canActivate: [LoginGuard]},
{ path: 'profile' , component: ProfileComponent , canActivate: [AuthGuard] },
{ path: 'students' , component: StudentsComponent , pathMatch: 'full' , canActivate: [AuthGuard] },
{ path: 'students/new' , component: StudentFormComponent , canActivate: [AuthGuard] },
{ path: 'students/:id' , component: StudentFormComponent , canActivate: [AuthGuard] },
{ path: 'students/:id/edit' , component: StudentFormComponent , canActivate: [AuthGuard] },
{ path: 'studentpanel/:id' , component: StudentPanelComponent, canActivate: [AuthGuard] },
{ path: 'dailylog/:id' , component: DailyLogFormComponent, canActivate: [AuthGuard] },
{ path: 'dailylogs' , component: DailyLogComponent , canActivate: [AuthGuard] },
{ path: 'report/:id' , component: ReportFormComponent , canActivate: [AuthGuard] },
{ path: 'reports' , component: ReportComponent , canActivate: [AuthGuard] },
{ path: 'referrals' , component: ReferralComponent , canActivate: [AuthGuard] },
{ path: 'referral/:id' , component: ReferralFormComponent, canActivate: [AuthGuard] },
{ path: 'referralpanel/:id' , component: ReferralPanelComponent, canActivate: [AuthGuard] },
{ path: 'dailylogpanel/:id' , component: DailyLogPanelComponent, canActivate: [AuthGuard] },
{ path: 'recommendation/:id', component: RecommendationPanelComponent, canActivate: [AuthGuard] }
{ path: '' , redirectTo: 'students' , pathMatch: 'full' },
{ path: 'login' , component: LoginComponent , canActivate: [LoginGuard]},
{ path: 'profile' , component: ProfileComponent , canActivate: [AuthGuard] },
{ path: 'students' , component: StudentsComponent , pathMatch: 'full' , canActivate: [AuthGuard] },
{ path: 'students/new' , component: StudentFormComponent , canActivate: [AuthGuard] },
{ path: 'studentpanel/:id' , component: StudentPanelComponent , canActivate: [AuthGuard] },
{ path: 'dailylogs/:id' , component: DailyLogComponent , canActivate: [AuthGuard] },
{ path: 'dailylog/:id' , component: DailyLogFormComponent , canActivate: [AuthGuard] },
{ path: 'dailylogpanel/:id' , component: DailyLogPanelComponent , canActivate: [AuthGuard] },
{ path: 'referrals/:id' , component: ReferralComponent , canActivate: [AuthGuard] },
{ path: 'referral/:id' , component: ReferralFormComponent , canActivate: [AuthGuard] },
{ 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] }
];

export const routes: ModuleWithProviders = RouterModule.forRoot(APP_ROUTES);
6 changes: 2 additions & 4 deletions src/app/guards/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import { AuthService } from "../services/auth.service";

@Injectable()
export class AuthGuard implements CanActivate {

constructor(
private authService: AuthService,
private router: Router
private router: Router,
private authService: AuthService
){}

canActivate() {
Expand All @@ -19,5 +18,4 @@ export class AuthGuard implements CanActivate {
return false;
}
}

}
10 changes: 4 additions & 6 deletions src/app/guards/login.guard.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Injectable } from '@angular/core';
import { CanActivate, Router } from "@angular/router";
import { Injectable } from '@angular/core';
import { CanActivate, Router } from "@angular/router";

import { AuthService } from "../services/auth.service";

@Injectable()
export class LoginGuard implements CanActivate {

constructor(
private authService: AuthService,
private router: Router
private router: Router,
private authService: AuthService
){}

canActivate() {
Expand All @@ -19,5 +18,4 @@ export class LoginGuard implements CanActivate {
return true;
}
}

}
51 changes: 1 addition & 50 deletions src/app/login/login.component.css
Original file line number Diff line number Diff line change
@@ -1,48 +1,3 @@
.outer {
display: table;
position: absolute;
height: 100%;
width: 100%;
left: 0px;
}

.middle {
background-image: url("https://www.secureaplus.com/wp-content/uploads/2016/04/SecureAPlus-For-Education-Background.png");
/*background: linear-gradient(#0099BB, #006699);*/
display: table-cell;
vertical-align: middle;
}

.inner {
position: relative;
min-height: 338px;
width: calc(100% - 40px);
min-width: 320px;
max-width: 440px;
margin-left: auto;
margin-right: auto;
margin-bottom: 28px;
padding: 28px;

}

.logo {
max-width: 256px;
height: 24px;
}

.text-title {
color: #404040;
font-size: 1.6rem;
font-weight: 500;
margin-top: 20px;
margin-bottom: 12px;
}

.top-margin {
margin-top: 40px;
}

img {
vertical-align: middle;
}
Expand All @@ -56,7 +11,7 @@ img {
}

.login-middle {
background-image: url("https://www.secureaplus.com/wp-content/uploads/2016/04/SecureAPlus-For-Education-Background.png");
background-image: url('../../assets/images/login-background.png');
display: table-cell;
vertical-align: middle;
}
Expand Down Expand Up @@ -90,7 +45,3 @@ img {
margin-top: 40px;
margin-bottom: 0px;
}

img {
vertical-align: middle;
}
2 changes: 1 addition & 1 deletion src/app/login/login.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="login-outer">
<div class="login-middle">
<div class="login-inner z-depth-4 card-panel">
<!-- <img class="login-logo" src="https://i.imgur.com/Yp3w68r.png"></img> -->
<img class="login-logo" src="assets/images/inclucare-icontext.png">
<h5 class="login-title">Entrar</h5>
<form [formGroup]="form" (ngSubmit)="signInUser()">
<div class="row mb-0">
Expand Down
10 changes: 5 additions & 5 deletions src/app/login/login.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { HttpModule } from '@angular/http';
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 { Angular2TokenService } from 'angular2-token';

import { AuthService } from "../services/auth.service";
import { LoginComponent } from './login.component';
import { AuthService } from "../services/auth.service";
import { LoginComponent } from './login.component';

describe('LoginComponent', () => {
let component: LoginComponent;
Expand Down
20 changes: 9 additions & 11 deletions src/app/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router";
import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";
import { Component, OnInit } from '@angular/core';
import { Router } from "@angular/router";
import { FormBuilder, FormControl, FormGroup, Validators } from "@angular/forms";

import { RegisterData } from "angular2-token";
import { MaterializeAction } from "angular2-materialize";
import { MaterializeAction } from "angular2-materialize";
import { RegisterData } from "angular2-token";

import { AuthService } from "../services/auth.service";
import { FormUtils } from "../shared/form.utils";
import { AuthService } from "../services/auth.service";
import { FormUtils } from "../shared/form.utils";

@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {

form: FormGroup;
formUtils: FormUtils;
public submitted: boolean;
public formErrors: Array<string>;

constructor(
private authService: AuthService,
private router: Router,
private formBuilder: FormBuilder,
private router: Router
private authService: AuthService
) {
this.setupForm();
this.formUtils = new FormUtils(this.form);
Expand All @@ -47,7 +46,6 @@ export class LoginComponent implements OnInit {
console.log('err:', err);
}
);

}

private setupForm(){
Expand Down
4 changes: 3 additions & 1 deletion src/app/navbar/navbar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';

import { MaterializeModule } from 'angular2-materialize';
import { Angular2TokenService } from 'angular2-token';
Expand All @@ -24,7 +25,8 @@ describe('NavbarComponent', () => {
RouterTestingModule,
MaterializeModule,
FormsModule,
ReactiveFormsModule
ReactiveFormsModule,
HttpModule
],
providers: [
AuthService,
Expand Down
3 changes: 3 additions & 0 deletions src/app/profile/admin-page/admin-page.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h4 {
color: red;
}
29 changes: 29 additions & 0 deletions src/app/profile/admin-page/admin-page.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<div *ngIf="authTokenService.currentUserData">
<div *ngIf="authTokenService.currentUserData.nickname == 'admin'; else elseBlock ">
<h3>Painel de Membros</h3>
<table class="striped">
<thead>
<tr>
<th data-field="name">Nome</th>
<th data-field="email">Email</th>
<tr>
</thead>

<tr *ngFor="let teamMember of getTeamMembers()">
<td>{{ teamMember.name }}</td>
<td>{{ teamMember.email }}</td>
<td>
<a (click)="deleteTeamMember(teamMember)" class="btn waves-effect waves-light gradient-inclucare" type="button" name="action">Excluir Membro da Equipe
<i class="material-icons right">delete</i>
</a>
</td>
</tr>
</table>
</div>

<ng-template #elseBlock>
<h4>Você não possui perfil de administrador! <br/>
Por favor,entre em contato com administrador da sua equipe.</h4>
</ng-template>

</div>
Loading

0 comments on commit bf7d94f

Please sign in to comment.