-
+
{{msg.u.name}}
{{showDateDuration(msg._updatedAt)}}
-
+
{{msg.msg}}
+
+
+
+
+
+
+
+
+
+ {{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}}
+
+
+
+
+
+
+
+
+
+ {{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.html b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html
index 0525e41fe..733469865 100644
--- a/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html
+++ b/src/app/shared/popover/chat-options-popover/chat-options-popover.page.html
@@ -5,9 +5,9 @@
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