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 d945acd8e..34c6ef866 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -116,7 +116,6 @@ export class NewPublicationPage implements OnInit { private modalController: ModalController, public photoService: PhotoService, private navParams: NavParams, - private toastService: ToastService, public ThemeService: ThemeService, private platform: Platform, public imageCompress: NgxImageCompressService, @@ -136,7 +135,7 @@ export class NewPublicationPage implements OnInit { this.publicationType = this.navParams.get('publicationType'); this.folderId = this.navParams.get('folderId'); const publication = this.navParams.get('publication'); - if (publication && typeof publication?.Files == 'object') { + if (publication && Array.isArray(publication?.Files)) { this.filecontent = true; const newFiles: PublicationAttachmentEntity[] = publication.Files.map(e => { @@ -177,14 +176,14 @@ export class NewPublicationPage implements OnInit { } ngOnInit() { - this.reciveSharedContent(); + // this.reciveSharedContent(); - this.setTitle(); - Filesystem.mkdir({ - path: IMAGE_DIR, - directory: Directory.Data, - recursive: true - }); + // this.setTitle(); + // Filesystem.mkdir({ + // path: IMAGE_DIR, + // directory: Directory.Data, + // recursive: true + // }); /* try { document.addEventListener("click", clickOutside, false); 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 a1ab1e4cd..fe282efd4 100644 --- a/src/app/shared/publication/new-publication/new-publication.page.ts +++ b/src/app/shared/publication/new-publication/new-publication.page.ts @@ -15,8 +15,6 @@ import { MiddlewareServiceService } from "src/app/shared/API/middleware/middlewa import { LakefsRepositoryService } from '../../repository/lakefs/lakefs-repository.service'; import { SocketConnectionMCRService } from "src/app/services/socket-connection-mcr.service" -import { CMAPIService } from '../../repository/CMAPI/cmapi.service'; -import { environment } from 'src/environments/environment'; import { CaptureImageOptions, MediaCapture } from '@awesome-cordova-plugins/media-capture/ngx'; import { Directory, Filesystem, FilesystemDirectory } from '@capacitor/filesystem'; import { ModalController, Platform } from '@ionic/angular'; @@ -136,19 +134,22 @@ export class NewPublicationPage implements OnInit { DatePublication: res.DatePublication }) - const newFiles: PublicationAttachmentEntity[] = res.Files.map(e => { - return new PublicationAttachmentEntity( - { - base64: e.FileBase64, - extension: e.FileExtension, - OriginalFileName: e.OriginalFileName, - FileType: this.checkFileType.checkFileType(e.FileExtension) as any - } - ) - }) + if (res.Files && Array.isArray(res?.Files)) { - for(const files of newFiles) { - this.PublicationFromMvService.form.Files.push(files) + const newFiles: PublicationAttachmentEntity[] = res.Files.map(e => { + return new PublicationAttachmentEntity( + { + base64: e.FileBase64, + extension: e.FileExtension, + OriginalFileName: e.OriginalFileName, + FileType: this.checkFileType.checkFileType(e.FileExtension) as any + } + ) + }) + + for(const files of newFiles) { + this.PublicationFromMvService.form.Files.push(files) + } } } 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 4158ddabc..df99f1f6c 100644 --- a/src/app/shared/publication/upload/publication-from-mv.service.ts +++ b/src/app/shared/publication/upload/publication-from-mv.service.ts @@ -56,7 +56,7 @@ export class PublicationFromMvService { this.ObjectMergeNotification = new ObjectMergeNotification() this.totalPercentage = 0 - this.ObjectMergeNotification.connect(); + // this.ObjectMergeNotification.connect(); window['upload-header-set-add'](this.id, this.totalPercentage, this.save) } diff --git a/version/git-version.ts b/version/git-version.ts index be69b9fd1..006511e11 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,11 +1,11 @@ export let versionData = { - "shortSHA": "d78e20925", - "SHA": "d78e209252c51e4b90fb90ac358fb55eba2c6605", + "shortSHA": "2c7bf9bea", + "SHA": "2c7bf9bea45e1b3b7ff5d7bab269f3df8498a7ca", "branch": "feature/agenda-api-peter", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Thu Jul 25 12:14:45 2024 +0100'", - "lastCommitMessage": "fix performance issue", - "lastCommitNumber": "5882", - "changeStatus": "On branch feature/agenda-api-peter\nYour branch is ahead of 'origin/feature/agenda-api-peter' by 3 commits.\n (use \"git push\" to publish your local commits)\n\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: version/git-version.ts", + "lastCommitTime": "'Thu Jul 25 12:22:45 2024 +0100'", + "lastCommitMessage": "improve perfomance issue", + "lastCommitNumber": "5883", + "changeStatus": "On branch feature/agenda-api-peter\nYour branch is up to date with 'origin/feature/agenda-api-peter'.\n\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/shared/publication/new-publication/new-publication.page.ts\n\tmodified: src/app/shared/publication/upload/publication-from-mv.service.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file