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/
|
||||||
-src
|
-src
|
||||||
plugin copy
|
plugin copy
|
||||||
|
pm2.yaml
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
validateFrom = false
|
validateFrom = false
|
||||||
|
|
||||||
@Input() publication!: Publication;
|
@Input() publication!: Publication;
|
||||||
@Input() publicationType: string;
|
@Input() publicationType: ActionType;
|
||||||
@Input() folderId: string;
|
@Input() folderId: string;
|
||||||
@Input() documentId: string;
|
@Input() documentId: string;
|
||||||
|
|
||||||
@@ -364,6 +364,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.PublicationFromMvService.setFolderId(this.folderId)
|
||||||
this.PublicationFromMvService.setFolderId(this.folderId)
|
this.PublicationFromMvService.setFolderId(this.folderId)
|
||||||
this.goBack();
|
this.goBack();
|
||||||
await this.PublicationFromMvService.save()
|
await this.PublicationFromMvService.save()
|
||||||
@@ -407,6 +408,7 @@ export class NewPublicationPage implements OnInit {
|
|||||||
else if (this.publicationType == ActionType.edit) {
|
else if (this.publicationType == ActionType.edit) {
|
||||||
this.publicationTitle = 'Editar Publicação';
|
this.publicationTitle = 'Editar Publicação';
|
||||||
}
|
}
|
||||||
|
this.PublicationFromMvService.publicationType = this.publicationType
|
||||||
}
|
}
|
||||||
|
|
||||||
async goBack() {
|
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 { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||||
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
||||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||||
|
import { PublicationHolderService } from 'src/app/services/publication/publication-holder.service'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publication-detail-shared',
|
selector: 'app-publication-detail-shared',
|
||||||
templateUrl: './publication-detail.page.html',
|
templateUrl: './publication-detail.page.html',
|
||||||
@@ -35,7 +37,8 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
public p:PermissionService,
|
public p:PermissionService,
|
||||||
private httpErrorHandle: HttpErrorHandle,
|
private httpErrorHandle: HttpErrorHandle,
|
||||||
public publicationFolderService: PublicationFolderService,
|
public publicationFolderService: PublicationFolderService,
|
||||||
public checkFileType: checkFileTypeService
|
public checkFileType: checkFileTypeService,
|
||||||
|
public PublicationHolderService: PublicationHolderService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||||
@@ -138,32 +141,35 @@ export class PublicationDetailPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async editPost(publicationType:any) {
|
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){
|
modal.onDidDismiss().then(()=>{
|
||||||
const modal = await this.modalController.create({
|
setTimeout(() => {
|
||||||
component: NewPublicationPage,
|
this.getPublicationDetail();
|
||||||
componentProps:{
|
}, 5000);
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.addNewPublication.emit({
|
||||||
publicationType: publicationType,
|
publicationType: publicationType,
|
||||||
|
folderId: this.folderId,
|
||||||
publication: this.publication,
|
publication: this.publication,
|
||||||
},
|
})
|
||||||
cssClass: 'new-publication',
|
}
|
||||||
backdropDismiss: false
|
|
||||||
});
|
|
||||||
|
|
||||||
modal.onDidDismiss().then(()=>{
|
|
||||||
setTimeout(() => {
|
|
||||||
this.getPublicationDetail();
|
|
||||||
}, 5000);
|
|
||||||
});
|
|
||||||
await modal.present();
|
|
||||||
} else {
|
} else {
|
||||||
|
this.toastService._successMessage('já existe uma publicação a ser processado');
|
||||||
this.addNewPublication.emit({
|
|
||||||
publicationType: publicationType,
|
|
||||||
folderId: this.folderId,
|
|
||||||
publication: this.publication,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user