mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -7,8 +7,8 @@
|
|||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button hidden (click)="notImplemented()" full class="btn-cancel" shape="round" >Tirar Fotografia</button>
|
<button hidden (click)="notImplemented()" full class="btn-cancel" shape="round" >Tirar Fotografia</button>
|
||||||
<button hidden (click)="notImplemented()" class="btn-cancel" shape="round" >Digitalizar Documento</button>
|
<button hidden (click)="notImplemented()" class="btn-cancel" shape="round" >Digitalizar Documento</button>
|
||||||
<button hidden (click)="notImplemented()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
|
<button (click)="anexarFoto()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
|
||||||
<button hidden (click)="getDoc()" class="btn-cancel" shape="round" >Anexar Documento</button>
|
<button (click)="addDocGestaoDocumental()" class="btn-cancel" shape="round" >Anexar Documento (G.D.)</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="bookMeeting()" class="btn-cancel" shape="round" >Marcar reunião</button>
|
<button (click)="bookMeeting()" class="btn-cancel" shape="round" >Marcar reunião</button>
|
||||||
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
|
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import { SearchList } from 'src/app/models/search-document';
|
|||||||
import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page';
|
import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page';
|
||||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
import { AlertService } from 'src/app/services/alert.service';
|
import { AlertService } from 'src/app/services/alert.service';
|
||||||
|
import { ChatService } from 'src/app/services/chat.service';
|
||||||
|
import { FileLoaderService } from 'src/app/services/file/file-loader.service';
|
||||||
|
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -18,11 +21,17 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
|||||||
members: any;
|
members: any;
|
||||||
attendees: EventPerson[] = [];
|
attendees: EventPerson[] = [];
|
||||||
|
|
||||||
|
capturedImage:any;
|
||||||
|
capturedImageTitle:any;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private popoverController: PopoverController,
|
private popoverController: PopoverController,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private alertService: AlertService,
|
private alertService: AlertService,
|
||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
|
private fileLoaderService: FileLoaderService,
|
||||||
|
private fileToBase64Service: FileToBase64Service,
|
||||||
|
private chatService: ChatService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.members = this.navParams.get('members');
|
this.members = this.navParams.get('members');
|
||||||
@@ -59,6 +68,77 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
anexarFoto(){
|
||||||
|
this.modalController.dismiss('picture');
|
||||||
|
}
|
||||||
|
|
||||||
|
addDocGestaoDocumental(){
|
||||||
|
this.modalController.dismiss('documentoGestaoDocumental');
|
||||||
|
}
|
||||||
|
|
||||||
|
laodPicture() {
|
||||||
|
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": "J5WDHyrYWHQrybbno",
|
||||||
|
"msg": "this.message",
|
||||||
|
"attachments": [{
|
||||||
|
"title": this.capturedImageTitle ,
|
||||||
|
"text": "description",
|
||||||
|
"title_link_download": false,
|
||||||
|
"image_url": this.capturedImage,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
console.log(res);
|
||||||
|
},(error) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
//console.log(this.capturedImage)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
sendMessage(){
|
||||||
|
let body = {
|
||||||
|
"message":
|
||||||
|
{
|
||||||
|
"rid": "J5WDHyrYWHQrybbno",
|
||||||
|
"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",
|
||||||
|
}] */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
|
|
||||||
|
},(error) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/* getGroupContacts(room:any){
|
/* getGroupContacts(room:any){
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
//If group is private call getGroupMembers
|
//If group is private call getGroupMembers
|
||||||
@@ -95,7 +175,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
|||||||
const data = res.data;
|
const data = res.data;
|
||||||
this.documents.push(data.selected);
|
this.documents.push(data.selected);
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/searc
|
|||||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||||
import { PermissionService } from 'src/app/OtherService/permission.service';
|
import { PermissionService } from 'src/app/OtherService/permission.service';
|
||||||
import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page';
|
import { SearchedDocumentOptionsPage } from 'src/app/shared/popover/searched-document-options/searched-document-options.page';
|
||||||
|
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
|
import { Location } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-document-detail',
|
selector: 'app-document-detail',
|
||||||
@@ -39,7 +41,8 @@ export class DocumentDetailPage implements OnInit {
|
|||||||
private menu: MenuController,
|
private menu: MenuController,
|
||||||
private iab: InAppBrowser,
|
private iab: InAppBrowser,
|
||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
private popoverController: PopoverController
|
private popoverController: PopoverController,
|
||||||
|
private location: Location,
|
||||||
) {
|
) {
|
||||||
this.docId = this.navParams.get('docId');
|
this.docId = this.navParams.get('docId');
|
||||||
this.applicationId = this.navParams.get('applicationId');
|
this.applicationId = this.navParams.get('applicationId');
|
||||||
@@ -51,6 +54,8 @@ export class DocumentDetailPage implements OnInit {
|
|||||||
|
|
||||||
async LoadDocumentDetails() {
|
async LoadDocumentDetails() {
|
||||||
this.processes.GetDocumentDetails(this.docId, this.applicationId).subscribe(res=>{
|
this.processes.GetDocumentDetails(this.docId, this.applicationId).subscribe(res=>{
|
||||||
|
console.log(res);
|
||||||
|
|
||||||
this.LoadedDocument = res;
|
this.LoadedDocument = res;
|
||||||
|
|
||||||
this.LoadedDocument.Subject = this.LoadedDocument.Assunto
|
this.LoadedDocument.Subject = this.LoadedDocument.Assunto
|
||||||
@@ -129,7 +134,7 @@ export class DocumentDetailPage implements OnInit {
|
|||||||
async openExpedientActionsModal( taskAction: any) {
|
async openExpedientActionsModal( taskAction: any) {
|
||||||
|
|
||||||
let classs;
|
let classs;
|
||||||
if( window.innerWidth <= 800) {
|
if( window.innerWidth < 701) {
|
||||||
classs = 'modal modal-desktop'
|
classs = 'modal modal-desktop'
|
||||||
} else {
|
} else {
|
||||||
classs = 'modal modal-desktop showAsideOptions'
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
@@ -150,9 +155,10 @@ export class DocumentDetailPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openBookMeetingModal() {
|
async openBookMeetingModal() {
|
||||||
|
console.log(this.LoadedDocument);
|
||||||
|
|
||||||
let classs;
|
let classs;
|
||||||
if( window.innerWidth <= 800) {
|
if( window.innerWidth < 701) {
|
||||||
classs = 'book-meeting-modal modal modal-desktop'
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
} else {
|
} else {
|
||||||
classs = 'modal modal-desktop showAsideOptions'
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
@@ -167,9 +173,34 @@ export class DocumentDetailPage implements OnInit {
|
|||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
});
|
});
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss();
|
modal.onDidDismiss().then(res=>{
|
||||||
|
//this.location.back();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* async openBookMeetingModal() {
|
||||||
|
//console.log(task);
|
||||||
|
|
||||||
|
let classs;
|
||||||
|
if( window.innerWidth < 701){
|
||||||
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
|
} else {
|
||||||
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
}
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: BookMeetingModalPage,
|
||||||
|
componentProps: {
|
||||||
|
task: this.task,
|
||||||
|
},
|
||||||
|
cssClass: classs,
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then(res=>{
|
||||||
|
this.location.back();
|
||||||
|
});
|
||||||
|
} */
|
||||||
|
|
||||||
async openOptions() {
|
async openOptions() {
|
||||||
const popover = await this.popoverController.create({
|
const popover = await this.popoverController.create({
|
||||||
component: SearchedDocumentOptionsPage,
|
component: SearchedDocumentOptionsPage,
|
||||||
|
|||||||
@@ -86,7 +86,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
emptyTextDescription = "Sem intervenientes selecionados";
|
emptyTextDescription = "Sem intervenientes selecionados";
|
||||||
|
|
||||||
document: SearchFolderDetails | SearchDocumentDetails | any;
|
document: SearchFolderDetails | SearchDocumentDetails | any;
|
||||||
subject: string
|
subject: string;
|
||||||
|
docs:any[] = [];
|
||||||
|
|
||||||
eventPipe = new EventPipe()
|
eventPipe = new EventPipe()
|
||||||
|
|
||||||
@@ -118,6 +119,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
this.adding = "intervenient";
|
this.adding = "intervenient";
|
||||||
this.setDefaultTime()
|
this.setDefaultTime()
|
||||||
this.getRecurrenceTypes();
|
this.getRecurrenceTypes();
|
||||||
|
console.log(this.document);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getRecurrenceTypes() {
|
getRecurrenceTypes() {
|
||||||
@@ -179,7 +182,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
let folder: SearchFolderDetails = this.document
|
let folder: SearchFolderDetails = this.document
|
||||||
let document: SearchDocumentDetails = this.document
|
let document: SearchDocumentDetails = this.document
|
||||||
|
|
||||||
if(folder.Documents) {
|
/* if(folder.Documents) {
|
||||||
this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => {
|
this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => {
|
||||||
Attachments.push({
|
Attachments.push({
|
||||||
ApplicationId: 361,
|
ApplicationId: 361,
|
||||||
@@ -204,8 +207,28 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
SourceId: e.Id,
|
SourceId: e.Id,
|
||||||
SourceTitle: e.Assunto
|
SourceTitle: e.Assunto
|
||||||
})
|
})
|
||||||
})
|
}) */
|
||||||
|
|
||||||
|
if(this.document.Documents){
|
||||||
|
this.document.Documents.forEach((e)=> {
|
||||||
|
this.docs.push({
|
||||||
|
ApplicationId: e.ApplicationId || e.ApplicationType,
|
||||||
|
Source: 1,
|
||||||
|
SourceId: e.DocId || e.docID || e.docId,
|
||||||
|
SourceName: e.Assunto
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.docs.push({
|
||||||
|
ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
|
||||||
|
Source: 1,
|
||||||
|
SourceId: this.document.DocId || this.document.docID || this.document.docId,
|
||||||
|
SourceName: this.document.Assunto
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(this.docs);
|
||||||
|
|
||||||
let postEvent = {
|
let postEvent = {
|
||||||
EventId: '',
|
EventId: '',
|
||||||
@@ -227,32 +250,34 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
|||||||
HasAttachments: false,
|
HasAttachments: false,
|
||||||
EventRecurrence: {
|
EventRecurrence: {
|
||||||
Type: this.EventRecurrenceType,
|
Type: this.EventRecurrenceType,
|
||||||
LastOccurrence: this.Occurrence
|
LastOccurrence: this.Occurrence,
|
||||||
},
|
},
|
||||||
|
Attachments: this.docs,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(postEvent);
|
||||||
|
|
||||||
|
|
||||||
const laoder = this.toastService.loading()
|
const laoder = this.toastService.loading()
|
||||||
|
|
||||||
this.eventService.create({
|
this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => {
|
||||||
body: postEvent,
|
|
||||||
calendar: this.postData.CalendarName
|
|
||||||
}).subscribe(async (respose) => {
|
|
||||||
|
|
||||||
const res: any = respose;
|
const res: any = respose;
|
||||||
const eventId: string = res
|
const eventId: string = res
|
||||||
|
|
||||||
const DocumentToSave = this.attachments.map((e) => {
|
/* const DocumentToSave = this.attachments.map((e) => {
|
||||||
return this.eventPipe.AttactSearchResult(e, eventId, {})
|
return this.eventPipe.AttactSearchResult(e, eventId, {})
|
||||||
});
|
});
|
||||||
|
|
||||||
await DocumentToSave.forEach(async (attachments, i) => {
|
await DocumentToSave.forEach(async (attachments, i) => {
|
||||||
await this.eventService.addAttachment(attachments).toPromise();
|
await this.eventService.addAttachment(attachments).toPromise();
|
||||||
});
|
}); */
|
||||||
|
|
||||||
|
this.toastService.successMessage('Reunião criada')
|
||||||
laoder.remove()
|
laoder.remove()
|
||||||
this.modalController.dismiss()
|
this.modalController.dismiss()
|
||||||
|
},(error) => {
|
||||||
})
|
this.toastService.badRequest('Não foi possível marcar a reunião');
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export class SearchList {
|
|||||||
|
|
||||||
export class Attachments {
|
export class Attachments {
|
||||||
Id?: number
|
Id?: number
|
||||||
|
ParentId?:any
|
||||||
Source: number
|
Source: number
|
||||||
SourceId: any
|
SourceId: any
|
||||||
SourceName: any
|
SourceName: any
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content class="main-content-l height-100 white ">
|
<ion-content class="main-content-l height-100 white ">
|
||||||
|
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||||
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
|
<ion-refresher-content>
|
||||||
|
</ion-refresher-content>
|
||||||
|
</ion-refresher>
|
||||||
|
|
||||||
<div class="main-content d-flex height-100" [className]="isModal ? '_main-content d-flex height-100 ma-0 px-20 pt-30 pb-20 background-white' : 'main-content d-flex height-100'">
|
<div class="main-content d-flex height-100" [className]="isModal ? '_main-content d-flex height-100 ma-0 px-20 pt-30 pb-20 background-white' : 'main-content d-flex height-100'">
|
||||||
<div class="content d-flex flex-column width-100">
|
<div class="content d-flex flex-column width-100">
|
||||||
@@ -77,7 +82,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="loadedAttachments" class="bottom-content width-100">
|
<div *ngIf="loadedEvent.Attachments" class="bottom-content width-100">
|
||||||
<h5>Documentos Anexados</h5>
|
<h5>Documentos Anexados</h5>
|
||||||
<ion-list class="width-100">
|
<ion-list class="width-100">
|
||||||
<ion-item *ngFor="let attach of loadedEvent.Attachments; let i = index" class="width-100" class="ion-no-margin ion-no-padding">
|
<ion-item *ngFor="let attach of loadedEvent.Attachments; let i = index" class="width-100" class="ion-no-margin ion-no-padding">
|
||||||
|
|||||||
@@ -122,6 +122,11 @@ export class ViewEventPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doRefresh(ev){
|
||||||
|
this.loadEvent();
|
||||||
|
ev.target.complete();
|
||||||
|
}
|
||||||
|
|
||||||
loadEvent() {
|
loadEvent() {
|
||||||
const loader = this.toastService.loading();
|
const loader = this.toastService.loading();
|
||||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||||
@@ -144,7 +149,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deleteEvent(){
|
deleteEvent(){
|
||||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
|
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||||
{
|
{
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
cssClass: 'my-custom-class',
|
cssClass: 'my-custom-class',
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
<ion-item-sliding>
|
<ion-item-sliding>
|
||||||
<div class="item item-hover width-100 d-flex ion-no-padding ion-no-margin"
|
<div class="item item-hover width-100 d-flex ion-no-padding ion-no-margin"
|
||||||
*ngFor="let dm of userDirectMessages"
|
*ngFor="let dm of userDirectMessages"
|
||||||
[class.item-active]="dm._id ==idSelected">
|
[class.item-active]="dm._id == idSelected">
|
||||||
<div class="item-icon">
|
<div class="item-icon">
|
||||||
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
|
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<ion-list class="members-list" *ngFor="let user of members">
|
<ion-list class="members-list" *ngFor="let user of members">
|
||||||
<ion-item-sliding>
|
<ion-item-sliding>
|
||||||
<ion-item lines="none" class="members-checkbox ion-no-border ion-no-padding">
|
<ion-item lines="none" class="members-checkbox ion-no-border ion-no-padding">
|
||||||
<ion-checkbox checked color="primary"></ion-checkbox>
|
<ion-checkbox checked disabled color="primary"></ion-checkbox>
|
||||||
<p>{{user.name}}</p>
|
<p>{{user.name}}</p>
|
||||||
<ion-icon class="{{user.status}}" name="ellipse"></ion-icon>
|
<ion-icon class="{{user.status}}" name="ellipse"></ion-icon>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|||||||
@@ -40,24 +40,54 @@
|
|||||||
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div *ngFor="let msg of messages; let last = last" >
|
<div *ngFor="let msg of messages; let last = last" >
|
||||||
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
|
<div *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<ion-label>{{msg.u.name}}</ion-label>
|
<ion-label>{{msg.u.name}}</ion-label>
|
||||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="message">
|
||||||
<ion-label>{{msg.msg}}</ion-label>
|
<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() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.t == 'r'" class="info-text">
|
<div *ngIf="msg.t == 'r'" class="info-text">
|
||||||
<ion-label>Alterou o assunto para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
<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>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="leaveStatus" class="info-text-leave">
|
|
||||||
<ion-label>{{leaveStatus}}</ion-label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -93,17 +93,17 @@
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
.info-text{
|
.info-text{
|
||||||
/* width: 322px; */
|
display: flex;
|
||||||
width: em(422px);
|
width: fit-content;
|
||||||
background: #fef4c5;
|
height: auto;
|
||||||
text-align: center;
|
background: #fef4c5;
|
||||||
font-size: 13px;
|
text-align: center;
|
||||||
color: #262420;
|
font-size: 13px;
|
||||||
padding: 10px;
|
color: #262420;
|
||||||
margin: 10px auto;
|
padding: 10px;
|
||||||
line-height: 1.2rem;
|
margin: 10px auto;
|
||||||
/* margin: 15px 0px 15px 0px; */
|
line-height: 1.2rem;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
.info-text-leave{
|
.info-text-leave{
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -168,6 +168,28 @@
|
|||||||
float: right;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.online{
|
.online{
|
||||||
color:#99e47b !important;
|
color:#99e47b !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ import { GroupContactsPage } from './group-contacts/group-contacts.page';
|
|||||||
import {Router} from '@angular/router'
|
import {Router} from '@angular/router'
|
||||||
import { EditGroupPage } from '../edit-group/edit-group.page';
|
import { EditGroupPage } from '../edit-group/edit-group.page';
|
||||||
import { TimeService } from 'src/app/services/functions/time.service';
|
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 { FileService } from 'src/app/services/functions/file.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
@@ -22,13 +26,13 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
isGroupCreated:boolean;
|
isGroupCreated:boolean;
|
||||||
loggedUser: any;
|
loggedUser: any;
|
||||||
message:any;
|
message:any;
|
||||||
leaveStatus:any;
|
|
||||||
messages:any;
|
messages:any;
|
||||||
|
|
||||||
room:any;
|
room:any;
|
||||||
roomName:any;
|
roomName:any;
|
||||||
members:any;
|
members:any;
|
||||||
contacts: string[] = [" Ana M.", "Andre F.", "Bruno G.", "Catarina T", "Tiago"];
|
contacts: string[] = [" Ana M.", "Andre F.", "Bruno G.", "Catarina T", "Tiago"];
|
||||||
|
allUsers:any[] = [];
|
||||||
|
|
||||||
roomId: string;
|
roomId: string;
|
||||||
loggedUserChat:any;
|
loggedUserChat:any;
|
||||||
@@ -39,6 +43,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
currentPosition: any;
|
currentPosition: any;
|
||||||
startPosition: number;
|
startPosition: number;
|
||||||
|
|
||||||
|
capturedImage:any;
|
||||||
|
capturedImageTitle:any;
|
||||||
|
|
||||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -52,6 +59,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private alertService: AlertService,
|
private alertService: AlertService,
|
||||||
private route: Router,
|
private route: Router,
|
||||||
private timeService: TimeService,
|
private timeService: TimeService,
|
||||||
|
private fileLoaderService: FileLoaderService,
|
||||||
|
private fileToBase64Service: FileToBase64Service,
|
||||||
|
private fileService: FileService,
|
||||||
|
private toastService: ToastService,
|
||||||
) {
|
) {
|
||||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||||
this.isGroupCreated = true;
|
this.isGroupCreated = true;
|
||||||
@@ -70,6 +81,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.scrollToBottom();
|
this.scrollToBottom();
|
||||||
this.serverLongPull();
|
this.serverLongPull();
|
||||||
this.setStatus('online');
|
this.setStatus('online');
|
||||||
|
this.getChatMembers();
|
||||||
}
|
}
|
||||||
|
|
||||||
setStatus(status:string){
|
setStatus(status:string){
|
||||||
@@ -125,6 +137,16 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/* load(){
|
/* load(){
|
||||||
this.getGroupContacts();
|
this.getGroupContacts();
|
||||||
this.loadGroupMessages();
|
this.loadGroupMessages();
|
||||||
@@ -246,7 +268,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then(res=>{
|
modal.onDidDismiss().then(res=>{
|
||||||
if(res.data == 'leave'){
|
if(res.data == 'leave'){
|
||||||
this.leaveStatus = this.loggedUser.me.name + ' saiu do grupo';
|
console.log('saiu do grupo');
|
||||||
}
|
}
|
||||||
else if(res.data == 'cancel'){
|
else if(res.data == 'cancel'){
|
||||||
console.log('cancel');
|
console.log('cancel');
|
||||||
@@ -257,6 +279,47 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
console.log(res);
|
||||||
|
},(error) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
//console.log(this.capturedImage)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
viewDocument(url:string){
|
||||||
|
this.fileService.viewDocumentByUrl(url);
|
||||||
|
}
|
||||||
|
|
||||||
async openChatOptions(ev?: any) {
|
async openChatOptions(ev?: any) {
|
||||||
console.log(this.members);
|
console.log(this.members);
|
||||||
|
|
||||||
@@ -271,7 +334,37 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
},
|
},
|
||||||
translucent: true
|
translucent: true
|
||||||
});
|
});
|
||||||
return await popover.present();
|
await popover.present();
|
||||||
|
await popover.onDidDismiss().then((res)=>{
|
||||||
|
if(res['data'] == "loadPicture"){
|
||||||
|
this.loadPicture();
|
||||||
|
}
|
||||||
|
else if(res['data'] == "takePicture"){
|
||||||
|
let data = this.fileService.takePicture();
|
||||||
|
if(data.name != null){
|
||||||
|
let body = {
|
||||||
|
"message":
|
||||||
|
{
|
||||||
|
"rid": this.roomId,
|
||||||
|
"msg": "",
|
||||||
|
"attachments": [{
|
||||||
|
"title": data.name,
|
||||||
|
"title_link_download": false,
|
||||||
|
"image_url": data.image,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
console.log(res);
|
||||||
|
},(error) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toastService.badRequest("Não foi possível adicionar a fotografia!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async addContacts(){
|
async addContacts(){
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ export class EditEventPage implements OnInit {
|
|||||||
|
|
||||||
Delete()
|
Delete()
|
||||||
{
|
{
|
||||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
|
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||||
{
|
{
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
cssClass: 'my-custom-class',
|
cssClass: 'my-custom-class',
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ export class EventDetailModalPage implements OnInit {
|
|||||||
|
|
||||||
Delete()
|
Delete()
|
||||||
{
|
{
|
||||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
|
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||||
{
|
{
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
cssClass: 'my-custom-class',
|
cssClass: 'my-custom-class',
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ export class EventDetailPage implements OnInit {
|
|||||||
|
|
||||||
Delete()
|
Delete()
|
||||||
{
|
{
|
||||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
|
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
|
||||||
{
|
{
|
||||||
/* const alert = await this.alertController.create({
|
/* const alert = await this.alertController.create({
|
||||||
cssClass: 'my-custom-class',
|
cssClass: 'my-custom-class',
|
||||||
|
|||||||
@@ -111,7 +111,9 @@ export class EventsPage implements OnInit {
|
|||||||
this.router.events.forEach((event) => {
|
this.router.events.forEach((event) => {
|
||||||
if(event instanceof NavigationEnd && event.url == '/home/events') {
|
if(event instanceof NavigationEnd && event.url == '/home/events') {
|
||||||
this.RefreshEvents();
|
this.RefreshEvents();
|
||||||
this.LoadList();
|
setTimeout(()=>{
|
||||||
|
this.LoadList();
|
||||||
|
}, 1500)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.hideSearch();
|
this.hideSearch();
|
||||||
@@ -362,7 +364,7 @@ export class EventsPage implements OnInit {
|
|||||||
|
|
||||||
viewExpedientListPage(){
|
viewExpedientListPage(){
|
||||||
if(this.loggeduser.Profile == 'MDGPR'){
|
if(this.loggeduser.Profile == 'MDGPR'){
|
||||||
if( window.innerWidth < 801){
|
if( window.innerWidth < 701){
|
||||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -371,7 +373,7 @@ export class EventsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(this.loggeduser.Profile == 'PR'){
|
else if(this.loggeduser.Profile == 'PR'){
|
||||||
if( window.innerWidth < 801){
|
if( window.innerWidth < 701){
|
||||||
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
+2
-3
@@ -143,7 +143,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
async openAddNoteModal(actionName:string) {
|
async openAddNoteModal(actionName:string) {
|
||||||
let classs;
|
let classs;
|
||||||
if( window.innerWidth < 801) {
|
if( window.innerWidth < 701) {
|
||||||
classs = 'modal modal-desktop'
|
classs = 'modal modal-desktop'
|
||||||
} else {
|
} else {
|
||||||
classs = 'add-note-modal'
|
classs = 'add-note-modal'
|
||||||
@@ -382,7 +382,6 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
});
|
});
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then( async(res)=>{
|
modal.onDidDismiss().then( async(res)=>{
|
||||||
alert('AQUI')
|
|
||||||
let body = res['data'];
|
let body = res['data'];
|
||||||
if(res['data']) {
|
if(res['data']) {
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
@@ -470,7 +469,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
console.log(task);
|
console.log(task);
|
||||||
|
|
||||||
let classs;
|
let classs;
|
||||||
if( window.innerWidth <= 800){
|
if( window.innerWidth < 701){
|
||||||
classs = 'book-meeting-modal modal modal-desktop'
|
classs = 'book-meeting-modal modal modal-desktop'
|
||||||
} else {
|
} else {
|
||||||
classs = 'modal modal-desktop showAsideOptions'
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<div class="item width-100">
|
<div class="item width-100">
|
||||||
<div class="exp-top-detail">
|
<div class="exp-top-detail">
|
||||||
<div class="subject">
|
<div class="subject">
|
||||||
<ion-label>{{ task.Folio }}</ion-label>
|
<ion-label>{{ task.Subject }}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-icon">
|
<div class="exp-icon">
|
||||||
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
|
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
<p class="text-center exp-card-content">{{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
|
<p class="text-center exp-card-content">{{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} <span class="title1">Documentos</span></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div [class.active]="selectedElement == 'Correspondence'" (click)="openExpedientListPage(); selectedElement='Correspondence'" class="box-hover exp-card d-flex flex-column justify-center" *ngIf="loggeduser.Profile == 'MDGPR'">
|
<div (click)="openExpedientListPage(); selectedElement='Correspondence'" [class.active]="selectedElement == 'Correspondence'" class="box-hover exp-card d-flex flex-column justify-center">
|
||||||
<div class="d-flex justify-center">
|
<div class="d-flex justify-center">
|
||||||
<ion-icon src="assets/images/icons-correspondencia.svg"></ion-icon>
|
<ion-icon src="assets/images/icons-correspondencia.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private location: Location ) {
|
private location: Location ) {
|
||||||
|
|
||||||
alert('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
|
|
||||||
|
|
||||||
this.publicationId = this.navParams.get('publicationId');
|
this.publicationId = this.navParams.get('publicationId');
|
||||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||||
this.publication = {
|
this.publication = {
|
||||||
|
|||||||
@@ -603,7 +603,7 @@ export class SearchPage implements OnInit {
|
|||||||
async viewDocumentDetail(docId:string, applicationId:string) {
|
async viewDocumentDetail(docId:string, applicationId:string) {
|
||||||
let classs;
|
let classs;
|
||||||
|
|
||||||
if( window.innerWidth <= 800) {
|
if( window.innerWidth < 701) {
|
||||||
classs = 'modal modal-desktop'
|
classs = 'modal modal-desktop'
|
||||||
} else {
|
} else {
|
||||||
classs = 'modal modal-desktop showAsideOptions'
|
classs = 'modal modal-desktop showAsideOptions'
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export class AttachmentsService {
|
|||||||
|
|
||||||
deleteEventAttachmentById(attachmentId) {
|
deleteEventAttachmentById(attachmentId) {
|
||||||
|
|
||||||
let geturl = environment.apiURL + `Attachments/Delete?attachmentId=${attachmentId}`;
|
let geturl = environment.apiURL + 'Attachments/Delete';
|
||||||
|
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ export class EventsService {
|
|||||||
return this.http.post<string>(`${puturl}`, event, options)
|
return this.http.post<string>(`${puturl}`, event, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteEvent(eventid:string, eventDeleteType:number)
|
deleteEvent(eventid:string, eventDeleteType:number, calendarName:string)
|
||||||
{
|
{
|
||||||
const puturl = environment.apiURL + 'calendar/DeleteEvent';
|
const puturl = environment.apiURL + 'calendar/DeleteEvent';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
@@ -421,10 +421,38 @@ export class EventsService {
|
|||||||
// 0 for occurence and 1 for serie (delete all events)
|
// 0 for occurence and 1 for serie (delete all events)
|
||||||
params = params.set("eventDeleteType", eventDeleteType.toString());
|
params = params.set("eventDeleteType", eventDeleteType.toString());
|
||||||
|
|
||||||
let options = {
|
let options;
|
||||||
headers: this.headers,
|
|
||||||
params: params
|
switch (this.loggeduser.Profile) {
|
||||||
};
|
case 'MDGPR':
|
||||||
|
if(calendarName == 'Pessoal'){
|
||||||
|
options = {
|
||||||
|
headers: this.headersMdPessoal,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else if(calendarName == 'Oficial'){
|
||||||
|
options = {
|
||||||
|
headers: this.headersMdOficial,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'PR':
|
||||||
|
if(calendarName == 'Pessoal'){
|
||||||
|
options = {
|
||||||
|
headers: this.headersPrPessoal,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else if(calendarName == 'Oficial'){
|
||||||
|
options = {
|
||||||
|
headers: this.headersPrOficial,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.delete(`${puturl}`, options)
|
return this.http.delete(`${puturl}`, options)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { FileService } from './file.service';
|
||||||
|
|
||||||
|
describe('FileService', () => {
|
||||||
|
let service: FileService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(FileService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { FileLoaderService } from '../file/file-loader.service';
|
||||||
|
import { FileToBase64Service } from '../file/file-to-base64.service';
|
||||||
|
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||||
|
//Cordova
|
||||||
|
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class FileService {
|
||||||
|
|
||||||
|
capturedImage:any;
|
||||||
|
capturedImageTitle:any;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private camera: Camera,
|
||||||
|
private fileLoaderService: FileLoaderService,
|
||||||
|
private fileToBase64Service: FileToBase64Service,
|
||||||
|
private iab: InAppBrowser,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
takePicture() {
|
||||||
|
const options: CameraOptions = {
|
||||||
|
quality: 50,
|
||||||
|
destinationType: this.camera.DestinationType.DATA_URL,
|
||||||
|
encodingType: this.camera.EncodingType.JPEG,
|
||||||
|
mediaType: this.camera.MediaType.PICTURE,
|
||||||
|
targetWidth: 720,
|
||||||
|
targetHeight: 720,
|
||||||
|
}
|
||||||
|
|
||||||
|
this.camera.getPicture(options).then((imageData) => {
|
||||||
|
// imageData is either a base64 encoded string or a file URI
|
||||||
|
// 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); */
|
||||||
|
});
|
||||||
|
let data = {
|
||||||
|
image:this.capturedImage,
|
||||||
|
name: this.capturedImageTitle
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 data = {
|
||||||
|
image:this.capturedImage,
|
||||||
|
name: this.capturedImageTitle
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
viewDocumentByUrl(url) {
|
||||||
|
const browser = this.iab.create(url,"_blank");
|
||||||
|
browser.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
<ion-content>
|
<ion-content>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
|
|
||||||
|
|
||||||
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||||
<ion-input placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
|
<ion-input placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ export class ViewEventPage implements OnInit {
|
|||||||
//this.getAttachments();
|
//this.getAttachments();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doRefresh(ev){
|
||||||
|
this.loadEvent();
|
||||||
|
ev.target.complete();
|
||||||
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: any): void {
|
ngOnChanges(changes: any): void {
|
||||||
this.loadedAttachments = null;
|
this.loadedAttachments = null;
|
||||||
this.loadEvent();
|
this.loadEvent();
|
||||||
@@ -115,7 +120,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
if (this.loadedEvent.IsRecurring) {
|
if (this.loadedEvent.IsRecurring) {
|
||||||
|
|
||||||
} else {
|
} 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.toastService.successMessage('Evento apagado');
|
||||||
this.close();
|
this.close();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -39,13 +39,29 @@
|
|||||||
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div class="container-width-100" *ngFor="let msg of messages; let last = last" #scrollMe>
|
<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">
|
<div class="title">
|
||||||
<ion-label>{{msg.u.name}}</ion-label>
|
<ion-label>{{msg.u.name}}</ion-label>
|
||||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="message">
|
||||||
<ion-label>{{msg.msg}}</ion-label>
|
<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() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -53,11 +69,24 @@
|
|||||||
<ion-label>Alterou o nome do grupo para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
<ion-label>Alterou o nome do grupo para "{{msg.msg.split('-').join(' ')}}"</ion-label><br />
|
||||||
{{last ? scrollToBottom() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<div *ngIf="leaveStatus" class="info-text-leave">
|
|
||||||
<ion-label>{{leaveStatus}}</ion-label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
|
|||||||
@@ -144,19 +144,41 @@
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
.title{
|
.title{
|
||||||
display: inline;
|
display: inline;
|
||||||
color: #0782c9;
|
color: #0782c9;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
|
|
||||||
.time{
|
.time{
|
||||||
color: #797979;
|
color: #797979;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
float: right;
|
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{
|
ion-footer{
|
||||||
padding-top: 7.5px;
|
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 { ChatOptionsPopoverPage } from '../../popover/chat-options-popover/chat-options-popover.page';
|
||||||
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
|
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
|
||||||
import { TimeService } from 'src/app/services/functions/time.service';
|
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({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
@@ -22,14 +28,18 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
isGroupCreated:boolean;
|
isGroupCreated:boolean;
|
||||||
loggedUser: any;
|
loggedUser: any;
|
||||||
message:any;
|
message:any;
|
||||||
leaveStatus:any;
|
|
||||||
messages:any;
|
messages:any;
|
||||||
|
allUsers:any[] = [];
|
||||||
|
documents:SearchList[] = [];
|
||||||
|
|
||||||
|
|
||||||
room:any = new Array();
|
room:any = new Array();
|
||||||
roomName:any;
|
roomName:any;
|
||||||
members:any;
|
members:any;
|
||||||
|
|
||||||
|
capturedImage:any;
|
||||||
|
capturedImageTitle:any;
|
||||||
|
|
||||||
loggedUserChat:any;
|
loggedUserChat:any;
|
||||||
scrollingOnce:boolean = true;
|
scrollingOnce:boolean = true;
|
||||||
private scrollChangeCallback: () => void;
|
private scrollChangeCallback: () => void;
|
||||||
@@ -57,6 +67,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
private alertService: AlertService,
|
private alertService: AlertService,
|
||||||
private route: Router,
|
private route: Router,
|
||||||
private timeService: TimeService,
|
private timeService: TimeService,
|
||||||
|
private fileLoaderService: FileLoaderService,
|
||||||
|
private fileToBase64Service: FileToBase64Service,
|
||||||
|
private processesService: ProcessesService,
|
||||||
|
private fileService: FileService,
|
||||||
) {
|
) {
|
||||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||||
this.isGroupCreated = true;
|
this.isGroupCreated = true;
|
||||||
@@ -72,6 +86,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
this.serverLongPull();
|
this.serverLongPull();
|
||||||
console.log(this.roomId);
|
console.log(this.roomId);
|
||||||
this.setStatus('online');
|
this.setStatus('online');
|
||||||
|
this.getChatMembers();
|
||||||
}
|
}
|
||||||
|
|
||||||
setStatus(status:string){
|
setStatus(status:string){
|
||||||
@@ -102,10 +117,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
let scroll = e.srcElement.scrollTop;
|
let scroll = e.srcElement.scrollTop;
|
||||||
if (scroll > this.currentPosition) {
|
if (scroll > this.currentPosition) {
|
||||||
//this.showButton = false;
|
//this.showButton = false;
|
||||||
//alert('BOTTOM');
|
|
||||||
} else {
|
} else {
|
||||||
//this.showButton = true;
|
//this.showButton = true;
|
||||||
//alert('UP');
|
|
||||||
this.scrollingOnce = false;
|
this.scrollingOnce = false;
|
||||||
}
|
}
|
||||||
this.currentPosition = scroll;
|
this.currentPosition = scroll;
|
||||||
@@ -116,6 +129,16 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
window.removeEventListener('scroll', this.scrollChangeCallback, true);
|
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(){
|
openGroupContactsPage(){
|
||||||
this.openGroupContacts.emit(this.roomId);
|
this.openGroupContacts.emit(this.roomId);
|
||||||
}
|
}
|
||||||
@@ -206,11 +229,19 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendMessage(){
|
sendMessage(){
|
||||||
|
|
||||||
let body = {
|
let body = {
|
||||||
"message":
|
"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=>{
|
modal.onDidDismiss().then(res=>{
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if(res.data == 'leave'){
|
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'){
|
else if(res.data == 'delete'){
|
||||||
this.closeAllDesktopComponents.emit();
|
this.closeAllDesktopComponents.emit();
|
||||||
@@ -341,7 +374,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
},
|
},
|
||||||
translucent: true
|
translucent: true
|
||||||
});
|
});
|
||||||
return await popover.present();
|
await popover.present();
|
||||||
|
await popover.onDidDismiss().then(()=>{
|
||||||
|
});
|
||||||
}
|
}
|
||||||
async addContacts(){
|
async addContacts(){
|
||||||
console.log(this.members);
|
console.log(this.members);
|
||||||
@@ -366,31 +401,95 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* async actionSheet() {
|
loadPicture() {
|
||||||
const actionSheet = await this.actionSheetController.create({
|
const input = this.fileLoaderService.createInput({
|
||||||
cssClass: 'my-custom-class',
|
accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||||
buttons: [{
|
})
|
||||||
text: 'Sair do grupo',
|
|
||||||
handler: () => {
|
input.onchange = async () => {
|
||||||
console.log('Delete clicked');
|
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: () => {
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
console.log('Alterar nome do grupo');
|
console.log(res);
|
||||||
this.openChangeGroupName()
|
},(error) => {
|
||||||
}
|
|
||||||
}, {
|
});
|
||||||
text: 'Apagar o grupo',
|
//console.log(this.capturedImage)
|
||||||
handler: () => {
|
};
|
||||||
console.log('Play clicked');
|
}
|
||||||
}
|
|
||||||
},
|
async addDocGestaoDocumental(){
|
||||||
]
|
const modal = await this.modalController.create({
|
||||||
});
|
component: SearchPage,
|
||||||
await actionSheet.present();
|
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() {
|
async _openChatOptions() {
|
||||||
|
|
||||||
@@ -439,6 +538,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
this.openNewEventPage.emit(data);
|
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 { 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 { LoginUserRespose } from 'src/app/models/user.model';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
@@ -26,6 +26,16 @@ export class AllProcessesPage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.loadAllProcesses();
|
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() {
|
doRefresh() {
|
||||||
@@ -35,6 +45,13 @@ export class AllProcessesPage implements OnInit {
|
|||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshing() {
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loadAllProcesses();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
async loadAllProcesses(){
|
async loadAllProcesses(){
|
||||||
let allProcessesList = await this.processesService.GetTasksList("", false).toPromise();
|
let allProcessesList = await this.processesService.GetTasksList("", false).toPromise();
|
||||||
console.log(allProcessesList);
|
console.log(allProcessesList);
|
||||||
@@ -128,7 +145,7 @@ export class AllProcessesPage implements OnInit {
|
|||||||
|
|
||||||
goToProcess(serialNumber:string, workflowName:string, activityName:string){
|
goToProcess(serialNumber:string, workflowName:string, activityName:string){
|
||||||
if(workflowName == 'Despacho') {
|
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']);
|
this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="item width-100">
|
<div class="item width-100">
|
||||||
<div class="exp-top-detail">
|
<div class="exp-top-detail">
|
||||||
<div class="subject">
|
<div class="subject">
|
||||||
<ion-label>{{ task.Folio }}</ion-label>
|
<ion-label>{{ task.Subject }}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-icon">
|
<div class="exp-icon">
|
||||||
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
|
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<ion-header class="ion-no-border">
|
<ion-header class="ion-no-border">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<div class="thetitle"><ion-label >Expediente11</ion-label></div>
|
<div class="thetitle"><ion-label >Expediente</ion-label></div>
|
||||||
<div class="theicon">
|
<div class="theicon">
|
||||||
<button class="btn-no-color" (click)="doRefresh()">
|
<button class="btn-no-color" (click)="doRefresh()">
|
||||||
<ion-icon slot="end" class="title-icon" name="reload-circle"></ion-icon>
|
<ion-icon slot="end" class="title-icon" name="reload-circle"></ion-icon>
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<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()" 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>
|
<button hidden (click)="getDoc()" class="btn-ok" shape="round" >Anexar Documento</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="bookMeeting()" class="btn-ok" shape="round" >Marcar reunião</button>
|
<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');
|
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(){
|
close(){
|
||||||
if( window.innerWidth < 701){
|
if( window.innerWidth < 701){
|
||||||
this.popoverController.dismiss();
|
this.popoverController.dismiss();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<ion-content class="options-container">
|
<ion-content class="options-container">
|
||||||
<div class="arrow-right">
|
<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>
|
<ion-icon slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button>
|
<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>
|
<button (click)="openChangeGroupName()" class="btn-cancel" shape="round" >Alterar nome do grupo</button>
|
||||||
<div class="solid"></div>
|
<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>
|
<button (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
|
||||||
</div>
|
</div>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
import { ChatService } from 'src/app/services/chat.service';
|
import { ChatService } from 'src/app/services/chat.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-chat-popover',
|
selector: 'app-chat-popover',
|
||||||
@@ -16,6 +17,7 @@ export class ChatPopoverPage implements OnInit {
|
|||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
private chatService: ChatService,
|
private chatService: ChatService,
|
||||||
|
private toastService: ToastService,
|
||||||
) {
|
) {
|
||||||
this.roomId = this.navParams.get('roomId');
|
this.roomId = this.navParams.get('roomId');
|
||||||
}
|
}
|
||||||
@@ -24,14 +26,14 @@ export class ChatPopoverPage implements OnInit {
|
|||||||
console.log(this.roomId);
|
console.log(this.roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
close(){
|
close(action:any){
|
||||||
if( window.innerWidth <= 701){
|
if( window.innerWidth <= 701){
|
||||||
this.popoverController.dismiss('cancel');
|
this.popoverController.dismiss(action);
|
||||||
this.modalController.dismiss('cancel');
|
this.modalController.dismiss(action);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.popoverController.dismiss('cancel');
|
this.popoverController.dismiss(action);
|
||||||
this.modalController.dismiss('cancel');
|
this.modalController.dismiss(action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,16 +50,43 @@ export class ChatPopoverPage implements OnInit {
|
|||||||
if(this.room.t === 'p'){
|
if(this.room.t === 'p'){
|
||||||
this.chatService.leaveGroup(body).subscribe(res=>{
|
this.chatService.leaveGroup(body).subscribe(res=>{
|
||||||
console.log(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{
|
else{
|
||||||
this.chatService.leaveChannel(body).subscribe(res=>{
|
this.chatService.leaveChannel(body).subscribe(res=>{
|
||||||
console.log(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
|
//Delete
|
||||||
|
|||||||
Reference in New Issue
Block a user