From a25b8ba40f25c50166eebfe285a91d8f00543a5d Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 10 Mar 2023 11:41:44 +0100 Subject: [PATCH 1/2] fix chat --- src/app/pages/chat/chat.page.ts | 4 ++- .../group-messages/group-messages.page.ts | 2 +- .../group-messages/group-messages.page.ts | 2 +- .../popover/chat-popover/chat-popover.page.ts | 17 +++--------- src/theme/variables.scss | 26 +++++++++++++++++++ version/git-version.ts | 12 ++++----- 6 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 31f8c4831..42b5f2efe 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -816,7 +816,9 @@ export class ChatPage implements OnInit { }, }); await modal.present(); - modal.onDidDismiss(); + modal.onDidDismiss().then(() =>{ + this.ChatSystemService.currentRoom.roomLeave() + }); } } diff --git a/src/app/pages/chat/group-messages/group-messages.page.ts b/src/app/pages/chat/group-messages/group-messages.page.ts index 2b1529809..4901d347a 100644 --- a/src/app/pages/chat/group-messages/group-messages.page.ts +++ b/src/app/pages/chat/group-messages/group-messages.page.ts @@ -528,7 +528,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy { async openOptions() { const modal = await this.popoverController.create({ component: ChatPopoverPage, - cssClass: 'chat-popover', + cssClass: 'popover-bottom', componentProps: { roomId: this.roomId, members: this.members, 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 5ac3f36a4..249aa5739 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -519,7 +519,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe enterAnimation, leaveAnimation, component: ChatPopoverPage, - cssClass: 'model profile-modal search-submodal chat-aside', + cssClass: 'model search-submodal chat-option-aside', componentProps: { roomId: this.roomId, members: this.members, 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 2ee30fe75..48c217b02 100644 --- a/src/app/shared/popover/chat-popover/chat-popover.page.ts +++ b/src/app/shared/popover/chat-popover/chat-popover.page.ts @@ -39,10 +39,8 @@ export class ChatPopoverPage implements OnInit { close(action:any){ if( window.innerWidth < 701){ this.popoverController.dismiss(action); - this.modalController.dismiss(action) } else{ - this.popoverController.dismiss(action); this.modalController.dismiss(action) } } @@ -123,25 +121,16 @@ export class ChatPopoverPage implements OnInit { }); } }); - this.popoverController.dismiss('delete'); - this.modalController.dismiss('delete') + this.close('delete'); } async openChangeGroupName(){ - if( window.innerWidth < 701){ - this.popoverController.dismiss('edit'); - this.modalController.dismiss('edit') - } - else{ - this.popoverController.dismiss('edit'); - this.modalController.dismiss('edit') - } + this.close('edit'); } async addUser() { - this.popoverController.dismiss('addUser'); - this.modalController.dismiss('addUser') + this.close('addUser'); } } diff --git a/src/theme/variables.scss b/src/theme/variables.scss index 664b0a0b1..a59fe8646 100644 --- a/src/theme/variables.scss +++ b/src/theme/variables.scss @@ -348,6 +348,32 @@ $app-theme: mat-light-theme( right: 0 !important; top: unset !important; } + +.popover-bottom::part(content), .popover-bottom .popover-content { + top: unset !important; + bottom: 0px; + position: absolute; + width: 100%; + left: 0px !important; + right: 0px; +} + +.chat-option-aside::part(content), .chat-option-aside .modal-wrapper{ + position: absolute; + right: 0px; + height: 90%; + max-width: 100%; + top: -40px; + border-radius: 0 0 25px 25px; + -webkit-border-radius: 0 0 25px 25px; + -moz-border-radius: 0 0 25px 25px; + -ms-border-radius: 0 0 25px 25px; + -o-border-radius: 0 0 25px 25px; + max-width: 400px; + width: 100%; + opacity: 1; +} + .exp-options .popover-content { width: 100% !important; left: 0 !important; diff --git a/version/git-version.ts b/version/git-version.ts index a81b15cc3..b1ffa625c 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "a558e835a", - "SHA": "a558e835a044e44664bb473f0e70428ad8a82b56", + "shortSHA": "9c7281ce4", + "SHA": "9c7281ce48b7bd3b792db5b350d99dd7cf06f60e", "branch": "no_bug_movemente", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Thu Mar 9 17:13:19 2023 +0100'", - "lastCommitMessage": "remove plugin and remove header", - "lastCommitNumber": "4857", + "lastCommitTime": "'Thu Mar 9 17:14:42 2023 +0100'", + "lastCommitMessage": "fix", + "lastCommitNumber": "4858", "change": "", - "changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts", + "changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/chat/chat.page.ts\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/popover/chat-popover/chat-popover.page.ts\n\tmodified: src/theme/variables.scss\n\tmodified: version/git-version.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file From 5b060642036e92e97d14f9926b9e49e29257fd43 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 10 Mar 2023 14:30:50 +0100 Subject: [PATCH 2/2] update actions --- .../view-publications.page.ts | 72 +++++++++++++------ .../view-publications.page.ts | 67 ++++++++++++----- version/git-version.ts | 12 ++-- 3 files changed, 105 insertions(+), 46 deletions(-) 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 75971806c..7c5715daf 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -52,16 +52,12 @@ export class ViewPublicationsPage implements OnInit { private httpErroHandle: HttpErrorHandle, private storage: Storage,) { - if(!this.publicationList[this.folderId]) { - this.publicationList[this.folderId] = [] - this.publicationItem[this.folderId] = new PublicationFolder(); - } + this.createPublicationList() this.getFromDB(); this.activatedRoute.paramMap.subscribe(params => { - if (params["params"]) { this.folderId = params["params"].folderId; // @@ -76,12 +72,8 @@ export class ViewPublicationsPage implements OnInit { if (typeof (this.folderId) == 'object') { this.folderId = this.folderId['ProcessId'] } - - if(!this.publicationList[this.folderId]) { - this.publicationList[this.folderId] = [] - this.publicationItem[this.folderId] = new PublicationFolder(); - } + this.createPublicationList() this.getFromDB(); //this.testForkJoin() @@ -96,7 +88,6 @@ export class ViewPublicationsPage implements OnInit { //this.testForkJoin() }) - } ngOnChanges() { @@ -105,14 +96,21 @@ export class ViewPublicationsPage implements OnInit { this.folderId = this.folderId['ProcessId'] } - if(!this.publicationList[this.folderId]) { - this.publicationList[this.folderId] = [] - this.publicationItem[this.folderId] = new PublicationFolder(); - } + this.createPublicationList() this.getFromDB(); } + + createPublicationList(folderId = this.folderId) { + if(!this.publicationList[folderId]) { + this.publicationList[folderId] = [] + } + if(!this.publicationItem[folderId]) { + this.publicationItem[folderId] = new PublicationFolder(); + } + } + doRefresh = (event) => { //setTimeout(() => { //this.testForkJoin() @@ -164,18 +162,22 @@ export class ViewPublicationsPage implements OnInit { try { const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise(); - + + this.createPublicationList(folderId) + let loadLater = [] for (let publicationId of publicationIds) { - let Publication = await this.publications.GetPublicationById(publicationId).toPromise(); - let publicationDetails: Publication = this.publicationPipe.itemList(Publication) - - const found = this.publicationList[folderId].find( e => e.DocumentId == publicationId ) - if(!found) { - PublicationModel.create(publicationDetails) - this.publicationList[folderId].push(publicationDetails) + 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; @@ -187,6 +189,30 @@ export class ViewPublicationsPage implements OnInit { } + publicationIsPresent(publicationId, folderId) { + return this.publicationList[folderId].find( e => e.DocumentId == publicationId ) + } + publicationFind(publicationId, folderId) { + return this.publicationList[folderId].find( e => e.DocumentId == publicationId ) + } + publicationFindIndex(publicationId, folderId) { + return this.publicationList[folderId].findIndex( e => e.DocumentId == publicationId ) + } + + 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 AddPublication(publicationType: any, folderId: any) { const modal = await this.modalController.create({ component: NewPublicationPage, diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index a26b3936d..e5579fb3a 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -48,10 +48,7 @@ export class ViewPublicationsPage implements OnInit { public p:PermissionService, private httpErrorHandle: HttpErrorHandle ) { - if(!this.publicationList[this.folderId]) { - this.publicationList[this.folderId] = [] - this.publicationItem[this.folderId] = new PublicationFolder(); - } + this.createPublicationList() } ngOnInit() { @@ -59,10 +56,7 @@ export class ViewPublicationsPage implements OnInit { this.folderId = this.folderId['ProcessId'] } - if(!this.publicationList[this.folderId]) { - this.publicationList[this.folderId] = [] - this.publicationItem[this.folderId] = new PublicationFolder(); - } + this.createPublicationList() window['app-view-publications-page-doRefresh'] = this.doRefresh @@ -76,10 +70,11 @@ export class ViewPublicationsPage implements OnInit { } if(!this.publicationList[this.folderId]) { - this.publicationList[this.folderId] = [] this.publicationItem[this.folderId] = new PublicationFolder(); } + this.createPublicationList() + this.getFromDB(); this.getPublicationDetail(); @@ -88,6 +83,17 @@ export class ViewPublicationsPage implements OnInit { } + + createPublicationList(folderId = this.folderId) { + if(!this.publicationList[this.folderId]) { + this.publicationList[this.folderId] = [] + } + if(!this.publicationItem[this.folderId]) { + this.publicationItem[this.folderId] = new PublicationFolder(); + } + + } + doRefresh =(event) => { this.getPublicationDetail(); @@ -118,18 +124,22 @@ export class ViewPublicationsPage implements OnInit { try { const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise(); - + + this.createPublicationList(folderId) + let loadLater = [] for (let publicationId of publicationIds) { - let Publication = await this.publications.GetPublicationById(publicationId).toPromise(); - let publicationDetails: Publication = this.publicationPipe.itemList(Publication) - - const found = this.publicationList[folderId].find( e => e.DocumentId == publicationId ) - if(!found) { - /* PublicationModel.create(publicationDetails) */ - this.publicationList[folderId].push(publicationDetails) + 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; @@ -139,7 +149,30 @@ export class ViewPublicationsPage implements OnInit { this.showLoader = false; } + } + publicationIsPresent(publicationId, folderId) { + return this.publicationList[folderId].find( e => e.DocumentId == publicationId ) + } + publicationFind(publicationId, folderId) { + return this.publicationList[folderId].find( e => e.DocumentId == publicationId ) + } + publicationFindIndex(publicationId, folderId) { + return this.publicationList[folderId].findIndex( e => e.DocumentId == publicationId ) + } + + 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 + } + } getFromDB() { diff --git a/version/git-version.ts b/version/git-version.ts index 7d588a0d2..06f40ae70 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "a25b8ba40", - "SHA": "a25b8ba40f25c50166eebfe285a91d8f00543a5d", + "shortSHA": "e11a66d9c", + "SHA": "e11a66d9c2a6230e4bd16e4e73c3a0f9edf8a6f7", "branch": "no_bug_movemente", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Fri Mar 10 11:41:44 2023 +0100'", - "lastCommitMessage": "fix chat", - "lastCommitNumber": "4859", + "lastCommitTime": "'Fri Mar 10 11:47:53 2023 +0100'", + "lastCommitMessage": "fix merge", + "lastCommitNumber": "4865", "change": "", - "changeStatus": "On branch no_bug_movemente\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/modals/add-note/add-note.page.html\n\tmodified: src/app/models/beast-orm.ts\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.html\n\tmodified: src/app/pages/gabinete-digital/despachos/despachos.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar/diplomas-gerar.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente.page.ts\n\tmodified: src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html\n\tmodified: src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.html\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedidos.page.html\n\tmodified: src/app/pages/gabinete-digital/pendentes/pendentes.page.html\n\tmodified: src/app/pages/login/login.page.ts\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html\n\tmodified: src/app/shared/gabinete-digital/expedients/expedients.page.ts\n\tmodified: src/app/shared/popover/chat-popover/chat-popover.page.ts\n\tmodified: src/app/shared/popover/deploma-options/deploma-options.page.html\n\tmodified: src/app/shared/popover/opts-expediente/opts-expediente.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts\n\tmodified: src/environments/environment.prod.ts\n\tmodified: version/git-version.ts", + "changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file