diff --git a/src/app/pages/chat/chat.page.scss b/src/app/pages/chat/chat.page.scss index 8c5e7498a..90dfdab01 100644 --- a/src/app/pages/chat/chat.page.scss +++ b/src/app/pages/chat/chat.page.scss @@ -33,18 +33,17 @@ ion-content{ .main-content{ - width: 100%; - height: 100%; font-family: Roboto; margin: 0 auto; background-color: #fff; border-top-left-radius: 25px; border-top-right-radius: 25px; + overflow: auto; .aside-wrapper{ - padding: 0 !important; margin: 0 !important; + padding: 30px 20px 0 20px !important; } .iconschatnew-group{ @@ -109,8 +108,7 @@ ion-content{ .aside-wrapper{ - width: 40%; - padding: 30px 20px 0 20px !important; + width: 35%; border-right: 1px solid #d8d8d8; .aside-title{ font-size: 25px; @@ -120,7 +118,7 @@ ion-content{ width: 340px; } */ .aside-content{ - width: 60%; + width: 65%; display: flex !important; background-color: white; } diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index d97cbe1ef..9f4690cb8 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -136,7 +136,7 @@ export class ChatPage implements OnInit { this.closeAllDesktopComponents(); if( window.innerWidth <= 1024){ - //this.selectContact(); + this.selectContact(); } else{ console.log('here'); diff --git a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html index f63a629a8..7b473c119 100644 --- a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html +++ b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html @@ -36,7 +36,7 @@

{{user.name}}

- +
@@ -50,7 +50,7 @@

{{user.name}}

- +
diff --git a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.scss b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.scss index 829026a52..b6e007730 100644 --- a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.scss +++ b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.scss @@ -136,6 +136,21 @@ color:#99e47b; margin-left: 10px; } + .online{ + color:#99e47b !important; + } + .offline{ + color:#cbced1 !important; + } + .away{ + color:#ffd21f !important; + } + .invisible{ + color:#cbced1 !important; + } + .busy{ + color:#f5455c !important; + } } \ No newline at end of file diff --git a/src/app/pages/chat/group-messages/group-messages.page.html b/src/app/pages/chat/group-messages/group-messages.page.html index 0f69171a8..24581eacf 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.html +++ b/src/app/pages/chat/group-messages/group-messages.page.html @@ -50,7 +50,7 @@ - + + --> + + +
+
+ +
+
+ + + + +
+
+ +
+
diff --git a/src/app/pages/chat/group-messages/group-messages.page.scss b/src/app/pages/chat/group-messages/group-messages.page.scss index 08390cfcc..f1acc3533 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.scss +++ b/src/app/pages/chat/group-messages/group-messages.page.scss @@ -137,38 +137,57 @@ float: right; } } + .online{ + color:#99e47b !important; + } + .offline{ + color:#cbced1 !important; + } + .away{ + color:#ffd21f !important; + } + .invisible{ + color:#cbced1 !important; + } + .busy{ + color:#f5455c !important; + } } ion-footer{ - .row{ - width: 380px; - margin: 0 auto; - } + padding-top: 7.5px; + padding-bottom: 7.5px; + .container{ + justify-content: center; + justify-content: space-evenly; + + } + + .chat-icon-options{ + display:block !important; + font-size: 25px; + float: right !important; + margin-top: 10px; + } - .chat-icon-options{ - display:block !important; - font-size: 25px; - float: right !important; - margin-top: 10px; - } - - .chat-icon-send{ - font-size: 45px; - margin: 0 auto; - margin-top: 4px; - } + .chat-icon-send{ + font-size: 45px; + margin: 0 auto; + margin-top: 4px; + } .type-message{ - display: flex; - border: 1px solid #ebebeb; - border-radius: 25px; - padding-left: 15px; - align-items: center; - overflow: auto; + display: flex; + border: 1px solid #ebebeb; + border-radius: 25px; + padding-left: 15px; + align-items: center; + overflow: auto; - ion-textarea{ - margin: 0 !important; - align-self: center; - } - } - } \ No newline at end of file + ion-textarea{ + margin: 0 !important; + align-self: center; + } + } + +} \ No newline at end of file diff --git a/src/app/pages/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index 0668b7eac..c8802c92d 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -44,7 +44,8 @@ - + + + --> + + +
+
+ +
+
+ + + + +
+
+ +
+
\ No newline at end of file diff --git a/src/app/pages/chat/messages/messages.page.scss b/src/app/pages/chat/messages/messages.page.scss index 7299ad24a..1a67bbcda 100644 --- a/src/app/pages/chat/messages/messages.page.scss +++ b/src/app/pages/chat/messages/messages.page.scss @@ -150,39 +150,43 @@ } ion-footer{ - .row{ - width: 380px; - margin: 0 auto; - } - - .chat-icon-options{ - display:block !important; - font-size: 25px; - float: right !important; - margin-top: 10px; - } - - .chat-icon-send{ - font-size: 45px; - margin: 0 auto; - margin-top: 4px; - } - - .type-message{ - display: flex; - border: 1px solid #ebebeb; - border-radius: 25px; - padding-left: 15px; - align-items: center; - overflow: auto; - - ion-textarea{ - margin: 0 !important; - align-self: center; - } - } - + padding-top: 7.5px; + padding-bottom: 7.5px; + .container{ + justify-content: center; + justify-content: space-evenly; + } + + .chat-icon-options{ + display:block !important; + font-size: 25px; + float: right !important; + margin-top: 10px; + } + + .chat-icon-send{ + font-size: 45px; + margin: 0 auto; + margin-top: 4px; + } + + .type-message{ + display: flex; + border: 1px solid #ebebeb; + border-radius: 25px; + padding-left: 15px; + align-items: center; + overflow: auto; + + ion-textarea{ + margin: 0 !important; + align-self: center; + overflow: auto; + } + } + +} .text-color-blue{ font-size: 15px; 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 4baa1e7a5..c0f241913 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 @@ -19,21 +19,21 @@ - + -
-
+
+
Contactos selecção:

{{user.name}}

- +
@@ -47,7 +47,7 @@
{{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 876e8cf68..b681605ce 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 @@ -73,7 +73,7 @@ } .main-content{ - width: 100%; + //width: 100%; height: 100%; font-family: Roboto; margin: 0 auto; @@ -81,15 +81,24 @@ padding: 0 0 0 0; overflow:auto; + .members{ + padding: 15px 20px 0 20px !important; + + .members-list{ + margin: 0 !important; + padding: 0 !important; + } + } + .members-label{ - margin: 10px 20px 10px 20px !important; + //margin: 10px 20px 10px 20px !important; /* font-size: 15px; */ font-weight: bold; } .members-checkbox{ display: flex; - margin: .5px 20px .5px 20px !important; + //margin: 0px 20px 0px 20px !important; overflow: auto; align-items: center; @@ -124,8 +133,22 @@ } .icon, .members-checkbox ion-icon{ font-size: 10px; - color:#99e47b; } + .online{ + color:#99e47b !important; + } + .offline{ + color:#cbced1 !important; + } + .away{ + color:#ffd21f !important; + } + .invisible{ + color:#cbced1 !important; + } + .busy{ + color:#f5455c !important; + } } \ No newline at end of file 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 8c2c6dea7..3b6091d09 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 @@ -56,18 +56,46 @@ export class GroupContactsPage implements OnInit { ngOnInit() { //this.getRoomInfo(); - this.loadUsers(); + //this.loadUsers(); console.log(this.roomId); + this.getChatInfo(); //console.log(this.isGroupCreated); } + getChatInfo(){ + console.log('HERE'); + this.chatService.getRoomInfo(this.roomId).subscribe(room=>{ + console.log('HERE 2'); + console.log(room['room']); + this.getGroupContacts(room['room']); + }); + } + + getGroupContacts(room:any){ + this.showLoader = true; + if(room.t === 'p'){ + this.chatService.getGroupMembers(this.roomId).subscribe(res=>{ + this.members = res['members']; + this.loadUsers1(this.members); + this.showLoader = false; + }); + } + else{ + this.chatService.getChannelMembers(this.roomId).subscribe(res=>{ + this.members = res['members']; + this.loadUsers1(this.members); + this.showLoader = false; + }); + } + } + updateGroup(){ this.showLoader = true; this.chatService.getRoomInfo(this.roomId).subscribe(room=>{ this.room = room['room']; this.addContacts(this.room); this.showLoader = false; - this.openGroupMessage.emit(this.room._id) + this.openGroupMessage.emit(this.room._id); }); } openGroupMessagesPage(){ @@ -76,11 +104,44 @@ export class GroupContactsPage implements OnInit { this.showLoader = false; } + loadUsers1(members:any){ + this.options = { + headers: this.headers, + }; + this.chatService.getAllUsers().subscribe((res:any)=>{ + + + + if(members){ + this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id)); + } + else{ + this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username); + } + + this.users = this.contacts.sort((a,b) => { + if(a.name < b.name){ + return -1; + } + if(a.name > b.name){ + return 1; + } + return 0; + }); + console.log(this.users); + + this.showLoader = false; + }); + } + loadUsers(){ this.options = { headers: this.headers, }; this.chatService.getAllUsers().subscribe((res:any)=>{ + + + if(this.members){ this.contacts = res.users.filter(f => !this.members.some(item => item._id === f._id)); } @@ -146,16 +207,16 @@ export class GroupContactsPage implements OnInit { onChange(event){ this.textSearch = event.detail.value; } + clicked(){ console.log('clicked'); - } + selectedContact(user:any){ /* this.groupName = this.room.name; */ user.isChecked = !user.isChecked; - - } + addContacts(room:any){ console.log(room); this.selectedUserList = this.users.filter(function(contact) { diff --git a/src/app/shared/chat/messages/contacts/contacts.page.ts b/src/app/shared/chat/messages/contacts/contacts.page.ts index d52746222..68df0176b 100644 --- a/src/app/shared/chat/messages/contacts/contacts.page.ts +++ b/src/app/shared/chat/messages/contacts/contacts.page.ts @@ -42,8 +42,8 @@ export class ContactsPage implements OnInit { ngOnInit() { this.loadUsers(); - } + onChange(event){ this.textSearch = event.detail.value; } @@ -70,6 +70,7 @@ export class ContactsPage implements OnInit { }; this.chatService.getAllUsers().subscribe((res:any)=>{ console.log(res.users); + //this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username); this.contacts = res.users.filter(data => data.username != this.loggedUser.me.username); this.users = this.contacts.sort((a,b) => { if(a.name < b.name){