diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 441a1156c..ed7241472 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -21,6 +21,14 @@ const routes: Routes = [ path: 'header', loadChildren: () => import('./shared/header/header.module').then( m => m.HeaderPageModule) }, + { + path: 'header', + loadChildren: () => import('./shared/header/header.module').then( m => m.HeaderPageModule) + }, + { + path: 'header-pr', + loadChildren: () => import('./shared/header-pr/header-pr.module').then( m => m.HeaderPrPageModule) + }, /* { diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts index e8d6ba005..ec29eb7f3 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/home/home-routing.module.ts @@ -112,24 +112,6 @@ const routes: Routes = [ } ] }, - /* { - path: 'expediente', - children: [ - { - path:'', - loadChildren: ()=> import('../pages/gabinete-digital/expediente/expediente.module').then(m => m.ExpedientePageModule) - } - ] - }, */ - { - path: 'chat', - children: [ - { - path:'', - loadChildren: ()=> import('../pages/chat/chat.module').then(m => m.ChatPageModule) - } - ] - }, { path: 'publications', children: [ @@ -158,6 +140,15 @@ const routes: Routes = [ }, ] }, + { + path: 'chat', + children: [ + { + path:'', + loadChildren: ()=> import('../pages/chat/chat.module').then(m => m.ChatPageModule) + } + ] + }, ] }, { diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index b24215954..dc266711b 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -27,7 +27,7 @@ Pesquisa --> diff --git a/src/app/pages/chat/chat.module.ts b/src/app/pages/chat/chat.module.ts index b15c82b94..d4f756504 100644 --- a/src/app/pages/chat/chat.module.ts +++ b/src/app/pages/chat/chat.module.ts @@ -1,4 +1,4 @@ -import { NgModule } from '@angular/core'; +import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; @@ -7,14 +7,17 @@ import { IonicModule } from '@ionic/angular'; import { ChatPageRoutingModule } from './chat-routing.module'; import { ChatPage } from './chat.page'; +import { SharedModule } from 'src/app/shared/shared.module'; @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, - ChatPageRoutingModule + SharedModule, + ChatPageRoutingModule, ], - declarations: [ChatPage] + declarations: [ChatPage], + schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class ChatPageModule {} diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index c5228c5ae..c50efbfab 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -1,12 +1,24 @@ - - Chat - - + + + + +
+
+
+ Chat +
+
+ + +
+
+
+
@@ -17,8 +29,11 @@ + + +
- + @@ -46,6 +61,6 @@
- +
diff --git a/src/app/pages/chat/chat.page.scss b/src/app/pages/chat/chat.page.scss index e91f81b0e..25fc37b11 100644 --- a/src/app/pages/chat/chat.page.scss +++ b/src/app/pages/chat/chat.page.scss @@ -20,4 +20,51 @@ width: 40px; height: 40px; object-fit: contain; +} +.main-header{ + width: 100%; /* 400px */ + height: 100%; + font-family: Roboto; + border-top-left-radius: 25px; + border-top-right-radius: 25px; + background-color: #fff; + overflow:hidden; + padding: 30px 20px 0px 20px; + color:#000; + transform: translate3d(0, 1px, 0); + + .title-content{ + width: 360px; + margin: 0px auto; + overflow: auto; + padding: 0 !important; + background: #fff; + } + .div-title{ + padding: 0!important; + float: left; + } + .title{ + font-size: 25px; + } + .div-icon{ + width: 112px; + float: right; + font-size: 35px; + overflow: auto; + padding: 1px; + } + .div-icon ion-icon{ + float: right; + padding-left: 20px; + } +} +.main-content{ + width: 100%; /* 400px */ + height: 100%; + font-family: Roboto; + margin: 0 auto; + background-color: #fff; + overflow:auto; + padding: 15px 20px 0 20px; } \ No newline at end of file diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 655cd54ae..2b3ecc684 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -10,6 +10,7 @@ import { ConversationPage } from './conversation/conversation.page'; styleUrls: ['./chat.page.scss'], }) export class ChatPage implements OnInit { + showLoader: boolean; loggedUser: any; /* Set segment variable */ segment:string; @@ -24,28 +25,33 @@ export class ChatPage implements OnInit { ngOnInit() { this.segment = "Contactos"; - this.authService.userData$.subscribe((res:any)=>{ - this.loggedUser=res; - }); + this.doRefresh(); + + } + onSegmentChange(){ + this.doRefresh(); + } + doRefresh(){ this.getGroups(); this.getConnectedUsers(); } - onSegmentChange(){ - this.RefreshEvents(); - } - RefreshEvents(){} getGroups(){ + this.showLoader = true; this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{ this.groupList = res.groups; - /* console.log(this.groupList); */ + this.showLoader = false; }); } + getConnectedUsers(){ + this.showLoader = true; this.result = this.chatService.getAllConnectedUsers().subscribe((res:any)=>{ this.userConnectedList = res.users; console.log(this.userConnectedList); + this.showLoader = false; }); } + async starConversation(selectedUser) { const modal = await this.modalController.create({ component: ConversationPage, diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 3b48a2633..a2cd3d0af 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -55,28 +55,15 @@ export class LoginPage implements OnInit { await alert.present(); } - loginAction(){ - - if(this.validateInput()){ - /* this.authService.loginChat2(this.postData).subscribe((res: any) =>{ - if(res.data){ - this.storageService.store(AuthConnstants.AUTH, res.data); - console.log('Log RockectChat OK'); - //console.log(res.data); - - } - else{ - console.log("Invalid username or password!"); - } - }, - (error:any) =>{ - console.log('Network error'); - }) */ - } - else{ - this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.'); - } + loginRocketChat(){ + this.authService.loginChat(this.postData).subscribe((res: any) =>{ + console.log('Login to Rocket chat OK'); + },(error:any) =>{ + console.log('Network error'); + }); } + + async Login(){ try { @@ -90,7 +77,7 @@ export class LoginPage implements OnInit { BasicAuthKey: "" } if (await this.authService.login(this.userattempt)){ - this.loginAction(); + this.loginRocketChat(); console.log('Log Gabinete Digital OK'); this.router.navigate(['/home/events']); } @@ -108,7 +95,4 @@ export class LoginPage implements OnInit { this.presentAlert('Ocorreu um erro ao fazer login. Contacte o administrador de sistema.'); } } - openCamera(){ - this.photoService.takePicture(); - } } diff --git a/src/app/pages/publications/publications.module.ts b/src/app/pages/publications/publications.module.ts index 870197516..65ba82f1c 100644 --- a/src/app/pages/publications/publications.module.ts +++ b/src/app/pages/publications/publications.module.ts @@ -7,12 +7,14 @@ import { IonicModule } from '@ionic/angular'; import { PublicationsPageRoutingModule } from './publications-routing.module'; import { PublicationsPage } from './publications.page'; +import { SharedModule } from 'src/app/shared/shared.module'; @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, + SharedModule, PublicationsPageRoutingModule ], declarations: [PublicationsPage] diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 25191bc90..a40b1b5ce 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -1,4 +1,7 @@ - + + + +
@@ -36,8 +39,6 @@
- -
{{publication.DatePublication | date: 'dd-MM-yy | h:mm'}}

+ + + + +
image diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts index 73b65a259..c9e88025e 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts @@ -11,7 +11,7 @@ import { NewPublicationPage } from '../../new-publication/new-publication.page'; styleUrls: ['./publication-detail.page.scss'], }) export class PublicationDetailPage implements OnInit { - + showLoader: boolean; publicationId: string; folderId: string; publication: Publication; @@ -42,6 +42,7 @@ export class PublicationDetailPage implements OnInit { } getPublicationDetail(){ + this.showLoader = true; console.log(this.publicationId); console.log(this.folderId); this.publications.GetPublicationById(this.folderId,this.publicationId).subscribe(res=>{ @@ -56,7 +57,8 @@ export class PublicationDetailPage implements OnInit { OriginalFileName: '', FileExtension: '', } - }) + this.showLoader = false; + }); } close(){ diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 4d4e1c4dd..03ada687f 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -44,14 +44,8 @@ export class AuthService { } - loginChat(){ - const body = {"user": "admin","password": "tabteste@006"}; - const url = "http://192.168.100.111:3000/api/v1/login"; - return this.http.post(url, body); - } - //Login to rocketChat server - loginChat2(postData: any):Observable { + loginChat(postData: any):Observable { return this.httpService.post('login', postData); } diff --git a/src/app/shared/header-pr/header-pr-routing.module.ts b/src/app/shared/header-pr/header-pr-routing.module.ts new file mode 100644 index 000000000..d911e2771 --- /dev/null +++ b/src/app/shared/header-pr/header-pr-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { HeaderPrPage } from './header-pr.page'; + +const routes: Routes = [ + { + path: '', + component: HeaderPrPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class HeaderPrPageRoutingModule {} diff --git a/src/app/shared/header-pr/header-pr.module.ts b/src/app/shared/header-pr/header-pr.module.ts new file mode 100644 index 000000000..b2a41677a --- /dev/null +++ b/src/app/shared/header-pr/header-pr.module.ts @@ -0,0 +1,20 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + +import { IonicModule } from '@ionic/angular'; + +import { HeaderPrPageRoutingModule } from './header-pr-routing.module'; + +import { HeaderPrPage } from './header-pr.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + HeaderPrPageRoutingModule + ], + declarations: [HeaderPrPage] +}) +export class HeaderPrPageModule {} diff --git a/src/app/shared/header-pr/header-pr.page.html b/src/app/shared/header-pr/header-pr.page.html new file mode 100644 index 000000000..97880cb13 --- /dev/null +++ b/src/app/shared/header-pr/header-pr.page.html @@ -0,0 +1,13 @@ + +
+ + +
+ +
+
+
diff --git a/src/app/shared/header-pr/header-pr.page.scss b/src/app/shared/header-pr/header-pr.page.scss new file mode 100644 index 000000000..cf8935c63 --- /dev/null +++ b/src/app/shared/header-pr/header-pr.page.scss @@ -0,0 +1,28 @@ +.div-top-header{ + width: 400px; + margin: 0 auto; + background-color: #0782c9; + overflow: auto; + padding-top: 15px; + border: 0!important; + + .div-search{ + font-size: 45px; + float: left; + margin: 0 0 0 10px + } + .div-logo{ + background: transparent; + width: 140px; + margin: 5px 0 0px 71px; + float: left; + } + .div-logo img{ + width: 100%; + } + .div-profile{ + font-size: 45px; + float: right; + margin-right: 10px; + } + } \ No newline at end of file diff --git a/src/app/shared/header-pr/header-pr.page.spec.ts b/src/app/shared/header-pr/header-pr.page.spec.ts new file mode 100644 index 000000000..a4452be8d --- /dev/null +++ b/src/app/shared/header-pr/header-pr.page.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { HeaderPrPage } from './header-pr.page'; + +describe('HeaderPrPage', () => { + let component: HeaderPrPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HeaderPrPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(HeaderPrPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/header-pr/header-pr.page.ts b/src/app/shared/header-pr/header-pr.page.ts new file mode 100644 index 000000000..d09241781 --- /dev/null +++ b/src/app/shared/header-pr/header-pr.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-header-pr', + templateUrl: './header-pr.page.html', + styleUrls: ['./header-pr.page.scss'], +}) +export class HeaderPrPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index 467b9ad5c..49c3e1cac 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -1,6 +1,5 @@ - - -
+ +
@@ -12,3 +11,4 @@
+ diff --git a/src/app/shared/header/header.page.scss b/src/app/shared/header/header.page.scss index cee7e2053..cf8935c63 100644 --- a/src/app/shared/header/header.page.scss +++ b/src/app/shared/header/header.page.scss @@ -1,21 +1,11 @@ -:host{ - background: #0782c9; - } - ion-content{ - --background: transparent; - } - ion-toolbar{ - background: transparent; - border-width: 0 !important; - } - .div-top-header{ - width: 400px; - margin: 0 auto; - background-color: #0782c9; - overflow: auto; - padding-top: 15px; - border: 0!important; - } +.div-top-header{ + width: 400px; + margin: 0 auto; + background-color: #0782c9; + overflow: auto; + padding-top: 15px; + border: 0!important; + .div-search{ font-size: 45px; float: left; @@ -35,7 +25,4 @@ float: right; margin-right: 10px; } - ion-content{ - --background:#0782c9; - --border: none; - } \ No newline at end of file + } \ No newline at end of file diff --git a/src/app/shared/shared.modules.ts b/src/app/shared/shared.module.ts similarity index 62% rename from src/app/shared/shared.modules.ts rename to src/app/shared/shared.module.ts index eebc23949..ff9aee71d 100644 --- a/src/app/shared/shared.modules.ts +++ b/src/app/shared/shared.module.ts @@ -2,6 +2,8 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { IonicModule } from '@ionic/angular'; +import { HeaderPage } from './header/header.page'; +import { HeaderPrPage } from './header-pr/header-pr.page'; @NgModule({ imports: [ @@ -9,8 +11,8 @@ import { IonicModule } from '@ionic/angular'; FormsModule, IonicModule, ], - exports: [], + exports: [HeaderPage, HeaderPrPage], entryComponents:[], - declarations: [] + declarations: [HeaderPage, HeaderPrPage] }) export class SharedModule {} \ No newline at end of file diff --git a/src/assets/images/icons-nav-chat-inactive.svg b/src/assets/images/icons-nav-chat-inactive.svg new file mode 100644 index 000000000..4960afef1 --- /dev/null +++ b/src/assets/images/icons-nav-chat-inactive.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/assets/images/icons-profile-pr.svg b/src/assets/images/icons-profile-pr.svg new file mode 100644 index 000000000..c322507eb --- /dev/null +++ b/src/assets/images/icons-profile-pr.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + PR + + + + + +