diff --git a/src/app/pages/chat/messages/messages.page.html b/src/app/pages/chat/messages/messages.page.html index 8ededb7ad..13eff3f66 100644 --- a/src/app/pages/chat/messages/messages.page.html +++ b/src/app/pages/chat/messages/messages.page.html @@ -36,7 +36,7 @@
-
+
{{msg.u.name}} {{showDateDuration(msg._updatedAt)}} diff --git a/src/app/pages/chat/messages/messages.page.ts b/src/app/pages/chat/messages/messages.page.ts index 52fcb613a..cf21ce7a9 100644 --- a/src/app/pages/chat/messages/messages.page.ts +++ b/src/app/pages/chat/messages/messages.page.ts @@ -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"){ diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html index 52b14f8ef..2c4e1eb7f 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html @@ -98,7 +98,6 @@
-
diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index 310721a0b..75cf376c4 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -85,7 +85,11 @@
+
Responder ao PR
+
Reencaminhar para Área jurídica
+ +
Outras opções
diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.scss b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.scss index 592d2c19e..686e62d8f 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.scss +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.scss @@ -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; + } +} \ No newline at end of file diff --git a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts index ae7ac0da9..ccc747f4a 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedidos.page.ts @@ -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() { diff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html index 4eaf095fc..552158990 100644 --- a/src/app/shared/chat/messages/messages.page.html +++ b/src/app/shared/chat/messages/messages.page.html @@ -31,7 +31,7 @@
-
+
{{msg.u.name}} diff --git a/src/app/shared/chat/messages/messages.page.ts b/src/app/shared/chat/messages/messages.page.ts index ed7d4f333..fe12f9d27 100644 --- a/src/app/shared/chat/messages/messages.page.ts +++ b/src/app/shared/chat/messages/messages.page.ts @@ -10,6 +10,8 @@ import { ContactsPage } from '../new-group/contacts/contacts.page'; import { Router } from '@angular/router'; import { connection } from 'src/app/services/socket/synchro.service'; import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.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', @@ -38,6 +40,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy connection = connection; + chatMessageStore = ChatMessageStore + chatUserStorage = ChatUserStorage + scrollingOnce:boolean = true; private scrollChangeCallback: () => void; currentPosition: any; @@ -164,9 +169,12 @@ export class MessagesPage implements OnInit, OnChanges, 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.serverLongPull(res) /* this.chatService.subscribe(this.roomId).then(res => { @@ -176,7 +184,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy }) } - getChatMembers(){ + getChatMembers() { console.log(this.roomId); //this.showLoader = true; @@ -339,7 +347,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy }); } - async serverLongPull(){ + async serverLongPull() { + + const roomId = this.roomId this.chatService.getRoomMessages(this.roomId).subscribe(async res => { if (res == 502) { @@ -352,6 +362,7 @@ export class MessagesPage implements OnInit, OnChanges, 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"){ diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.html b/src/app/shared/popover/despachos-options/despachos-options.page.html index 362b2db56..2ac3f2577 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.html +++ b/src/app/shared/popover/despachos-options/despachos-options.page.html @@ -5,7 +5,38 @@
-
+ +
+
+
+ + + + + + +
+
+ + + + +
+
+
+
+ + + + +
+
+ +
+ +
+ +
@@ -15,6 +46,7 @@
+
diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.scss b/src/app/shared/popover/despachos-options/despachos-options.page.scss index 009bb2ba4..bfbc4ced7 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.scss +++ b/src/app/shared/popover/despachos-options/despachos-options.page.scss @@ -30,27 +30,33 @@ margin-bottom: 5px !important; margin-top: 5px !important; } -@media only screen and (max-width: 800px) { - .btn-ok, .btn-cancel, .btn-delete{ - width: 47% !important; + +.pr-options { + .btn-ok, .btn-cancel{ + width: 100% !important; } } -@media only screen and (min-width: 1024px) { - .arrow-right{ - display: flex; - justify-content: flex-end; + +@media only screen and (min-width: 1024px){ + .content{ + width: 70%; } - .btn-cancel{ - display: none; - width: 100% !important; - margin-bottom: 10px !important; + .aside-right{ + width: 30%; } - .btn-delete, .btn-ok{ - width: 100% !important; - margin-bottom: 10px !important; - margin-top: 10px !important; + } + + @media only screen and (min-width: 1140px){ + .content{ + width: 75%; } - /* .solid{ - display: block; - } */ + .aside-right{ + width: 25%; + } + } + + +.desk{ + text-align: left; + background-color: white; } \ No newline at end of file diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.ts b/src/app/shared/popover/despachos-options/despachos-options.page.ts index cacb43cf9..5741824b9 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.ts +++ b/src/app/shared/popover/despachos-options/despachos-options.page.ts @@ -9,6 +9,7 @@ import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; import { ToastService } from 'src/app/services/toast.service'; import { customTask, fullTask } from 'src/app/models/dailyworktask.model'; +import { PermissionService } from 'src/app/OtherService/permission.service'; @Component({ @@ -29,6 +30,7 @@ export class DespachosOptionsPage implements OnInit { public popoverController: PopoverController, private navParams: NavParams, private toastService: ToastService, + public p: PermissionService, ) { this.task = this.navParams.get('task') this.fulltask = this.navParams.get('fulltask') diff --git a/src/app/shared/popover/request-options/request-options.page.html b/src/app/shared/popover/request-options/request-options.page.html index 7105a6e4f..a343f7758 100644 --- a/src/app/shared/popover/request-options/request-options.page.html +++ b/src/app/shared/popover/request-options/request-options.page.html @@ -12,7 +12,7 @@
- +
@@ -22,7 +22,7 @@
- +
@@ -51,7 +51,7 @@ - +
diff --git a/src/app/store/chat-message.service.spec.ts b/src/app/store/chat/chat-message.service.spec.ts similarity index 100% rename from src/app/store/chat-message.service.spec.ts rename to src/app/store/chat/chat-message.service.spec.ts diff --git a/src/app/store/chat-message.service.ts b/src/app/store/chat/chat-message.service.ts similarity index 74% rename from src/app/store/chat-message.service.ts rename to src/app/store/chat/chat-message.service.ts index 8cc1be0b1..e9e5fe84d 100644 --- a/src/app/store/chat-message.service.ts +++ b/src/app/store/chat/chat-message.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { localstoreService } from './localstore.service' +import { localstoreService } from '../localstore.service' import { SHA1 } from 'crypto-js' @Injectable({ @@ -13,7 +13,7 @@ export class ChatMessageService { constructor() { - this.keyName = (SHA1(this.constructor.name)).toString() + this.keyName = ('chat'+SHA1(this.constructor.name)).toString() setTimeout(()=> { let restore = localstoreService.get(this.keyName, {}) @@ -22,18 +22,22 @@ export class ChatMessageService { } + get message() { + return this._message + } + getMessages(roomId) { return this._message[roomId] || [] } - add(roomId, message) { + add(roomId:string, message: any[]) { this._message[roomId] = message setTimeout(()=> { localstoreService.set(this.keyName, { message: this._message }) - }, 5000) + }, 10) } } diff --git a/src/app/store/chat/chat-user.service.spec.ts b/src/app/store/chat/chat-user.service.spec.ts new file mode 100644 index 000000000..089b979cf --- /dev/null +++ b/src/app/store/chat/chat-user.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { ChatUserService } from './chat-user.service'; + +describe('ChatUserService', () => { + let service: ChatUserService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(ChatUserService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/store/chat/chat-user.service.ts b/src/app/store/chat/chat-user.service.ts new file mode 100644 index 000000000..1fa1166b2 --- /dev/null +++ b/src/app/store/chat/chat-user.service.ts @@ -0,0 +1,46 @@ +import { Injectable } from '@angular/core'; +import { localstoreService } from '../localstore.service' +import { SHA1 } from 'crypto-js' + +@Injectable({ + providedIn: 'root' +}) +export class ChatUserService { + + // main data + private _userList = [] + // local storage keyName + private keyName: string; + + constructor() { + + this.keyName = ('chat'+SHA1(this.constructor.name)).toString() + + setTimeout(()=>{ + let restore = localstoreService.get(this.keyName, []) + this._userList = restore.userList + }, 10) + + } + + get userList() { + return this._userList + } + + reset(userList: any[]) { + this._userList = userList + + this.save() + } + + private save() { + setTimeout(()=> { + localstoreService.set(this.keyName, { + userList: this._userList + }) + }, 10) + } +} + + +export const ChatUserStorage = new ChatUserService()