This commit is contained in:
Peter Maquiran
2021-06-29 14:16:49 +01:00
parent df5e87357a
commit 4a5aaedf27
5 changed files with 45 additions and 11 deletions
+2
View File
@@ -1234,6 +1234,8 @@ export class AgendaPage implements OnInit {
this.mobileComponent.transparentEventList = true;
this.mobileComponent.showEventToApprove = true;
}
}
closeEventToApprove(){
@@ -73,7 +73,6 @@
</div>
</div>
<div *ngIf="loadedEvent" class="aside-right flex-column height-100">
<div class="aside-buttons">
<button hidden full class="btn-ok" shape="round" >Editar evento</button>
@@ -18,6 +18,7 @@ import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { ViewPublicationsPage } from '../view-publications/view-publications.page';
import { LoadingService } from 'src/app/services/loading.service';
import { ToastService } from 'src/app/services/toast.service';
@Component({
selector: 'app-new-publication',
@@ -52,6 +53,7 @@ export class NewPublicationPage implements OnInit {
private navParams: NavParams,
private publications: PublicationsService,
private camera: Camera,
private toastService: ToastService,
) {
this.publicationType = this.navParams.get('publicationType');
@@ -107,10 +109,10 @@ export class NewPublicationPage implements OnInit {
}
async save(){
if(this.publicationType == '3'){
if(this.publicationType == '3') {
console.log(this.navParams.get('publication'));
if(this.capturedImage != ''){
if(this.capturedImage != '') {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId:this.publication.DocumentId,
@@ -122,10 +124,18 @@ export class NewPublicationPage implements OnInit {
FileBase64: this.capturedImage,
FileExtension: 'jpeg',
}
console.log('Edit change image');
console.log(this.publication);
this.publications.UpdatePublication(this.publication.ProcessId, this.publication);
this.close();
try {
console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage("Publicação criado")
this.close();
} catch (error) {
this.toastService.badRequest("Publicação não criado")
}
}
else{
this.publication = {
@@ -141,8 +151,16 @@ export class NewPublicationPage implements OnInit {
}
/* console.log('Edit - keep image');
console.log(this.publication); */
this.publications.UpdatePublication(this.publication.ProcessId, this.publication);
this.close();
try {
console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage("Publicação criado")
this.close();
} catch (error) {
this.toastService.badRequest("Publicação não criado")
}
}
}
else{
@@ -163,6 +181,19 @@ export class NewPublicationPage implements OnInit {
console.log(this.publication); */
this.publications.CreatePublication(this.folderId, this.publication);
this.close();
try {
console.log(this.publication);
await this.publications.CreatePublication(this.folderId, this.publication).toPromise()
this.toastService.successMessage("Publicação criado")
this.close();
} catch (error) {
this.toastService.badRequest("Publicação não criado")
}
}
}
@@ -20,7 +20,7 @@
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
</div>
<div class="header-title flex-grow-1 cursor-pointer">
<label>{{loadedEvent.workflowInstanceDataFields.Subject}} 11 </label>
<label>{{loadedEvent.workflowInstanceDataFields.Subject}} </label>
</div>
<div (click)="editar(loadedEvent.serialNumber)" class="header-icon-right display-none-{{showAside}}">
<button class="btn-no-color">
@@ -63,12 +63,14 @@ export class ViewPublicationsPage implements OnInit {
close(){
this.closeDesktopComponent.emit();
}
getPublicationDetail(){
getPublicationDetail() {
this.publications.GetPublicationFolderById(this.folderId).subscribe(res=>{
console.log(res);
this.item = res;
});
}
getPublications(){
this.showLoader = true;