mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
cant edit publication without attachment
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user