mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
ComponentFactoryResolver,
|
||||
ComponentRef,
|
||||
ComponentFactory,
|
||||
Output
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
import { ModalController, Platform } from '@ionic/angular';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
@@ -17,7 +17,6 @@ import { ContactsPage } from './messages/contacts/contacts.page';
|
||||
import { MessagesPage } from './messages/messages.page';
|
||||
import { NewGroupPage } from './new-group/new-group.page';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
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';
|
||||
@@ -136,6 +135,7 @@ export class ChatPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log(this.loggedUserChat);
|
||||
|
||||
this.segment = "Contactos";
|
||||
@@ -164,19 +164,23 @@ export class ChatPage implements OnInit {
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
|
||||
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/chat')) {
|
||||
//alert('OIII')
|
||||
} else {
|
||||
if (this.dataService.get("newGroup")) {
|
||||
this.openNewGroupPage();
|
||||
}
|
||||
if (this.dataService.get("newGroup")) {
|
||||
this.openNewGroupPage();
|
||||
}
|
||||
else{
|
||||
this.closeAllDesktopComponents();
|
||||
this.showEmptyComponent = true;
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.dataService.set("newGroup", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.setStatus('offline');
|
||||
this.dataService.set("newGroup", false);
|
||||
console.log('On Destroy')
|
||||
}
|
||||
|
||||
@@ -490,6 +494,13 @@ export class ChatPage implements OnInit {
|
||||
console.log('Chat list', res);
|
||||
|
||||
if (res != 200) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.userDirectMessages = res.ims.sort((a, b) => {
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
}
|
||||
//console.log(res.ims);
|
||||
/* this.userDirectMessages = res.ims.sort((a, b) => {
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
@@ -534,9 +545,10 @@ export class ChatPage implements OnInit {
|
||||
this.chatService.getAllUsers().subscribe(res => {
|
||||
console.log('chatusers', res);
|
||||
this.transformDataUserList(res['users'])
|
||||
|
||||
//this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
|
||||
//console.log(this.dmUsers);
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
|
||||
console.log(this.dmUsers);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-d
|
||||
import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-group',
|
||||
@@ -19,6 +20,7 @@ export class NewGroupPage implements OnInit {
|
||||
selectedDuration = ['','',''];
|
||||
thedate:any;
|
||||
groupName:string;
|
||||
documents:any;
|
||||
|
||||
constructor(
|
||||
private pickerController: PickerController,
|
||||
@@ -27,15 +29,18 @@ export class NewGroupPage implements OnInit {
|
||||
private navParams: NavParams,
|
||||
public ThemeService: ThemeService,
|
||||
private chatService: ChatService,
|
||||
private processesService: ProcessesService,
|
||||
)
|
||||
{
|
||||
this.isGroupCreated = false;
|
||||
this.groupName = this.navParams.get('name');
|
||||
this.documents = this.navParams.get('documents');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log(this.documents);
|
||||
}
|
||||
|
||||
_ionChange(event){
|
||||
this.showDuration = event.detail.checked;
|
||||
|
||||
@@ -52,6 +57,7 @@ export class NewGroupPage implements OnInit {
|
||||
|
||||
createGroup(){
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
//Take out all special characters in string
|
||||
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
||||
let body = { "name":name, }
|
||||
this.chatService.addGroup(body).subscribe(res=>{
|
||||
@@ -73,6 +79,39 @@ export class NewGroupPage implements OnInit {
|
||||
this.isGroupCreated = true;
|
||||
this.addContacts(res['group']);
|
||||
|
||||
if(this.documents.length > 0){
|
||||
//If there is documents add
|
||||
this.documents.forEach(async document => {
|
||||
|
||||
let url = await this.processesService.GetDocumentUrl(document.DocId, document.ApplicationId).toPromise();
|
||||
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
|
||||
let body = {
|
||||
"message":
|
||||
{
|
||||
"rid": res['group']._id,
|
||||
"msg": "",
|
||||
"attachments": [{
|
||||
"title": document.Assunto,
|
||||
"description": document.DocTypeDesc,
|
||||
"title_link": url_no_options,
|
||||
"title_link_download": true,
|
||||
//"thumb_url": "assets/images/webtrix-logo.png",
|
||||
"message_link": url_no_options,
|
||||
"type": "webtrix"
|
||||
}],
|
||||
"file":{
|
||||
"name": document.Assunto,
|
||||
"type": "application/webtrix",
|
||||
"ApplicationId": document.ApplicationType,
|
||||
"DocId": document.Id,
|
||||
"Assunto": document.Assunto,
|
||||
}
|
||||
}
|
||||
}
|
||||
this.chatService.sendMessage(body).toPromise();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -634,16 +634,16 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
openNewGroupPage() {
|
||||
this.router.navigate(['/home/chat']);
|
||||
this.dataService.set("newGroup", true);
|
||||
|
||||
if (window.innerWidth < 801) {
|
||||
this.router.navigate(['/home/chat']);
|
||||
this.newGroup();
|
||||
}
|
||||
else {
|
||||
this.dataService.set("newGroup", true);
|
||||
this.dataService.set("task", this.task);
|
||||
this.dataService.set("newGroupName", this.task.Folio);
|
||||
this.dataService.set("documents", this.fulltask.Documents);
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import { SqliteService } from '../../services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { DataService } from 'src/app/services/data.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-gabinete-digital',
|
||||
@@ -133,6 +134,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
private dataService: DataService,
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
@@ -616,7 +618,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
doRefresh(event) {
|
||||
console.log(event);
|
||||
|
||||
|
||||
this.LoadCounts();
|
||||
|
||||
if (event) {
|
||||
|
||||
@@ -130,8 +130,8 @@
|
||||
<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 class="buttons">
|
||||
<button (click)="openNewGroupPage(task)" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||
<div *ngIf="task.WorkflowName == 'Pedido de Parecer do Presidente'" class="buttons">
|
||||
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -480,17 +480,17 @@ export class PedidoPage implements OnInit {
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
openNewGroupPage(task?:any){
|
||||
this.router.navigate(['/home/chat']);
|
||||
this.dataService.set("newGroup", true);
|
||||
|
||||
if( window.innerWidth < 801){
|
||||
openNewGroupPage() {
|
||||
if (window.innerWidth < 801) {
|
||||
this.router.navigate(['/home/chat']);
|
||||
this.newGroup();
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.dataService.set("newGroup", true);
|
||||
this.dataService.set("task", this.task);
|
||||
this.dataService.set("newGroupName", this.task.Folio);
|
||||
this.dataService.set("documents", this.fulltask.Documents);
|
||||
this.router.navigate(['/home/chat']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user