mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -18,9 +18,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="div-icon">
|
<div class="div-icon">
|
||||||
|
|
||||||
<button (click)="openChatDebuggingPageModal()" title="Nova Conversa Individual" class="btn-no-color font-12">
|
<!-- <button (click)="openChatDebuggingPageModal()" title="Nova Conversa Individual" class="btn-no-color font-12">
|
||||||
Dev
|
Dev
|
||||||
</button>
|
</button> -->
|
||||||
<button title="Nova Conversa Individual" class="btn-no-color" (click)="openContactsPage()">
|
<button title="Nova Conversa Individual" class="btn-no-color" (click)="openContactsPage()">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src="assets/images/icons-chat-new-conversation.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src="assets/images/icons-chat-new-conversation.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src="assets/images/theme/gov/icons-chat-new-conversation.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src="assets/images/theme/gov/icons-chat-new-conversation.svg"></ion-icon>
|
||||||
@@ -213,6 +213,7 @@
|
|||||||
(addGroupMessage)="openGroupContactsPage($event)"
|
(addGroupMessage)="openGroupContactsPage($event)"
|
||||||
(closeAllDesktopComponents)="closeAllDesktopComponents()"
|
(closeAllDesktopComponents)="closeAllDesktopComponents()"
|
||||||
[style.display]="showNewGroup ? 'flex' : 'none'"
|
[style.display]="showNewGroup ? 'flex' : 'none'"
|
||||||
|
*ngIf="showNewGroup"
|
||||||
class=" height-100 flex-column">
|
class=" height-100 flex-column">
|
||||||
</app-new-group>
|
</app-new-group>
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { MessagesPage } from './messages/messages.page';
|
|||||||
import { NewGroupPage } from './new-group/new-group.page';
|
import { NewGroupPage } from './new-group/new-group.page';
|
||||||
import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
|
import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
|
||||||
import { Subject } from "rxjs/Rx";
|
import { Subject } from "rxjs/Rx";
|
||||||
import { NavigationStart, Router } from '@angular/router';
|
import { NavigationStart, Router, NavigationEnd } from '@angular/router';
|
||||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
@@ -142,30 +142,29 @@ export class ChatPage implements OnInit {
|
|||||||
this.hideRefreshButton();
|
this.hideRefreshButton();
|
||||||
this.getChatMembers();
|
this.getChatMembers();
|
||||||
|
|
||||||
let t = this.showDateDuration(new Date());
|
|
||||||
|
|
||||||
|
this.checkCreateGroup();
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
|
|
||||||
|
if (event instanceof NavigationEnd && event.url == '/home/chat' ||
|
||||||
|
event instanceof NavigationEnd && event.url == "/home/chat?gbCreateGroup=true") {
|
||||||
|
this.checkCreateGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCreateGroup() {
|
||||||
if (this.dataService.get("newGroup")) {
|
if (this.dataService.get("newGroup")) {
|
||||||
this.openNewGroupPage();
|
this.openNewGroupPage();
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.closeAllDesktopComponents();
|
this.closeAllDesktopComponents();
|
||||||
this.showEmptyComponent = true;
|
this.showEmptyComponent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this.router.events.forEach((event) => {
|
|
||||||
if (event instanceof NavigationStart || event.url.endsWith('/home/chat')) {
|
|
||||||
if (this.dataService.get("newGroup")) {
|
|
||||||
this.openNewGroupPage();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.closeAllDesktopComponents();
|
|
||||||
this.showEmptyComponent = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.dataService.set("newGroup", false);
|
|
||||||
}
|
|
||||||
}); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
numSequence(n: number): Array<number> {
|
numSequence(n: number): Array<number> {
|
||||||
@@ -174,7 +173,6 @@ export class ChatPage implements OnInit {
|
|||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.setStatus('offline');
|
this.setStatus('offline');
|
||||||
this.dataService.set("newGroup", false);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-3
@@ -3,7 +3,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
|||||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||||
import { EventsService } from 'src/app/services/events.service';
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||||
import { Event } from '../../../../models/event.model';
|
import { Event } from '../../../../models/event.model';
|
||||||
import { ModalController, PopoverController } from '@ionic/angular';
|
import { ModalController, PopoverController } from '@ionic/angular';
|
||||||
import { ExpedientTaskModalPage } from '../expedient-task-modal/expedient-task-modal.page';
|
import { ExpedientTaskModalPage } from '../expedient-task-modal/expedient-task-modal.page';
|
||||||
@@ -656,7 +656,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
openNewGroupPage() {
|
openNewGroupPage() {
|
||||||
if (window.innerWidth < 701) {
|
if (window.innerWidth < 701) {
|
||||||
this.router.navigate(['/home/chat']);
|
|
||||||
this.newGroup();
|
this.newGroup();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -666,7 +665,9 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
this.dataService.set("task", this.task);
|
this.dataService.set("task", this.task);
|
||||||
this.dataService.set("newGroupName", this.task.Folio);
|
this.dataService.set("newGroupName", this.task.Folio);
|
||||||
this.dataService.set("documents", this.fulltask.Documents);
|
this.dataService.set("documents", this.fulltask.Documents);
|
||||||
this.router.navigate(['/home/chat']);
|
setTimeout(()=> {
|
||||||
|
this.router.navigate(['/home/chat']);
|
||||||
|
}, 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ export class RoomService {
|
|||||||
this.countDownTime = "Expired";
|
this.countDownTime = "Expired";
|
||||||
let body = { "roomId": this.id }
|
let body = { "roomId": this.id }
|
||||||
|
|
||||||
this.chatService.getRoomInfo(this.id).subscribe(room=>{
|
this.chatService.getRoomInfo(this.id).subscribe( room =>{
|
||||||
|
|
||||||
|
|
||||||
if(this.t === 'p') {
|
if(this.t === 'p') {
|
||||||
|
|||||||
@@ -218,8 +218,6 @@ export class WsChatMethodsService {
|
|||||||
|
|
||||||
|
|
||||||
await this.storage.set('Rooms', rooms);
|
await this.storage.set('Rooms', rooms);
|
||||||
console.log("Done")
|
|
||||||
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.sortRoomList()
|
this.sortRoomList()
|
||||||
@@ -247,7 +245,6 @@ export class WsChatMethodsService {
|
|||||||
*/
|
*/
|
||||||
subscribeToRoom() {
|
subscribeToRoom() {
|
||||||
|
|
||||||
console.log('subcribe/////////////////////////////////')
|
|
||||||
for (const id in this.dm) {
|
for (const id in this.dm) {
|
||||||
this.defaultSubtribe(id)
|
this.defaultSubtribe(id)
|
||||||
}
|
}
|
||||||
@@ -297,15 +294,11 @@ export class WsChatMethodsService {
|
|||||||
this.WsChatService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
|
this.WsChatService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
|
||||||
const room = this.getRoomById(id);
|
const room = this.getRoomById(id);
|
||||||
room.status.receive.readMessage = true;
|
room.status.receive.readMessage = true;
|
||||||
// console.log(subscription, "subStreamNotifyRoom");
|
|
||||||
//
|
|
||||||
})
|
})
|
||||||
|
|
||||||
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription) => {
|
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription) => {
|
||||||
const room = this.getRoomById(id);
|
const room = this.getRoomById(id);
|
||||||
room.status.receive.deleteMessage = true;
|
room.status.receive.deleteMessage = true;
|
||||||
// console.log(subscription);
|
|
||||||
//
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,7 +355,6 @@ export class WsChatMethodsService {
|
|||||||
|
|
||||||
this.dm[roomId] = room
|
this.dm[roomId] = room
|
||||||
this._dm.push(room)
|
this._dm.push(room)
|
||||||
// console.log(this._dm)
|
|
||||||
this.dmCount++
|
this.dmCount++
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { Injectable } from '@angular/core';
|
|||||||
export class DataService {
|
export class DataService {
|
||||||
|
|
||||||
|
|
||||||
private data = {}
|
data = {}
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
set(name: string, value: any) {
|
set(name: string, value: any) {
|
||||||
|
|||||||
@@ -48,23 +48,14 @@ export class NewGroupPage implements OnInit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.router.events.forEach((event) => {
|
this.task = this.dataService.get("task");
|
||||||
if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
|
this.groupName = this.task.Folio;
|
||||||
if (this.dataService.get("newGroup")) {
|
this.documents = this.dataService.get("documents");
|
||||||
this.task = this.dataService.get("task");
|
console.log(this.dataService.data);
|
||||||
this.groupName = this.task.Folio;
|
this.dataService.set("newGroup", false);
|
||||||
this.documents = this.dataService.get("documents");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.dataService.set("newGroup", false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_ionChange(event){
|
_ionChange(event) {
|
||||||
|
|
||||||
|
|
||||||
this.showDuration = event.detail.checked;
|
this.showDuration = event.detail.checked;
|
||||||
|
|
||||||
@@ -77,7 +68,7 @@ export class NewGroupPage implements OnInit{
|
|||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
|
this.dataService.set("newGroup", false);
|
||||||
this.addGroupMessage.emit();
|
this.addGroupMessage.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user