merge with developer

This commit is contained in:
Eudes Inácio
2021-09-21 06:16:06 +01:00
42 changed files with 934 additions and 296 deletions
@@ -14,6 +14,7 @@
<ion-content>
<div class="main-content">
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
<ion-input placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
</div>
@@ -166,7 +166,7 @@ export class EditEventPage implements OnInit {
const str: any = this.postEvent.EventRecurrence.Type.toString()
this.postEvent.EventRecurrence.Type = str
}
this.Form = new FormGroup({
Subject: new FormControl(this.postEvent.Subject, [
Validators.required,
@@ -16,7 +16,7 @@
<ion-icon class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
</button>
<button class="btn-no-color" (click)="deleteEvent()">
<ion-icon class="delete" name="trash-sharp"></ion-icon>
<ion-icon class="delete" name="trash-sharp"></ion-icon>
</button>
</div>
@@ -32,14 +32,14 @@
<div class="content-location">
<span class="date">{{loadedEvent.Location}}</span>
<div *ngIf="loadedEvent.Organizer">
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Presidente da República' ">
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #99e47b;">{{loadedEvent.CalendarName}}</span>
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #958bfc;">{{loadedEvent.CalendarName}}</span>
</div>
<div *ngIf="loadedEvent.Organizer.Name == 'Agenda do Ministro e Director do Gabinete do PR' ">
<span class="label" *ngIf="loadedEvent.CalendarName == 'Oficial' " style="background-color: #ffb703;">{{loadedEvent.CalendarName}}</span>
<span class="label" *ngIf="loadedEvent.CalendarName == 'Pessoal' " style="background-color: #f05d5e;">{{loadedEvent.CalendarName}}</span>
@@ -77,7 +77,7 @@
<div class="line"></div>
</div>
</div>
<div *ngIf="loadedEvent.Attachments" class="bottom-content width-100">
<h5>Documentos Anexados</h5>
<ion-list class="width-100">
@@ -101,7 +101,7 @@
</ion-list>
</div>
<!-- <div class="line"></div> -->
</div>
</ion-content>
</div>
</ion-content>
@@ -63,6 +63,11 @@ export class ViewEventPage implements OnInit {
//this.getAttachments();
}
doRefresh(ev){
this.loadEvent();
ev.target.complete();
}
ngOnChanges(changes: any): void {
this.loadedAttachments = null;
this.loadEvent();
@@ -115,7 +120,7 @@ export class ViewEventPage implements OnInit {
if (this.loadedEvent.IsRecurring) {
} else {
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () => {
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
this.toastService.successMessage('Evento apagado');
this.close();
});
@@ -39,13 +39,29 @@
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div>
<div class="container-width-100" *ngFor="let msg of messages; let last = last" #scrollMe>
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
<div *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
</div>
<div>
<div class="message">
<ion-label>{{msg.msg}}</ion-label>
<div *ngIf="msg.attachments" class="message-attachments">
<div *ngFor="let file of msg.attachments">
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
<div *ngIf="file.thumb_url">
<div class="file d-flex">
<ion-thumbnail slot="start">
<img src="{{file.thumb_url}}" alt="image">
</ion-thumbnail>
<ion-label class="file-details">
<h3 (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">{{file.title}}</h3>
<p *ngIf="file.text">{{file.text}}</p>
</ion-label>
</div>
</div>
</div>
</div>
{{last ? scrollToBottom() : ''}}
</div>
</div>
@@ -53,11 +69,24 @@
<ion-label>Alterou o nome do grupo para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
{{last ? scrollToBottom() : ''}}
</div>
<div *ngIf="msg.t == 'ul'" class="info-text-leave">
<div *ngFor="let user of allUsers">
<div *ngIf="msg.msg == user.username">
<ion-label>{{user.name}} saiu do grupo</ion-label><br />
</div>
</div>
{{last ? scrollToBottom() : ''}}
</div>
<div *ngIf="msg.t == 'ru'" class="info-text-leave">
<div *ngFor="let user of allUsers">
<div *ngIf="msg.msg == user.username">
<ion-label>{{user.name}} foi removido do grupo</ion-label><br />
</div>
</div>
{{last ? scrollToBottom() : ''}}
</div>
</div>
</div>
<div *ngIf="leaveStatus" class="info-text-leave">
<ion-label>{{leaveStatus}}</ion-label>
</div>
</ion-content>
@@ -144,19 +144,41 @@
float: right;
}
.title{
display: inline;
color: #0782c9;
font-weight: bold;
margin-bottom: 5px;
display: inline;
color: #0782c9;
font-weight: bold;
margin-bottom: 5px;
.time{
color: #797979;
text-align: right;
margin-left: 10px;
float: right;
.time{
color: #797979;
text-align: right;
margin-left: 10px;
float: right;
}
}
}
}
.message{
.message-attachments{
.file{
align-items: center;
.file-details{
width: 100%;
.file-title{
color: #000;
text-decoration: underline;
white-space: nowrap;
overflow: hidden !important;
text-overflow: ellipsis !important;
}
.file-title:hover{
color: #0782c9;
}
}
}
}
}
}
ion-footer{
padding-top: 7.5px;
@@ -11,6 +11,12 @@ import { Router } from '@angular/router'
import { ChatOptionsPopoverPage } from '../../popover/chat-options-popover/chat-options-popover.page';
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
import { TimeService } from 'src/app/services/functions/time.service';
import { FileLoaderService } from 'src/app/services/file/file-loader.service';
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchList } from 'src/app/models/search-document';
import { ProcessesService } from 'src/app/services/processes.service';
import { FileService } from 'src/app/services/functions/file.service';
@Component({
selector: 'app-group-messages',
@@ -22,14 +28,18 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
isGroupCreated:boolean;
loggedUser: any;
message:any;
leaveStatus:any;
messages:any;
allUsers:any[] = [];
documents:SearchList[] = [];
room:any = new Array();
roomName:any;
members:any;
capturedImage:any;
capturedImageTitle:any;
loggedUserChat:any;
scrollingOnce:boolean = true;
private scrollChangeCallback: () => void;
@@ -57,6 +67,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
private alertService: AlertService,
private route: Router,
private timeService: TimeService,
private fileLoaderService: FileLoaderService,
private fileToBase64Service: FileToBase64Service,
private processesService: ProcessesService,
private fileService: FileService,
) {
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.isGroupCreated = true;
@@ -72,6 +86,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
this.serverLongPull();
console.log(this.roomId);
this.setStatus('online');
this.getChatMembers();
}
setStatus(status:string){
@@ -102,10 +117,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
let scroll = e.srcElement.scrollTop;
if (scroll > this.currentPosition) {
//this.showButton = false;
//alert('BOTTOM');
} else {
//this.showButton = true;
//alert('UP');
this.scrollingOnce = false;
}
this.currentPosition = scroll;
@@ -116,6 +129,16 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
window.removeEventListener('scroll', this.scrollChangeCallback, true);
}
async getChatMembers(){
//return await this.chatService.getMembers(roomId).toPromise();
this.chatService.getAllUsers().subscribe(res=> {
console.log(res);
this.allUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
console.log(this.allUsers);
});
}
openGroupContactsPage(){
this.openGroupContacts.emit(this.roomId);
}
@@ -206,11 +229,19 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
sendMessage(){
let body = {
"message":
{
"rid": this.roomId, "msg": this.message
"rid": this.roomId,
"msg": this.message,
/* "attachments": [{
"color": "#ff0000",
"text": "Yay for gruggy!",
"title": "Attachment Example",
"title_link": "https://youtube.com",
"title_link_download": false,
"image_url": "https://upload.wikimedia.org/wikipedia/commons/e/ee/Chain_link_icon.png",
}] */
}
}
@@ -271,7 +302,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
modal.onDidDismiss().then(res=>{
console.log(res);
if(res.data == 'leave'){
this.leaveStatus = this.loggedUser.me.name + ' saiu do grupo';
this.getRoomInfo();
this.closeAllDesktopComponents.emit();
this.showEmptyContainer.emit();
}
else if(res.data == 'delete'){
this.closeAllDesktopComponents.emit();
@@ -341,7 +374,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
},
translucent: true
});
return await popover.present();
await popover.present();
await popover.onDidDismiss().then(()=>{
});
}
async addContacts(){
console.log(this.members);
@@ -366,31 +401,95 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
}
/* async actionSheet() {
const actionSheet = await this.actionSheetController.create({
cssClass: 'my-custom-class',
buttons: [{
text: 'Sair do grupo',
handler: () => {
console.log('Delete clicked');
loadPicture() {
const input = this.fileLoaderService.createInput({
accept: ['image/apng', 'image/jpeg', 'image/png']
})
input.onchange = async () => {
const file = this.fileLoaderService.getFirstFile(input)
console.log(file);
const imageData = await this.fileToBase64Service.convert(file)
this.capturedImage = imageData;
this.capturedImageTitle = file.name;
let body = {
"message":
{
"rid": this.roomId,
"msg": "",
"attachments": [{
//"title": this.capturedImageTitle ,
//"text": "description",
"title_link_download": false,
"image_url": this.capturedImage,
}]
}
}, {
text: 'Alterar nome do grupo1',
handler: () => {
console.log('Alterar nome do grupo');
this.openChangeGroupName()
}
}, {
text: 'Apagar o grupo',
handler: () => {
console.log('Play clicked');
}
},
]
});
await actionSheet.present();
}
this.chatService.sendMessage(body).subscribe(res=> {
console.log(res);
},(error) => {
});
//console.log(this.capturedImage)
};
}
async addDocGestaoDocumental(){
const modal = await this.modalController.create({
component: SearchPage,
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
componentProps: {
type: 'AccoesPresidenciais & ArquivoDespachoElect',
select: true,
showSearchInput: true,
}
});
await modal.present();
modal.onDidDismiss().then(async res=>{
if(res){
const data = res.data;
this.documents.push(data.selected);
console.log(res.data.selected);
console.log(res.data.selected.Id);
console.log(res.data.selected.ApplicationType);
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
console.log(url_no_options);
console.log('Oie');
let body = {
"message":
{
"rid": this.roomId,
"msg": "",
"attachments": [{
"title": res.data.selected.Assunto,
"text": res.data.selected.DocTypeDesc,
"title_link": url_no_options,
"title_link_download": true,
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
"message_link": url_no_options,
}]
}
}
this.chatService.sendMessage(body).subscribe(res=> {
console.log(res);
},(error) => {
});
}
});
}
viewDocument(url:string){
this.fileService.viewDocumentByUrl(url);
}
*/
async _openChatOptions() {
@@ -439,6 +538,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
this.openNewEventPage.emit(data);
}
else if(res['data'] == 'picture'){
this.loadPicture();
}
else if(res['data'] == 'documentoGestaoDocumental'){
this.addDocGestaoDocumental();
}
});
}
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { NavigationStart, Router } from '@angular/router';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { ProcessesService } from 'src/app/services/processes.service';
@@ -26,6 +26,16 @@ export class AllProcessesPage implements OnInit {
ngOnInit() {
this.loadAllProcesses();
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital')) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing();
} else {
this.loadAllProcesses();
}
}
});
}
doRefresh() {
@@ -35,6 +45,13 @@ export class AllProcessesPage implements OnInit {
}, 1000);
}
refreshing() {
setTimeout(() => {
this.loadAllProcesses();
}, 1000);
}
async loadAllProcesses(){
let allProcessesList = await this.processesService.GetTasksList("", false).toPromise();
console.log(allProcessesList);
@@ -128,7 +145,7 @@ export class AllProcessesPage implements OnInit {
goToProcess(serialNumber:string, workflowName:string, activityName:string){
if(workflowName == 'Despacho') {
if(activityName == 'Tarefa de Despacho'){
if(activityName == 'Tarefa de Despacho'|| activityName == 'Concluir Despacho'){
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
}
}
@@ -22,7 +22,7 @@
<div class="item width-100">
<div class="exp-top-detail">
<div class="subject">
<ion-label>{{ task.Folio }}</ion-label>
<ion-label>{{ task.Subject }}</ion-label>
</div>
<div class="exp-icon">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
@@ -1,6 +1,6 @@
<ion-header class="ion-no-border">
<div class="title">
<div class="thetitle"><ion-label >Expediente11</ion-label></div>
<div class="thetitle"><ion-label >Expediente</ion-label></div>
<div class="theicon">
<button class="btn-no-color" (click)="doRefresh()">
<ion-icon slot="end" class="title-icon" name="reload-circle"></ion-icon>
@@ -5,9 +5,9 @@
</button>
</div>
<div class="buttons">
<button hidden (click)="notImplemented()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
<button hidden (click)="notImplemented()" class="btn-ok" shape="round" >Digitalizar Documento</button>
<button hidden (click)="notImplemented()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
<button hidden (click)="getDoc()" class="btn-ok" shape="round" >Anexar Documento</button>
<div class="solid"></div>
<button (click)="bookMeeting()" class="btn-ok" shape="round" >Marcar reunião</button>
@@ -45,6 +45,24 @@ export class ChatOptionsPopoverPage implements OnInit {
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
takePicture(){
if( window.innerWidth < 701){
this.popoverController.dismiss('takePicture');
}
else{
this.modalController.dismiss('takePicture');
}
}
anexarFoto(){
if( window.innerWidth < 701){
this.popoverController.dismiss('loadPicture');
}
else{
this.modalController.dismiss('loadPicture');
}
}
close(){
if( window.innerWidth < 701){
this.popoverController.dismiss();
@@ -1,6 +1,6 @@
<ion-content class="options-container">
<div class="arrow-right">
<button class="btn-no-color" (click)="close()">
<button class="btn-no-color" (click)="close('cancel')">
<ion-icon slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
</button>
</div>
@@ -8,7 +8,7 @@
<button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button>
<button (click)="openChangeGroupName()" class="btn-cancel" shape="round" >Alterar nome do grupo</button>
<div class="solid"></div>
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
<button (click)="close('cancel')" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
<button (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
</div>
</ion-content>
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service';
import { ToastService } from 'src/app/services/toast.service';
@Component({
selector: 'app-chat-popover',
@@ -16,6 +17,7 @@ export class ChatPopoverPage implements OnInit {
private modalController: ModalController,
private navParams: NavParams,
private chatService: ChatService,
private toastService: ToastService,
) {
this.roomId = this.navParams.get('roomId');
}
@@ -24,14 +26,14 @@ export class ChatPopoverPage implements OnInit {
console.log(this.roomId);
}
close(){
close(action:any){
if( window.innerWidth <= 701){
this.popoverController.dismiss('cancel');
this.modalController.dismiss('cancel');
this.popoverController.dismiss(action);
this.modalController.dismiss(action);
}
else{
this.popoverController.dismiss('cancel');
this.modalController.dismiss('cancel');
this.popoverController.dismiss(action);
this.modalController.dismiss(action);
}
}
@@ -48,16 +50,43 @@ export class ChatPopoverPage implements OnInit {
if(this.room.t === 'p'){
this.chatService.leaveGroup(body).subscribe(res=>{
console.log(res);
this.close('leave');
},
(e)=>{
if(e.error.errorType = "error-you-are-last-owner"){
this.toastService.badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo.");
this.close('cancel');
}
else{
this.toastService.badRequest("Não foi possível sair do grupo");
this.close('cancel');
}
},
()=>{
//loader.remove()
});
}
else{
this.chatService.leaveChannel(body).subscribe(res=>{
console.log(res);
this.close('leave');
},
(e)=>{
if(e.error.errorType = "error-you-are-last-owner"){
this.toastService.badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo.");
this.close('cancel');
}
else{
this.toastService.badRequest("Não foi possível sair do grupo");
this.close('cancel');
}
},
()=>{
//loader.remove()
});
}
});
this.popoverController.dismiss('leave');
this.modalController.dismiss('leave');
}
//Delete