mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -81,6 +81,19 @@ export class HomePage implements OnInit {
|
||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||
});
|
||||
|
||||
|
||||
// if (typeof Worker !== 'undefined') {
|
||||
// // Create a new
|
||||
// const worker = new Worker(new URL('./nice.worker.ts', import.meta.url));
|
||||
// worker.onmessage = ({ data }) => {
|
||||
// console.log(`page got message: ${data}`);
|
||||
// };
|
||||
// worker.postMessage('hello');
|
||||
// } else {
|
||||
// // Web workers are not supported in this environment.
|
||||
// // You should add a fallback so that your program still executes correctly.
|
||||
// }
|
||||
|
||||
{
|
||||
//this.folderId = this.navParams.get('folderId');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// / <reference lib="webworker" />
|
||||
|
||||
addEventListener('message', ({ data }) => {
|
||||
const response = `worker response to ${data}`;
|
||||
//postMessage(response);
|
||||
});
|
||||
@@ -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>
|
||||
|
||||
@@ -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" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' "> <div>Responder ao PR</div> </div>
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' ">Reencaminhar para Área jurídica</div>
|
||||
<button (click)="openAddNoteModal('Gerar Diploma')" *ngIf="task.WorkflowName == 'Despacho do Presidente da República'" class="btn-cancel" style="margin-bottom: 0px !important;" shape="round" >Gerar Diploma </button>
|
||||
<div class="option-desc" *ngIf="task.WorkflowName == 'Despacho do Presidente da República' " >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;
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||
import { Location } from '@angular/common'
|
||||
import { fullTask } from 'src/app/models/dailyworktask.model';
|
||||
import { Attachment, AttachmentList } from 'src/app/models/Excludetask';
|
||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho',
|
||||
@@ -50,6 +51,7 @@ export class DespachoPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private despachoService: DespachoService,
|
||||
private location: Location,
|
||||
public p: PermissionService,
|
||||
|
||||
|
||||
) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
<ion-content fullscreen>
|
||||
<ion-item class="close" lines="none" text-center>
|
||||
<button (click)="close()" fill="clear" >
|
||||
<ion-icon name="close" slot="start">Fechar</ion-icon>
|
||||
</button>
|
||||
</ion-item>
|
||||
<ion-slides>
|
||||
<ion-slide>
|
||||
<div class="swipper-zoom-container">
|
||||
<img src="{{imageUrl}}">
|
||||
</div>
|
||||
</ion-slide>
|
||||
</ion-slides>
|
||||
<ion-content fullscreen class="d-flex flex-column">
|
||||
<div class="main-content">
|
||||
|
||||
<div class="d-flex justify-end">
|
||||
<button (click)="close()" fill="clear" >
|
||||
<ion-icon name="close" slot="start">Fechar</ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<ion-slides>
|
||||
<ion-slide>
|
||||
<div class="swipper-zoom-container">
|
||||
<img src="{{imageUrl}}">
|
||||
</div>
|
||||
</ion-slide>
|
||||
</ion-slides>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
|
||||
|
||||
<ion-content>
|
||||
<div class="content-container">
|
||||
<div class="content-container d-flex flex-column">
|
||||
<div class="title-content width-100">
|
||||
<div class="div-title">
|
||||
<ion-label class="title">{{publicationTitle}}</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="publicationType!='1'" class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input [(ngModel)]="pub.Title" name="title" ngDefaultControl placeholder="Título" ></ion-input>
|
||||
</div>
|
||||
|
||||
<div *ngIf="publicationType!='1'" class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
<div class="overflow-y-auto">
|
||||
<div *ngIf="publicationType!='1'" class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input [(ngModel)]="pub.Title" name="title" ngDefaultControl placeholder="Título" ></ion-input>
|
||||
</div>
|
||||
<div class="ion-textarea-class" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
|
||||
<ion-textarea [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto..."></ion-textarea>
|
||||
|
||||
<div *ngIf="publicationType!='1'" class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-textarea-class" [class.input-error]="Form?.get('Message')?.invalid && validateFrom ">
|
||||
<ion-textarea [(ngModel)]="pub.Message" name="description" ngDefaultControl rows="12" cols="20" placeholder="Corpo de texto..."></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="capturedImage != '' " class="ion-item-container-no-border">
|
||||
<ion-label class="attached-title">Fotografia Anexada </ion-label>
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="capturedImage"></ion-img>
|
||||
</ion-thumbnail>
|
||||
<ion-label>
|
||||
<p>{{capturedImageTitle}}</p>
|
||||
<p hidden>size</p>
|
||||
</ion-label>
|
||||
<ion-icon (click)="clear()" name="close"></ion-icon>
|
||||
</ion-item>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="picture d-flex pb-5 hide-desktop" *ngIf="publication && capturedImage ==''">
|
||||
<div class="post-img" *ngIf="publication.FileBase64">
|
||||
<img src="{{publication.FileBase64}}" alt="image" >
|
||||
</div>
|
||||
<div class="d-flex flex-column pl-10" *ngIf="publication.FileBase64">
|
||||
<div class="picture-file-name">{{publication.OriginalFileName}}.{{publication.FileExtension}}</div>
|
||||
<div class="size">75 Kb</div>
|
||||
</div>
|
||||
<div class="flex-grow-1 d-flex align-center justify-end" *ngIf="publication.FileBase64">
|
||||
<div style="color: red;">X</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ion-item-container-no-border">
|
||||
<ion-label (click)="takePicture()">
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-add-photo.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Tirar Fotografia</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="ion-item-container-no-border">
|
||||
<ion-label (click)="laodPicture()">
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-add-photos.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Anexar Fotografia</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="capturedImage != ''" class="ion-item-container-no-border">
|
||||
<ion-label class="attached-title">Fotografia Anexada</ion-label>
|
||||
<ion-item lines="none">
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="'data:image/png;base64,'+capturedImage"></ion-img>
|
||||
</ion-thumbnail>
|
||||
<!-- <ion-thumbnail *ngIf="!publication" slot="start">
|
||||
<ion-img [(ngModel)]="publication.imageUrl" [src]="guestPicture"></ion-img>
|
||||
</ion-thumbnail> -->
|
||||
<ion-label>
|
||||
<p>{{capturedImageTitle}}</p>
|
||||
<p hidden>size</p>
|
||||
</ion-label>
|
||||
<ion-icon (click)="clear()" name="close"></ion-icon>
|
||||
</ion-item>
|
||||
|
||||
<!-- <ion-thumbnail>
|
||||
<ion-img src="{{imgUrl}}"></ion-img>
|
||||
</ion-thumbnail> -->
|
||||
</div>
|
||||
|
||||
<div class="picture d-flex pb-5 hide-desktop" *ngIf="publication.FileBase64 && capturedImage ==''">
|
||||
<div class="post-img">
|
||||
<img src="{{publication.FileBase64}}" alt="image" >
|
||||
</div>
|
||||
<div class="d-flex flex-column pl-10">
|
||||
<div class="picture-file-name">{{publication.OriginalFileName}}.{{publication.FileExtension}}</div>
|
||||
<div class="size">75 Kb</div>
|
||||
</div>
|
||||
<div class="flex-grow-1 d-flex align-center justify-end">
|
||||
<div style="color: red;">X</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ion-item-container-no-border">
|
||||
<ion-label (click)="takePicture()">
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-add-photo.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Tirar Fotografia</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<!-- <div class="ion-item-container-no-border">
|
||||
<ion-label (click)="laodPicture()">
|
||||
<div class="attach-icon">
|
||||
<ion-icon src="assets/images/icons-add-photos.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="attach-document">
|
||||
<ion-label>Anexar Fotografia</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -58,7 +58,6 @@ ion-toolbar{
|
||||
}
|
||||
.title-content{
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.div-title{
|
||||
|
||||
@@ -95,9 +95,10 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
this.camera.getPicture(options).then((imageData) => {
|
||||
// imageData is either a base64 encoded string or a file URI
|
||||
// If it's base64 (DATA_URL):
|
||||
let base64Image = 'data:image/jpeg;base64,' + imageData;
|
||||
this.capturedImage = imageData;
|
||||
// If it's base64 (DATA_URL): m
|
||||
//let base64Image = 'data:image/jpeg;base64,' + imageData;
|
||||
|
||||
this.capturedImage = 'data:image/png;base64,'+imageData;
|
||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||
}, (err) => {
|
||||
/* console.log(err); */
|
||||
@@ -116,6 +117,8 @@ export class NewPublicationPage implements OnInit {
|
||||
const imageData = await this.fileToBase64Service.convert(file)
|
||||
this.capturedImage = imageData;
|
||||
this.capturedImageTitle = file.name
|
||||
|
||||
console.log(this.capturedImage)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ import { AnimationController, ModalController, NavParams } from '@ionic/angular'
|
||||
import { Publication } from 'src/app/models/publication';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page';
|
||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||
import { ImageModalPage } from '../gallery/image-modal/image-modal.page';
|
||||
import { NewPublicationPage } from '../new-publication/new-publication.page';
|
||||
|
||||
@@ -27,6 +25,9 @@ export class PublicationDetailPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService
|
||||
) {
|
||||
|
||||
alert('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
|
||||
|
||||
this.publicationId = this.navParams.get('publicationId');
|
||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||
this.publication = {
|
||||
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
<ion-header class="ion-no-border d-md-none">
|
||||
<ion-header class="ion-no-border">
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</ion-refresher>
|
||||
|
||||
<div class="content-container">
|
||||
<div *ngIf="publication.Title != ''" class="d-flex flex-column">
|
||||
<div *ngIf="publication.Title != ''" class="d-flex flex-column height-100">
|
||||
<div class="title-content px-20 width-100 ">
|
||||
<div class="back-icon cursor-pointer" (click)="goBack()">
|
||||
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
@@ -33,6 +33,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="publication.Title == ''" class="d-flex flex-column">
|
||||
<div class="title-content width-100">
|
||||
<div class="back-icon cursor-pointer">
|
||||
|
||||
+1
-2
@@ -57,9 +57,8 @@
|
||||
padding: 25px 0px 0 0px;
|
||||
overflow: auto;
|
||||
}
|
||||
.title-content{
|
||||
.title-content {
|
||||
margin: 0px auto;
|
||||
overflow: auto;
|
||||
}
|
||||
.back-icon{
|
||||
width: auto;
|
||||
|
||||
+1
@@ -27,6 +27,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
) {
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params);
|
||||
if(params["params"]) {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-container background-white">
|
||||
<div class="main-container background-white height-100 overflow-y-auto">
|
||||
<ion-list>
|
||||
<!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
|
||||
<div class="post-item"
|
||||
|
||||
@@ -16,13 +16,12 @@ export class FileLoaderService {
|
||||
constructor() { }
|
||||
|
||||
|
||||
createInput(param:createInput): HTMLInputElement {
|
||||
createInput({accept, type = 'file'}:createInput): HTMLInputElement {
|
||||
|
||||
let input = document.createElement('input');
|
||||
input.type = param.type || 'file';
|
||||
input.accept = param.accept.join(', ')
|
||||
input.type = type || 'file';
|
||||
input.accept = accept.join(', ')
|
||||
|
||||
|
||||
// input.onchange = () => {
|
||||
// // you can use this method to get file and perform respective operations
|
||||
// let files = Array.from(input.files);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="messages" #scrollMe>
|
||||
<div class="container-width-100" *ngFor="let msg of messages; let last = last">
|
||||
<div class="container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last">
|
||||
<div class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
|
||||
@@ -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"){
|
||||
|
||||
@@ -5,7 +5,35 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
|
||||
|
||||
<div class="width-100 pr-options" *ngIf="task.activityInstanceName == 'Tarefa de Despacho' && task.WorkflowName == 'Despacho do Presidente da República' ">
|
||||
<div *ngIf="task && !p.userRole(['PR'])" class="d-flex width-100">
|
||||
<div class="flex-grow-1 width-50 pr-10">
|
||||
<button class="btn-cancel desk" shape="round" > Responder ao PR </button>
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel width-100" shape="round" >Executado</button>
|
||||
<button class="btn-cancel desk" shape="round"> Reencaminhar para Área jurídica </button>
|
||||
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel width-100" shape="round" >Gerar Diploma</button>
|
||||
<button class="btn-cancel desk" shape="round"> Outras opções </button>
|
||||
<button (click)="openTaskProcessModal('0',fulltask)" class="btn-cancel width-100" shape="round" >Efetuar Despacho</button>
|
||||
</div>
|
||||
<div class="flex-grow-1 width-50 pl-10">
|
||||
<button (click)="openTaskProcessModal('1',fulltask)" class="btn-cancel width-100" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openTaskProcessModal('2',fulltask)" class="btn-cancel width-100" shape="round" >Pedido de Deferimento</button>
|
||||
<button (click)="openDelegarModal(task)" class="btn-cancel width-100" shape="round" >Delegar</button>
|
||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel width-100" shape="round" >Enviar para pendentes</button>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
|
||||
<div class="flex-grow-1">
|
||||
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||
<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>
|
||||
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho' && task.WorkflowName != 'Despacho do Presidente da República' ">
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
|
||||
<div class="solid"></div>
|
||||
@@ -15,6 +43,7 @@
|
||||
<div class="solid"></div>
|
||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
</div>
|
||||
|
||||
<div class="buttons" *ngIf="task.activityInstanceName == 'Reexecutar Despacho'">
|
||||
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
|
||||
<button (click)="openDelegarModal(task)" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Delegar</button>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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')
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="solid"></div>
|
||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<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>
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="solid"></div>
|
||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<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>
|
||||
@@ -51,7 +51,7 @@
|
||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
<button *ngIf="p.userRole(['PR'])" (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
|
||||
<button (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<button *ngIf="!p.userRole(['PR'])" (click)="openExpedientActionsModal('2',fulltask)" class="btn-cancel" shape="round" >Pedido de Deferimento</button>
|
||||
<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>
|
||||
|
||||
@@ -147,25 +147,26 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
async viewPublicationDetail(publicationId:string) {
|
||||
|
||||
console.log(publicationId);
|
||||
|
||||
if( window.innerWidth <= 1024) {
|
||||
const modal = await this.modalController.create({
|
||||
component: PublicationDetailPage,
|
||||
componentProps:{
|
||||
publicationId: publicationId,
|
||||
},
|
||||
cssClass: 'publication-detail modal modal-desktop',
|
||||
//backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(()=>{
|
||||
this.doRefresh(event);
|
||||
});
|
||||
} else {
|
||||
// open publication details
|
||||
this.openPublicationDetails.emit(publicationId);
|
||||
}
|
||||
// if( window.innerWidth <= 1024) {
|
||||
// const modal = await this.modalController.create({
|
||||
// component: PublicationDetailPage,
|
||||
// componentProps:{
|
||||
// publicationId: publicationId,
|
||||
// },
|
||||
// cssClass: 'publication-detail modal modal-desktop',
|
||||
// //backdropDismiss: false
|
||||
// });
|
||||
// await modal.present();
|
||||
// modal.onDidDismiss().then(()=>{
|
||||
// this.doRefresh(event);
|
||||
// });
|
||||
// } else {
|
||||
// // open publication details
|
||||
// this.openPublicationDetails.emit(publicationId);
|
||||
// }
|
||||
|
||||
this.openPublicationDetails.emit(publicationId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user