mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
fix edit publication on web
This commit is contained in:
@@ -98,3 +98,4 @@ src/app/domain
|
||||
_src/
|
||||
-src
|
||||
plugin copy
|
||||
pm2.yaml
|
||||
|
||||
@@ -48,7 +48,7 @@ export class NewPublicationPage implements OnInit {
|
||||
validateFrom = false
|
||||
|
||||
@Input() publication!: Publication;
|
||||
@Input() publicationType: string;
|
||||
@Input() publicationType: ActionType;
|
||||
@Input() folderId: string;
|
||||
@Input() documentId: string;
|
||||
|
||||
@@ -364,6 +364,7 @@ export class NewPublicationPage implements OnInit {
|
||||
return false
|
||||
}
|
||||
|
||||
this.PublicationFromMvService.setFolderId(this.folderId)
|
||||
this.PublicationFromMvService.setFolderId(this.folderId)
|
||||
this.goBack();
|
||||
await this.PublicationFromMvService.save()
|
||||
@@ -407,6 +408,7 @@ export class NewPublicationPage implements OnInit {
|
||||
else if (this.publicationType == ActionType.edit) {
|
||||
this.publicationTitle = 'Editar Publicação';
|
||||
}
|
||||
this.PublicationFromMvService.publicationType = this.publicationType
|
||||
}
|
||||
|
||||
async goBack() {
|
||||
|
||||
+28
-22
@@ -11,6 +11,8 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
import { PublicationHolderService } from 'src/app/services/publication/publication-holder.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-publication-detail-shared',
|
||||
templateUrl: './publication-detail.page.html',
|
||||
@@ -35,7 +37,8 @@ export class PublicationDetailPage implements OnInit {
|
||||
public p:PermissionService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
public publicationFolderService: PublicationFolderService,
|
||||
public checkFileType: checkFileTypeService
|
||||
public checkFileType: checkFileTypeService,
|
||||
public PublicationHolderService: PublicationHolderService
|
||||
) {
|
||||
|
||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||
@@ -138,32 +141,35 @@ export class PublicationDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
async editPost(publicationType:any) {
|
||||
if(this.PublicationHolderService.PublicationFormMV.length == 0) {
|
||||
|
||||
if(window.innerWidth < 701){
|
||||
const modal = await this.modalController.create({
|
||||
component: NewPublicationPage,
|
||||
componentProps:{
|
||||
publicationType: publicationType,
|
||||
publication: this.publication,
|
||||
},
|
||||
cssClass: 'new-publication',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
if(window.innerWidth < 701){
|
||||
const modal = await this.modalController.create({
|
||||
component: NewPublicationPage,
|
||||
componentProps:{
|
||||
modal.onDidDismiss().then(()=>{
|
||||
setTimeout(() => {
|
||||
this.getPublicationDetail();
|
||||
}, 5000);
|
||||
});
|
||||
await modal.present();
|
||||
} else {
|
||||
|
||||
this.addNewPublication.emit({
|
||||
publicationType: publicationType,
|
||||
folderId: this.folderId,
|
||||
publication: this.publication,
|
||||
},
|
||||
cssClass: 'new-publication',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then(()=>{
|
||||
setTimeout(() => {
|
||||
this.getPublicationDetail();
|
||||
}, 5000);
|
||||
});
|
||||
await modal.present();
|
||||
})
|
||||
}
|
||||
} else {
|
||||
|
||||
this.addNewPublication.emit({
|
||||
publicationType: publicationType,
|
||||
folderId: this.folderId,
|
||||
publication: this.publication,
|
||||
})
|
||||
this.toastService._successMessage('já existe uma publicação a ser processado');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user