From b749731571a3c8eb67e48106739a13928e36e586 Mon Sep 17 00:00:00 2001 From: Kayaya Date: Fri, 7 Aug 2020 10:31:33 +0100 Subject: [PATCH] Updated feed page --- src/app/pages/feed/feed.page.html | 180 +++++++++++++++++++++++++++- src/app/pages/feed/feed.page.scss | 91 ++++++++++++++ src/app/pages/feed/feed.page.ts | 4 + src/app/pages/login/login.page.html | 2 +- src/app/pages/login/login.page.ts | 37 ++++-- src/app/services/auth.service.ts | 4 +- src/app/services/http.service.ts | 41 +++++-- 7 files changed, 338 insertions(+), 21 deletions(-) diff --git a/src/app/pages/feed/feed.page.html b/src/app/pages/feed/feed.page.html index 9c16bcab6..ee8bebf43 100644 --- a/src/app/pages/feed/feed.page.html +++ b/src/app/pages/feed/feed.page.html @@ -1,9 +1,183 @@ - + + + - feed + + + + Combinada + + + Oficial + + + Pessoal + + + + + + + + Combinada + + + Oficial + + + Pessoal + + - + +
+ + + + 8:00 am + + + +
+
+
+ +
+
+

Reunião de Conselho de Ministros

+

08:30 - 10:30

+
+
+
+
+ +
+
+

Luanda, Palácio presidencial

+
+
+ +
+
+
+
+ + 9:00 am + + +
+
+
+ +
+
+

Conference call Particular

+

11:00 - 12:30

+
+
+
+
+ +
+
+

Luanda, Palácio presidencial

+
+
+ +
+
+
+
+
+
+
+ + + + + + 8:00 am + + +
+
+
+ +
+
+

Reunião de Conselho de Ministros

+

08:30 - 10:30

+
+
+
+
+ +
+
+

Luanda, Palácio presidencial

+
+
+ +
+
+
+
+ +
+
+
+ + + + + 9:00 am + + +
+
+
+ +
+
+

Conference call Particular

+

11:00 - 12:30

+
+
+
+
+ +
+
+

Luanda, Palácio presidencial

+
+
+ +
+
+
+
+
+
+
+
diff --git a/src/app/pages/feed/feed.page.scss b/src/app/pages/feed/feed.page.scss index e69de29bb..11a065f49 100644 --- a/src/app/pages/feed/feed.page.scss +++ b/src/app/pages/feed/feed.page.scss @@ -0,0 +1,91 @@ +/* CONTENT */ +.item-list-small{ + font-size: 11px; + overflow: auto; + } + .ion-item-class{ + padding: 0; + + } + .label-text{ + width: 100%; + padding: 0; + margin: 0; + } + + //DIV + .div-item{ + width: 100%; + overflow: auto; + border-bottom: 1px solid #ccc; + margin: 10px 0 5px 0; + } + .div-up{ + width: 100%; + overflow: auto; + } + .div-up h3{ + margin: 0; + padding: 0; + font-size: 15px; + width: 100%; + } + .div-icon{ + width: 10%; + font-size: 20px; + float: left; + color: #808080; + } + .div-icon ion-icon{ + display: block; + margin: 0 auto; + + } + .div-content{ + width: 85%; + float: left; + border-left: 2px solid orange; + padding: 0 0 0 5px; + } + .div-content p{ + font-size: 10.5pt; + color: rgb(94, 92, 92); + padding: 0; + margin: 0; + } + .div-botton{ + width: 100%; + overflow: auto; + margin: 5px 0 5px 0; + } + .div-botton-left{ + width: 10%; + float: left; + } + .ion-icon-location{ + text-align: center; + display: block; + color: #000; + font-size: 14px; + margin: 0 auto; + } + .div-botton-middle{ + width: 75%; + float: left; + margin-top: 0.5px; + } + .div-botton-middle p{ + padding: 0; + margin: 0; + } + .div-botton-right{ + width: 10%; + float: left; + margin: 0; + padding: 0; + } + .ion-icon-attach{ + color: #666666; + font-size: 18px; + } + \ No newline at end of file diff --git a/src/app/pages/feed/feed.page.ts b/src/app/pages/feed/feed.page.ts index 4bdc991ea..0367636f8 100644 --- a/src/app/pages/feed/feed.page.ts +++ b/src/app/pages/feed/feed.page.ts @@ -7,9 +7,13 @@ import { Component, OnInit } from '@angular/core'; }) export class FeedPage implements OnInit { + segment:string; + constructor() { } ngOnInit() { + //Inicializar segment + this.segment = "combinada"; } } diff --git a/src/app/pages/login/login.page.html b/src/app/pages/login/login.page.html index 27b4ecb68..229ca251e 100644 --- a/src/app/pages/login/login.page.html +++ b/src/app/pages/login/login.page.html @@ -17,7 +17,7 @@ - Entrar + Entrar Criar conta diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 3e8be0e13..f6f384a07 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -36,25 +36,34 @@ export class LoginPage implements OnInit { ); } - loginAction(){ - //Go to our home in home/feed. - /* this.router.navigate(['/home/feed']); */ - /* console.log(this.postData); */ + loginRequest(){ + /* axios.get('https://gpr-dev-08.gabinetedigital.local/api/v2.0/me/calendarview?startDateTime=2014-10-01T01:00:00&endDateTime=2020-10-31T23:00:00') + .then(response => { + console.log(response.data.url); + console.log(response.data.explanation); + }) + .catch(error => { + console.log(error); + }); */ + + } + + loginAction(){/* if(this.validateInput()){ //Try to login this.authService.login(this.postData).subscribe((res: any)=> { - /* userData must be in the API results as paratemers otherwise change to the param that is in the API */ + //userData must be in the API results as paratemers otherwise change to the param that is in the API if(res.userData){ - /* Then we store this information at the staorage service */ + //Then we store this information at the staorage service this.storageService.store(AuthConnstants.AUTH, res.userData); - /* Then go to home view */ + //Then go to home view this.router.navigate(['home']); } else{ console.log("Os dados inseridos são inválidos"); } }, - /* Write a connection error */ + ///Write a connection error (error: any)=>{ console.log("Erro de conexão com a API."); } @@ -63,7 +72,19 @@ export class LoginPage implements OnInit { else{ //Display an error message console.log("Preencha todos campos"); + }*/ + } + + simpleLogin(){ + //Go to our home in home/feed. + if(this.validateInput()){ + this.router.navigate(['/home/feed']); + console.log(this.postData); } + else{ + console.log("Preencha todos campos"); + } + } } diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 4c7a03a48..d421c24e9 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -16,7 +16,7 @@ export class AuthService { private router: Router ) { } - login(postData: any): Observable { + /* login(postData: any): Observable { return this.httpService.post('login', postData); } @@ -29,5 +29,5 @@ export class AuthService { this.router.navigate(['']) }) - } + } */ } diff --git a/src/app/services/http.service.ts b/src/app/services/http.service.ts index c3f9cd3a7..b76b0188b 100644 --- a/src/app/services/http.service.ts +++ b/src/app/services/http.service.ts @@ -1,18 +1,45 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { environment } from '../../environments/environment'; +import { reject } from 'q'; @Injectable({ providedIn: 'root' }) export class HttpService { -constructor(private http: HttpClient) {} + constructor(private http: HttpClient) {} -post(serviceName: string, data: any) { -const headers = new HttpHeaders(); -const options = { headers: headers, withCredintials: false }; -const url = environment.apiURL + serviceName; + /* post(serviceName: string, data: any) { + const headers = new HttpHeaders(); + const options = { headers: headers, withCredintials: false }; + const url = environment.apiURL + serviceName; + + return this.http.post(url, JSON.stringify(data), options); + } */ + + private API_URL = 'https://gpr-dev-08.gabinetedigital.local/api/v2.0/me/calendarview'; + + /* loginRequest(username:string, password: string, domain: string){ + return new Promise((resolve, reject) => { + var data = { + emusernameail: username, + password: password, + domain: domain + }; + this.http.post(this.API_URL, data) + .subscribe(result: any)=> { + resolve(result.json()); + }, + (error)=>{ + reject(error.json()); + } + + }) + } */ + /* request(API_URL, { json: true },{username:"tiago.kayaya"}, {password:"tabteste@006"}, {domain:"gabinetedigital.local"} ,(err, res, body) => { + if (err) { return console.log(err); } + console.log(body.url); + console.log(body.explanation); + }); */ -return this.http.post(url, JSON.stringify(data), options); -} } \ No newline at end of file