Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
Front end enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelAPB committed Feb 8, 2018
1 parent b6d26f5 commit 10eaa6d
Show file tree
Hide file tree
Showing 23 changed files with 42 additions and 80 deletions.
4 changes: 2 additions & 2 deletions angular-src/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { TermsUsageComponent } from './general/terms-usage/terms-usage.component
import { FaqComponent } from './general/faq/faq.component';
import { GceHashCodeComponent } from './general/gce-hash-code/gce-hash-code.component';
import { GceHashCodeNextComponent } from './general/gce-hash-code-next/gce-hash-code-next.component';
import { secrets } from '../../.env';
import { Vars } from '../../.env';
import { UploadCvComponent } from './general/upload-cv/upload-cv.component';
import { FbComponent } from './general/fb/fb.component';
import { GceHashCodeProgramComponent } from './general/gce-hash-code-program/gce-hash-code-program.component';
Expand Down Expand Up @@ -145,7 +145,7 @@ const appRoutes: Routes = [
BsDropdownModule.forRoot(),
TabsModule.forRoot(),
AgmCoreModule.forRoot({
apiKey: secrets.GOOGLE_MAPS,
apiKey: Vars.GOOGLE_MAPS,
}),
FlashMessagesModule,
],
Expand Down
1 change: 0 additions & 1 deletion angular-src/src/app/general/faq/faq.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { AccordionModule } from 'ngx-bootstrap/accordion';

@Component({
selector: 'app-faq',
Expand Down
1 change: 1 addition & 0 deletions angular-src/src/app/general/footer/footer.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
import {ActivatedRoute} from '@angular/router';

@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {FlashMessagesService} from 'angular2-flash-messages';
import {Router} from '@angular/router';
import {StudentService} from "../../services/student.service";
import { Subscription } from 'rxjs/Subscription';
import {window} from "rxjs/operator/window";
import { AuthService} from "../../services/auth.service";

@Component({
Expand Down
11 changes: 7 additions & 4 deletions angular-src/src/app/general/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ <h1>Grupo De Contacto Com Empresas</h1>
</button>

<button type="button" [routerLink]="['/hashcode']" class="btn btn-primary bigFont" aria-label="Left Align">
<i class="fa fa-google"> Hash Code</i>
<i class="fa fa-google"> Waiting List</i>
</button>

<button type="button" [routerLink]="['/faq']" class="btn btn-success bigFont" aria-label="Left Align">
<i class="fa fa-google"> FAQ</i>
</button>

</div>
<p>1.2.2-Beta</p><br><br>
<p>1.2.3-Beta</p><br><br>
</div>

</div>
Expand Down Expand Up @@ -63,7 +63,7 @@ <h3><a>Estágios Remunerados</a></h3>
<div class="service-grid wow bounceIn" data-wow-delay="0.4s">
<i class="fa fa-lightbulb-o serviço3" aria-hidden="true"></i>
<h3><a>Serviços de inovação</a></h3>
<p>Fica atento! Podes querer participar.</p>
<p>Brevemente.</p>
</div>
</div>
<div class="clearfix"> </div>
Expand All @@ -75,6 +75,10 @@ <h3><a>Serviços de inovação</a></h3>
<!--- services --->
<div class="clearfix"> </div>


<app-info></app-info>


<!--- portfolio ---->
<div id="missao" class="portfolio">
<div class="portfolio-top">
Expand Down Expand Up @@ -193,7 +197,6 @@ <h4>Recolha de dados</h4>
</div>
<!--- Other Expertise ---->

<app-info></app-info>

<!--- portfolio ---->
<!---- about ---->
Expand Down
12 changes: 6 additions & 6 deletions angular-src/src/app/general/login/login.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { AuthService } from "../../services/auth.service";
import { Router, ActivatedRoute, Params} from "@angular/router";
import { Router, ActivatedRoute} from "@angular/router";
import { FlashMessagesService} from "angular2-flash-messages";
import { ValidateService} from "../../services/validate.service";
import { secrets } from '../../../../.env';
import { Vars } from '../../../../.env';
import { Subscription } from 'rxjs/Subscription';
import { ChangeDetectorRef} from '@angular/core';
import { OnDestroy } from '@angular/core';
Expand All @@ -21,15 +21,15 @@ export class LoginComponent implements OnInit, OnDestroy {
caller:string;
private subscriptions: Array<Subscription> = [];

constructor(private authService: AuthService, private router: Router,private activatedRoute: ActivatedRoute,
constructor(private authService: AuthService, private router: Router,
private flashMessage: FlashMessagesService, private validateService: ValidateService,
private cd: ChangeDetectorRef
) {


const clientId = secrets.FENIX_CLIENT_ID;
const redirectUri = secrets.REDIRECT_URL;
const redirectUriProf = secrets.REDIRECT_URL_PROF;
const clientId = Vars.FENIX_CLIENT_ID;
const redirectUri = Vars.REDIRECT_URL;
const redirectUriProf = Vars.REDIRECT_URL_PROF;

this.studentPath = 'https://fenix.tecnico.ulisboa.pt/oauth/userdialog?' +
'client_id=' + clientId + '&redirect_uri=' + redirectUri;
Expand Down
5 changes: 1 addition & 4 deletions angular-src/src/app/general/navbar/navbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ export class NavbarComponent implements OnInit {
type: string;
link: string;
LogoPath: string;
LogoWidth: string;
LogoHeight: string;
name: string = "Perfil";

constructor(private authService: AuthService, private router: Router,
private flashMessage: FlashMessagesService
constructor(private authService: AuthService, private router: Router
) {
this.LogoPath = "/assets/img/gce.png";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3>1.1. RECOLHA E TRATAMENTO DE DADOS DO UTILIZADOR</h3>
determinados Serviços da Plataforma. Se o GCE necessitar de dados adicionais, solicitará uma nova autorização aos Utilizadores.
<br>
O GCE também recolhe e trata informação sobre as páginas visitadas pelo Utilizador dentro da Plataforma.
Esta informação pode incluir: o seu tipo de browser, o nome de domínio, os tempos de acesso e determinadas ações dentro da Plataforma.
Esta informação pode incluir: o seu IP, o seu tipo de browser, o nome de domínio, os tempos de acesso e determinadas ações dentro da Plataforma.
Utilizamos esta informação para fins estatísticos e para melhorar a qualidade de visita à nossa Plataforma.
O GCE é o unico responsável pela recolha e tratamento de Dados dos Utilizadores.
<br><br>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { NgModule } from '@angular/core';
import {AuthService} from '../../services/auth.service';
import {CompanyService} from '../../services/company.service';

@NgModule({
Expand All @@ -17,8 +16,7 @@ export class ShowAllCompaniesComponent implements OnInit {

companies: object[];

constructor(private authService: AuthService,
private companyService: CompanyService) { }
constructor(private companyService: CompanyService) { }

ngOnInit() {
this.getAllCompanies();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component, OnInit,TemplateRef } from '@angular/core';
import { NgModule } from '@angular/core';
import {AuthService} from '../../services/auth.service';
import {CompanyService} from '../../services/company.service';
import { FlashMessagesService } from 'angular2-flash-messages';
import { BsModalService } from 'ngx-bootstrap/modal';
Expand All @@ -25,8 +24,7 @@ export class ShowAllProposalsComponent implements OnInit {
modalRef: any;
currentProposal: object;
index: number;
constructor(private authService: AuthService,
private companyService: CompanyService,
constructor(private companyService: CompanyService,
private flashMessage: FlashMessagesService,
private modalService: BsModalService) { }

Expand Down
4 changes: 1 addition & 3 deletions angular-src/src/app/services/auth-guard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import { Injectable } from '@angular/core';
import {Router} from '@angular/router';
import {CanActivate} from '@angular/router';
import { AuthService} from './auth.service';
import {FlashMessagesService} from "angular2-flash-messages";

@Injectable()
export class AuthGuardService implements CanActivate{

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

//Checks loggin using token not expired
canActivate() {
Expand Down
1 change: 0 additions & 1 deletion angular-src/src/app/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { tokenNotExpired } from 'angular2-jwt';
export class AuthService {
authToken: any;
user: any;
userType: String;

constructor(private http:Http) { }

Expand Down
4 changes: 3 additions & 1 deletion angular-src/src/app/services/company.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Http, Headers} from "@angular/http";
import { environment } from './../../environments/environment';
import {AuthService} from './auth.service';
import 'rxjs/add/operator/map';

Expand Down Expand Up @@ -60,4 +59,7 @@ export class CompanyService {
return this.http.put('company/addProposal', proposal, {headers: headers}).map(res => res.json());
}

loadCompanyProfile() {
return this.authService.loadUserProfile();
}
}
1 change: 0 additions & 1 deletion angular-src/src/app/services/matchmaking.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Http, Headers} from "@angular/http";
import { environment } from './../../environments/environment';
import {AuthService} from './auth.service';
import 'rxjs/add/operator/map';

Expand Down
5 changes: 4 additions & 1 deletion angular-src/src/app/services/student.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { Http, Headers} from '@angular/http';
import { environment } from './../../environments/environment';
import { AuthService} from './auth.service';
import 'rxjs/add/operator/map'

Expand Down Expand Up @@ -60,4 +59,8 @@ export class StudentService {

}

loadStudentProfile() {
return this.authService.loadUserProfile();
}

}
14 changes: 3 additions & 11 deletions angular-src/src/app/services/validate.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export class ValidateService {
constructor() { }

validateFeedback(feedback) {
if (feedback.name == null || feedback.email == null
|| feedback.rate == null || feedback.entity == null || feedback.type == null
|| feedback.message == null) {
if (feedback.email == null
|| feedback.rate == null
) {
return false;
} else {
return true;
Expand Down Expand Up @@ -73,14 +73,6 @@ export class ValidateService {
}
}

/*
validateEmail(email) {
// RFC 2822
const re = [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?
return re.test(email);
}
*/

validateLogin(item) {
return item;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core';
import {ValidateService} from '../../services/validate.service';
import {FlashMessagesService} from 'angular2-flash-messages';
import {AuthService} from '../../services/auth.service';
import {Router} from '@angular/router';
import {CompanyService} from '../../services/company.service';
import { BsDatepickerConfig } from 'ngx-bootstrap/datepicker';
Expand Down Expand Up @@ -38,13 +37,12 @@ export class CompanyAddProposalComponent implements OnInit {

constructor(private validateService: ValidateService,
private flashMessage: FlashMessagesService,
private authService: AuthService,
private companyService: CompanyService,
private router: Router
) {}

ngOnInit() {
this.company = this.authService.loadUserProfile();
this.company = this.companyService.loadCompanyProfile();
this.bsConfig = Object.assign({}, {containerClass: "theme-dark-blue",
locale: this.locale});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../services/auth.service';
import { ValidateService } from '../../services/validate.service';
import { FlashMessagesService } from 'angular2-flash-messages';
import { Router } from '@angular/router';
import {InfoComponent} from '../../general/info/info.component';
import {CompanyService} from '../../services/company.service';
import {InfoComponent} from '../../general/info/info.component';
import { NgModule } from '@angular/core';

@NgModule({
Expand All @@ -23,15 +19,11 @@ export class DashboardCompanyComponent implements OnInit {
[key: string]: any;


constructor(private validateService: ValidateService,
private flashMessage: FlashMessagesService,
private authService: AuthService,
private router: Router,
private companyService: CompanyService) {
constructor(private companyService: CompanyService) {
}

ngOnInit() {
this.company = this.authService.loadUserProfile();
this.company = this.companyService.loadCompanyProfile();
const companyName = this.company.name;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {Component, OnInit, TemplateRef} from '@angular/core';
import {FlashMessagesService} from 'angular2-flash-messages';
import {ValidateService} from '../../services/validate.service';
import {AuthService} from '../../services/auth.service';
import {Router} from '@angular/router';
import {CompanyService} from '../../services/company.service';
import {BsModalService} from "ngx-bootstrap/modal";

Expand All @@ -21,8 +19,6 @@ export class CompanyMyProposalsComponent implements OnInit {

constructor(private validateService: ValidateService,
private flashMessage: FlashMessagesService,
private authService: AuthService,
private router: Router,
private companyService: CompanyService,
private modalService: BsModalService) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../services/auth.service';
import { Router } from '@angular/router';
import { FlashMessagesService } from 'angular2-flash-messages';
import { StudentService } from '../../services/student.service';
import {CompanyService} from '../../services/company.service';

@Component({
selector: 'app-company-profile',
Expand All @@ -12,8 +9,7 @@ import { StudentService } from '../../services/student.service';
export class CompanyProfileComponent implements OnInit { user: object;
company: object;

constructor(private authService: AuthService, private router: Router,
private flashMessage: FlashMessagesService
constructor(private companyService: CompanyService
) {

}
Expand All @@ -25,7 +21,7 @@ export class CompanyProfileComponent implements OnInit { user: object;
}

loadUser() {
this.company = this.authService.loadUserProfile();
this.company = this.companyService.loadCompanyProfile();

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Component, OnInit } from '@angular/core';

import {AuthService} from '../../services/auth.service';
import {CompanyService} from '../../services/company.service';

@Component({
Expand All @@ -13,10 +11,10 @@ export class CompanyProposalsComponent implements OnInit {
company: any;
proposals: object[];

constructor(private authService: AuthService, private companyService: CompanyService) { }
constructor(private companyService: CompanyService) { }

ngOnInit() {
this.company = this.authService.loadUserProfile();
this.company = this.companyService.loadCompanyProfile();

this.companyService.getAllCompanyAllProposals().subscribe( proposals => { this.proposals = proposals.response_data; });
}
Expand Down
Loading

0 comments on commit 10eaa6d

Please sign in to comment.