add headers to options

This commit is contained in:
Peter Maquiran
2021-08-24 14:07:27 +01:00
parent 567209ed4b
commit 019b85d209
16 changed files with 184 additions and 32 deletions
@@ -36,7 +36,7 @@
</ion-refresher-content>
</ion-refresher>
<div class="messages" #scrollMe>
<div *ngFor="let msg of messages; let last = last" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<div *ngFor="let msg of chatMessageStore.message[roomId] ; let last = last" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
+12 -1
View File
@@ -9,6 +9,8 @@ import { connection } from 'src/app/services/socket/synchro.service';
import { ToastService } from 'src/app/services/toast.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 { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
@Component({
selector: 'app-messages',
@@ -32,6 +34,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
scrollingOnce:boolean = true;
connection = connection;
chatMessageStore = ChatMessageStore
chatUserStorage = ChatUserStorage
private scrollChangeCallback: () => void;
currentPosition: any;
@@ -146,9 +150,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
loadMessages() {
this.showLoader = true;
const roomId = this.roomId
this.chatService.getRoomMessages(this.roomId).subscribe(res => {
/* console.log(res); */
this.messages = res['messages'].reverse();
this.chatMessageStore.add(roomId, this.messages)
console.log(this.messages);
this.showLoader = false;
})
@@ -245,7 +252,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async serverLongPull() {
this.chatService.getRoomMessages(this.roomId).subscribe(async res => {
const roomId = this.roomId
this.chatService.getRoomMessages(roomId).subscribe(async res => {
if (res == 502) {
// Connection timeout
@@ -257,6 +266,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
//showMessage(response.statusText);
//this.loadMessages()
this.messages = res['messages'].reverse();
this.chatMessageStore.add(roomId, this.messages)
console.log(this.messages);
// Reconnect in one second
if(this.route.url != "/home/chat"){
@@ -98,7 +98,6 @@
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
</div>
<div *ngIf="!task" class="px-20">
@@ -85,7 +85,11 @@
<div *ngIf="task" class="aside-right flex-column height-100">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
<div class="option-desc"> <div>Responder ao PR</div> </div>
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
<div class="option-desc">Reencaminhar para Área jurídica</div>
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button>
<div class="option-desc">Outras opções</div>
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
@@ -195,3 +195,19 @@ ion-button{
width: 25%;
}
}
.option-desc {
display: flex;
color: #828282;
width: 100%;
justify-content: space-between;
align-items: center;
font-size: 11pt;
.option-desc-line {
height: 1px;
flex-grow: 1;
background-color: #e0e0e0;
padding-left: 4px;
}
}
@@ -6,6 +6,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController, NavParams } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { PedidosStore } from 'src/app/store/pedidos-store.service';
import { ModalService } from 'src/app/services/modal.service';
@Component({
selector: 'app-pedidos',
templateUrl: './pedidos.page.html',
@@ -37,6 +38,7 @@ export class PedidosPage implements OnInit {
private modalController: ModalController,
private alertService: AlertService,
private activatedRoute: ActivatedRoute,
private modalService: ModalService
) {
//Inicializar segment
this.segment = 'parecer';
@@ -49,6 +51,9 @@ export class PedidosPage implements OnInit {
}
});
const modal = this.modalService.BookMeetingModalPage({task: ''},{})
}
ngOnInit() {