diff --git a/package.json b/package.json index acdb2729a..3de89e4fe 100644 --- a/package.json +++ b/package.json @@ -198,4 +198,4 @@ "url": "git+https://Kayaya@bitbucket.org/equilibriumito/gabinete-digital.git" }, "license": "ISC" -} +} \ No newline at end of file diff --git a/src/app/modals/chat-options-features/chat-options-features.page.html b/src/app/modals/chat-options-features/chat-options-features.page.html index d7c27f6b5..d21bc3f28 100644 --- a/src/app/modals/chat-options-features/chat-options-features.page.html +++ b/src/app/modals/chat-options-features/chat-options-features.page.html @@ -7,8 +7,8 @@
- - + +
diff --git a/src/app/modals/chat-options-features/chat-options-features.page.ts b/src/app/modals/chat-options-features/chat-options-features.page.ts index 66fbb4545..3951f5120 100644 --- a/src/app/modals/chat-options-features/chat-options-features.page.ts +++ b/src/app/modals/chat-options-features/chat-options-features.page.ts @@ -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 { SearchPage } from 'src/app/pages/search/search.page'; 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'; @Component({ @@ -18,11 +21,17 @@ export class ChatOptionsFeaturesPage implements OnInit { members: any; attendees: EventPerson[] = []; + capturedImage:any; + capturedImageTitle:any; + constructor( private popoverController: PopoverController, private modalController: ModalController, private alertService: AlertService, private navParams: NavParams, + private fileLoaderService: FileLoaderService, + private fileToBase64Service: FileToBase64Service, + private chatService: ChatService, ) { 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){ this.showLoader = true; //If group is private call getGroupMembers @@ -95,7 +175,6 @@ export class ChatOptionsFeaturesPage implements OnInit { const data = res.data; this.documents.push(data.selected); console.log(res.data); - } }); } diff --git a/src/app/modals/document-detail/document-detail.page.ts b/src/app/modals/document-detail/document-detail.page.ts index 53e6865d2..702fee697 100644 --- a/src/app/modals/document-detail/document-detail.page.ts +++ b/src/app/modals/document-detail/document-detail.page.ts @@ -9,6 +9,8 @@ import { SearchDocumentDetails, SearchFolderDetails } from 'src/app/models/searc import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage'; import { PermissionService } from 'src/app/OtherService/permission.service'; 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({ selector: 'app-document-detail', @@ -39,7 +41,8 @@ export class DocumentDetailPage implements OnInit { private menu: MenuController, private iab: InAppBrowser, public p: PermissionService, - private popoverController: PopoverController + private popoverController: PopoverController, + private location: Location, ) { this.docId = this.navParams.get('docId'); this.applicationId = this.navParams.get('applicationId'); @@ -51,6 +54,8 @@ export class DocumentDetailPage implements OnInit { async LoadDocumentDetails() { this.processes.GetDocumentDetails(this.docId, this.applicationId).subscribe(res=>{ + console.log(res); + this.LoadedDocument = res; this.LoadedDocument.Subject = this.LoadedDocument.Assunto @@ -63,7 +68,7 @@ export class DocumentDetailPage implements OnInit { let task: ExpedientTaskModalPageNavParamsTask let document: SearchDocumentDetails = this.LoadedDocument let folder: SearchFolderDetails = this.LoadedDocument - + if(this.LoadedDocument.ApplicationID == 361 || this.LoadedDocument.ApplicationId == 361) { task = { serialNumber: folder.DispatchNumber, @@ -95,7 +100,7 @@ export class DocumentDetailPage implements OnInit { } else { console.log('unexpected ApplicationID') } - + this.task = task console.log('this.task = task', this.task) @@ -120,16 +125,16 @@ export class DocumentDetailPage implements OnInit { close() { this.modalController.dismiss(); } - + notImplemented() { this.alertService.presentAlert('Funcionalidade em desenvolvimento'); } - // efetuar despacho + // efetuar despacho async openExpedientActionsModal( taskAction: any) { let classs; - if( window.innerWidth <= 800) { + if( window.innerWidth < 701) { classs = 'modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' @@ -150,9 +155,10 @@ export class DocumentDetailPage implements OnInit { } async openBookMeetingModal() { + console.log(this.LoadedDocument); let classs; - if( window.innerWidth <= 800) { + if( window.innerWidth < 701) { classs = 'book-meeting-modal modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' @@ -167,9 +173,34 @@ export class DocumentDetailPage implements OnInit { backdropDismiss: false }); 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() { const popover = await this.popoverController.create({ component: SearchedDocumentOptionsPage, @@ -193,5 +224,5 @@ export class DocumentDetailPage implements OnInit { } }); } - -} \ No newline at end of file + +} diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts index 34972d358..4a0227d18 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts @@ -86,8 +86,9 @@ export class DocumentSetUpMeetingPage implements OnInit { emptyTextDescription = "Sem intervenientes selecionados"; document: SearchFolderDetails | SearchDocumentDetails | any; - subject: string - + subject: string; + docs:any[] = []; + eventPipe = new EventPipe() constructor( @@ -118,6 +119,8 @@ export class DocumentSetUpMeetingPage implements OnInit { this.adding = "intervenient"; this.setDefaultTime() this.getRecurrenceTypes(); + console.log(this.document); + } getRecurrenceTypes() { @@ -178,8 +181,8 @@ export class DocumentSetUpMeetingPage implements OnInit { var Attachments: addAttachment[] = [] let folder: SearchFolderDetails = this.document let document: SearchDocumentDetails = this.document - - if(folder.Documents) { + + /* if(folder.Documents) { this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => { Attachments.push({ ApplicationId: 361, @@ -204,8 +207,28 @@ export class DocumentSetUpMeetingPage implements OnInit { SourceId: e.Id, 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 = { EventId: '', @@ -227,32 +250,34 @@ export class DocumentSetUpMeetingPage implements OnInit { HasAttachments: false, EventRecurrence: { Type: this.EventRecurrenceType, - LastOccurrence: this.Occurrence + LastOccurrence: this.Occurrence, }, + Attachments: this.docs, } + console.log(postEvent); + + const laoder = this.toastService.loading() - this.eventService.create({ - body: postEvent, - calendar: this.postData.CalendarName - }).subscribe(async (respose) => { - + this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => { const res: any = respose; const eventId: string = res - const DocumentToSave = this.attachments.map((e) => { + /* const DocumentToSave = this.attachments.map((e) => { return this.eventPipe.AttactSearchResult(e, eventId, {}) }); await DocumentToSave.forEach(async (attachments, i) => { await this.eventService.addAttachment(attachments).toPromise(); - }); + }); */ + this.toastService.successMessage('Reunião criada') laoder.remove() this.modalController.dismiss() - - }) + },(error) => { + this.toastService.badRequest('Não foi possível marcar a reunião'); + }); } diff --git a/src/app/models/search-document.ts b/src/app/models/search-document.ts index c190e4461..970cda23f 100644 --- a/src/app/models/search-document.ts +++ b/src/app/models/search-document.ts @@ -12,6 +12,7 @@ export class SearchList { export class Attachments { Id?: number + ParentId?:any Source: number SourceId: any SourceName: any diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts index b6609a129..f395efb24 100644 --- a/src/app/pages/agenda/edit-event/edit-event.page.ts +++ b/src/app/pages/agenda/edit-event/edit-event.page.ts @@ -189,7 +189,7 @@ export class EditEventPage implements OnInit { } this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) - + this.postEvent.EventRecurrence.Type = this.selectedRecurringType; this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => { @@ -204,7 +204,7 @@ export class EditEventPage implements OnInit { finally { this.goBack(); } - + } this.toastService.successMessage(); @@ -213,7 +213,7 @@ export class EditEventPage implements OnInit { }); this.isEventEdited = true; - + this.modalController.dismiss(this.isEventEdited); @@ -285,7 +285,7 @@ export class EditEventPage implements OnInit { if(newAttendeesCC) { this.setIntervenientCC(newAttendeesCC); } - + } }); } diff --git a/src/app/pages/agenda/view-event/view-event.page.html b/src/app/pages/agenda/view-event/view-event.page.html index 4c6f67a76..5ae1ebfb3 100644 --- a/src/app/pages/agenda/view-event/view-event.page.html +++ b/src/app/pages/agenda/view-event/view-event.page.html @@ -3,7 +3,12 @@ - + + + + + +
@@ -22,29 +27,29 @@ +
- +
{{loadedEvent.Location}} - +
{{loadedEvent.CalendarName}} {{loadedEvent.CalendarName}}
- +
{{loadedEvent.CalendarName}} {{loadedEvent.CalendarName}}
- +
@@ -76,8 +81,8 @@
- -
+ +
Documentos Anexados
@@ -86,20 +91,20 @@ {{attach.SourceName}} {{attach.Stakeholders}}

- +
{{ attach.CreateDate | date: 'dd-MM-yyyy HH:mm' }}
- +
- +
- +
@@ -110,6 +115,6 @@
- - - \ No newline at end of file + + + diff --git a/src/app/pages/agenda/view-event/view-event.page.ts b/src/app/pages/agenda/view-event/view-event.page.ts index aa9559cce..c7da3ac5e 100644 --- a/src/app/pages/agenda/view-event/view-event.page.ts +++ b/src/app/pages/agenda/view-event/view-event.page.ts @@ -150,6 +150,11 @@ export class ViewEventPage implements OnInit { } + doRefresh(ev){ + this.loadEvent(); + ev.target.complete(); + } + loadEvent() { const loader = this.toastService.loading(); this.eventsService.getEvent(this.eventId).subscribe(res => { @@ -159,12 +164,12 @@ export class ViewEventPage implements OnInit { this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */ loader.remove() }, (error)=>{ - + if(error.status == 0) { this.toastService.badRequest('Não é possível vizualizar este evento no modo offline') } else { this.toastService.badRequest('Este evento já não existe na sua agenda') - } + } loader.remove() this.modalController.dismiss('Eevent not Foud'); @@ -173,7 +178,7 @@ export class ViewEventPage implements OnInit { } 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({ cssClass: 'my-custom-class', @@ -191,7 +196,7 @@ export class ViewEventPage implements OnInit { async OpenDeleteEventModal() { - + const modal = await this.modalController.create({ component: EliminateEventPage, componentProps: { diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index 57c795332..897f6b8df 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -44,7 +44,7 @@
+ [class.item-active]="dm._id == idSelected">
diff --git a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html index e5bebbbc9..263363b7d 100644 --- a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html +++ b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html @@ -37,7 +37,7 @@ - +

{{user.name}}

diff --git a/src/app/pages/chat/group-messages/group-messages.page.html b/src/app/pages/chat/group-messages/group-messages.page.html index 3e336a143..5e699a578 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.html +++ b/src/app/pages/chat/group-messages/group-messages.page.html @@ -40,24 +40,54 @@ A conversa original mantêm-se como chat individual
-
+
{{msg.u.name}} {{showDateDuration(msg._updatedAt)}}
-
+
{{msg.msg}} +
+
+ image +
+
+ + image + + +

{{file.title}}

+

{{file.text}}

+
+
+
+
+
{{last ? scrollToBottom() : ''}}
- Alterou o assunto para "{{msg.msg.split('-').join(' ')}}"
+ Alterou o nome do grupo para "{{msg.msg.split('-').join(' ')}}"
+ {{last ? scrollToBottom() : ''}} +
+
+
+
+ {{user.name}} saiu do grupo
+
+
+ {{last ? scrollToBottom() : ''}} +
+
+
+
+ {{user.name}} foi removido do grupo
+
+
+ {{last ? scrollToBottom() : ''}}
-
- {{leaveStatus}} -
- + diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 210a03648..11bb9a371 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -106,7 +106,7 @@

{{eventoaprovacaostore.countMd + eventoaprovacaostore.countPr}} Documentos

-
+
diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/publication-detail/publication-detail.page.ts index a13637b80..4661354f9 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/publication-detail/publication-detail.page.ts @@ -26,8 +26,6 @@ export class PublicationDetailPage implements OnInit { private animationController: AnimationController, private toastService: ToastService, private location: Location ) { - - alert('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') this.publicationId = this.navParams.get('publicationId'); /* this.folderId = this.navParams.get('folderIdId'); */ diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index a5d019f31..3dc1930a4 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -68,9 +68,9 @@ export class SearchPage implements OnInit { this.select = this.navParams.get('select'); this.showSearchInput = this.navParams.get('showSearchInput'); - + if(this.type == null || this.type == undefined) { - + if(this.currentPath == '/home/agenda') { this.type = "Agenda" } else if (this.currentPath =='/home/gabinete-digital') { @@ -138,7 +138,7 @@ export class SearchPage implements OnInit { res.forEach(e => { const array: any = Object.values(e); - + array[1] = (((array[1] - lowest) / perPercent) * (maximum - minimumSize)/ 100 ) + minimumSize; list.push(array) }); @@ -152,7 +152,7 @@ export class SearchPage implements OnInit { setTimeout(()=>{ WordCloud( elem, - { + { list: this.list, Family: 'Times, serif', gridSize: 15 @@ -171,7 +171,7 @@ export class SearchPage implements OnInit { WordCloud( elem, - { + { list: this.list, Family: 'Times, serif', gridSize: 15 @@ -188,7 +188,7 @@ export class SearchPage implements OnInit { reorderList(orderBy: string) { - + this.ordinance = orderBy; if(this.ordinance == 'recent'){ @@ -210,18 +210,18 @@ export class SearchPage implements OnInit { basicSearch() { if(this.type == "Agenda" ){ - + this.showLoader = true; this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '0').subscribe(res=>{ console.log(res); - + res.Categories.forEach( e => { e['Active'] = false; }); - + // bind respose this.searchCategories = res.Categories; @@ -231,11 +231,11 @@ export class SearchPage implements OnInit { // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - + this.showLoader = false; this.loadWordCloud(); @@ -254,24 +254,24 @@ export class SearchPage implements OnInit { this.search.searchForDoc(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ - + res.Categories.forEach( e => { e['Active'] = false; this.searchCategories.push(e) }); - + // bind respose - + this.sortArrayISODate(res.Documents).forEach(e => { e['appName'] = 'Correspondencia' this.searchDocuments.push(e) }); - + this.reorderList(this.ordinance); - + // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } @@ -280,33 +280,33 @@ export class SearchPage implements OnInit { if(counter ==2){ this.showLoader = false; } - + this.loadWordCloud(); }); - + this.search.searchForDoc(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res=>{ - + res.Categories.forEach( e => { e['Active'] = false; this.searchCategories.push(e) }); - - + + this.sortArrayISODate(res.Documents).forEach(e => { e['appName'] = 'ArquivoDespachoElect' this.searchDocuments.push(e) }); - + this.reorderList(this.ordinance); - + // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - + this.loadWordCloud(); counter++; @@ -314,34 +314,34 @@ export class SearchPage implements OnInit { this.showLoader = false; } }); - + } else { let counter = 0; this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ - + res.Categories.forEach( e => { e['Active'] = false; this.searchCategories.push(e) }); - + // bind respose - + this.sortArrayISODate(res.Documents).forEach(e => { e['appName'] = 'Correspondencia' this.searchDocuments.push(e) }); - + this.reorderList(this.ordinance); - + // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - + counter++; if(counter ==2){ @@ -350,31 +350,31 @@ export class SearchPage implements OnInit { this.loadWordCloud(); }); - + this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res=>{ - + res.Categories.forEach( e => { e['Active'] = false; this.searchCategories.push(e) }); - - + + this.sortArrayISODate(res.Documents).forEach(e => { e['appName'] = 'ArquivoDespachoElect' this.searchDocuments.push(e) }); - + this.reorderList(this.ordinance); - + // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - - + + counter++; if(counter ==2){ @@ -382,22 +382,22 @@ export class SearchPage implements OnInit { } this.loadWordCloud(); }); - + } } else if (this.type == "AccoesPresidenciais"){ - + this.showLoader = true; this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{ console.log(res); - + res.Categories.forEach( e => { e['Active'] = false; }); - + // bind respose this.searchCategories = res.Categories; @@ -407,11 +407,11 @@ export class SearchPage implements OnInit { // hide show document if(this.searchDocuments.length >= 1){ - this.showDocuments = true; + this.showDocuments = true; } else { this.showDocuments = false } - + this.showLoader = false; this.loadWordCloud(); }); @@ -447,7 +447,7 @@ export class SearchPage implements OnInit { this.searchCategories.forEach((e, j) => { if(i != j){ e['Active'] = false; - } + } }) if (this.searchCategories[i]['Active']){ @@ -526,10 +526,10 @@ export class SearchPage implements OnInit { } async filterDocList(categoryName:string){ - + // show all category if(this. showCategory == categoryName ){ - + this.showSearchDocuments = this.searchDocuments; } else { // filter category @@ -569,13 +569,13 @@ export class SearchPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then((res)=>{}); - + } else if(this.type == "AccoesPresidenciais"){ - + this.viewPublicationDetail(Id); } else if(this.type == "AccoesPresidenciais & ArquivoDespachoElect"){ - + if(ApplicationType == '8' || ApplicationType == '361') { this.viewDocumentDetail(Id, ApplicationType); // this.openExpedientActionsModal(searchDocument) @@ -594,7 +594,7 @@ export class SearchPage implements OnInit { cssClass: 'publication-detail modal modal-desktop ', //backdropDismiss: false }); - + await modal.present(); modal.onDidDismiss().then(()=>{}); @@ -603,12 +603,12 @@ export class SearchPage implements OnInit { async viewDocumentDetail(docId:string, applicationId:string) { let classs; - if( window.innerWidth <= 800) { + if( window.innerWidth < 701) { classs = 'modal modal-desktop' } else { classs = 'modal modal-desktop showAsideOptions' } - + const modal = await this.modalController.create({ component: DocumentDetailPage, componentProps:{ @@ -622,5 +622,5 @@ export class SearchPage implements OnInit { } - + } diff --git a/src/app/services/attachments.service.ts b/src/app/services/attachments.service.ts index ab80bc293..fa0be2ba1 100644 --- a/src/app/services/attachments.service.ts +++ b/src/app/services/attachments.service.ts @@ -74,7 +74,7 @@ export class AttachmentsService { deleteEventAttachmentById(attachmentId) { - let geturl = environment.apiURL + `Attachments/Delete?attachmentId=${attachmentId}`; + let geturl = environment.apiURL + 'Attachments/Delete'; let params = new HttpParams(); diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index 833d4323f..a3b4b8509 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -412,7 +412,7 @@ export class EventsService { return this.http.post(`${puturl}`, event, options) } - deleteEvent(eventid:string, eventDeleteType:number) + deleteEvent(eventid:string, eventDeleteType:number, calendarName:string) { const puturl = environment.apiURL + 'calendar/DeleteEvent'; let params = new HttpParams(); @@ -421,10 +421,38 @@ export class EventsService { // 0 for occurence and 1 for serie (delete all events) params = params.set("eventDeleteType", eventDeleteType.toString()); - let options = { - headers: this.headers, - params: params - }; + let options; + + 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) } diff --git a/src/app/services/functions/file.service.spec.ts b/src/app/services/functions/file.service.spec.ts new file mode 100644 index 000000000..35474aab7 --- /dev/null +++ b/src/app/services/functions/file.service.spec.ts @@ -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(); + }); +}); diff --git a/src/app/services/functions/file.service.ts b/src/app/services/functions/file.service.ts new file mode 100644 index 000000000..172e87ba4 --- /dev/null +++ b/src/app/services/functions/file.service.ts @@ -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(); + } +} diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html index ddea0f9c0..0bc43371e 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -14,6 +14,7 @@
+
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts index 308b74d4b..4255a3f65 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -166,7 +166,7 @@ export class EditEventPage implements OnInit { const str: any = this.postEvent.EventRecurrence.Type.toString() this.postEvent.EventRecurrence.Type = str } - + this.Form = new FormGroup({ Subject: new FormControl(this.postEvent.Subject, [ Validators.required, diff --git a/src/app/shared/agenda/view-event/view-event.page.html b/src/app/shared/agenda/view-event/view-event.page.html index a2e90819c..e34659b09 100644 --- a/src/app/shared/agenda/view-event/view-event.page.html +++ b/src/app/shared/agenda/view-event/view-event.page.html @@ -16,7 +16,7 @@
@@ -32,14 +32,14 @@
{{loadedEvent.Location}} - - + +
{{loadedEvent.CalendarName}} {{loadedEvent.CalendarName}}
- +
{{loadedEvent.CalendarName}} {{loadedEvent.CalendarName}} @@ -77,7 +77,7 @@
- +
Documentos Anexados
@@ -101,7 +101,7 @@
-
- - -
\ No newline at end of file +
+ + + diff --git a/src/app/shared/agenda/view-event/view-event.page.ts b/src/app/shared/agenda/view-event/view-event.page.ts index 04d844b06..da5b7723e 100644 --- a/src/app/shared/agenda/view-event/view-event.page.ts +++ b/src/app/shared/agenda/view-event/view-event.page.ts @@ -63,6 +63,11 @@ export class ViewEventPage implements OnInit { //this.getAttachments(); } + doRefresh(ev){ + this.loadEvent(); + ev.target.complete(); + } + ngOnChanges(changes: any): void { this.loadedAttachments = null; this.loadEvent(); @@ -115,7 +120,7 @@ export class ViewEventPage implements OnInit { if (this.loadedEvent.IsRecurring) { } else { - this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () => { + this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => { this.toastService.successMessage('Evento apagado'); this.close(); }); diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index 54d9bbcbf..93e2c0972 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -39,13 +39,29 @@ A conversa original mantêm-se como chat individual
-
+
{{msg.u.name}} {{showDateDuration(msg._updatedAt)}}
-
+
{{msg.msg}} +
+
+ image +
+
+ + image + + +

{{file.title}}

+

{{file.text}}

+
+
+
+
+
{{last ? scrollToBottom() : ''}}
@@ -53,11 +69,24 @@ Alterou o nome do grupo para "{{msg.msg.split('-').join(' ')}}"
{{last ? scrollToBottom() : ''}}
+
+
+
+ {{user.name}} saiu do grupo
+
+
+ {{last ? scrollToBottom() : ''}} +
+
+
+
+ {{user.name}} foi removido do grupo
+
+
+ {{last ? scrollToBottom() : ''}} +
-
- {{leaveStatus}} -
diff --git a/src/app/shared/chat/group-messages/group-messages.page.scss b/src/app/shared/chat/group-messages/group-messages.page.scss index ca3555a51..dbc4127ba 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.scss +++ b/src/app/shared/chat/group-messages/group-messages.page.scss @@ -144,19 +144,41 @@ float: right; } .title{ - display: inline; - color: #0782c9; - font-weight: bold; - margin-bottom: 5px; + display: inline; + color: #0782c9; + font-weight: bold; + margin-bottom: 5px; - .time{ - color: #797979; - text-align: right; - margin-left: 10px; - float: right; + .time{ + color: #797979; + text-align: right; + margin-left: 10px; + float: right; + } } - } - } + .message{ + .message-attachments{ + .file{ + align-items: center; + + .file-details{ + width: 100%; + + .file-title{ + color: #000; + text-decoration: underline; + white-space: nowrap; + overflow: hidden !important; + text-overflow: ellipsis !important; + } + .file-title:hover{ + color: #0782c9; + } + } + } + } + } + } ion-footer{ padding-top: 7.5px; diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index a266277f4..c75650f5a 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -11,6 +11,12 @@ import { Router } from '@angular/router' import { ChatOptionsPopoverPage } from '../../popover/chat-options-popover/chat-options-popover.page'; import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page'; import { TimeService } from 'src/app/services/functions/time.service'; +import { FileLoaderService } from 'src/app/services/file/file-loader.service'; +import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service'; +import { SearchPage } from 'src/app/pages/search/search.page'; +import { SearchList } from 'src/app/models/search-document'; +import { ProcessesService } from 'src/app/services/processes.service'; +import { FileService } from 'src/app/services/functions/file.service'; @Component({ selector: 'app-group-messages', @@ -22,14 +28,18 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe isGroupCreated:boolean; loggedUser: any; message:any; - leaveStatus:any; messages:any; + allUsers:any[] = []; + documents:SearchList[] = []; room:any = new Array(); roomName:any; members:any; + capturedImage:any; + capturedImageTitle:any; + loggedUserChat:any; scrollingOnce:boolean = true; private scrollChangeCallback: () => void; @@ -57,6 +67,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe private alertService: AlertService, private route: Router, private timeService: TimeService, + private fileLoaderService: FileLoaderService, + private fileToBase64Service: FileToBase64Service, + private processesService: ProcessesService, + private fileService: FileService, ) { this.loggedUserChat = authService.ValidatedUserChat['data']; this.isGroupCreated = true; @@ -72,6 +86,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe this.serverLongPull(); console.log(this.roomId); this.setStatus('online'); + this.getChatMembers(); } setStatus(status:string){ @@ -102,10 +117,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe let scroll = e.srcElement.scrollTop; if (scroll > this.currentPosition) { //this.showButton = false; - //alert('BOTTOM'); } else { //this.showButton = true; - //alert('UP'); this.scrollingOnce = false; } this.currentPosition = scroll; @@ -116,6 +129,16 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe window.removeEventListener('scroll', this.scrollChangeCallback, true); } + async getChatMembers(){ + //return await this.chatService.getMembers(roomId).toPromise(); + this.chatService.getAllUsers().subscribe(res=> { + console.log(res); + + this.allUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username); + console.log(this.allUsers); + }); + } + openGroupContactsPage(){ this.openGroupContacts.emit(this.roomId); } @@ -206,11 +229,19 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } sendMessage(){ - let body = { "message": { - "rid": this.roomId, "msg": this.message + "rid": this.roomId, + "msg": this.message, + /* "attachments": [{ + "color": "#ff0000", + "text": "Yay for gruggy!", + "title": "Attachment Example", + "title_link": "https://youtube.com", + "title_link_download": false, + "image_url": "https://upload.wikimedia.org/wikipedia/commons/e/ee/Chain_link_icon.png", + }] */ } } @@ -271,7 +302,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe modal.onDidDismiss().then(res=>{ console.log(res); if(res.data == 'leave'){ - this.leaveStatus = this.loggedUser.me.name + ' saiu do grupo'; + this.getRoomInfo(); + this.closeAllDesktopComponents.emit(); + this.showEmptyContainer.emit(); } else if(res.data == 'delete'){ this.closeAllDesktopComponents.emit(); @@ -341,7 +374,9 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe }, translucent: true }); - return await popover.present(); + await popover.present(); + await popover.onDidDismiss().then(()=>{ + }); } async addContacts(){ console.log(this.members); @@ -366,31 +401,95 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe }); } - /* async actionSheet() { - const actionSheet = await this.actionSheetController.create({ - cssClass: 'my-custom-class', - buttons: [{ - text: 'Sair do grupo', - handler: () => { - console.log('Delete clicked'); + loadPicture() { + const input = this.fileLoaderService.createInput({ + accept: ['image/apng', 'image/jpeg', 'image/png'] + }) + + input.onchange = async () => { + const file = this.fileLoaderService.getFirstFile(input) + + console.log(file); + + const imageData = await this.fileToBase64Service.convert(file) + this.capturedImage = imageData; + this.capturedImageTitle = file.name; + + let body = { + "message": + { + "rid": this.roomId, + "msg": "", + "attachments": [{ + //"title": this.capturedImageTitle , + //"text": "description", + "title_link_download": false, + "image_url": this.capturedImage, + }] } - }, { - text: 'Alterar nome do grupo1', - handler: () => { - console.log('Alterar nome do grupo'); - this.openChangeGroupName() - } - }, { - text: 'Apagar o grupo', - handler: () => { - console.log('Play clicked'); - } - }, - ] - }); - await actionSheet.present(); + } + + this.chatService.sendMessage(body).subscribe(res=> { + console.log(res); + },(error) => { + + }); + //console.log(this.capturedImage) + }; + } + + async addDocGestaoDocumental(){ + const modal = await this.modalController.create({ + component: SearchPage, + cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop', + componentProps: { + type: 'AccoesPresidenciais & ArquivoDespachoElect', + select: true, + showSearchInput: true, + } + }); + await modal.present(); + modal.onDidDismiss().then(async res=>{ + if(res){ + const data = res.data; + this.documents.push(data.selected); + console.log(res.data.selected); + console.log(res.data.selected.Id); + console.log(res.data.selected.ApplicationType); + + let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise(); + let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); + console.log(url_no_options); + console.log('Oie'); + + let body = { + "message": + { + "rid": this.roomId, + "msg": "", + "attachments": [{ + "title": res.data.selected.Assunto, + "text": res.data.selected.DocTypeDesc, + "title_link": url_no_options, + "title_link_download": true, + "thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png", + "message_link": url_no_options, + }] + } + } + this.chatService.sendMessage(body).subscribe(res=> { + console.log(res); + },(error) => { + + }); + + } + }); + } + + viewDocument(url:string){ + this.fileService.viewDocumentByUrl(url); } - */ async _openChatOptions() { @@ -439,6 +538,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } this.openNewEventPage.emit(data); } + else if(res['data'] == 'picture'){ + this.loadPicture(); + } + else if(res['data'] == 'documentoGestaoDocumental'){ + this.addDocGestaoDocumental(); + } }); } diff --git a/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts b/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts index 0854e0a57..66532d60c 100644 --- a/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts +++ b/src/app/shared/gabinete-digital/all-processes/all-processes.page.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import { NavigationStart, Router } from '@angular/router'; import { LoginUserRespose } from 'src/app/models/user.model'; import { AuthService } from 'src/app/services/auth.service'; import { ProcessesService } from 'src/app/services/processes.service'; @@ -26,6 +26,16 @@ export class AllProcessesPage implements OnInit { ngOnInit() { this.loadAllProcesses(); + + this.router.events.forEach((event) => { + if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital')) { + if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) { + this.refreshing(); + } else { + this.loadAllProcesses(); + } + } + }); } doRefresh() { @@ -35,6 +45,13 @@ export class AllProcessesPage implements OnInit { }, 1000); } + refreshing() { + + setTimeout(() => { + this.loadAllProcesses(); + }, 1000); + } + async loadAllProcesses(){ let allProcessesList = await this.processesService.GetTasksList("", false).toPromise(); console.log(allProcessesList); @@ -128,7 +145,7 @@ export class AllProcessesPage implements OnInit { goToProcess(serialNumber:string, workflowName:string, activityName:string){ if(workflowName == 'Despacho') { - if(activityName == 'Tarefa de Despacho'){ + if(activityName == 'Tarefa de Despacho'|| activityName == 'Concluir Despacho'){ this.router.navigate(['/home/gabinete-digital/despachos',serialNumber,'gabinete-digital']); } } diff --git a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.html b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.html index 4ba4bac60..164aec4fb 100644 --- a/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.html +++ b/src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page.html @@ -22,7 +22,7 @@
- {{ task.Folio }} + {{ task.Subject }}
diff --git a/src/app/shared/gabinete-digital/expedients/expedients.page.html b/src/app/shared/gabinete-digital/expedients/expedients.page.html index 1c65289ef..cff3e4143 100644 --- a/src/app/shared/gabinete-digital/expedients/expedients.page.html +++ b/src/app/shared/gabinete-digital/expedients/expedients.page.html @@ -1,6 +1,6 @@
-
Expediente11
+
Expediente
- + - +
diff --git a/src/app/shared/popover/chat-options-popover/chat-options-popover.page.ts b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.ts index bd38ed2c1..ef47957ae 100644 --- a/src/app/shared/popover/chat-options-popover/chat-options-popover.page.ts +++ b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.ts @@ -45,6 +45,24 @@ export class ChatOptionsPopoverPage implements OnInit { this.alertService.presentAlert('Funcionalidade em desenvolvimento'); } + takePicture(){ + if( window.innerWidth < 701){ + this.popoverController.dismiss('takePicture'); + } + else{ + this.modalController.dismiss('takePicture'); + } + } + + anexarFoto(){ + if( window.innerWidth < 701){ + this.popoverController.dismiss('loadPicture'); + } + else{ + this.modalController.dismiss('loadPicture'); + } + } + close(){ if( window.innerWidth < 701){ this.popoverController.dismiss(); diff --git a/src/app/shared/popover/chat-popover/chat-popover.page.html b/src/app/shared/popover/chat-popover/chat-popover.page.html index f179b830e..d402757a7 100644 --- a/src/app/shared/popover/chat-popover/chat-popover.page.html +++ b/src/app/shared/popover/chat-popover/chat-popover.page.html @@ -1,6 +1,6 @@
-
@@ -8,7 +8,7 @@
- +
diff --git a/src/app/shared/popover/chat-popover/chat-popover.page.ts b/src/app/shared/popover/chat-popover/chat-popover.page.ts index 990d70100..ca1d0742b 100644 --- a/src/app/shared/popover/chat-popover/chat-popover.page.ts +++ b/src/app/shared/popover/chat-popover/chat-popover.page.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { ModalController, NavParams, PopoverController } from '@ionic/angular'; import { ChatService } from 'src/app/services/chat.service'; +import { ToastService } from 'src/app/services/toast.service'; @Component({ selector: 'app-chat-popover', @@ -16,6 +17,7 @@ export class ChatPopoverPage implements OnInit { private modalController: ModalController, private navParams: NavParams, private chatService: ChatService, + private toastService: ToastService, ) { this.roomId = this.navParams.get('roomId'); } @@ -24,14 +26,14 @@ export class ChatPopoverPage implements OnInit { console.log(this.roomId); } - close(){ + close(action:any){ if( window.innerWidth <= 701){ - this.popoverController.dismiss('cancel'); - this.modalController.dismiss('cancel'); + this.popoverController.dismiss(action); + this.modalController.dismiss(action); } else{ - this.popoverController.dismiss('cancel'); - this.modalController.dismiss('cancel'); + this.popoverController.dismiss(action); + this.modalController.dismiss(action); } } @@ -48,16 +50,43 @@ export class ChatPopoverPage implements OnInit { if(this.room.t === 'p'){ this.chatService.leaveGroup(body).subscribe(res=>{ console.log(res); + this.close('leave'); + }, + (e)=>{ + if(e.error.errorType = "error-you-are-last-owner"){ + this.toastService.badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo."); + this.close('cancel'); + } + else{ + this.toastService.badRequest("Não foi possível sair do grupo"); + this.close('cancel'); + } + + }, + ()=>{ + //loader.remove() }); } else{ this.chatService.leaveChannel(body).subscribe(res=>{ console.log(res); + this.close('leave'); + }, + (e)=>{ + if(e.error.errorType = "error-you-are-last-owner"){ + this.toastService.badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo."); + this.close('cancel'); + } + else{ + this.toastService.badRequest("Não foi possível sair do grupo"); + this.close('cancel'); + } + }, + ()=>{ + //loader.remove() }); } }); - this.popoverController.dismiss('leave'); - this.modalController.dismiss('leave'); } //Delete