diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index b9e15b1cc..01de8ea31 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -19,6 +19,8 @@ import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera import { Filesystem, Directory } from '@capacitor/filesystem'; import { NgxImageCompressService } from "ngx-image-compress"; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; +import { PublicationFolderService } from 'src/app/store/publication-folder.service'; + const IMAGE_DIR = 'stored-images'; @@ -87,14 +89,15 @@ export class NewPublicationPage implements OnInit { private platform: Platform, private loadingCtrl: LoadingController, public imageCompress: NgxImageCompressService, - private httpErrorHandle: HttpErrorHandle + private httpErrorHandle: HttpErrorHandle, + public PublicationFolderService: PublicationFolderService ) { this.publicationType = this.navParams.get('publicationType'); this.folderId = this.navParams.get('folderId'); + this.publication = this.navParams.get('publication'); this.publicationTitle = 'Nova Publicação'; - this.convertBlobToBase64Worker = new Worker(new URL('./convertBlobToBase64.worker.js', import.meta.url)); } @@ -151,27 +154,6 @@ export class NewPublicationPage implements OnInit { }); - /* async laodPicture() { - const capturedImage = await Camera.getPhoto({ - resultType: CameraResultType.Uri, - source: CameraSource.Photos, - quality: 90, - width: 1080, - height: 720, - }); - - const response = await fetch(capturedImage.webPath!); - const blob = await response.blob(); - - this.photos.unshift({ - filepath: "soon...", - webviewPath: capturedImage.webPath - }); - - this.capturedImage = await this.convertBlobToBase64(blob); - this.capturedImageTitle = new Date().getTime() + '.jpeg'; - } */ - async laodPicture() { const capturedImage = await Camera.getPhoto({ @@ -295,8 +277,6 @@ export class NewPublicationPage implements OnInit { FileBase64: this.capturedImage, FileExtension: 'jpeg', } - - const loader = this.toastService.loading() @@ -312,6 +292,8 @@ export class NewPublicationPage implements OnInit { } } + + this.PublicationFolderService.loadPublication(this.publication.DocumentId, this.publication.ProcessId) } else { diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts index a0013f0e6..e02b7030d 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts @@ -76,33 +76,54 @@ export class PublicationDetailPage implements OnInit { } getPublicationDetail() { - this.showLoader = true; - - this.publications.GetPublicationById(this.publicationId).subscribe(res => { - - /* this.publication = res; */ + const folderId = this.folderId + const localPublication = this.publicationFolderService.getLocalPublication(folderId, this.publicationId); + + if(localPublication?.DocumentId) { + this.publication = { - DateIndex: res.DateIndex, - DocumentId: res.DocumentId, - ProcessId:res.ProcessId, - Title:res.Title, - Message: res.Message, - DatePublication: res.DatePublication, - FileBase64: "data:image/jpg;base64," + res.FileBase64, - OriginalFileName: res.OriginalFileName, + DateIndex: localPublication.DateIndex, + DocumentId: localPublication.DocumentId, + ProcessId:localPublication.ProcessId, + Title:localPublication.Title, + Message: localPublication.Message, + DatePublication: localPublication.DatePublication, + FileBase64: localPublication.FileBase64, + OriginalFileName: localPublication.OriginalFileName, FileExtension: 'jpeg', } - console.log('PUBLICATIO ImG',this.publication.FileBase64) - this.showLoader = false; - }, (error) => { + } else { - if(error.status == 404) { - this.publicationFolderService.deletePost(this.folderId, this.publicationId) - } + this.showLoader = true; + + this.publications.GetPublicationById(this.publicationId).subscribe(res => { + + /* this.publication = res; */ + this.publication = { + DateIndex: res.DateIndex, + DocumentId: res.DocumentId, + ProcessId:res.ProcessId, + Title:res.Title, + Message: res.Message, + DatePublication: res.DatePublication, + FileBase64: "data:image/jpg;base64," + res.FileBase64, + OriginalFileName: res.OriginalFileName, + FileExtension: 'jpeg', + } + + this.showLoader = false; + }, (error) => { + this.showLoader = false; + + if(error.status == 404) { + this.publicationFolderService.deletePost(this.folderId, this.publicationId) + } + + this.goBack(); + this.httpErrorHandle.httpStatusHandle(error) + }); + } - this.goBack(); - this.httpErrorHandle.httpStatusHandle(error) - }); } close() { @@ -110,7 +131,7 @@ export class PublicationDetailPage implements OnInit { } goBack() { - if(!window.location.href.includes('/home/publications/view-publications')) { + if(this.isModal) { this.close() } else { this.RouteService.goBack(); @@ -179,9 +200,4 @@ export class PublicationDetailPage implements OnInit { modal.present(); } - - - - - } diff --git a/src/app/pages/publications/view-publications/view-publications.page.html b/src/app/pages/publications/view-publications/view-publications.page.html index 7ff5f4681..dee636a27 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.html +++ b/src/app/pages/publications/view-publications/view-publications.page.html @@ -7,9 +7,8 @@ -
+

{{publicationFolderService.FolderDetails[folderId].Description}}

-

{{publicationFolderService.FolderDetails[folderId].Detail}}

@@ -30,6 +29,9 @@
+ +

{{publicationFolderService.FolderDetails[folderId].Detail}}

+ @@ -51,65 +53,6 @@
-
diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index fd11fdd61..c7b85af1b 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -100,6 +100,7 @@ export class ViewPublicationsPage implements OnInit { createPublicationList(folderId = this.folderId) { + console.log('create') if(!this.publicationFolderService.publicationList[folderId]) { this.publicationFolderService.publicationList[folderId] = [] } @@ -132,7 +133,6 @@ export class ViewPublicationsPage implements OnInit { getPublicationDetail() { const folderId = this.folderId this.publications.GetPresidentialAction(folderId).subscribe(res =>{ - this.publicationFolderService.FolderDetails[folderId] = res this.storage.set(folderId+"name", res) }, (error) => { diff --git a/src/app/services/task.service.ts b/src/app/services/task.service.ts index 12283484b..12407e95b 100644 --- a/src/app/services/task.service.ts +++ b/src/app/services/task.service.ts @@ -18,6 +18,7 @@ import { SortService } from './functions/sort.service'; import { customTask } from '../models/dailyworktask.model'; import { Router } from '@angular/router'; import { v4 as uuidv4 } from 'uuid' +import { ChangeProfileService } from './change-profile.service'; @Injectable({ providedIn: 'root' @@ -64,8 +65,14 @@ export class TaskService { private despachoRule: DespachoService, public eventService: EventsService, private router: Router, + private changeProfileService: ChangeProfileService, ) { + this.changeProfileService.registerCallback(() => { + this.updateCount() + this.runCallback(); + }) + window['all-process-gabinete'] = () => { this.updateAllProcess(); this.updateCount(); diff --git a/src/app/shared/publication/new-publication/new-publication.page.ts b/src/app/shared/publication/new-publication/new-publication.page.ts index 89f89425f..91211de48 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -9,6 +9,8 @@ import { FormControl, FormGroup, Validators } from '@angular/forms'; import { ThemeService } from 'src/app/services/theme.service'; import { Camera, CameraResultType, CameraSource} from '@capacitor/camera'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; +import { PublicationFolderService } from 'src/app/store/publication-folder.service'; + @Component({ selector: 'app-new-publication', templateUrl: './new-publication.page.html', @@ -50,7 +52,8 @@ export class NewPublicationPage implements OnInit { private publications: PublicationsService, private toastService: ToastService, public ThemeService: ThemeService, - private httpErroHandle: HttpErrorHandle + private httpErroHandle: HttpErrorHandle, + public PublicationFolderService: PublicationFolderService ) { this.publicationTitle = 'Nova Publicação'; } @@ -65,22 +68,43 @@ export class NewPublicationPage implements OnInit { } getPublicationDetail() { - this.showLoader = true; - this.publications.GetPublicationById(this.publicationId).subscribe( res => { + + + const folderId = this.folderId + const localPublication = this.PublicationFolderService.getLocalPublication(folderId, this.publicationId); + + if(localPublication?.DocumentId) { + this.publication = { - DateIndex: res.DateIndex, - DocumentId: res.DocumentId, - ProcessId:res.ProcessId, - Title:res.Title, - Message: res.Message, - DatePublication: res.DatePublication, - FileBase64: "data:image/jpg;base64," + res.FileBase64, - OriginalFileName: res.OriginalFileName, + DateIndex: localPublication.DateIndex, + DocumentId: localPublication.DocumentId, + ProcessId:localPublication.ProcessId, + Title:localPublication.Title, + Message: localPublication.Message, + DatePublication: localPublication.DatePublication, + FileBase64: localPublication.FileBase64, + OriginalFileName: localPublication.OriginalFileName, FileExtension: 'jpeg', } - this.pub = this.publication; - this.showLoader = false; - }); + } else { + this.showLoader = true; + this.publications.GetPublicationById(this.publicationId).subscribe( res => { + this.publication = { + DateIndex: res.DateIndex, + DocumentId: res.DocumentId, + ProcessId:res.ProcessId, + Title:res.Title, + Message: res.Message, + DatePublication: res.DatePublication, + FileBase64: "data:image/jpg;base64," + res.FileBase64, + OriginalFileName: res.OriginalFileName, + FileExtension: 'jpeg', + } + this.pub = this.publication; + this.showLoader = false; + }); + } + } @@ -228,6 +252,9 @@ export class NewPublicationPage implements OnInit { } } + + + this.PublicationFolderService.loadPublication(this.publication.DocumentId, this.publication.ProcessId) } else { diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html index 077646950..c2bfb2b33 100644 --- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html +++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html @@ -19,6 +19,7 @@

+ diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts index 475a05a4b..14a2b5491 100644 --- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts @@ -18,7 +18,6 @@ export class PublicationDetailPage implements OnInit { showLoader: boolean; /* folderId: string; */ publication: Publication; - @Input() publicationId: string; @Input() folderId: string; @Output() addNewPublication = new EventEmitter(); @@ -64,30 +63,52 @@ export class PublicationDetailPage implements OnInit { } getPublicationDetail() { - this.showLoader = true; - this.publications.GetPublicationById(this.publicationId).subscribe(res => { - + + const folderId = this.folderId + const localPublication = this.publicationFolderService.getLocalPublication(folderId, this.publicationId); + + if(localPublication?.DocumentId) { + this.publication = { - DateIndex: res.DateIndex, - DocumentId: res.DocumentId, - ProcessId:res.ProcessId, - Title:res.Title, - Message: res.Message, - DatePublication: res.DatePublication, - FileBase64: "data:image/jpg;base64," + res.FileBase64, - OriginalFileName: res.OriginalFileName, + DateIndex: localPublication.DateIndex, + DocumentId: localPublication.DocumentId, + ProcessId:localPublication.ProcessId, + Title:localPublication.Title, + Message: localPublication.Message, + DatePublication: localPublication.DatePublication, + FileBase64: localPublication.FileBase64, + OriginalFileName: localPublication.OriginalFileName, FileExtension: 'jpeg', } - this.showLoader = false; - }, (error) => { + } else { + + this.showLoader = true; + this.publications.GetPublicationById(this.publicationId).subscribe(res => { + + this.publication = { + DateIndex: res.DateIndex, + DocumentId: res.DocumentId, + ProcessId:res.ProcessId, + Title:res.Title, + Message: res.Message, + DatePublication: res.DatePublication, + FileBase64: "data:image/jpg;base64," + res.FileBase64, + OriginalFileName: res.OriginalFileName, + FileExtension: 'jpeg', + } + this.showLoader = false; + }, (error) => { + this.showLoader = false; - if(error.status == 404) { - this.publicationFolderService.deletePost(this.folderId, this.publicationId) - } - - this.goBack(); - this.httpErrorHandle.httpStatusHandle(error) - }); + if(error.status == 404) { + this.publicationFolderService.deletePost(this.folderId, this.publicationId) + } + + this.goBack(); + this.httpErrorHandle.httpStatusHandle(error) + }); + } + } close() { diff --git a/src/app/shared/publication/view-publications/view-publications.page.html b/src/app/shared/publication/view-publications/view-publications.page.html index 1fa05e351..9f716f4a6 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.html +++ b/src/app/shared/publication/view-publications/view-publications.page.html @@ -1,12 +1,12 @@
-
+
{{publicationFolderService.FolderDetails[folderId].Description}}
-
+
-

{{publicationFolderService.FolderDetails[folderId].Detail}}

@@ -36,6 +35,8 @@
+

{{publicationFolderService.FolderDetails[folderId].Detail}}

+ diff --git a/src/app/store/publication-folder.service.ts b/src/app/store/publication-folder.service.ts index 0597856c2..a54700c33 100644 --- a/src/app/store/publication-folder.service.ts +++ b/src/app/store/publication-folder.service.ts @@ -2,6 +2,8 @@ import { Injectable } from '@angular/core'; import { PublicationFolder } from '../models/publicationfolder'; import { Storage } from '@ionic/storage'; import { Publication } from '../models/publication'; +import { PublicationsService } from '../services/publications.service'; +import { PublicationPipe } from 'src/app/pipes/publication.pipe'; @Injectable({ providedIn: 'root' @@ -14,9 +16,15 @@ export class PublicationFolderService { restoreFolder: {} = {} keyName: string + + showLoader = true + publicationPipe = new PublicationPipe() + getpublication = []; + constructor( private storage: Storage, + private publications: PublicationsService, ) {} @@ -31,6 +39,7 @@ export class PublicationFolderService { getFromDB(folderId: any) { + if(!this.restoreFolder[folderId]) { this.storage.get(folderId).then((viewPublications) => { @@ -69,11 +78,8 @@ export class PublicationFolderService { const findIndex = this.publicationFindIndex(publicationId, folderId) const found = this.publicationIsPresent(publicationId, folderId) if(!found) { - console.log('push',folderId, Publication) this.publicationList[folderId].push(Publication) } else { - - console.log('update',folderId, Publication) this.publicationList[folderId][findIndex] = Publication } } @@ -88,6 +94,108 @@ export class PublicationFolderService { } } + + getPublicationDetail(folderId) { + + this.publications.GetPresidentialAction(folderId).subscribe(res => { + this.FolderDetails[folderId] = res + this.storage.set(folderId+"name", res) + }, (error) => { + this.showLoader = false; + // this.httpErroHandle.httpStatusHandle(error) + }); + } + + + async getPublicationsIds(folderId) { + + this.showLoader = true; + + try { + const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise(); + + this.createPublicationList(folderId) + let loadLater = [] + for (let publicationId of publicationIds) { + + if(!this.publicationIsPresent(publicationId, folderId)) { + await this.loadPublication(publicationId, folderId) + + } else { + loadLater.push(publicationId) + } + } + + for( let publicationId of loadLater) { + await this.loadPublication(publicationId, folderId) + } + + this.showLoader = false; + + this.storage.set(folderId, this.publicationList[folderId]); + this.getpublication = this.publicationList[folderId]; + } catch(error) { + this.showLoader = false; + } + + } + + + async loadPublication(publicationId, folderId) { + let Publication = await this.publications.GetPublicationById(publicationId).toPromise(); + let publicationDetails: Publication = this.publicationPipe.itemList(Publication) + + const findIndex = this.publicationFindIndex(publicationId, folderId) + const found = this.publicationIsPresent(publicationId, folderId) + if(!found) { + this.publicationList[folderId].push(publicationDetails) + } else { + this.publicationList[folderId][findIndex] = publicationDetails + } + + } + + async setPublication(publicationId, folderId, publicationDetails: Publication) { + + + const findIndex = this.publicationFindIndex(publicationId, folderId) + const found = this.publicationIsPresent(publicationId, folderId) + if(!found) { + this.publicationList[folderId].push(publicationDetails) + } else { + this.publicationList[folderId][findIndex] = publicationDetails + } + + } + + + async getPublication(publicationId, folderId, publicationDetails: Publication) { + + + const findIndex = this.publicationFindIndex(publicationId, folderId) + const found = this.publicationIsPresent(publicationId, folderId) + if(!found) { + this.publicationList[folderId].push(publicationDetails) + } else { + return this.publicationList[folderId][findIndex] + } + + } + + + getLocalPublication (folderId, publicationId) { + + if(this.publicationList[folderId]) { + + this.publicationList[folderId].filter( e=> e.ProcessId == publicationId || e.DocumentId == publicationId); + + return this.publicationList[folderId].filter( e => e.ProcessId == publicationId || e.DocumentId == publicationId)?.[0] + } else { + + } + + } + } diff --git a/src/theme/variables.scss b/src/theme/variables.scss index ae5d5b2ae..29fb1618f 100644 --- a/src/theme/variables.scss +++ b/src/theme/variables.scss @@ -779,7 +779,7 @@ body { --login-background: linear-gradient(180deg, #c63527 60%, #000 100%) !important; --button-hover: #c63527; --button-color: #ffb81c; - --button-text-color: white; + --button-text-color: black; --inicio-open-page-from-box: #c63527; --PinBackground: #e1e7eb; --background-mobile: var(--color); diff --git a/version/git-version.ts b/version/git-version.ts index 345180966..edf696ada 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "37e02a6de", - "SHA": "37e02a6ded365a1928894f6d97b7a74c593c383d", + "shortSHA": "eb77736a6", + "SHA": "eb77736a60ce338807e2160729fd08121755516e", "branch": "developer-prod", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Wed Aug 16 08:01:45 2023 +0100'", + "lastCommitTime": "'Wed Aug 16 08:38:09 2023 +0100'", "lastCommitMessage": "fix", - "lastCommitNumber": "5170", - "change": "", - "changeStatus": "On branch developer-prod\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts", + "lastCommitNumber": "5171", + "change": "diff --git a/src/app/models/beast-orm.ts b/src/app/models/beast-orm.ts\nindex ce46ac39b..6d1062fe3 100644\n--- a/src/app/models/beast-orm.ts\n+++ b/src/app/models/beast-orm.ts\n@@ -23,6 +23,7 @@ export class MessageModel extends models.Model {\n \tlocalReference = models.CharField({blank:true, unique: true})\n \tattachments = ArrayField({blank:true})\n \tfile = JsonField({blank:true})\n+\tUploadAttachmentsTemp = models.IntegerField()\n \n \tasync getAttachments() {\n \t\tconsole.log('this[id]', this['id'])\ndiff --git a/src/app/models/chatMethod.ts b/src/app/models/chatMethod.ts\nindex 8a3363d2d..e1ac3a2ba 100644\n--- a/src/app/models/chatMethod.ts\n+++ b/src/app/models/chatMethod.ts\n@@ -94,6 +94,7 @@ export interface Message {\n \t\tfileBase64: string\n \t}\n \thasFile: boolean\n+\tUploadAttachmentsTemp: number\n }\n \n \ndiff --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\nindex d0f7f1af9..ee75fc6ca 100644\n--- a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html\n+++ b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html\n@@ -47,19 +47,19 @@\n \n
\n \n- \n+ \n+
\n \n-
\n- {{header}}\n+
\n+ {{ userContainer.key }}\n
\n \n-
\n- \n-

{{user.name}}

\n- \n+
\n+ \n+ {{user.name}}\n+
\n
\n-\n- \n+
\n \n
\n \ndiff --git a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts\nindex 90eab93a4..0d7e58e22 100644\n--- a/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts\n+++ b/src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts\n@@ -32,6 +32,10 @@ export class GroupContactsPage implements OnInit {\n groupName:string;\n selectedUserList:any;\n sessionStore = SessionStore\n+\n+\n+ objectUserSingleStone = []\n+ userContainer = {}\n \n constructor(\n private modalController: ModalController,\n@@ -81,6 +85,30 @@ export class GroupContactsPage implements OnInit {\n }\n return 0;\n });\n+\n+\n+\n+\n+ for( const user of this.users) {\n+\n+ const foundUser = this.objectUserSingleStone.find( e => e.name == user.name)\n+\n+ if(!foundUser) {\n+ this.objectUserSingleStone.push(user)\n+ }\n+ \n+ }\n+ \n+ for(const user of this.objectUserSingleStone) {\n+ const firstLetter = user.name.charAt(0)\n+\n+ if(!this.userContainer[firstLetter]) {\n+ this.userContainer[firstLetter] = [user]\n+ } else {\n+ this.userContainer[firstLetter].push(user)\n+ }\n+ \n+ }\n \n \n this.showLoader = false;\n@@ -178,6 +206,26 @@ export class GroupContactsPage implements OnInit {\n })\n \n this.users = users\n+\n+\n+\n+\n+ let a = this.objectUserSingleStone.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase()))\n+ \n+ let b = {}\n+ for(const user of a) {\n+ const firstLetter = user.name.charAt(0)\n+\n+ if(!b[firstLetter]) {\n+ b[firstLetter] = [user]\n+ } else {\n+ b[firstLetter].push(user)\n+ }\n+ \n+ }\n+\n+\n+ this.userContainer = b\n \n \n }\n@@ -185,9 +233,11 @@ export class GroupContactsPage implements OnInit {\n \n \n }\n- selectedContact(user:any){\n- /* this.groupName = this.room.name; */\n- user.isChecked = !user.isChecked;\n+ selectedContact(user:any) {\n+ /* this.groupName = this.room.name; */\n+ user.isChecked = user.isChecked != false ? true : false \n+ const userIndex = this.objectUserSingleStone.findIndex((e) => e._id == user._id)\n+ this.objectUserSingleStone[userIndex].isChecked = user.isChecked\n \n \n }\ndiff --git a/src/app/pages/chat/messages/contacts/contacts.page.html b/src/app/pages/chat/messages/contacts/contacts.page.html\nindex 21cce9129..9f6f6a645 100644\n--- a/src/app/pages/chat/messages/contacts/contacts.page.html\n+++ b/src/app/pages/chat/messages/contacts/contacts.page.html\n@@ -32,7 +32,7 @@\n \n
\n \n- \n+ \n \n
\n {{header}}\ndiff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html\nindex 231a8e6d6..51bd68ef9 100644\n--- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html\n+++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html\n@@ -7,7 +7,7 @@\n
\n
\n
\n-
\n+
\n \n \n \ndiff --git a/src/app/pipes/filter.pipe.ts b/src/app/pipes/filter.pipe.ts\nindex 97100f9eb..9992c805d 100644\n--- a/src/app/pipes/filter.pipe.ts\n+++ b/src/app/pipes/filter.pipe.ts\n@@ -7,13 +7,15 @@ export class FilterPipe implements PipeTransform {\n \n transform(array: any[], text:string, column:string): any {\n \n+ console.log(array, text, column);\n+ \n if(text === ''){\n return array;\n }\n \n text = text.toLowerCase();\n \n- if(Array.isArray(array)) {\n+ if(!Array.isArray(array)) {\n array = []\n }\n \ndiff --git a/src/app/services/chat/chat-system.service.ts b/src/app/services/chat/chat-system.service.ts\nindex 6c5c85cc7..0e2766c77 100644\n--- a/src/app/services/chat/chat-system.service.ts\n+++ b/src/app/services/chat/chat-system.service.ts\n@@ -65,6 +65,23 @@ export class ChatSystemService {\n private notificationService: NotificationsService\n ) {\n \n+\n+ const user = this.users\n+\n+ const alfa = {}\n+\n+ const sortedUserList = user.sort((a, b) => {\n+ if(a.name < b.name) {\n+ return -1;\n+ }\n+ if(a.name > b.name) {\n+ return 1;\n+ }\n+ return 0;\n+ })\n+\n+ console.log({sortedUserList})\n+\n this.RochetChatConnectorService.registerCallback({\n type: 'reConnect',\n funx: async () => {\ndiff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts\nindex 599700e12..a1b6ab1e4 100644\n--- a/src/app/services/chat/message.service.ts\n+++ b/src/app/services/chat/message.service.ts\n@@ -79,7 +79,7 @@ export class MessageService {\n private notificationService: NotificationsService) {\n }\n \n- setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference = 'out-'+uuidv4() , viewed = [], received = [], delate = false, delateRequest =false, from, sendAttempt = 0, origin, attachmentsModelData, hasFile = false }:Message) {\n+ setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference = 'out-'+uuidv4() , viewed = [], received = [], delate = false, delateRequest =false, from, sendAttempt = 0, origin, attachmentsModelData, hasFile = false, UploadAttachmentsTemp = 0 }:Message) {\n \n this.channels = channels || []\n this.mentions = mentions || []\n@@ -99,6 +99,7 @@ export class MessageService {\n this.sendAttempt = 0\n this.origin = origin\n this.attachmentsModelData = attachmentsModelData\n+ this.UploadAttachmentsTemp = UploadAttachmentsTemp\n \n if(this.attachments?.length >= 1 && attachments?.length >= 1) {\n this.attachments[0] = Object.assign(this.attachments[0], attachments[0])\n@@ -268,15 +269,20 @@ export class MessageService {\n uploadSuccessfully = await this.NfService.beforeSendAttachment(this)\n this.UploadAttachmentsTemp++\n this.uploadingFile = false\n- \n+\n this.manualRetry = false\n this.errorUploadingAttachment = false\n this.hasSendAttachment = true\n+\n+ this.saveChanges()\n } catch (error) {\n this.uploadingFile = false\n+ \n \n this.errorUploadingAttachment = true\n this.UploadAttachmentsTemp++\n+\n+ this.saveChanges()\n }\n \n }\n@@ -513,7 +519,8 @@ export class MessageService {\n localReference: this.localReference,\n attachments: this.attachments,\n file: this.file,\n- delate: this.delate\n+ delate: this.delate,\n+ UploadAttachmentsTemp: this.UploadAttachmentsTemp\n }\n }\n \ndiff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html\nindex 6e820fa0b..a6e3d6584 100644\n--- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html\n+++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html\n@@ -40,7 +40,7 @@\n \n
\n \n-

{{user.name}}

\n+

{{user.name}}

\n \n
\n \n- \n \n-
\n- {{header}}\n+
\n+\n+
\n+ {{ userContainer.key }}\n
\n \n-
\n- \n- {{user.name}}\n+
\n+ {{ user.isChecked }}\n+ \n+ {{user.name}}\n
\n
\n-\n- \n+
\n \n
\n \ndiff --git a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts\nindex 7dd8027bb..eacccb208 100644\n--- a/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts\n+++ b/src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts\n@@ -36,6 +36,10 @@ export class GroupContactsPage implements OnInit {\n @Input() roomId:string;\n @Output() openGroupMessage:EventEmitter = new EventEmitter();\n \n+\n+ objectUserSingleStone = []\n+ userContainer = {}\n+\n constructor(\n private modalController: ModalController,\n private chatService: ChatService,\n@@ -168,7 +172,7 @@ export class GroupContactsPage implements OnInit {\n });\n }\n \n- loadUsers(){\n+ loadUsers() {\n \n this.chatService.getAllUsers().subscribe((res:any)=>{\n \n@@ -192,22 +196,29 @@ export class GroupContactsPage implements OnInit {\n });\n \n \n- this.showLoader = false;\n- });\n- }\n+ for( const user of this.users) {\n \n- separateLetter(record, recordIndex, records){\n- if(recordIndex == 0){\n- return record.name[0];\n- }\n+ const foundUser = this.objectUserSingleStone.find( e => e.name == user.name)\n \n- let first_prev = records[recordIndex - 1].name[0];\n- let first_current = record.name[0];\n+ if(!foundUser) {\n+ this.objectUserSingleStone.push(user)\n+ }\n+ \n+ }\n+ \n+ for(const user of this.objectUserSingleStone) {\n+ const firstLetter = user.name.charAt(0)\n \n- if(first_prev != first_current){\n- return first_current;\n- }\n- return null;\n+ if(!this.userContainer[firstLetter]) {\n+ this.userContainer[firstLetter] = [user]\n+ } else {\n+ this.userContainer[firstLetter].push(user)\n+ }\n+ \n+ }\n+\n+ this.showLoader = false;\n+ });\n }\n \n doRefresh(ev){\n@@ -267,6 +278,24 @@ export class GroupContactsPage implements OnInit {\n \n this.users = users\n \n+\n+ let a = this.objectUserSingleStone.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase()))\n+ \n+ let b = {}\n+ for(const user of a) {\n+ const firstLetter = user.name.charAt(0)\n+\n+ if(!b[firstLetter]) {\n+ b[firstLetter] = [user]\n+ } else {\n+ b[firstLetter].push(user)\n+ }\n+ \n+ }\n+\n+\n+ this.userContainer = b\n+\n // console.log('this.users', this.users)\n }\n \n@@ -274,18 +303,24 @@ export class GroupContactsPage implements OnInit {\n \n }\n \n- selectedContact(user:any){\n- /* this.groupName = this.room.name; */\n- user.isChecked = !user.isChecked;\n-\n- const userIndex = this.users.findIndex((e) => e._id == user._id)\n- this.users[userIndex] = user \n+ selectedContact(user:any) {\n+ /* this.groupName = this.room.name; */\n+ if(user.isChecked != false ) {\n+ user.isChecked = true\n+ alert('tro')\n+ } else {\n+ alert('false')\n+ user.isChecked = false\n+ }\n+ \n+ const userIndex = this.objectUserSingleStone.findIndex((e) => e._id == user._id)\n+ this.objectUserSingleStone[userIndex].isChecked = user.isChecked\n \n }\n \n- addContacts(roomId:any){\n+ addContacts(roomId:any) {\n \n- this.selectedUserList = this.users.filter(function(contact) {\n+ this.selectedUserList = this.objectUserSingleStone.filter(function(contact) {\n return contact.isChecked == true;\n });\n \ndiff --git a/src/app/shared/chat/messages/messages.page.html b/src/app/shared/chat/messages/messages.page.html\nindex 5ae210611..165bd22d4 100644\n--- a/src/app/shared/chat/messages/messages.page.html\n+++ b/src/app/shared/chat/messages/messages.page.html\n@@ -39,7 +39,6 @@\n \n
\n- \n
\n
\n \ndiff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.html b/src/app/shared/popover/opts-expediente/opts-expediente.page.html\nindex 59f5fd715..86a2711b7 100644\n--- a/src/app/shared/popover/opts-expediente/opts-expediente.page.html\n+++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.html\n@@ -7,7 +7,7 @@\n
\n
\n
\n-
\n+
\n \n \n \n@@ -22,23 +22,9 @@\n \n \n \n+ \n
\n
\n- \n \n-
\n- \n
\n \ndiff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.scss b/src/app/shared/popover/opts-expediente/opts-expediente.page.scss\nindex 121c5db26..677be7d4a 100644\n--- a/src/app/shared/popover/opts-expediente/opts-expediente.page.scss\n+++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.scss\n@@ -35,7 +35,7 @@\n }\n @media only screen and (max-width: 800px) {\n .btn-ok, .btn-cancel, .btn-delete{\n- width: 100% !important;\n+ width: 47% !important;\n }\n }\n @media only screen and (min-width: 1024px) {\n@@ -45,11 +45,11 @@\n }\n .btn-cancel{\n display: none;\n- width: 100% !important;\n+ width: 47% !important;\n margin-bottom: 10px !important;\n }\n .btn-delete, .btn-ok{\n- width: 100% !important;\n+ width: 47% !important;\n margin-bottom: 10px !important;\n margin-top: 10px !important;\n }", + "changeStatus": "On branch developer-prod\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.html\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.ts\n\tmodified: src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html\n\tmodified: src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.html\n\tmodified: src/app/store/publication-folder.service.ts\n\tmodified: src/theme/variables.scss\n\nChanges not staged for commit:\n (use \"git add ...\" to update what will be committed)\n (use \"git restore ...\" to discard changes in working directory)\n\tmodified: src/app/models/beast-orm.ts\n\tmodified: src/app/models/chatMethod.ts\n\tmodified: src/app/pages/chat/group-messages/group-contacts/group-contacts.page.html\n\tmodified: src/app/pages/chat/group-messages/group-contacts/group-contacts.page.ts\n\tmodified: src/app/pages/chat/messages/contacts/contacts.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html\n\tmodified: src/app/pipes/filter.pipe.ts\n\tmodified: src/app/services/chat/chat-system.service.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/shared/chat/group-messages/group-contacts/group-contacts.page.html\n\tmodified: src/app/shared/chat/group-messages/group-contacts/group-contacts.page.ts\n\tmodified: src/app/shared/chat/messages/messages.page.html\n\tmodified: src/app/shared/popover/opts-expediente/opts-expediente.page.html\n\tmodified: src/app/shared/popover/opts-expediente/opts-expediente.page.scss", "changeAuthor": "peter.maquiran" } \ No newline at end of file