fix publications

This commit is contained in:
Peter Maquiran
2024-04-02 11:57:29 +01:00
parent 4e91973244
commit 6f94b0fa97
3 changed files with 20 additions and 11 deletions
@@ -143,6 +143,7 @@ export class NewPublicationPage implements OnInit {
private videoconvertService: VideoconvertService, private videoconvertService: VideoconvertService,
public PublicationFromMvService: PublicationFromMvService, public PublicationFromMvService: PublicationFromMvService,
) { ) {
this.PublicationFromMvService.clear()
this.publicationType = this.navParams.get('publicationType'); this.publicationType = this.navParams.get('publicationType');
this.folderId = this.navParams.get('folderId'); 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.publicationTitle = 'Nova Publicação';
this.intent = this.navParams.get('intent'); this.intent = this.navParams.get('intent');
this.convertBlobToBase64Worker = new Worker(new URL('./convertBlobToBase64.worker.js', import.meta.url)); this.convertBlobToBase64Worker = new Worker(new URL('./convertBlobToBase64.worker.js', import.meta.url));
this.PublicationFromMvService.clear()
} }
ngOnInit() { ngOnInit() {
@@ -376,8 +390,6 @@ export class NewPublicationPage implements OnInit {
if (!window["sharedContent"]) { if (!window["sharedContent"]) {
this.close(); this.close();
} else {
alert('dont close')
} }
this.PublicationFromMvService.publicationType = this.publicationType as any this.PublicationFromMvService.publicationType = this.publicationType as any
@@ -399,20 +411,17 @@ export class NewPublicationPage implements OnInit {
close() { close() {
this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { this.modalController.dismiss(this.PublicationFromMvService.form).then(() => {
alert('desmiss')
this.showLoader = true; this.showLoader = true;
}); });
} }
cancel() { cancel() {
alert('this.PublicationFromMvService.form.send'+ this.PublicationFromMvService.form.send)
if(this.PublicationFromMvService.form.send == false) { if(this.PublicationFromMvService.form.send == false) {
this.PublicationFromMvService.cancel() this.PublicationFromMvService.cancel()
this.PublicationFromMvService.ObjectMergeNotification.close() this.PublicationFromMvService.ObjectMergeNotification.close()
} }
this.modalController.dismiss(this.PublicationFromMvService.form).then(() => { this.modalController.dismiss(this.PublicationFromMvService.form).then(() => {
alert('desmiss2')
this.showLoader = true; this.showLoader = true;
}); });
} }
@@ -90,11 +90,11 @@ export class NewPublicationPage implements OnInit {
private modalController: ModalController private modalController: ModalController
) { ) {
this.publicationTitle = 'Nova Publicação'; this.publicationTitle = 'Nova Publicação';
this.PublicationFromMvService.clear()
} }
ngOnInit() { ngOnInit() {
this.PublicationFromMvService.clear()
this.setAction(); this.setAction();
this.setData() this.setData()
} }
@@ -12,6 +12,7 @@ import { IPublicationFormModelEntity } from '../new-publication/interface/interf
import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service" import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service"
import { App } from '@capacitor/app'; import { App } from '@capacitor/app';
import { ModalController, NavParams, Platform, LoadingController } from '@ionic/angular'; import { ModalController, NavParams, Platform, LoadingController } from '@ionic/angular';
import { Router } from '@angular/router';
enum ActionType { enum ActionType {
newRapid = "1", newRapid = "1",
@@ -43,6 +44,7 @@ export class PublicationFromMvService {
public publicationFolderService: PublicationFolderService, public publicationFolderService: PublicationFolderService,
private platform: Platform, private platform: Platform,
private modalController: ModalController, private modalController: ModalController,
private router: Router,
) {} ) {}
@@ -188,9 +190,6 @@ export class PublicationFromMvService {
OriginalFileName: e.OriginalFileName || 'foto' OriginalFileName: e.OriginalFileName || 'foto'
})) }))
publication.DocumentId = null;
publication.ProcessId = this.folderId
try { try {
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise() await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
@@ -230,7 +229,6 @@ export class PublicationFromMvService {
closeApp() { closeApp() {
if (window["sharedContent"]) { if (window["sharedContent"]) {
alert('close android')
if (this.platform.is('android')) { if (this.platform.is('android')) {
App.exitApp() App.exitApp()
@@ -240,7 +238,9 @@ export class PublicationFromMvService {
if (this.platform.is('ios')) { if (this.platform.is('ios')) {
this.modalController.dismiss(this.form).then(() => { this.modalController.dismiss(this.form).then(() => {
this.router.navigate(['/home/publications', this.folderId])
}); });
} }
} }
} }