Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer

This commit is contained in:
Peter Maquiran
2021-07-27 09:35:05 +01:00
6 changed files with 78 additions and 37 deletions
+20 -18
View File
@@ -38,56 +38,58 @@
</ion-segment-button>
</ion-segment>
</ion-toolbar>
<div class="overflow-y-auto d-flex flex-wrap flex-grow-1">
<div class=" aside overflow-y-auto d-flex flex-wrap flex-grow-1">
<div class="width-100" [ngSwitch]="segment">
<ion-list *ngSwitchCase="'Contactos'">
<ion-item-group>
<ion-item-sliding>
<ion-item class="item width-100 d-flex" *ngFor="let dm of userDirectMessages">
<div class="item width-100 d-flex ion-no-padding ion-no-margin"
*ngFor="let dm of userDirectMessages"
[class.item-active]="dm._id ==idSelected">
<div class="item-icon">
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
</div>
<div (click)="openMessagesPage(dm._id)" class="item-content flex-grow-1"><!-- (click)="openMessages(dm)" -->
<div [class.highlight]="dm._id =='cjFv5XfreKz5j3fWW'"
(click)="openMessagesPage(dm._id)"
class="item-content flex-grow-1"><!-- (click)="openMessages(dm)" -->
<div class="item-title-time">
<div class="item-title">
<div class="item-title" [class.item-title-active]="dm._id == idSelected">
<ion-label *ngFor="let user of dm.usernames">
<span *ngIf="user !=loggedUserChat.me.username">
{{user}}
</span>
</ion-label>
</div>
<div class="item-date">{{dm._updatedAt | date: 'HH:mm'}}</div>
<div class="item-date" [class.item-date-active]="dm._id == idSelected">{{dm._updatedAt | date: 'HH:mm'}}</div>
</div>
<div class="item-description">
<div class="item-description" [class.item-description-active]="dm._id == idSelected">
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
</div>
</div>
</ion-item>
</div>
</ion-item-sliding>
</ion-item-group>
</ion-list>
<ion-list *ngSwitchCase="'Grupos'" >
<ion-item-group>
<ion-item-sliding>
<div *ngFor="let group of allGroups" class="item d-flex">
<div *ngFor="let group of allGroups"
[class.item-active]="group._id ==idSelected"
class="item d-flex">
<div class="item-icon">
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
</div>
<div (click)="openGroupMessagesPage(group._id)" class="item-content flex-grow-1">
<div
(click)="openGroupMessagesPage(group._id)" class="item-content flex-grow-1">
<div class="item-title-time">
<div class="item-title">
<div class="item-title" [class.item-title-active]="group._id ==idSelected">
<ion-label>{{group.name.split('-').join(' ')}}</ion-label>
</div>
<div class="item-date" *ngIf="group.lastMessage">{{group.lastMessage._updatedAt | date: 'HH:mm'}}</div>
<div class="item-date" [class.item-date-active]="group._id ==idSelected" *ngIf="group.lastMessage">{{group.lastMessage._updatedAt | date: 'HH:mm'}}</div>
</div>
<div class="item-description" *ngIf="group.lastMessage">
<div class="item-description" [class.item-description-active]="group._id ==idSelected" *ngIf="group.lastMessage">
<ion-label>{{group.lastMessage.u.name}}: {{group.lastMessage.msg}}</ion-label>
</div>
</div>
</div>
</ion-item-sliding>
</ion-item-group>
</ion-list>
</div>
<!-- <button (click)="sendMsg()" style="height: 41px;">Send message</button> -->
@@ -108,7 +110,7 @@
[style.display]="showMessages ? 'flex' : 'none'"
[roomId]="roomId"
[showMessages]="showMessages" #messagecontainer>
</app-messages>
<app-contacts
(openMessage)="openMessagesPage($event)"
+29 -2
View File
@@ -45,7 +45,14 @@ ion-content{
.aside-wrapper{
margin: 0 !important;
padding: 30px 20px 0 20px !important;
.title-content{
padding: 30px 20px 0 20px !important;
}
.aside{
padding: 0 !important;
}
}
.iconschatnew-group{
@@ -66,6 +73,7 @@ ion-content{
.item{
width: 100%;
border-bottom: 1px solid #ebebeb;
padding: 0px 20px 0 20px !important;
overflow: auto;
.item-icon{
@@ -79,8 +87,9 @@ ion-content{
}
.item-content{
width: 317px;
float:right
float:right;
}
.item-title-time{
width: 100%;
overflow: auto;
@@ -92,6 +101,9 @@ ion-content{
font-size: 15px;
color: #0d89d1;
}
.item-title-active{
color: #fff;
}
.item-date{
width: 20%;
float: right;
@@ -99,10 +111,20 @@ ion-content{
color: #797979;
text-align: right;
}
.item-date-active{
color: #fff;
}
.item-description{
font-size: 13px;
color: #000;
}
.item-description-active{
color: #fff;
}
}
.item-active{
color: #fff !important;
background-color: #42b9fe !important;
}
@media only screen and (min-width: 801px) {
.main-content{
@@ -135,3 +157,8 @@ ion-content{
}
}
.highlight {
color: #fff !important;
background-color: #42b9fe !important;
}
+6
View File
@@ -22,6 +22,7 @@ import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
import * as Rx from "rxjs/Rx";
import { Message } from 'src/app/models/message.model';
import { Observable, Subject } from "rxjs/Rx";
import { Router } from '@angular/router';
@Component({
selector: 'app-chat',
@@ -49,6 +50,7 @@ export class ChatPage implements OnInit {
userDirectMessages: any[];
result:any;
dmUsers:any;
idSelected: string;
desktopComponent: any = {
showMessages: false,
@@ -100,6 +102,7 @@ export class ChatPage implements OnInit {
private authService: AuthService,
private storage:Storage,
private resolver: ComponentFactoryResolver,
private router: Router,
){
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.headers = new HttpHeaders();
@@ -177,8 +180,10 @@ hideRefreshButton(){
}
}
openMessagesPage(rid) {
this.idSelected = rid;
if( window.innerWidth < 801){
this.openMessagesModal(rid);
//this.router.navigate(['/home/chat/messages',rid,]);
}
else{
this.closeAllDesktopComponents();
@@ -220,6 +225,7 @@ hideRefreshButton(){
}
openGroupMessagesPage(rid) {
this.idSelected = rid;
console.log(rid);
if( window.innerWidth < 801){
+8 -2
View File
@@ -1,5 +1,5 @@
import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import {Router} from '@angular/router'
import {ActivatedRoute, Router} from '@angular/router'
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { Status } from 'src/app/models/chat/status.model';
import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page';
@@ -38,8 +38,14 @@ export class MessagesPage implements OnInit, AfterViewChecked {
private authService: AuthService,
private alertService: AlertService,
private toastService: ToastService,
private route: Router
private route: Router,
private activatedRoute: ActivatedRoute,
) {
/* this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
this.roomId = params["params"].roomId;
}
}); */
this.loggedUser = authService.ValidatedUserChat['data'];
this.roomId = this.navParams.get('roomId');
}
@@ -260,7 +260,7 @@ export class ExpedienteDetailPage implements OnInit {
try {
await this.processes.CompleteTask(otherbody).toPromise()
this.toastService.successMessage('Processo descartado');
//this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService.badRequest('Processo não descartado')
@@ -278,7 +278,7 @@ export class ExpedienteDetailPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage('Processo descartado');
//this.toastService.successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService.badRequest('Processo não descartado')