fix commit to hub

This commit is contained in:
Peter Maquiran
2024-02-09 10:33:53 +01:00
parent 8dca3a64a8
commit da49dd680a
6 changed files with 81 additions and 15 deletions
@@ -53,6 +53,16 @@
X
</div>
<div *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && seleted.chucksManager">
<mat-progress-bar
mode="determinate"
[style.width]="seleted.chucksManager.uploadPercentage"
></mat-progress-bar>
</div>
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
name="image" ngDefaultControl [src]="seleted.url" style="height: 69px;"></ion-img>
@@ -23,7 +23,7 @@ import { Filesystem, Directory, Encoding, FilesystemDirectory } from '@capacitor
import { Platform } from '@ionic/angular';
import { Capacitor } from '@capacitor/core';
import { PublicationAttachmentEntity, PublicationFormMV } from '../upload/upload-streaming.service';
import { PublicationFormMVService } from "src/app/shared/publication/upload/publication-form-mv.service"
enum ActionType {
newRapid = "1",
@@ -75,6 +75,7 @@ export class NewPublicationPage implements OnInit {
constructor(
PublicationFormMVService: PublicationFormMVService,
public photoService: PhotoService,
private publications: PublicationsService,
private toastService: ToastService,
@@ -452,8 +453,6 @@ export class NewPublicationPage implements OnInit {
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
e.FileExtension = "mp4"
}
this.publicationFormMV.ObjectMergeNotification.socket.commit(e.chucksManager.path)
return e
})
@@ -515,7 +514,6 @@ export class NewPublicationPage implements OnInit {
e.Base64 = ""
}
this.publicationFormMV.ObjectMergeNotification.socket.commit(e.chucksManager.path)
return e
})
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { PublicationFormMVService } from './publication-form-mv.service';
describe('PublicationFormMVService', () => {
let service: PublicationFormMVService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(PublicationFormMVService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class PublicationFormMVService {
constructor() { }
}
@@ -4,7 +4,7 @@ import { ObjectMergeNotification } from 'src/app/services/socket-connection-mcr.
import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service"
import { DomSanitizer } from '@angular/platform-browser';
const objectMergeNotification = new ObjectMergeNotification()
export enum UploadError {
noConnection = 'noConnection',
@@ -192,10 +192,10 @@ export class PublicationFormMV {
private UploadFileUseCase = new UploadFileUseCase()
private form = new PublicationFormModel()
ObjectMergeNotification = objectMergeNotification
ObjectMergeNotification = new ObjectMergeNotification()
constructor() {
this.ObjectMergeNotification.connect();
// this.ObjectMergeNotification.connect();
}
setDataToFrom(data: IPublicationFormModelEntity) {
@@ -218,11 +218,11 @@ export class PublicationFormMV {
PublicationAttachmentEntity.setChunkManger(fileChunks)
PublicationAttachmentEntity.chucksManager.registerOnLastChunk(() => {
this.ObjectMergeNotification.socket.commit(PublicationAttachmentEntity.chucksManager.path)
const guid = PublicationAttachmentEntity.chucksManager.path
this.ObjectMergeNotification.subscribe(guid, (data) => {
// console.log("data", data)
PublicationAttachmentEntity
resolve(true)
})
@@ -437,7 +437,7 @@ export class ChucksManager {
}
registerOnLastChunk(a: Function) {
this.onSetPath.push(a)
this.onSetLastChunk.push(a)
}
registerToUseCaseResponse(a: Function) {