From 6fba6c0d64eb738bbd23e6888a97ae428c155881 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 15 Mar 2021 15:19:07 +0100 Subject: [PATCH 01/15] save --- src/app/app-routing.module.ts | 54 ++++++++++--------- src/app/app.module.ts | 2 +- src/app/pages/chat/chat.module.ts | 5 +- src/app/pages/chat/chat.page.html | 6 ++- src/app/pages/chat/chat.page.ts | 19 ++++++- .../empty-chat/empty-chat-routing.module.ts | 17 ++++++ .../chat/empty-chat/empty-chat.module.ts | 20 +++++++ .../chat/empty-chat/empty-chat.page.html | 5 ++ .../chat/empty-chat/empty-chat.page.scss | 5 ++ .../chat/empty-chat/empty-chat.page.spec.ts | 24 +++++++++ .../shared/chat/empty-chat/empty-chat.page.ts | 15 ++++++ .../chat/messages/contacts/contacts.module.ts | 6 +-- src/app/shared/shared.module.ts | 3 ++ 13 files changed, 148 insertions(+), 33 deletions(-) create mode 100644 src/app/shared/chat/empty-chat/empty-chat-routing.module.ts create mode 100644 src/app/shared/chat/empty-chat/empty-chat.module.ts create mode 100644 src/app/shared/chat/empty-chat/empty-chat.page.html create mode 100644 src/app/shared/chat/empty-chat/empty-chat.page.scss create mode 100644 src/app/shared/chat/empty-chat/empty-chat.page.spec.ts create mode 100644 src/app/shared/chat/empty-chat/empty-chat.page.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8ea73ab47..8d9efe98a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,27 +1,31 @@ -import { NgModule } from '@angular/core'; -import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; -import { ChatPage } from './pages/chat/chat.page'; -import { MessagesPage } from './pages/chat/messages/messages.page'; - -const routes: Routes = [ - { - path: '', - loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule) +import { NgModule } from '@angular/core'; +import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; +import { ChatPage } from './pages/chat/chat.page'; +import { MessagesPage } from './pages/chat/messages/messages.page'; + +const routes: Routes = [ + { + path: '', + loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule) + }, + { + path: '', + loadChildren: () => import('./home/home.module').then( m => m.HomePageModule) + }, { + path: 'empty-chat', + loadChildren: () => import('./shared/chat/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule) }, - { - path: '', - loadChildren: () => import('./home/home.module').then( m => m.HomePageModule) - }, - /* { - path: 'chat', - component: ChatPage - } */ -]; -@NgModule({ - imports: [ - RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) - ], - exports: [RouterModule] -}) -export class AppRoutingModule {} + /* { + path: 'chat', + component: ChatPage + } */ + +]; +@NgModule({ + imports: [ + RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) + ], + exports: [RouterModule] +}) +export class AppRoutingModule {} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index adaccc9db..a88262399 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -45,7 +45,7 @@ import { MessagesPage } from './pages/chat/messages/messages.page'; IonicStorageModule.forRoot(), AppRoutingModule, PipesModule, - HttpClientModule, + HttpClientModule, ], providers: [ StatusBar, diff --git a/src/app/pages/chat/chat.module.ts b/src/app/pages/chat/chat.module.ts index 0d1929a26..066c25c5f 100644 --- a/src/app/pages/chat/chat.module.ts +++ b/src/app/pages/chat/chat.module.ts @@ -11,6 +11,8 @@ import { SharedModule } from 'src/app/shared/shared.module'; import { RouterModule } from '@angular/router'; import { GroupMessagesPage } from 'src/app/shared/chat/group-messages/group-messages.page'; import { MessagesPage } from 'src/app/shared/chat/messages/messages.page'; +import { EmptyChatPage } from 'src/app/shared/chat/empty-chat/empty-chat.page'; +import { ContactsPage } from 'src/app/shared/chat/messages/contacts/contacts.page'; @NgModule({ imports: [ @@ -24,9 +26,10 @@ import { MessagesPage } from 'src/app/shared/chat/messages/messages.page'; declarations: [ ChatPage, MessagesPage, + ContactsPage, GroupMessagesPage, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], - entryComponents: [MessagesPage, GroupMessagesPage] + entryComponents: [MessagesPage,ContactsPage, GroupMessagesPage] }) export class ChatPageModule {} diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index 53f03b5e2..ca88f46e6 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -18,7 +18,7 @@
- +
@@ -90,8 +90,10 @@ + - + + diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index e31f52f53..a222e14b0 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -57,7 +57,9 @@ export class ChatPage implements OnInit { componentRef: any; roomId:any; + showEmptyComponent=true; showMessages=false; + showContacts=false; showGroupMessages=false; @Output() getRoomInfo; @@ -99,7 +101,9 @@ export class ChatPage implements OnInit { } closeAllDesktopComponents() { this.showMessages=false; + this.showContacts=false; this.showGroupMessages=false; + this.showEmptyComponent=false; } openMessagesPage(rid) { if( window.innerWidth <= 1024){ @@ -107,22 +111,35 @@ export class ChatPage implements OnInit { } else{ this.closeAllDesktopComponents(); + this.showEmptyComponent = false; this.roomId = rid; this.showMessages=true; } } + openContactsPage() { + console.log('OK'); + this.closeAllDesktopComponents(); + + if( window.innerWidth <= 1024){ + //this.selectContact(); + } + else{ + console.log('here'); + this.showContacts=true; + } + } openGroupMessagesPage(rid) { if( window.innerWidth <= 1024){ this.openGroupMessagesModal(rid); } else{ this.closeAllDesktopComponents(); + this.showEmptyComponent = false; this.roomId = rid; this.showGroupMessages=true; } } - onSegmentChange(){ this.load(); } diff --git a/src/app/shared/chat/empty-chat/empty-chat-routing.module.ts b/src/app/shared/chat/empty-chat/empty-chat-routing.module.ts new file mode 100644 index 000000000..f35c9faa0 --- /dev/null +++ b/src/app/shared/chat/empty-chat/empty-chat-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { EmptyChatPage } from './empty-chat.page'; + +const routes: Routes = [ + { + path: '', + component: EmptyChatPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class EmptyChatPageRoutingModule {} diff --git a/src/app/shared/chat/empty-chat/empty-chat.module.ts b/src/app/shared/chat/empty-chat/empty-chat.module.ts new file mode 100644 index 000000000..bf6038f1c --- /dev/null +++ b/src/app/shared/chat/empty-chat/empty-chat.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 { EmptyChatPageRoutingModule } from './empty-chat-routing.module'; + +import { EmptyChatPage } from './empty-chat.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + EmptyChatPageRoutingModule + ], + declarations: [EmptyChatPage] +}) +export class EmptyChatPageModule {} diff --git a/src/app/shared/chat/empty-chat/empty-chat.page.html b/src/app/shared/chat/empty-chat/empty-chat.page.html new file mode 100644 index 000000000..b5514095a --- /dev/null +++ b/src/app/shared/chat/empty-chat/empty-chat.page.html @@ -0,0 +1,5 @@ + +
+

Sem conversa selecionada

+
+
diff --git a/src/app/shared/chat/empty-chat/empty-chat.page.scss b/src/app/shared/chat/empty-chat/empty-chat.page.scss new file mode 100644 index 000000000..6483b8c01 --- /dev/null +++ b/src/app/shared/chat/empty-chat/empty-chat.page.scss @@ -0,0 +1,5 @@ +.center { + display: flex; + justify-content: center; + align-items: center; + } \ No newline at end of file diff --git a/src/app/shared/chat/empty-chat/empty-chat.page.spec.ts b/src/app/shared/chat/empty-chat/empty-chat.page.spec.ts new file mode 100644 index 000000000..361635c9e --- /dev/null +++ b/src/app/shared/chat/empty-chat/empty-chat.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { EmptyChatPage } from './empty-chat.page'; + +describe('EmptyChatPage', () => { + let component: EmptyChatPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ EmptyChatPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(EmptyChatPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/chat/empty-chat/empty-chat.page.ts b/src/app/shared/chat/empty-chat/empty-chat.page.ts new file mode 100644 index 000000000..fff63b39d --- /dev/null +++ b/src/app/shared/chat/empty-chat/empty-chat.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-empty-chat', + templateUrl: './empty-chat.page.html', + styleUrls: ['./empty-chat.page.scss'], +}) +export class EmptyChatPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/shared/chat/messages/contacts/contacts.module.ts b/src/app/shared/chat/messages/contacts/contacts.module.ts index 8284984be..b90d8af4e 100644 --- a/src/app/shared/chat/messages/contacts/contacts.module.ts +++ b/src/app/shared/chat/messages/contacts/contacts.module.ts @@ -8,7 +8,7 @@ import { ContactsPageRoutingModule } from './contacts-routing.module'; import { ContactsPage } from './contacts.page'; import { SharedModule } from 'src/app/shared/shared.module'; -import { PipesModule } from 'src/app/pipes/pipes.module'; +import { FilterPipe } from 'src/app/pipes/filter.pipe'; @NgModule({ imports: [ @@ -16,9 +16,9 @@ import { PipesModule } from 'src/app/pipes/pipes.module'; FormsModule, IonicModule, SharedModule, - PipesModule, ContactsPageRoutingModule ], - declarations: [ContactsPage] + exports: [FilterPipe], + declarations: [ContactsPage, FilterPipe] }) export class ContactsPageModule {} diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 7b1be4f52..7924c965b 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -8,6 +8,7 @@ import { BtnSeguintePage } from './btn-seguinte/btn-seguinte.page'; import { BtnModalDismissPage } from './btn-modal-dismiss/btn-modal-dismiss.page'; import { ChatPopoverPage } from './popover/chat-popover/chat-popover.page'; import { HeaderNoSearchPage } from './headers/header-no-search/header-no-search.page'; +import { EmptyChatPage } from './chat/empty-chat/empty-chat.page'; @NgModule({ imports: [ @@ -21,6 +22,7 @@ import { HeaderNoSearchPage } from './headers/header-no-search/header-no-search. HeaderNoSearchPage, BtnSeguintePage, BtnModalDismissPage, + EmptyChatPage, ], entryComponents:[], declarations: [ @@ -29,6 +31,7 @@ import { HeaderNoSearchPage } from './headers/header-no-search/header-no-search. HeaderNoSearchPage, BtnSeguintePage, BtnModalDismissPage, + EmptyChatPage, ] }) export class SharedModule {} \ No newline at end of file From 4c29d70adfe135c08205002f1b6f6043f122c4b0 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 15 Mar 2021 18:09:41 +0100 Subject: [PATCH 02/15] style new group view desktop/tablet --- src/app/pages/chat/chat.module.ts | 9 ++++++++- src/app/pages/chat/chat.page.html | 3 ++- src/app/pages/chat/chat.page.ts | 11 +++++++++++ .../shared/chat/new-group/new-group.page.html | 7 ++----- .../shared/chat/new-group/new-group.page.scss | 16 +++++++++------- src/app/shared/chat/new-group/new-group.page.ts | 10 ++++++---- 6 files changed, 38 insertions(+), 18 deletions(-) diff --git a/src/app/pages/chat/chat.module.ts b/src/app/pages/chat/chat.module.ts index 066c25c5f..70faea048 100644 --- a/src/app/pages/chat/chat.module.ts +++ b/src/app/pages/chat/chat.module.ts @@ -13,6 +13,7 @@ import { GroupMessagesPage } from 'src/app/shared/chat/group-messages/group-mess import { MessagesPage } from 'src/app/shared/chat/messages/messages.page'; import { EmptyChatPage } from 'src/app/shared/chat/empty-chat/empty-chat.page'; import { ContactsPage } from 'src/app/shared/chat/messages/contacts/contacts.page'; +import { NewGroupPage } from 'src/app/shared/chat/new-group/new-group.page'; @NgModule({ imports: [ @@ -28,8 +29,14 @@ import { ContactsPage } from 'src/app/shared/chat/messages/contacts/contacts.pag MessagesPage, ContactsPage, GroupMessagesPage, + NewGroupPage, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], - entryComponents: [MessagesPage,ContactsPage, GroupMessagesPage] + entryComponents: [ + MessagesPage, + ContactsPage, + GroupMessagesPage, + NewGroupPage, + ] }) export class ChatPageModule {} diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index ca88f46e6..d70bfca1b 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -17,7 +17,7 @@ Chat
- +
@@ -93,6 +93,7 @@ + diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index a222e14b0..38ff6c12b 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -60,6 +60,7 @@ export class ChatPage implements OnInit { showEmptyComponent=true; showMessages=false; showContacts=false; + showNewGroup=false; showGroupMessages=false; @Output() getRoomInfo; @@ -102,6 +103,7 @@ export class ChatPage implements OnInit { closeAllDesktopComponents() { this.showMessages=false; this.showContacts=false; + this.showNewGroup=false; this.showGroupMessages=false; this.showEmptyComponent=false; } @@ -128,6 +130,15 @@ export class ChatPage implements OnInit { this.showContacts=true; } } + openNewGroupPage() { + if( window.innerWidth <= 1024){ + this.newGroup(); + } + else{ + this.closeAllDesktopComponents(); + this.showNewGroup=true; + } + } openGroupMessagesPage(rid) { if( window.innerWidth <= 1024){ this.openGroupMessagesModal(rid); diff --git a/src/app/shared/chat/new-group/new-group.page.html b/src/app/shared/chat/new-group/new-group.page.html index b53fdda69..fcc87ac41 100644 --- a/src/app/shared/chat/new-group/new-group.page.html +++ b/src/app/shared/chat/new-group/new-group.page.html @@ -2,9 +2,6 @@
-
- -
Novo Grupo
@@ -15,11 +12,11 @@ -
+
-
+
Grupo Ultra-secreto
diff --git a/src/app/shared/chat/new-group/new-group.page.scss b/src/app/shared/chat/new-group/new-group.page.scss index 428f62e08..025d3aedd 100644 --- a/src/app/shared/chat/new-group/new-group.page.scss +++ b/src/app/shared/chat/new-group/new-group.page.scss @@ -47,7 +47,7 @@ ion-content{ transform: translate3d(0, 1px, 0); .title-content{ - width: 360px; + //width: 360px; margin: 0px auto; overflow: auto; padding: 0 !important; @@ -63,7 +63,7 @@ ion-content{ padding: 0!important; float: left; width: 221px; - margin: 2.5px 0 0 5px; + //margin: 2.5px 0 0 5px; } .right{ padding: 0!important; @@ -101,7 +101,7 @@ ion-content{ padding: 15px 20px 0 20px; .item-container{ - width: 360px; + //width: 360px; margin: 15px auto; border: 1px solid #ebebeb; border-radius: 5px; @@ -110,7 +110,7 @@ ion-content{ .item-container-no-border{ display: flex; - width: 360px; + //width: 360px; margin: 25px auto; border-radius: 5px; align-items: center; @@ -124,15 +124,16 @@ ion-content{ } .container-div{ + width: 100%; margin-bottom: 15px; overflow: auto; .ion-item-class-2{ - width: 360px; + width: 100%; margin: 0px auto; .ion-icon-class{ - width: 45px; + width: 5%; height: 45px; float: left; padding: 10px; @@ -140,12 +141,13 @@ ion-content{ } } .ion-input-class{ - width: 315px; + width: 93%; height: 45px; border: 1px solid #ebebeb; border-radius: 5px; padding-left: 5px; padding-right: 10px; + margin-left: 2%; float: left; } } diff --git a/src/app/shared/chat/new-group/new-group.page.ts b/src/app/shared/chat/new-group/new-group.page.ts index 6774503b1..21872959a 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -1,5 +1,5 @@ import { analyzeAndValidateNgModules } from '@angular/compiler'; -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular'; import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page'; import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page'; @@ -15,17 +15,19 @@ export class NewGroupPage implements OnInit { displayDuration: any; showDuration: boolean; selectedDuration = ['','','']; - groupName:string; + //groupName:string; + + @Input() groupName:string; constructor( private pickerController: PickerController, private popoverController: PopoverController, private modalController: ModalController, - private navParams: NavParams, + //private navParams: NavParams, ) { this.isGroupCreated = false; - this.groupName = this.navParams.get('name'); + //this.groupName = this.navParams.get('name'); } ngOnInit() { From 79310babc8b227712ac45a481959821dde296d48 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 16 Mar 2021 14:33:11 +0100 Subject: [PATCH 03/15] save --- .../group-contacts/group-contacts.page.ts | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts index c1fdc3618..fad0eb6ee 100644 --- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts +++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts @@ -1,5 +1,5 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ModalController, NavParams } from '@ionic/angular'; import * as _ from 'lodash'; import { AuthService } from 'src/app/services/auth.service'; @@ -31,12 +31,14 @@ export class GroupContactsPage implements OnInit { groupName:string; selectedUserList:any; + @Input() roomId:string; + constructor( private modalController: ModalController, private http: HttpClient, private chatService: ChatService, private authService: AuthService, - private navParams: NavParams, + //private navParams: NavParams, ) { this.authService.userData$.subscribe((res:any)=>{ @@ -45,18 +47,31 @@ export class GroupContactsPage implements OnInit { this.textSearch=""; this.dm=null; this.room=null; - this.isGroupCreated = this.navParams.get('isCreated'); + /* this.isGroupCreated = this.navParams.get('isCreated'); this.groupName = this.navParams.get('name'); this.room = this.navParams.get('room'); - this.members = this.navParams.get('members'); + this.members = this.navParams.get('members'); */ } ngOnInit() { + this.getRoomInfo(); this.loadUsers(); console.log(this.groupName); console.log(this.isGroupCreated); } + getRoomInfo(){ + this.showLoader = true; + this.chatService.getRoomInfo(this.roomId).subscribe(room=>{ + this.room = room['room']; + this.groupName = this.room.name.split('-').join(' '); + /* this.roomName = this.room.name.split('-').join(' '); + this.getGroupContacts(this.room); + this.loadGroupMessages(this.room); */ + this.showLoader = false; + }); + } + loadUsers(){ this.options = { headers: this.headers, @@ -156,8 +171,8 @@ export class GroupContactsPage implements OnInit { } createGroup(){ + console.log(this.groupName); if(!this.isGroupCreated){ - /* this.close(); */ let body = { "name":this.groupName, } this.chatService.addGroup(body).subscribe(res=>{ console.log('group created'); @@ -170,15 +185,7 @@ export class GroupContactsPage implements OnInit { } else{ this.addContacts(this.room); - this.close(); - /* this.openGroupMessages(this.room); */ - /* this.chatService.getGroupInfo(this.room._id).subscribe(res=>{ - console.log(res); - - this.addContacts(res['group']); - this.openGroupMessages(res['group']); - }) */ - + this.close(); } } From eccad1e3331c79c0498c5b22fc6e7842e4fbacaa Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 16 Mar 2021 14:33:36 +0100 Subject: [PATCH 04/15] save --- src/app/pages/agenda/agenda.page.ts | 2 +- src/app/pages/chat/chat.module.ts | 3 ++ src/app/pages/chat/chat.page.html | 3 +- src/app/pages/chat/chat.page.ts | 11 ++++ .../group-contacts/group-contacts.page.html | 10 ++-- .../group-contacts/group-contacts.page.scss | 24 +++------ .../group-contacts-routing.module.ts | 17 +++++++ .../group-contacts/group-contacts.module.ts | 20 ++++++++ .../group-contacts/group-contacts.page.html | 9 ++++ .../group-contacts/group-contacts.page.scss | 0 .../group-contacts.page.spec.ts | 24 +++++++++ .../group-contacts/group-contacts.page.ts | 15 ++++++ .../new-group/new-group-routing.module.ts | 50 ++++++++++--------- .../shared/chat/new-group/new-group.page.html | 2 +- .../shared/chat/new-group/new-group.page.ts | 19 ++++++- 15 files changed, 159 insertions(+), 50 deletions(-) create mode 100644 src/app/shared/chat/new-group/group-contacts/group-contacts-routing.module.ts create mode 100644 src/app/shared/chat/new-group/group-contacts/group-contacts.module.ts create mode 100644 src/app/shared/chat/new-group/group-contacts/group-contacts.page.html create mode 100644 src/app/shared/chat/new-group/group-contacts/group-contacts.page.scss create mode 100644 src/app/shared/chat/new-group/group-contacts/group-contacts.page.spec.ts create mode 100644 src/app/shared/chat/new-group/group-contacts/group-contacts.page.ts diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index 73f143d4a..3046e9671 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -762,7 +762,7 @@ export class AgendaPage implements OnInit { async cloneAllmobileComponent(){ - this.mobileComponent= { + this.mobileComponent = { showAddNewEvent: false, showEditEvent: false, showEventDitails: false, diff --git a/src/app/pages/chat/chat.module.ts b/src/app/pages/chat/chat.module.ts index 70faea048..340239ee6 100644 --- a/src/app/pages/chat/chat.module.ts +++ b/src/app/pages/chat/chat.module.ts @@ -14,6 +14,7 @@ import { MessagesPage } from 'src/app/shared/chat/messages/messages.page'; import { EmptyChatPage } from 'src/app/shared/chat/empty-chat/empty-chat.page'; import { ContactsPage } from 'src/app/shared/chat/messages/contacts/contacts.page'; import { NewGroupPage } from 'src/app/shared/chat/new-group/new-group.page'; +import { GroupContactsPage } from 'src/app/shared/chat/group-messages/group-contacts/group-contacts.page'; @NgModule({ imports: [ @@ -30,6 +31,7 @@ import { NewGroupPage } from 'src/app/shared/chat/new-group/new-group.page'; ContactsPage, GroupMessagesPage, NewGroupPage, + GroupContactsPage, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], entryComponents: [ @@ -37,6 +39,7 @@ import { NewGroupPage } from 'src/app/shared/chat/new-group/new-group.page'; ContactsPage, GroupMessagesPage, NewGroupPage, + GroupContactsPage, ] }) export class ChatPageModule {} diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index d70bfca1b..9538e432b 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -93,7 +93,8 @@ - + +
diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 38ff6c12b..059c39639 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -62,6 +62,7 @@ export class ChatPage implements OnInit { showContacts=false; showNewGroup=false; showGroupMessages=false; + showGroupContacts=false; @Output() getRoomInfo; @@ -106,6 +107,16 @@ export class ChatPage implements OnInit { this.showNewGroup=false; this.showGroupMessages=false; this.showEmptyComponent=false; + console.log('All components closed!'); + } + openGroupContactsPage(){ + this.closeAllDesktopComponents(); + if(window.innerWidth <= 1024){ + + } + else{ + this.showGroupContacts = true; + } } openMessagesPage(rid) { if( window.innerWidth <= 1024){ diff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html index f63a629a8..e9c4d1253 100644 --- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html +++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html @@ -1,7 +1,7 @@ -
-
+
+
@@ -41,7 +41,7 @@
- +
{{header}} @@ -49,8 +49,8 @@
-

{{user.name}}

- + {{user.name}} +
diff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.scss b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.scss index 829026a52..876e8cf68 100644 --- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.scss +++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.scss @@ -3,11 +3,8 @@ --opacity: 1; .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; @@ -26,7 +23,6 @@ padding-left: 20px; } .title-content{ - width: 360px; margin: 0px auto; overflow: auto; padding: 0 !important; @@ -62,28 +58,28 @@ border-radius: 5px; } .search ion-searchbar{ - /* border: 1px solid green; */ width: 100%; margin: 0 !important; padding: 0 !important; --border-radius: 5px; --box-shadow: none; - overflow: auto; + overflow: hidden; --icon-color:#0d89d1; } - } + ion-content{ --background:transparent; } + .main-content{ width: 100%; height: 100%; font-family: Roboto; margin: 0 auto; background-color: #fff; - overflow:auto; padding: 0 0 0 0; + overflow:auto; .members-label{ margin: 10px 20px 10px 20px !important; @@ -111,8 +107,6 @@ display: flex; margin: 10px 20px 10px 20px !important; overflow: auto; - align-items: center; - } .item-checkbox ion-checkbox, .members-checkbox ion-checkbox{ @@ -121,20 +115,16 @@ float: left; } - .item-checkbox p, .members-checkbox p{ - display: block; - margin: 0 !important; - width: 330px; + .item-checkbox ion-label, .members-checkbox p{ padding-left: 10px; font-size: 15px; color: #0d89d1; float: left; + flex-grow: 1; } - .item-checkbox ion-icon, .members-checkbox ion-icon{ + .icon, .members-checkbox ion-icon{ font-size: 10px; - float: left; color:#99e47b; - margin-left: 10px; } } diff --git a/src/app/shared/chat/new-group/group-contacts/group-contacts-routing.module.ts b/src/app/shared/chat/new-group/group-contacts/group-contacts-routing.module.ts new file mode 100644 index 000000000..c998741ed --- /dev/null +++ b/src/app/shared/chat/new-group/group-contacts/group-contacts-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { GroupContactsPage } from './group-contacts.page'; + +const routes: Routes = [ + { + path: '', + component: GroupContactsPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class GroupContactsPageRoutingModule {} diff --git a/src/app/shared/chat/new-group/group-contacts/group-contacts.module.ts b/src/app/shared/chat/new-group/group-contacts/group-contacts.module.ts new file mode 100644 index 000000000..2946bd28c --- /dev/null +++ b/src/app/shared/chat/new-group/group-contacts/group-contacts.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 { GroupContactsPageRoutingModule } from './group-contacts-routing.module'; + +import { GroupContactsPage } from './group-contacts.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + GroupContactsPageRoutingModule + ], + declarations: [GroupContactsPage] +}) +export class GroupContactsPageModule {} diff --git a/src/app/shared/chat/new-group/group-contacts/group-contacts.page.html b/src/app/shared/chat/new-group/group-contacts/group-contacts.page.html new file mode 100644 index 000000000..7cca9b8cf --- /dev/null +++ b/src/app/shared/chat/new-group/group-contacts/group-contacts.page.html @@ -0,0 +1,9 @@ + + + group-contacts + + + + + + diff --git a/src/app/shared/chat/new-group/group-contacts/group-contacts.page.scss b/src/app/shared/chat/new-group/group-contacts/group-contacts.page.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/shared/chat/new-group/group-contacts/group-contacts.page.spec.ts b/src/app/shared/chat/new-group/group-contacts/group-contacts.page.spec.ts new file mode 100644 index 000000000..5d3e2033f --- /dev/null +++ b/src/app/shared/chat/new-group/group-contacts/group-contacts.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { GroupContactsPage } from './group-contacts.page'; + +describe('GroupContactsPage', () => { + let component: GroupContactsPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ GroupContactsPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(GroupContactsPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/chat/new-group/group-contacts/group-contacts.page.ts b/src/app/shared/chat/new-group/group-contacts/group-contacts.page.ts new file mode 100644 index 000000000..7cb431b9a --- /dev/null +++ b/src/app/shared/chat/new-group/group-contacts/group-contacts.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-group-contacts', + templateUrl: './group-contacts.page.html', + styleUrls: ['./group-contacts.page.scss'], +}) +export class GroupContactsPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/shared/chat/new-group/new-group-routing.module.ts b/src/app/shared/chat/new-group/new-group-routing.module.ts index 42b9b7e24..8d2201158 100644 --- a/src/app/shared/chat/new-group/new-group-routing.module.ts +++ b/src/app/shared/chat/new-group/new-group-routing.module.ts @@ -1,25 +1,29 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { NewGroupPage } from './new-group.page'; - -const routes: Routes = [ - { - path: '', - component: NewGroupPage - }, - { - path: 'contacts', - loadChildren: () => import('./contacts/contacts.module').then( m => m.ContactsPageModule) - }, - { - path: 'group-chat', - loadChildren: () => import('./group-chat/group-chat.module').then( m => m.GroupChatPageModule) +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { NewGroupPage } from './new-group.page'; + +const routes: Routes = [ + { + path: '', + component: NewGroupPage + }, + { + path: 'contacts', + loadChildren: () => import('./contacts/contacts.module').then( m => m.ContactsPageModule) + }, + { + path: 'group-chat', + loadChildren: () => import('./group-chat/group-chat.module').then( m => m.GroupChatPageModule) + }, { + path: 'group-contacts', + loadChildren: () => import('./group-contacts/group-contacts.module').then( m => m.GroupContactsPageModule) } -]; -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class NewGroupPageRoutingModule {} +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class NewGroupPageRoutingModule {} diff --git a/src/app/shared/chat/new-group/new-group.page.html b/src/app/shared/chat/new-group/new-group.page.html index fcc87ac41..b2e9d9d23 100644 --- a/src/app/shared/chat/new-group/new-group.page.html +++ b/src/app/shared/chat/new-group/new-group.page.html @@ -5,7 +5,7 @@
Novo Grupo
- +
diff --git a/src/app/shared/chat/new-group/new-group.page.ts b/src/app/shared/chat/new-group/new-group.page.ts index 21872959a..335dc6253 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -1,6 +1,7 @@ import { analyzeAndValidateNgModules } from '@angular/compiler'; -import { Component, Input, OnInit } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular'; +import { ChatService } from 'src/app/services/chat.service'; import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page'; import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page'; @@ -18,11 +19,13 @@ export class NewGroupPage implements OnInit { //groupName:string; @Input() groupName:string; + @Output() closeAllDesktopComponent = new EventEmitter(); constructor( private pickerController: PickerController, private popoverController: PopoverController, private modalController: ModalController, + private chatService: ChatService, //private navParams: NavParams, ) { @@ -37,7 +40,19 @@ export class NewGroupPage implements OnInit { this.showDuration = event.detail.checked; } close(){ - this.modalController.dismiss(); + //this.modalController.dismiss(); + console.log('close'); + this.closeAllDesktopComponent.emit(); + } + + createGroup(){ + let name = this.groupName.split(' ').join('-'); + let body = { "name":name, } + this.chatService.addGroup(body).subscribe(res=>{ + console.log('group created'); + console.log(res['group']); + this.closeAllDesktopComponent.emit(res['group']._id); + }); } async addContacts(){ From 41d9c2b5b6565f9a3f5da341216542a88d959717 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 17 Mar 2021 09:06:42 +0100 Subject: [PATCH 05/15] save --- src/app/pages/chat/chat.page.html | 4 ++-- src/app/pages/chat/chat.page.scss | 1 + src/app/pages/chat/chat.page.ts | 15 +++++++++---- .../group-contacts/group-contacts.page.html | 2 +- .../group-contacts/group-contacts.page.ts | 22 +++++++++---------- .../shared/chat/new-group/new-group.page.ts | 6 ++--- 6 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index 9538e432b..be3fe5977 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -93,8 +93,8 @@ - - + +
diff --git a/src/app/pages/chat/chat.page.scss b/src/app/pages/chat/chat.page.scss index d9067fd6c..609d7e864 100644 --- a/src/app/pages/chat/chat.page.scss +++ b/src/app/pages/chat/chat.page.scss @@ -44,6 +44,7 @@ ion-content{ overflow: auto; .aside-wrapper{ + border: 1px solid red; padding: 0 !important; margin: 0 !important; } diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 059c39639..fc9d0e549 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -57,6 +57,7 @@ export class ChatPage implements OnInit { componentRef: any; roomId:any; + groupRoomId:any; showEmptyComponent=true; showMessages=false; showContacts=false; @@ -107,9 +108,13 @@ export class ChatPage implements OnInit { this.showNewGroup=false; this.showGroupMessages=false; this.showEmptyComponent=false; + this.showGroupContacts=false; console.log('All components closed!'); } - openGroupContactsPage(){ + openGroupContactsPage(data){ + console.log(data); + this.groupRoomId = data; + console.log(this.groupRoomId); this.closeAllDesktopComponents(); if(window.innerWidth <= 1024){ @@ -150,14 +155,16 @@ export class ChatPage implements OnInit { this.showNewGroup=true; } } - openGroupMessagesPage(rid) { + openGroupMessagesPage(data) { + console.log('HERE'); + if( window.innerWidth <= 1024){ - this.openGroupMessagesModal(rid); + this.openGroupMessagesModal(data); } else{ this.closeAllDesktopComponents(); this.showEmptyComponent = false; - this.roomId = rid; + this.roomId = data; this.showGroupMessages=true; } } diff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html index e9c4d1253..7653713b6 100644 --- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html +++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html @@ -8,7 +8,7 @@
Contactos
- +
diff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts index fad0eb6ee..ae7e9eb29 100644 --- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts +++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts @@ -1,5 +1,5 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; -import { Component, Input, OnInit } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { ModalController, NavParams } from '@ionic/angular'; import * as _ from 'lodash'; import { AuthService } from 'src/app/services/auth.service'; @@ -32,6 +32,7 @@ export class GroupContactsPage implements OnInit { selectedUserList:any; @Input() roomId:string; + @Output() openGroupMessage:EventEmitter = new EventEmitter(); constructor( private modalController: ModalController, @@ -54,21 +55,19 @@ export class GroupContactsPage implements OnInit { } ngOnInit() { - this.getRoomInfo(); + //this.getRoomInfo(); this.loadUsers(); - console.log(this.groupName); - console.log(this.isGroupCreated); + console.log(this.roomId); + //console.log(this.isGroupCreated); } - getRoomInfo(){ + updateGroup(){ this.showLoader = true; this.chatService.getRoomInfo(this.roomId).subscribe(room=>{ this.room = room['room']; - this.groupName = this.room.name.split('-').join(' '); - /* this.roomName = this.room.name.split('-').join(' '); - this.getGroupContacts(this.room); - this.loadGroupMessages(this.room); */ + this.addContacts(this.room); this.showLoader = false; + this.openGroupMessage.emit(this.room._id) }); } @@ -162,7 +161,6 @@ export class GroupContactsPage implements OnInit { let body ={ "roomId":room._id, "userId":user._id, - } this.chatService.addUserToGroup(body).subscribe(res=>{ console.log(res['success']); @@ -170,7 +168,7 @@ export class GroupContactsPage implements OnInit { }); } - createGroup(){ + /* createGroup(){ console.log(this.groupName); if(!this.isGroupCreated){ let body = { "name":this.groupName, } @@ -187,7 +185,7 @@ export class GroupContactsPage implements OnInit { this.addContacts(this.room); this.close(); } - } + } */ async newGroup(){ this.close(); diff --git a/src/app/shared/chat/new-group/new-group.page.ts b/src/app/shared/chat/new-group/new-group.page.ts index 335dc6253..160e0e21e 100644 --- a/src/app/shared/chat/new-group/new-group.page.ts +++ b/src/app/shared/chat/new-group/new-group.page.ts @@ -19,7 +19,7 @@ export class NewGroupPage implements OnInit { //groupName:string; @Input() groupName:string; - @Output() closeAllDesktopComponent = new EventEmitter(); + @Output() addGroupMessage:EventEmitter = new EventEmitter(); constructor( private pickerController: PickerController, @@ -42,7 +42,7 @@ export class NewGroupPage implements OnInit { close(){ //this.modalController.dismiss(); console.log('close'); - this.closeAllDesktopComponent.emit(); + this.addGroupMessage.emit(); } createGroup(){ @@ -51,7 +51,7 @@ export class NewGroupPage implements OnInit { this.chatService.addGroup(body).subscribe(res=>{ console.log('group created'); console.log(res['group']); - this.closeAllDesktopComponent.emit(res['group']._id); + this.addGroupMessage.emit(res['group']._id); }); } From c161ec0855c1d45ea34b4fd558715a537d72f634 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 17 Mar 2021 11:13:09 +0100 Subject: [PATCH 06/15] Improve workflow of creating new messages group + add new customised buttons --- src/app/app-routing.module.ts | 8 +++++++ src/app/pages/chat/chat.page.html | 4 ++-- src/app/pages/chat/chat.page.scss | 2 -- .../btn-seguinte/btn-seguinte.page.html | 2 +- .../btn-seguinte/btn-seguinte.page.scss | 12 +++++----- .../btn-adicionar-routing.module.ts | 17 +++++++++++++ .../btn-adicionar/btn-adicionar.module.ts | 20 ++++++++++++++++ .../btn-adicionar/btn-adicionar.page.html | 3 +++ .../btn-adicionar/btn-adicionar.page.scss | 7 ++++++ .../btn-adicionar/btn-adicionar.page.spec.ts | 24 +++++++++++++++++++ .../btn-adicionar/btn-adicionar.page.ts | 15 ++++++++++++ .../btn-criar/btn-criar-routing.module.ts | 17 +++++++++++++ .../buttons/btn-criar/btn-criar.module.ts | 20 ++++++++++++++++ .../buttons/btn-criar/btn-criar.page.html | 3 +++ .../buttons/btn-criar/btn-criar.page.scss | 7 ++++++ .../buttons/btn-criar/btn-criar.page.spec.ts | 24 +++++++++++++++++++ .../buttons/btn-criar/btn-criar.page.ts | 15 ++++++++++++ .../group-contacts/group-contacts.page.html | 4 ++-- .../group-contacts/group-contacts.page.ts | 5 ++++ .../group-messages/group-messages.page.html | 2 +- .../group-messages/group-messages.page.ts | 7 +++++- .../shared/chat/new-group/new-group.page.html | 4 ++-- src/app/shared/shared.module.ts | 6 +++++ 23 files changed, 211 insertions(+), 17 deletions(-) create mode 100644 src/app/shared/buttons/btn-adicionar/btn-adicionar-routing.module.ts create mode 100644 src/app/shared/buttons/btn-adicionar/btn-adicionar.module.ts create mode 100644 src/app/shared/buttons/btn-adicionar/btn-adicionar.page.html create mode 100644 src/app/shared/buttons/btn-adicionar/btn-adicionar.page.scss create mode 100644 src/app/shared/buttons/btn-adicionar/btn-adicionar.page.spec.ts create mode 100644 src/app/shared/buttons/btn-adicionar/btn-adicionar.page.ts create mode 100644 src/app/shared/buttons/btn-criar/btn-criar-routing.module.ts create mode 100644 src/app/shared/buttons/btn-criar/btn-criar.module.ts create mode 100644 src/app/shared/buttons/btn-criar/btn-criar.page.html create mode 100644 src/app/shared/buttons/btn-criar/btn-criar.page.scss create mode 100644 src/app/shared/buttons/btn-criar/btn-criar.page.spec.ts create mode 100644 src/app/shared/buttons/btn-criar/btn-criar.page.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8d9efe98a..3dd13aae4 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -15,6 +15,14 @@ const routes: Routes = [ path: 'empty-chat', loadChildren: () => import('./shared/chat/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule) }, + { + path: 'btn-criar', + loadChildren: () => import('./shared/buttons/btn-criar/btn-criar.module').then( m => m.BtnCriarPageModule) + }, + { + path: 'btn-adicionar', + loadChildren: () => import('./shared/buttons/btn-adicionar/btn-adicionar.module').then( m => m.BtnAdicionarPageModule) + }, /* { path: 'chat', diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index be3fe5977..d05ced47c 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -10,7 +10,7 @@
-
+
@@ -95,7 +95,7 @@ - +
diff --git a/src/app/pages/chat/chat.page.scss b/src/app/pages/chat/chat.page.scss index 609d7e864..8c5e7498a 100644 --- a/src/app/pages/chat/chat.page.scss +++ b/src/app/pages/chat/chat.page.scss @@ -8,7 +8,6 @@ ion-content{ .title-content{ width: 100%; margin-bottom: 15px; - overflow: auto; padding: 0 !important; background: #fff; @@ -44,7 +43,6 @@ ion-content{ overflow: auto; .aside-wrapper{ - border: 1px solid red; padding: 0 !important; margin: 0 !important; } diff --git a/src/app/shared/btn-seguinte/btn-seguinte.page.html b/src/app/shared/btn-seguinte/btn-seguinte.page.html index 2ecf0814d..526d8f40c 100644 --- a/src/app/shared/btn-seguinte/btn-seguinte.page.html +++ b/src/app/shared/btn-seguinte/btn-seguinte.page.html @@ -1,3 +1,3 @@
Seguinte -
+
\ No newline at end of file diff --git a/src/app/shared/btn-seguinte/btn-seguinte.page.scss b/src/app/shared/btn-seguinte/btn-seguinte.page.scss index fef7141e5..bc35e6d03 100644 --- a/src/app/shared/btn-seguinte/btn-seguinte.page.scss +++ b/src/app/shared/btn-seguinte/btn-seguinte.page.scss @@ -1,7 +1,7 @@ .right{ - padding: 0!important; - float: right; - font-size: 15px; - color: #0782c9; - margin: 8px 0 0 5px; - } \ No newline at end of file + padding: 0!important; + float: right; + font-size: 15px; + color: #0782c9; + margin: 8px 0 0 5px; +} \ No newline at end of file diff --git a/src/app/shared/buttons/btn-adicionar/btn-adicionar-routing.module.ts b/src/app/shared/buttons/btn-adicionar/btn-adicionar-routing.module.ts new file mode 100644 index 000000000..b6f074394 --- /dev/null +++ b/src/app/shared/buttons/btn-adicionar/btn-adicionar-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { BtnAdicionarPage } from './btn-adicionar.page'; + +const routes: Routes = [ + { + path: '', + component: BtnAdicionarPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class BtnAdicionarPageRoutingModule {} diff --git a/src/app/shared/buttons/btn-adicionar/btn-adicionar.module.ts b/src/app/shared/buttons/btn-adicionar/btn-adicionar.module.ts new file mode 100644 index 000000000..42e7d2a67 --- /dev/null +++ b/src/app/shared/buttons/btn-adicionar/btn-adicionar.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 { BtnAdicionarPageRoutingModule } from './btn-adicionar-routing.module'; + +import { BtnAdicionarPage } from './btn-adicionar.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + BtnAdicionarPageRoutingModule + ], + declarations: [BtnAdicionarPage] +}) +export class BtnAdicionarPageModule {} diff --git a/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.html b/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.html new file mode 100644 index 000000000..e53e30f5d --- /dev/null +++ b/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.html @@ -0,0 +1,3 @@ +
+ Adicionar +
diff --git a/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.scss b/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.scss new file mode 100644 index 000000000..b7b93819b --- /dev/null +++ b/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.scss @@ -0,0 +1,7 @@ +.right{ + padding: 0!important; + float: right; + font-size: 15px; + color: #0782c9; + margin: 8px 5px 0 5px; + } \ No newline at end of file diff --git a/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.spec.ts b/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.spec.ts new file mode 100644 index 000000000..43026a2ac --- /dev/null +++ b/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { BtnAdicionarPage } from './btn-adicionar.page'; + +describe('BtnAdicionarPage', () => { + let component: BtnAdicionarPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ BtnAdicionarPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(BtnAdicionarPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.ts b/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.ts new file mode 100644 index 000000000..55d0d768f --- /dev/null +++ b/src/app/shared/buttons/btn-adicionar/btn-adicionar.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-btn-adicionar', + templateUrl: './btn-adicionar.page.html', + styleUrls: ['./btn-adicionar.page.scss'], +}) +export class BtnAdicionarPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/shared/buttons/btn-criar/btn-criar-routing.module.ts b/src/app/shared/buttons/btn-criar/btn-criar-routing.module.ts new file mode 100644 index 000000000..83df1196f --- /dev/null +++ b/src/app/shared/buttons/btn-criar/btn-criar-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { BtnCriarPage } from './btn-criar.page'; + +const routes: Routes = [ + { + path: '', + component: BtnCriarPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class BtnCriarPageRoutingModule {} diff --git a/src/app/shared/buttons/btn-criar/btn-criar.module.ts b/src/app/shared/buttons/btn-criar/btn-criar.module.ts new file mode 100644 index 000000000..311f914d5 --- /dev/null +++ b/src/app/shared/buttons/btn-criar/btn-criar.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 { BtnCriarPageRoutingModule } from './btn-criar-routing.module'; + +import { BtnCriarPage } from './btn-criar.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + BtnCriarPageRoutingModule + ], + declarations: [BtnCriarPage] +}) +export class BtnCriarPageModule {} diff --git a/src/app/shared/buttons/btn-criar/btn-criar.page.html b/src/app/shared/buttons/btn-criar/btn-criar.page.html new file mode 100644 index 000000000..cf6ccee57 --- /dev/null +++ b/src/app/shared/buttons/btn-criar/btn-criar.page.html @@ -0,0 +1,3 @@ +
+ Criar grupo +
diff --git a/src/app/shared/buttons/btn-criar/btn-criar.page.scss b/src/app/shared/buttons/btn-criar/btn-criar.page.scss new file mode 100644 index 000000000..b7b93819b --- /dev/null +++ b/src/app/shared/buttons/btn-criar/btn-criar.page.scss @@ -0,0 +1,7 @@ +.right{ + padding: 0!important; + float: right; + font-size: 15px; + color: #0782c9; + margin: 8px 5px 0 5px; + } \ No newline at end of file diff --git a/src/app/shared/buttons/btn-criar/btn-criar.page.spec.ts b/src/app/shared/buttons/btn-criar/btn-criar.page.spec.ts new file mode 100644 index 000000000..ce36f9653 --- /dev/null +++ b/src/app/shared/buttons/btn-criar/btn-criar.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { BtnCriarPage } from './btn-criar.page'; + +describe('BtnCriarPage', () => { + let component: BtnCriarPage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ BtnCriarPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(BtnCriarPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/shared/buttons/btn-criar/btn-criar.page.ts b/src/app/shared/buttons/btn-criar/btn-criar.page.ts new file mode 100644 index 000000000..6afea0c23 --- /dev/null +++ b/src/app/shared/buttons/btn-criar/btn-criar.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-btn-criar', + templateUrl: './btn-criar.page.html', + styleUrls: ['./btn-criar.page.scss'], +}) +export class BtnCriarPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html index 7653713b6..a2ae1f8b7 100644 --- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html +++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html @@ -3,12 +3,12 @@
- +
Contactos
- +
diff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts index ae7e9eb29..8c2c6dea7 100644 --- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts +++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts @@ -70,6 +70,11 @@ export class GroupContactsPage implements OnInit { this.openGroupMessage.emit(this.room._id) }); } + openGroupMessagesPage(){ + this.showLoader = true; + this.openGroupMessage.emit(this.roomId) + this.showLoader = false; + } loadUsers(){ this.options = { diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index 437f8909d..262a9813f 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -9,7 +9,7 @@
-
+
diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index 8578835ea..0f275b018 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -1,4 +1,4 @@ -import { Component, OnChanges, OnInit, Input, SimpleChanges} from '@angular/core'; +import { Component, OnChanges, OnInit, Input, SimpleChanges, Output, EventEmitter} from '@angular/core'; import { ActionSheetController, MenuController, ModalController, PopoverController } from '@ionic/angular'; import { AuthService } from 'src/app/services/auth.service'; import { ChatService } from 'src/app/services/chat.service'; @@ -25,6 +25,7 @@ export class GroupMessagesPage implements OnInit, OnChanges { members:any; @Input() roomId:string; + @Output() openGroupContacts:EventEmitter = new EventEmitter(); constructor( private menu: MenuController, @@ -49,6 +50,10 @@ export class GroupMessagesPage implements OnInit, OnChanges { console.log(this.roomId); } + openGroupContactsPage(){ + this.openGroupContacts.emit(this.roomId); + } + close(){ this.modalController.dismiss(); } diff --git a/src/app/shared/chat/new-group/new-group.page.html b/src/app/shared/chat/new-group/new-group.page.html index b2e9d9d23..02dc25311 100644 --- a/src/app/shared/chat/new-group/new-group.page.html +++ b/src/app/shared/chat/new-group/new-group.page.html @@ -5,7 +5,7 @@
Novo Grupo
- +
@@ -16,7 +16,7 @@
-
+
Grupo Ultra-secreto
diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 7924c965b..3b01186fc 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -9,6 +9,8 @@ import { BtnModalDismissPage } from './btn-modal-dismiss/btn-modal-dismiss.page' import { ChatPopoverPage } from './popover/chat-popover/chat-popover.page'; import { HeaderNoSearchPage } from './headers/header-no-search/header-no-search.page'; import { EmptyChatPage } from './chat/empty-chat/empty-chat.page'; +import { BtnCriarPage } from './buttons/btn-criar/btn-criar.page'; +import { BtnAdicionarPage } from './buttons/btn-adicionar/btn-adicionar.page'; @NgModule({ imports: [ @@ -23,6 +25,8 @@ import { EmptyChatPage } from './chat/empty-chat/empty-chat.page'; BtnSeguintePage, BtnModalDismissPage, EmptyChatPage, + BtnCriarPage, + BtnAdicionarPage, ], entryComponents:[], declarations: [ @@ -32,6 +36,8 @@ import { EmptyChatPage } from './chat/empty-chat/empty-chat.page'; BtnSeguintePage, BtnModalDismissPage, EmptyChatPage, + BtnCriarPage, + BtnAdicionarPage, ] }) export class SharedModule {} \ No newline at end of file From 1b5d98dd2ba7b1dd467df08b8854a375ffa99ab0 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 17 Mar 2021 11:43:14 +0100 Subject: [PATCH 07/15] save --- src/app/shared/chat/group-messages/group-messages.page.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/shared/chat/group-messages/group-messages.page.scss b/src/app/shared/chat/group-messages/group-messages.page.scss index 9018913ce..517a2659c 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.scss +++ b/src/app/shared/chat/group-messages/group-messages.page.scss @@ -43,7 +43,6 @@ } .header-bottom-contacts{ - width: 275px; font-size: 15px; color: #797979; white-space: nowrap; From c16fc7197a8b8fde7370e85665508238b9639d6d Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 18 Mar 2021 09:25:59 +0100 Subject: [PATCH 08/15] style menus --- src/app/pages/chat/chat.page.html | 2 +- .../group-contacts/group-contacts.page.html | 3 - .../group-messages/group-messages.page.html | 2 +- .../group-messages/group-messages.page.ts | 52 ++++++++++++++- .../chat/messages/contacts/contacts.page.html | 6 +- .../chat/messages/contacts/contacts.page.scss | 17 +++-- .../chat/messages/contacts/contacts.page.ts | 20 +++++- .../shared/chat/messages/messages.page.html | 2 +- src/app/shared/chat/messages/messages.page.ts | 55 +++++++++++++++- .../chat-popover/chat-popover.page.html | 16 ++++- .../chat-popover/chat-popover.page.scss | 64 +++++++++++++++---- .../popover/chat-popover/chat-popover.page.ts | 7 +- .../messages-options.page.html | 18 +++--- .../messages-options.page.scss | 47 +++++++++++++- .../messages-options/messages-options.page.ts | 10 ++- src/assets/icon/icons-arrow-arrow-left.svg | 11 ++++ src/assets/images/icons-arrow-arrow-right.svg | 9 +++ 17 files changed, 291 insertions(+), 50 deletions(-) create mode 100644 src/assets/icon/icons-arrow-arrow-left.svg create mode 100644 src/assets/images/icons-arrow-arrow-right.svg diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index d05ced47c..445dc5297 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -92,7 +92,7 @@ Destroy --> - + diff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html index a2ae1f8b7..dc129dd35 100644 --- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html +++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html @@ -26,9 +26,6 @@ - - -
Contactos selecção: diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index 262a9813f..c5971d016 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -6,7 +6,7 @@ {{room.name.split('-').join(' ')}}
- +
diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index 0f275b018..7e3823775 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -1,5 +1,5 @@ import { Component, OnChanges, OnInit, Input, SimpleChanges, Output, EventEmitter} from '@angular/core'; -import { ActionSheetController, MenuController, ModalController, PopoverController } from '@ionic/angular'; +import { ActionSheetController, AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular'; import { AuthService } from 'src/app/services/auth.service'; import { ChatService } from 'src/app/services/chat.service'; import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page'; @@ -34,6 +34,7 @@ export class GroupMessagesPage implements OnInit, OnChanges { public popoverController: PopoverController, private chatService: ChatService, private authService: AuthService, + private animationController: AnimationController, ) { this.isGroupCreated = true; } @@ -137,6 +138,55 @@ export class GroupMessagesPage implements OnInit, OnChanges { }); this.message = ""; } + async openGroupMessagesOptions() { + + const enterAnimation = (baseEl: any) => { + const backdropAnimation = this.animationController.create() + .addElement(baseEl.querySelector('ion-backdrop')!) + .fromTo('opacity', '0.01', 'var(--backdrop-opacity)'); + + const wrapperAnimation = this.animationController.create() + .addElement(baseEl.querySelector('.modal-wrapper')!) + .keyframes([ + { offset: 0, opacity: '1', right: '-100%' }, + { offset: 1, opacity: '1', right: '0px' } + ]); + + return this.animationController.create() + .addElement(baseEl) + .easing('ease-out') + .duration(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + + /* const popover = await this.popoverController.create({ + component: MessagesOptionsPage, + componentProps: { + roomId: this.dm._id, + }, + cssClass: 'messages-options', + event: ev, + translucent: true, + }); + return await popover.present(); */ + + const modal = await this.modalController.create({ + enterAnimation, + leaveAnimation, + component: ChatPopoverPage, + cssClass: 'model profile-modal search-submodal', + componentProps: { + roomId: this.roomId, + } + }); + return await modal.present(); + } + /* async openOptions(ev: any) { const popover = await this.popoverController.create({ diff --git a/src/app/shared/chat/messages/contacts/contacts.page.html b/src/app/shared/chat/messages/contacts/contacts.page.html index b2f8e9705..b8e86ee60 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.html +++ b/src/app/shared/chat/messages/contacts/contacts.page.html @@ -19,20 +19,22 @@ + +
- +
{{header}}
-
+

{{user.name}}

diff --git a/src/app/shared/chat/messages/contacts/contacts.page.scss b/src/app/shared/chat/messages/contacts/contacts.page.scss index 1eb104bdb..24392c458 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.scss +++ b/src/app/shared/chat/messages/contacts/contacts.page.scss @@ -4,7 +4,7 @@ --opacity: 1; .main-header{ - width: 100%; /* 400px */ + width: 100%; height: 100%; font-family: Roboto; border-top-left-radius: 25px; @@ -27,7 +27,6 @@ padding-left: 20px; } .title-content{ - width: 360px; margin: 0px auto; overflow: auto; padding: 0 !important; @@ -80,13 +79,13 @@ --background:transparent; } .main-content{ - width: 100%; - height: 100%; - font-family: Roboto; - margin: 0 auto; - background-color: #fff; - overflow:auto; - padding: 0 0 0 0; + width: 100%; + height: 100%; + font-family: Roboto; + margin: 0 auto; + background-color: #fff; + padding: 0 0 0 0; + overflow:auto; .item-divider{ background: #ebebeb; diff --git a/src/app/shared/chat/messages/contacts/contacts.page.ts b/src/app/shared/chat/messages/contacts/contacts.page.ts index ff86e8d5b..d52746222 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.ts +++ b/src/app/shared/chat/messages/contacts/contacts.page.ts @@ -1,5 +1,5 @@ import { HttpClient, HttpHeaders } from '@angular/common/http'; -import { Component, OnInit } from '@angular/core'; +import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { ModalController } from '@ionic/angular'; import { AuthService } from 'src/app/services/auth.service'; import { ChatService } from 'src/app/services/chat.service'; @@ -23,6 +23,8 @@ export class ContactsPage implements OnInit { room:any; dm:any; + @Output() openMessage:EventEmitter = new EventEmitter(); + constructor( private modalController: ModalController, private http: HttpClient, @@ -46,6 +48,22 @@ export class ContactsPage implements OnInit { this.textSearch = event.detail.value; } + openMessagesPage(username:string){ + if( window.innerWidth <= 1024){ + this.createRoom(username); + } + else{ + let body = { + username: username, + } + this.chatService.createRoom(body).subscribe(res => { + console.log(res); + this.room = res['room']; + this.openMessage.emit(this.room._id); + }); + } + } + loadUsers(){ this.options = { headers: this.headers, diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index 2936836e6..0dda497cf 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -7,7 +7,7 @@
- +
diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index 44f4e928c..ad7536359 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -1,10 +1,11 @@ import { AfterViewChecked, Component, ElementRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; -import { ModalController, NavParams, PopoverController } from '@ionic/angular'; +import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular'; import { Status } from 'src/app/models/chat/status.model'; import { AuthService } from 'src/app/services/auth.service'; import { ChatService } from 'src/app/services/chat.service'; import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page'; import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page'; +import { ProfileComponent } from '../../headers/header-no-search/profile/profile.component'; import { ContactsPage } from '../new-group/contacts/contacts.page'; @Component({ @@ -33,6 +34,7 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges { /* private navParams: NavParams, */ private chatService: ChatService, private authService: AuthService, + private animationController: AnimationController, ) { /* this.dm = this.navParams.get('dm'); */ } @@ -155,5 +157,56 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges { return await popover.present(); } + + + async _openMessagesOptions() { + + const enterAnimation = (baseEl: any) => { + const backdropAnimation = this.animationController.create() + .addElement(baseEl.querySelector('ion-backdrop')!) + .fromTo('opacity', '0.01', 'var(--backdrop-opacity)'); + + const wrapperAnimation = this.animationController.create() + .addElement(baseEl.querySelector('.modal-wrapper')!) + .keyframes([ + { offset: 0, opacity: '1', right: '-100%' }, + { offset: 1, opacity: '1', right: '0px' } + ]); + + return this.animationController.create() + .addElement(baseEl) + .easing('ease-out') + .duration(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + + /* const popover = await this.popoverController.create({ + component: MessagesOptionsPage, + componentProps: { + roomId: this.dm._id, + }, + cssClass: 'messages-options', + event: ev, + translucent: true, + }); + return await popover.present(); */ + + const modal = await this.modalController.create({ + enterAnimation, + leaveAnimation, + component: MessagesOptionsPage, + cssClass: 'model profile-modal search-submodal', + componentProps: { + roomId: this.roomId, + } + }); + return await modal.present(); + } + } diff --git a/src/app/shared/popover/chat-popover/chat-popover.page.html b/src/app/shared/popover/chat-popover/chat-popover.page.html index 4f109ee1a..49130161a 100644 --- a/src/app/shared/popover/chat-popover/chat-popover.page.html +++ b/src/app/shared/popover/chat-popover/chat-popover.page.html @@ -1,5 +1,15 @@ - - + +
+ +
+
+ + +
+ + +
+
diff --git a/src/app/shared/popover/chat-popover/chat-popover.page.scss b/src/app/shared/popover/chat-popover/chat-popover.page.scss index 0171ad1d0..67e991974 100644 --- a/src/app/shared/popover/chat-popover/chat-popover.page.scss +++ b/src/app/shared/popover/chat-popover/chat-popover.page.scss @@ -1,15 +1,53 @@ -ion-row{ - padding: 10px 10px 5px 10px; +.container{ + --padding-top:20px !important; + --padding-bottom:20px !important; + --padding-start:20px !important; + --padding-end:20px !important; } -.border-top{ - padding-top: 5px !important; - border-top: 1px solid #ebebeb; +.arrow-right{ + display: none; + margin-bottom: 20px; + .arrow-right-icon{ + width: 37px; + float: right; + font-size: 35px; + overflow: hidden; + } +} +.buttons{ + display: flex; + flex-wrap: wrap; + justify-content: space-around; +} +.solid { + display: none; + width: 90%; + border-top: 1px solid #bbb; + margin: 0 auto !important; +} +@media only screen and (min-width: 1024px) { + .arrow-right{ + display: flex; + justify-content: flex-end; + } + .btn-cancel{ + //display: none; + width: 100% !important; + margin-bottom: 10px !important; + } + .btn-ok{ + width: 100% !important; + margin-bottom: 10px !important; +} + .btn-delete{ + width: 100% !important; + margin-bottom: 10px !important; + margin-top: 10px !important; + } + .solid{ + display: block; + } + .mobile-only{ + display: none !important; + } } -/* ion-col{ - border: 1px solid red; -} */ - -/* .btn-ok, .btn-cancel, .btn-delete{ - font-size: 13px; - padding:0 !important; -} */ diff --git a/src/app/shared/popover/chat-popover/chat-popover.page.ts b/src/app/shared/popover/chat-popover/chat-popover.page.ts index ebf338bd6..cae809bb3 100644 --- a/src/app/shared/popover/chat-popover/chat-popover.page.ts +++ b/src/app/shared/popover/chat-popover/chat-popover.page.ts @@ -25,7 +25,12 @@ export class ChatPopoverPage implements OnInit { } close(){ - this.popoverController.dismiss(); + if( window.innerWidth <= 1024){ + this.popoverController.dismiss(); + } + else{ + this.modalController.dismiss(); + } } //Top menu options diff --git a/src/app/shared/popover/messages-options/messages-options.page.html b/src/app/shared/popover/messages-options/messages-options.page.html index be9bcf347..9d8ac3b7d 100644 --- a/src/app/shared/popover/messages-options/messages-options.page.html +++ b/src/app/shared/popover/messages-options/messages-options.page.html @@ -1,10 +1,10 @@ - - - - - - - - - + +
+ +
+
+ +
+ +
diff --git a/src/app/shared/popover/messages-options/messages-options.page.scss b/src/app/shared/popover/messages-options/messages-options.page.scss index 63122bda8..03fcefe0d 100644 --- a/src/app/shared/popover/messages-options/messages-options.page.scss +++ b/src/app/shared/popover/messages-options/messages-options.page.scss @@ -1,3 +1,46 @@ -ion-row{ - padding: 10px 10px 5px 10px; +.container{ + --padding-top:20px !important; + --padding-bottom:20px !important; + --padding-start:20px !important; + --padding-end:20px !important; +} +.arrow-right{ + display: none; + margin-bottom: 20px; + .arrow-right-icon{ + width: 37px; + float: right; + font-size: 35px; + overflow: hidden; + } +} +.buttons{ + display: flex; + flex-wrap: wrap; + justify-content: space-around; +} +.solid { + display: none; + width: 90%; + border-top: 1px solid #bbb; + margin: 0 auto !important; + } +@media only screen and (min-width: 1024px) { + .arrow-right{ + display: flex; + justify-content: flex-end; + } + .btn-cancel{ + display: none; + width: 100% !important; + margin-bottom: 10px !important; + } + .btn-delete{ + width: 100% !important; + margin-bottom: 10px !important; + margin-top: 10px !important; + } + /* .solid{ + display: block; + } */ } \ No newline at end of file diff --git a/src/app/shared/popover/messages-options/messages-options.page.ts b/src/app/shared/popover/messages-options/messages-options.page.ts index 98ac52044..44262ee86 100644 --- a/src/app/shared/popover/messages-options/messages-options.page.ts +++ b/src/app/shared/popover/messages-options/messages-options.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { NavParams, PopoverController } from '@ionic/angular'; +import { ModalController, NavParams, PopoverController } from '@ionic/angular'; import { ChatService } from 'src/app/services/chat.service'; @Component({ @@ -13,6 +13,7 @@ export class MessagesOptionsPage implements OnInit { constructor( private popoverController: PopoverController, + private modalController: ModalController, private chatService: ChatService, private navParams: NavParams, ) @@ -24,7 +25,12 @@ export class MessagesOptionsPage implements OnInit { } close(){ - this.popoverController.dismiss(); + if( window.innerWidth <= 1024){ + this.popoverController.dismiss(); + } + else{ + this.modalController.dismiss(); + } } closeChatRoom(){ diff --git a/src/assets/icon/icons-arrow-arrow-left.svg b/src/assets/icon/icons-arrow-arrow-left.svg new file mode 100644 index 000000000..4c329dbd3 --- /dev/null +++ b/src/assets/icon/icons-arrow-arrow-left.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/images/icons-arrow-arrow-right.svg b/src/assets/images/icons-arrow-arrow-right.svg new file mode 100644 index 000000000..02f62df57 --- /dev/null +++ b/src/assets/images/icons-arrow-arrow-right.svg @@ -0,0 +1,9 @@ + + + + + + + + + From 2c766015e7df0cacac5ea397b3a5eca149dc7d1d Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 18 Mar 2021 16:30:03 +0100 Subject: [PATCH 09/15] -style approve entents for desktop finished -style expedient for desktop ongoing --- src/app/app-routing.module.ts | 8 ++ src/app/pages/chat/chat.module.ts | 2 + src/app/pages/chat/chat.page.html | 5 +- src/app/pages/chat/chat.page.ts | 9 +- .../gabinete-digital.module.ts | 13 ++- .../gabinete-digital.page.html | 21 ++-- .../gabinete-digital.page.scss | 26 ++++- .../gabinete-digital/gabinete-digital.page.ts | 31 +++++- .../chat/empty-chat/empty-chat.page.html | 2 +- .../shared/chat/empty-chat/empty-chat.page.ts | 3 +- .../group-messages/group-messages.page.html | 2 +- .../group-messages/group-messages.page.ts | 59 ++++++++-- .../shared/chat/messages/messages.page.html | 4 +- src/app/shared/chat/messages/messages.page.ts | 63 +++++++++++ .../empty-container-routing.module.ts | 17 +++ .../empty-container/empty-container.module.ts | 20 ++++ .../empty-container/empty-container.page.html | 5 + .../empty-container/empty-container.page.scss | 5 + .../empty-container.page.spec.ts | 24 ++++ .../empty-container/empty-container.page.ts | 16 +++ .../events-to-approve-routing.module.ts | 17 +++ .../events-to-approve.module.ts | 20 ++++ .../events-to-approve.page.html | 68 ++++++++++++ .../events-to-approve.page.scss | 92 ++++++++++++++++ .../events-to-approve.page.spec.ts | 24 ++++ .../events-to-approve.page.ts | 104 ++++++++++++++++++ .../expediente/expediente.page.html | 2 +- .../chat-options-popover.page.html | 18 ++- .../chat-options-popover.page.scss | 71 +++++++----- .../chat-options-popover.page.ts | 12 +- .../chat-popover/chat-popover.page.html | 16 --- 31 files changed, 685 insertions(+), 94 deletions(-) create mode 100644 src/app/shared/empty-container/empty-container-routing.module.ts create mode 100644 src/app/shared/empty-container/empty-container.module.ts create mode 100644 src/app/shared/empty-container/empty-container.page.html create mode 100644 src/app/shared/empty-container/empty-container.page.scss create mode 100644 src/app/shared/empty-container/empty-container.page.spec.ts create mode 100644 src/app/shared/empty-container/empty-container.page.ts create mode 100644 src/app/shared/gabinete-digital/events-to-approve/events-to-approve-routing.module.ts create mode 100644 src/app/shared/gabinete-digital/events-to-approve/events-to-approve.module.ts create mode 100644 src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html create mode 100644 src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.scss create mode 100644 src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.spec.ts create mode 100644 src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 3dd13aae4..425f2122c 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -23,6 +23,14 @@ const routes: Routes = [ path: 'btn-adicionar', loadChildren: () => import('./shared/buttons/btn-adicionar/btn-adicionar.module').then( m => m.BtnAdicionarPageModule) }, + { + path: 'empty-container', + loadChildren: () => import('./shared/empty-container/empty-container.module').then( m => m.EmptyContainerPageModule) + }, + { + path: 'events-to-approve', + loadChildren: () => import('./shared/gabinete-digital/events-to-approve/events-to-approve.module').then( m => m.EventsToApprovePageModule) + }, /* { path: 'chat', diff --git a/src/app/pages/chat/chat.module.ts b/src/app/pages/chat/chat.module.ts index 340239ee6..d3e4021b0 100644 --- a/src/app/pages/chat/chat.module.ts +++ b/src/app/pages/chat/chat.module.ts @@ -32,6 +32,7 @@ import { GroupContactsPage } from 'src/app/shared/chat/group-messages/group-cont GroupMessagesPage, NewGroupPage, GroupContactsPage, + EmptyChatPage, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], entryComponents: [ @@ -40,6 +41,7 @@ import { GroupContactsPage } from 'src/app/shared/chat/group-messages/group-cont GroupMessagesPage, NewGroupPage, GroupContactsPage, + EmptyChatPage, ] }) export class ChatPageModule {} diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index 445dc5297..427672943 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -87,10 +87,7 @@
- - + diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index fc9d0e549..d97cbe1ef 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -64,9 +64,11 @@ export class ChatPage implements OnInit { showNewGroup=false; showGroupMessages=false; showGroupContacts=false; + emptyTextDescription = 'Sem conversa selecionada'; @Output() getRoomInfo; + constructor( private http:HttpClient, private chatService: ChatService, @@ -80,11 +82,6 @@ export class ChatPage implements OnInit { /* this.headers = this.headers.set('X-User-Id', 'GqjNWiLrGEHRna7Zn'); this.headers = this.headers.set('X-Auth-Token', 'SJwIgtlqfloPK696fpc2VBvyDluipuIHKB_0Q6-9ycJ'); */ } - closeAllDesktopComponent(){ - this.desktopComponent = { - showMessages: false, - } - } ngOnInit() { this.segment = "Contactos"; @@ -265,7 +262,7 @@ export class ChatPage implements OnInit { modal.onDidDismiss(); } async openMessagesModal(roomId:any){ - this.closeAllDesktopComponent(); + this.closeAllDesktopComponents(); let classs; if( window.innerWidth <= 1024){ diff --git a/src/app/pages/gabinete-digital/gabinete-digital.module.ts b/src/app/pages/gabinete-digital/gabinete-digital.module.ts index c27f2256f..f8eb0f2d4 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.module.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.module.ts @@ -10,7 +10,9 @@ import { GabineteDigitalPage } from './gabinete-digital.page'; import { SharedModule } from 'src/app/shared/shared.module'; import { EventListComponent } from 'src/app/shared/agenda/event-list/event-list.component'; -import { ExpedientePage } from 'src/app/shared/gabinete-digital/expediente/expediente.page' +import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-container.page'; +import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page'; +import { ExpedientePage } from 'src/app/shared/gabinete-digital/expediente/expediente.page'; /* import { ComponentsModule } from 'src/app/components/components.module'; */ @@ -25,7 +27,14 @@ import { ExpedientePage } from 'src/app/shared/gabinete-digital/expediente/exped declarations: [ GabineteDigitalPage, EventListComponent, - ExpedientePage + EmptyContainerPage, + EventsToApprovePage, + ExpedientePage, + ], + entryComponents: [ + EmptyContainerPage, + EventsToApprovePage, + ExpedientePage, ], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 8146870bd..8db7a198e 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -8,15 +8,13 @@ -
+
-
- - -
+ +

Gabinete Digital

-
+
@@ -69,12 +67,11 @@
- -
- - + +
+ + +
-
-
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.scss b/src/app/pages/gabinete-digital/gabinete-digital.page.scss index c60877f91..8073fc452 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.scss +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.scss @@ -107,7 +107,7 @@ ion-content{ padding: 30px 5px 30px 5px; border-radius: 15px; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07); - border: solid 1px #e9e9e9; + //border: solid 1px #e9e9e9; /* --background-color: #ffffff !important; */ background-color: #ffffff !important; float: left; @@ -153,8 +153,9 @@ ion-content{ .main-content{ .aside-wrapper{ - border: 1px solid red; + width: 40%; justify-content: flex-start !important; + border-right: 1px solid #d8d8d8; .aside-title{ font-family: Roboto; font-size: 25px; @@ -162,25 +163,38 @@ ion-content{ } } .aside-content{ + width: 60%; display: flex !important; background-color: white; } } .exp-card{ - margin: 5px auto; + display: flex; + align-items: center; + margin: 0 auto; + margin-bottom: 15px; flex-direction: row !important; width: 100%; - padding-right: 11px; - padding-bottom: 5px; - padding-top: 5px; + padding: 10px 17px 10px 17px; height: unset !important; + box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07); + .exp-card-title{ flex: 1; text-align: left; + margin-top: 0px !important; + } + .exp-card-content{ + margin: 0 !important; } .exp-card-content .title1{ display: none; + margin-top: 0px !important; + } + .exp-card-content .number{ + //display: none; + margin-top: 0px !important; } } } diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index cc9e51ebc..7c3e2a02f 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -31,6 +31,10 @@ export class GabineteDigitalPage implements OnInit { showEventList: false, showExpediente : false } + showEventsToApprove = true; + showEmptyContainer = false; + showExpedients = false; + emptyTextDescription = 'Sem opção selecionada'; constructor( private processesbackend:ProcessesService, @@ -90,6 +94,13 @@ this.processesbackend.GetActionsList().subscribe(res=>{ }); } + closeAllDesktopComponents(){ + this.showEmptyContainer = false; + this.showEventsToApprove = false; + this.showExpedients = false; + this.showExpedients = false; + } + LoadCounts() { this.showLoader = true; this.processesbackend.GetTasksList("Expediente", true).subscribe(res =>{ @@ -122,6 +133,16 @@ this.processesbackend.GetActionsList().subscribe(res=>{ notImplemented(){ this.alertService.presentAlert('Funcionalidade em desenvolvimento'); } + + openEventsToApprovePage(segment:any){ + this.closeAllDesktopComponents(); + if( window.innerWidth <= 1024){ + this.openEventsToApproveList(segment); + } + else{ + this.showEventsToApprove = true; + } + } async openEventsToApproveList(segment:any){ @@ -151,7 +172,15 @@ this.processesbackend.GetActionsList().subscribe(res=>{ //} } - + openExpedientListPage(){ + this.closeAllDesktopComponents(); + if( window.innerWidth <= 1024){ + this.openExpedientList(); + } + else{ + this.showExpedients = true; + } + } async openExpedientList(){ this.closeAllDesktopComponent(); diff --git a/src/app/shared/chat/empty-chat/empty-chat.page.html b/src/app/shared/chat/empty-chat/empty-chat.page.html index b5514095a..1d2bf5d00 100644 --- a/src/app/shared/chat/empty-chat/empty-chat.page.html +++ b/src/app/shared/chat/empty-chat/empty-chat.page.html @@ -1,5 +1,5 @@
-

Sem conversa selecionada

+

{{texto}}

diff --git a/src/app/shared/chat/empty-chat/empty-chat.page.ts b/src/app/shared/chat/empty-chat/empty-chat.page.ts index fff63b39d..c22d2189c 100644 --- a/src/app/shared/chat/empty-chat/empty-chat.page.ts +++ b/src/app/shared/chat/empty-chat/empty-chat.page.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; @Component({ selector: 'app-empty-chat', @@ -6,6 +6,7 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./empty-chat.page.scss'], }) export class EmptyChatPage implements OnInit { + @Input() texto:string; constructor() { } diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index c5971d016..789262d29 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -55,7 +55,7 @@
- +
diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index 7e3823775..3f5445438 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -187,8 +187,19 @@ export class GroupMessagesPage implements OnInit, OnChanges { return await modal.present(); } + openSendGroupMessageOptions(ev: any){ + if(window.innerWidth <= 1024){ + console.log('mobile'); + this.openChatOptions(ev); + } + else{ + console.log('desktop'); + this._openChatOptions(); + } + } - /* async openOptions(ev: any) { + + async openOptions(ev: any) { const popover = await this.popoverController.create({ component: ChatPopoverPage, cssClass: 'chat-popover', @@ -202,10 +213,7 @@ export class GroupMessagesPage implements OnInit, OnChanges { popover.onDidDismiss().then(res=>{ console.log(res); if(res.data){ - this.roomName = res.data.name.split('-').join(' '); - console.log(this.roomName); - - this.load(); + this.getRoomInfo(); //this.modalController.dismiss(); }; @@ -241,10 +249,10 @@ export class GroupMessagesPage implements OnInit, OnChanges { await modal.present(); modal.onDidDismiss().then(()=>{ - this.load(); + this.getRoomInfo(); }); } - */ + /* async actionSheet() { const actionSheet = await this.actionSheetController.create({ cssClass: 'my-custom-class', @@ -271,5 +279,42 @@ export class GroupMessagesPage implements OnInit, OnChanges { } */ + async _openChatOptions() { + + const enterAnimation = (baseEl: any) => { + const backdropAnimation = this.animationController.create() + .addElement(baseEl.querySelector('ion-backdrop')!) + .fromTo('opacity', '0.01', 'var(--backdrop-opacity)'); + + const wrapperAnimation = this.animationController.create() + .addElement(baseEl.querySelector('.modal-wrapper')!) + .keyframes([ + { offset: 0, opacity: '1', right: '-100%' }, + { offset: 1, opacity: '1', right: '0px' } + ]); + + return this.animationController.create() + .addElement(baseEl) + .easing('ease-out') + .duration(500) + .addAnimation([backdropAnimation, wrapperAnimation]); + } + + const leaveAnimation = (baseEl: any) => { + return enterAnimation(baseEl).direction('reverse'); + } + + const modal = await this.modalController.create({ + enterAnimation, + leaveAnimation, + component: ChatOptionsPopoverPage, + cssClass: 'model profile-modal search-submodal', + componentProps: { + roomId: this.roomId, + } + }); + return await modal.present(); + } + } diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index 0dda497cf..9ac6880fb 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -10,7 +10,7 @@
-
+