From c78532680369f90f105463cff3cc56484734941f Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 28 Mar 2024 16:28:17 +0100 Subject: [PATCH 01/15] fix share content --- .../new-publication/new-publication.page.ts | 57 ++++++++++++------- src/app/services/chat/room.service.ts | 3 + 2 files changed, 38 insertions(+), 22 deletions(-) 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 bc823ac54..5ea3f061d 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -790,16 +790,21 @@ export class NewPublicationPage implements OnInit { if (this.checkFileType.checkFileType(FileExtension) == 'image') { Filesystem.readFile({ path: fullPath }).then(async (content) => { - let fileObject; try { - fileObject = { - FileBase64: this.removeTextBeforeSlash(content.data, ','), - FileExtension: FileExtension, - OriginalFileName: 'shared', - } + console.log('shared base', content.data) - this.PublicationFromMvService.form.Files.push(fileObject) + const newAttachment = new PublicationAttachmentEntity( + { + base64: this.removeTextBeforeSlash(content.data, ','), + extension: FileExtension, + FileType: this.checkFileType.checkFileType(FileExtension) as any, + OriginalFileName: 'shared' + } + ) + + + this.PublicationFromMvService.form.Files.push(newAttachment) } catch (error) { console.log('error shared filesystem', error) } @@ -811,7 +816,6 @@ export class NewPublicationPage implements OnInit { path: '', }); - let fileObject = {}; this.videoconvertService.convertVideo(fullPath, directory.uri, filename, 'mp4').then(async () => { await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4` }) @@ -835,7 +839,7 @@ export class NewPublicationPage implements OnInit { newAttachment.needUpload() this.PublicationFromMvService.form.Files.push(newAttachment) - fileObject = {}; + const deleteSecretFile = async () => { await Filesystem.deleteFile({ path: `${filename}.mp4`, @@ -844,7 +848,7 @@ export class NewPublicationPage implements OnInit { }; deleteSecretFile().then((value) => { console.log('delete file', value) - fileObject = {}; + }) .catch((erro) => console.error('read converted video erro ', erro)); }); @@ -862,26 +866,35 @@ export class NewPublicationPage implements OnInit { shareContentAndroid(resultUrl, FileExtension) { Filesystem.readFile({ path: resultUrl }).then(async (content) => { - let fileObject; + let newAttachment: PublicationAttachmentEntity; try { if (this.checkFileType.checkFileType(FileExtension) == 'image') { - fileObject = { - FileBase64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','), - FileExtension: FileExtension, - OriginalFileName: 'shared', - } + const newAttachment = new PublicationAttachmentEntity( + { + base64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','), + extension: FileExtension, + FileType: this.checkFileType.checkFileType(FileExtension) as any, + OriginalFileName: 'shared' + } + ) + this.PublicationFromMvService.form.Files.push(newAttachment) } else if (this.checkFileType.checkFileType(FileExtension) == 'video') { - fileObject = { - FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','), - FileExtension: FileExtension, - OriginalFileName: 'shared', - } + + const newAttachment = new PublicationAttachmentEntity( + { + base64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','), + extension: 'mp4', + FileType: this.checkFileType.checkFileType('mp4') as any, + OriginalFileName: 'shared' + } + ) + newAttachment.needUpload() } console.log('shared base', content.data) - this.PublicationFromMvService.form.Files.push(fileObject) + this.PublicationFromMvService.form.Files.push(newAttachment) } catch (error) { console.log('error shared filesystem', error) } diff --git a/src/app/services/chat/room.service.ts b/src/app/services/chat/room.service.ts index 3767b9518..5c002e9a3 100644 --- a/src/app/services/chat/room.service.ts +++ b/src/app/services/chat/room.service.ts @@ -219,6 +219,9 @@ export class RoomService { if (difference < 0) { this.deleteRoom(); + if(this.chatOpen) { + + } } else { setTimeout(() => { From 4abedabd9241e9fea949f51dd98886d3bc54bdf2 Mon Sep 17 00:00:00 2001 From: Equilibrium ITO Date: Mon, 1 Apr 2024 10:59:25 +0100 Subject: [PATCH 02/15] ios changes --- ios/App/App.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 86b9b1828..5aa1b679b 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -489,7 +489,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 96; + CURRENT_PROJECT_VERSION = 97; DEVELOPMENT_TEAM = 94BRNM2LSS; ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; @@ -516,7 +516,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = App/App.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 96; + CURRENT_PROJECT_VERSION = 97; DEVELOPMENT_TEAM = 94BRNM2LSS; ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = App/Info.plist; From 44a4c30e6468845389ee74db42cea428378e800f Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 1 Apr 2024 12:18:25 +0100 Subject: [PATCH 03/15] file chunk share content --- .../new-publication/new-publication.page.ts | 33 +++++++++---------- .../upload/publication-from-mv.service.ts | 23 +++++++++++-- src/environments/environment.prod.ts | 2 +- src/environments/environment.ts | 2 +- workspace.code-workspace | 3 ++ 5 files changed, 40 insertions(+), 23 deletions(-) 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 5ea3f061d..0cb908bc5 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -374,7 +374,10 @@ export class NewPublicationPage implements OnInit { if (this.PublicationFromMvService.form.Files.length != 0) { - this.close(); + if (!window["sharedContent"]) { + this.close(); + } + this.PublicationFromMvService.setFolderId(this.folderId) await this.PublicationFromMvService.save() @@ -394,10 +397,6 @@ export class NewPublicationPage implements OnInit { this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { this.showLoader = true; }); - - if (window["sharedContent"]) { - this.closeApp(); - } } clear() { @@ -631,14 +630,6 @@ export class NewPublicationPage implements OnInit { this.PublicationFromMvService.form.Files.splice(index, 1) } - closeApp() { - if (this.platform.is('android')) { - App.exitApp() - } else { - window["sharedContent"] = null - } - - } async recordevideoIos(fullPath, element) { @@ -785,6 +776,9 @@ export class NewPublicationPage implements OnInit { } async shareContentIso(fullPath, FileExtension, filename) { + + console.log({fullPath, FileExtension, filename}) + try { if (this.checkFileType.checkFileType(FileExtension) == 'image') { @@ -865,11 +859,12 @@ export class NewPublicationPage implements OnInit { shareContentAndroid(resultUrl, FileExtension) { + console.log({resultUrl, FileExtension}) + Filesystem.readFile({ path: resultUrl }).then(async (content) => { - let newAttachment: PublicationAttachmentEntity; try { if (this.checkFileType.checkFileType(FileExtension) == 'image') { - const newAttachment = new PublicationAttachmentEntity( + let newAttachment = new PublicationAttachmentEntity( { base64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','), extension: FileExtension, @@ -879,22 +874,24 @@ export class NewPublicationPage implements OnInit { ) this.PublicationFromMvService.form.Files.push(newAttachment) + } else if (this.checkFileType.checkFileType(FileExtension) == 'video') { - const newAttachment = new PublicationAttachmentEntity( + let newAttachment = new PublicationAttachmentEntity( { - base64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','), + base64: content.data, extension: 'mp4', FileType: this.checkFileType.checkFileType('mp4') as any, OriginalFileName: 'shared' } ) newAttachment.needUpload() + this.PublicationFromMvService.form.Files.push(newAttachment) } console.log('shared base', content.data) - this.PublicationFromMvService.form.Files.push(newAttachment) + } catch (error) { console.log('error shared filesystem', error) } diff --git a/src/app/shared/publication/upload/publication-from-mv.service.ts b/src/app/shared/publication/upload/publication-from-mv.service.ts index 1f1c3591b..f18269bdc 100644 --- a/src/app/shared/publication/upload/publication-from-mv.service.ts +++ b/src/app/shared/publication/upload/publication-from-mv.service.ts @@ -10,6 +10,8 @@ import { v4 as uuidv4 } from 'uuid' import { Result } from 'neverthrow'; import { IPublicationFormModelEntity } from '../new-publication/interface/interface'; import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service" +import { App } from '@capacitor/app'; +import { ModalController, NavParams, Platform, LoadingController } from '@ionic/angular'; enum ActionType { newRapid = "1", @@ -37,7 +39,8 @@ export class PublicationFromMvService { private httpErroHandle: HttpErrorHandle, public PublicationFolderService: PublicationFolderService, private CMAPIService: CMAPIService, - public publicationFolderService: PublicationFolderService + public publicationFolderService: PublicationFolderService, + private platform: Platform, ) {} @@ -63,7 +66,7 @@ export class PublicationFromMvService { this.folderId = folderId } - save = async() => { + save = async() => { const needChunk = this.needToUploadChunk() @@ -183,7 +186,7 @@ export class PublicationFromMvService { try { await this.publications.CreatePublication(publication.ProcessId, publication).toPromise() - + this.closeApp() if (this.publicationType == '1') { } else if (this.publicationType == '2') { @@ -219,7 +222,21 @@ export class PublicationFromMvService { // this.PublicationHolderService.setPublication(this.publicationFormMV) + this.ObjectMergeNotification.close() + + } + + + closeApp() { + if (window["sharedContent"]) { + + if (this.platform.is('android')) { + App.exitApp() + } else { + window["sharedContent"] = null + } + } } diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 0bd217c5f..43c1647f5 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -4,4 +4,4 @@ import { environment as oaprProd } from './suport/oapr' import { DevDev } from './suport/dev' -export const environment: Environment = oaprProd; +export const environment: Environment = DevDev; diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 03d2a6508..8982b9007 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,4 +4,4 @@ import { environment as oaprDev } from './suport/oapr' import { DevDev } from './suport/dev' -export const environment: Environment = oaprDev +export const environment: Environment = DevDev diff --git a/workspace.code-workspace b/workspace.code-workspace index bf4bc2067..b1838162c 100644 --- a/workspace.code-workspace +++ b/workspace.code-workspace @@ -2,6 +2,9 @@ "folders": [ { "path": "." + }, + { + "path": "../sih/ORM" } ], "settings": { From 30829f599ae5e6fc29824d0485c99b2d4f73398f Mon Sep 17 00:00:00 2001 From: Equilibrium ITO Date: Mon, 1 Apr 2024 12:52:17 +0100 Subject: [PATCH 04/15] crop add to web --- .../modals/crop-image/crop-image.page.html | 5 +- .../new-publication/new-publication.page.ts | 94 ++++++++++++++----- src/environments/environment.ts | 2 +- 3 files changed, 74 insertions(+), 27 deletions(-) diff --git a/src/app/modals/crop-image/crop-image.page.html b/src/app/modals/crop-image/crop-image.page.html index bf56cd320..1207eab1c 100644 --- a/src/app/modals/crop-image/crop-image.page.html +++ b/src/app/modals/crop-image/crop-image.page.html @@ -24,7 +24,8 @@ --> - + + - 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 d7fdac7a1..96d9fadc5 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -398,6 +398,13 @@ export class NewPublicationPage implements OnInit { close() { + this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { + alert('desmiss') + this.showLoader = true; + }); + } + + cancel() { alert('this.PublicationFromMvService.form.send'+ this.PublicationFromMvService.form.send) if(this.PublicationFromMvService.form.send == false) { this.PublicationFromMvService.cancel() @@ -405,6 +412,7 @@ export class NewPublicationPage implements OnInit { } this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { + alert('desmiss2') this.showLoader = true; }); } From 6f94b0fa971aa8543a2fd79afdb8d3a32fb85e89 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 2 Apr 2024 11:57:29 +0100 Subject: [PATCH 10/15] fix publications --- .../new-publication/new-publication.page.ts | 21 +++++++++++++------ .../new-publication/new-publication.page.ts | 2 +- .../upload/publication-from-mv.service.ts | 8 +++---- 3 files changed, 20 insertions(+), 11 deletions(-) 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 aa81b53e4..f6ae2e297 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -143,6 +143,7 @@ export class NewPublicationPage implements OnInit { private videoconvertService: VideoconvertService, public PublicationFromMvService: PublicationFromMvService, ) { + this.PublicationFromMvService.clear() this.publicationType = this.navParams.get('publicationType'); this.folderId = this.navParams.get('folderId'); @@ -166,12 +167,25 @@ export class NewPublicationPage implements OnInit { } } + if(this.publicationType == '3') { + this.PublicationFromMvService.form.setData({ + DateIndex: publication.DateIndex, + DocumentId: publication.DocumentId, + ProcessId: publication.ProcessId, + Title: publication.Title, + Message: publication.Message, + DatePublication: publication.DatePublication + }) + + } + + this.publicationTitle = 'Nova Publicação'; this.intent = this.navParams.get('intent'); this.convertBlobToBase64Worker = new Worker(new URL('./convertBlobToBase64.worker.js', import.meta.url)); - this.PublicationFromMvService.clear() + } ngOnInit() { @@ -376,8 +390,6 @@ export class NewPublicationPage implements OnInit { if (!window["sharedContent"]) { this.close(); - } else { - alert('dont close') } this.PublicationFromMvService.publicationType = this.publicationType as any @@ -399,20 +411,17 @@ export class NewPublicationPage implements OnInit { close() { this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { - alert('desmiss') this.showLoader = true; }); } cancel() { - alert('this.PublicationFromMvService.form.send'+ this.PublicationFromMvService.form.send) if(this.PublicationFromMvService.form.send == false) { this.PublicationFromMvService.cancel() this.PublicationFromMvService.ObjectMergeNotification.close() } this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { - alert('desmiss2') this.showLoader = true; }); } 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 e0be30459..ed021947b 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -90,11 +90,11 @@ export class NewPublicationPage implements OnInit { private modalController: ModalController ) { this.publicationTitle = 'Nova Publicação'; - this.PublicationFromMvService.clear() } ngOnInit() { + this.PublicationFromMvService.clear() this.setAction(); this.setData() } diff --git a/src/app/shared/publication/upload/publication-from-mv.service.ts b/src/app/shared/publication/upload/publication-from-mv.service.ts index 695825a0e..73d375ffe 100644 --- a/src/app/shared/publication/upload/publication-from-mv.service.ts +++ b/src/app/shared/publication/upload/publication-from-mv.service.ts @@ -12,6 +12,7 @@ import { IPublicationFormModelEntity } from '../new-publication/interface/interf import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service" import { App } from '@capacitor/app'; import { ModalController, NavParams, Platform, LoadingController } from '@ionic/angular'; +import { Router } from '@angular/router'; enum ActionType { newRapid = "1", @@ -43,6 +44,7 @@ export class PublicationFromMvService { public publicationFolderService: PublicationFolderService, private platform: Platform, private modalController: ModalController, + private router: Router, ) {} @@ -188,9 +190,6 @@ export class PublicationFromMvService { OriginalFileName: e.OriginalFileName || 'foto' })) - publication.DocumentId = null; - publication.ProcessId = this.folderId - try { await this.publications.CreatePublication(publication.ProcessId, publication).toPromise() @@ -230,7 +229,6 @@ export class PublicationFromMvService { closeApp() { if (window["sharedContent"]) { - alert('close android') if (this.platform.is('android')) { App.exitApp() @@ -240,7 +238,9 @@ export class PublicationFromMvService { if (this.platform.is('ios')) { this.modalController.dismiss(this.form).then(() => { + this.router.navigate(['/home/publications', this.folderId]) }); + } } } From 1269a7a72873b2c8fc70260d2dc794381e6070d8 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 2 Apr 2024 12:16:19 +0100 Subject: [PATCH 11/15] fix process id --- .../shared/publication/upload/publication-from-mv.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/shared/publication/upload/publication-from-mv.service.ts b/src/app/shared/publication/upload/publication-from-mv.service.ts index 73d375ffe..1ce989d33 100644 --- a/src/app/shared/publication/upload/publication-from-mv.service.ts +++ b/src/app/shared/publication/upload/publication-from-mv.service.ts @@ -111,6 +111,8 @@ export class PublicationFromMvService { OriginalFileName: e.OriginalFileName || 'foto' })) + publication.ProcessId = this.folderId + try { const response = await this.publications.UpdatePublication(publication.ProcessId, publication).toPromise() @@ -190,6 +192,9 @@ export class PublicationFromMvService { OriginalFileName: e.OriginalFileName || 'foto' })) + publication.DocumentId = null; + publication.ProcessId = this.folderId + try { await this.publications.CreatePublication(publication.ProcessId, publication).toPromise() From 00a58e12f43d999f77d203343fb0131743726f97 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 3 Apr 2024 10:18:05 +0100 Subject: [PATCH 12/15] fix validation --- .../shared/publication/upload/publication-from-mv.service.ts | 3 --- src/environments/environment.prod.ts | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/shared/publication/upload/publication-from-mv.service.ts b/src/app/shared/publication/upload/publication-from-mv.service.ts index 1ce989d33..d98d6aad9 100644 --- a/src/app/shared/publication/upload/publication-from-mv.service.ts +++ b/src/app/shared/publication/upload/publication-from-mv.service.ts @@ -239,9 +239,6 @@ export class PublicationFromMvService { App.exitApp() } else { window["sharedContent"] = null - } - - if (this.platform.is('ios')) { this.modalController.dismiss(this.form).then(() => { this.router.navigate(['/home/publications', this.folderId]) }); diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 43c1647f5..0bd217c5f 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -4,4 +4,4 @@ import { environment as oaprProd } from './suport/oapr' import { DevDev } from './suport/dev' -export const environment: Environment = DevDev; +export const environment: Environment = oaprProd; From 1671ace74541fb74f6e650dc2771ff85c49b6a30 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 3 Apr 2024 15:28:58 +0100 Subject: [PATCH 13/15] save --- .../new-publication/new-publication.page.ts | 18 ++++++++--- .../new-publication/new-publication.page.html | 2 +- .../new-publication/new-publication.page.ts | 2 +- .../upload/publication-from-mv.service.ts | 32 ++++++++++++++----- .../upload/upload-streaming.service.ts | 1 + 5 files changed, 41 insertions(+), 14 deletions(-) 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 f6ae2e297..00930ef69 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -409,21 +409,31 @@ export class NewPublicationPage implements OnInit { close() { - this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { this.showLoader = true; }); } cancel() { + + this.PublicationFromMvService.form.cancel = true if(this.PublicationFromMvService.form.send == false) { this.PublicationFromMvService.cancel() this.PublicationFromMvService.ObjectMergeNotification.close() } - this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { - this.showLoader = true; - }); + if (window["sharedContent"]) { + + if (this.platform.is('android')) { + App.exitApp() + } else { + window["sharedContent"] = null; + this.close() + } + } else { + this.close() + } + } clear() { diff --git a/src/app/shared/publication/new-publication/new-publication.page.html b/src/app/shared/publication/new-publication/new-publication.page.html index 65e49d75f..30afdfc30 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.html +++ b/src/app/shared/publication/new-publication/new-publication.page.html @@ -66,7 +66,7 @@ - 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 ed021947b..0b9b8b5af 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -315,7 +315,7 @@ export class NewPublicationPage implements OnInit { console.log('load video tablet base64', content) this.filecontent = true; let fileObject = new PublicationAttachmentEntity({ - base64: 'data:video/mp4;base64,'+content.data, + base64: content.data, extension: this.removeTextBeforeSlash(element.mimeType, '/'), OriginalFileName: 'video', FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any diff --git a/src/app/shared/publication/upload/publication-from-mv.service.ts b/src/app/shared/publication/upload/publication-from-mv.service.ts index d98d6aad9..b3947dbb4 100644 --- a/src/app/shared/publication/upload/publication-from-mv.service.ts +++ b/src/app/shared/publication/upload/publication-from-mv.service.ts @@ -113,11 +113,19 @@ export class PublicationFromMvService { publication.ProcessId = this.folderId + if(this.form.cancel) { + window['upload-header-set-remove'](this.id); + return false + } + try { const response = await this.publications.UpdatePublication(publication.ProcessId, publication).toPromise() - this.httpErroHandle.httpsSucessMessagge('Editar publicação') + if (!this.form.cancel) { + this.httpErroHandle.httpsSucessMessagge('Editar publicação') + } + this.publicationFolderService.getPublicationsIds(this.folderId) window['upload-header-set-remove'](this.id); @@ -195,21 +203,24 @@ export class PublicationFromMvService { publication.DocumentId = null; publication.ProcessId = this.folderId + if(this.form.cancel) { + window['upload-header-set-remove'](this.id); + return false + } + try { await this.publications.CreatePublication(publication.ProcessId, publication).toPromise() - if (this.publicationType == '1') { + if (this.publicationType == '1' && !this.form.cancel) { this.httpErroHandle.httpsSucessMessagge('Criar publicação') - } else if (this.publicationType == '2') { + } else if (this.publicationType == '2' && !this.form.cancel) { this.httpErroHandle.httpsSucessMessagge('Criar publicação') - } else if (this.publicationType == '3') { - this.httpErroHandle.httpsSucessMessagge('Editar publicação') } // this.goBackToViewPublications.emit(); window['upload-header-set-remove'](this.id); - this.closeApp() + this.doneUpload() this.publicationFolderService.getPublicationsIds(this.folderId) } catch (error) { window['upload-header-set-retry'](this.id) @@ -232,11 +243,14 @@ export class PublicationFromMvService { } - closeApp() { + doneUpload() { if (window["sharedContent"]) { if (this.platform.is('android')) { - App.exitApp() + window["sharedContent"] = null + this.modalController.dismiss(this.form).then(() => { + this.router.navigate(['/home/publications', this.folderId]) + }); } else { window["sharedContent"] = null this.modalController.dismiss(this.form).then(() => { @@ -244,6 +258,8 @@ export class PublicationFromMvService { }); } + } else { + this.modalController.dismiss(this.form).then(() => {}); } } diff --git a/src/app/shared/publication/upload/upload-streaming.service.ts b/src/app/shared/publication/upload/upload-streaming.service.ts index 4cb5b9b86..ca533e38b 100644 --- a/src/app/shared/publication/upload/upload-streaming.service.ts +++ b/src/app/shared/publication/upload/upload-streaming.service.ts @@ -215,6 +215,7 @@ export class PublicationFormModel implements IPublicationFormModelEntity { hasSet = false send = false + cancel = false setData(data: IPublicationFormModelEntity) { if(data.Files) { From 1d67ea1352bac967255f35978f6eefe29db595f9 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 3 Apr 2024 15:32:41 +0100 Subject: [PATCH 14/15] fix agenda --- src/app/pages/publications/publications.page.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 4b793f994..f5ee0d697 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -113,6 +113,7 @@ export class PublicationsPage implements OnInit { this.getActions(); this.checkQueryParameter() } + this.intent = window['sharedContent'] }); this.hideRefreshButton(); From 470d79c7ed71543115e41150a8812ba1ac972e23 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 3 Apr 2024 17:15:10 +0100 Subject: [PATCH 15/15] fix --- .../publications/new-publication/new-publication.page.ts | 4 +--- .../publication/upload/publication-from-mv.service.ts | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) 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 00930ef69..5b9437553 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -388,9 +388,7 @@ export class NewPublicationPage implements OnInit { if (this.PublicationFromMvService.form.Files.length != 0) { - if (!window["sharedContent"]) { - this.close(); - } + this.close(); this.PublicationFromMvService.publicationType = this.publicationType as any this.PublicationFromMvService.setFolderId(this.folderId) diff --git a/src/app/shared/publication/upload/publication-from-mv.service.ts b/src/app/shared/publication/upload/publication-from-mv.service.ts index b3947dbb4..9197ac7ce 100644 --- a/src/app/shared/publication/upload/publication-from-mv.service.ts +++ b/src/app/shared/publication/upload/publication-from-mv.service.ts @@ -122,7 +122,7 @@ export class PublicationFromMvService { const response = await this.publications.UpdatePublication(publication.ProcessId, publication).toPromise() - if (!this.form.cancel) { + if (this.form.cancel == false) { this.httpErroHandle.httpsSucessMessagge('Editar publicação') } @@ -203,7 +203,7 @@ export class PublicationFromMvService { publication.DocumentId = null; publication.ProcessId = this.folderId - if(this.form.cancel) { + if(this.form.cancel == false) { window['upload-header-set-remove'](this.id); return false } @@ -212,9 +212,9 @@ export class PublicationFromMvService { await this.publications.CreatePublication(publication.ProcessId, publication).toPromise() - if (this.publicationType == '1' && !this.form.cancel) { + if (this.publicationType == '1') { this.httpErroHandle.httpsSucessMessagge('Criar publicação') - } else if (this.publicationType == '2' && !this.form.cancel) { + } else if (this.publicationType == '2') { this.httpErroHandle.httpsSucessMessagge('Criar publicação') }