mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
merge
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -193,9 +193,9 @@
|
||||
<app-new-publication
|
||||
*ngIf="desktopComponent.showAddNewPublication"
|
||||
class="height-100 d-flex flex-column overflow-hidden background-white flex-grow-1"
|
||||
[folderId]="folderId"
|
||||
[publicationType]="publicationType"
|
||||
[publicationId]="publicationId"
|
||||
[publication]="publication"
|
||||
[folderId]="folderId"
|
||||
|
||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
||||
|
||||
@@ -395,9 +395,9 @@ export class PublicationsPage implements OnInit {
|
||||
this.desktopComponent.showEditActions = true;
|
||||
}
|
||||
|
||||
async openPublicationDetails(publicationId: string) {
|
||||
async openPublicationDetails({DocumentId, ProcessId}) {
|
||||
|
||||
this.publicationId = publicationId;
|
||||
this.publicationId = DocumentId;
|
||||
|
||||
this.closeDesktopComponent();
|
||||
this.idSelected = this.folderId;
|
||||
|
||||
+5
-1
@@ -50,9 +50,13 @@
|
||||
margin: 0 auto;
|
||||
border-radius: 0px!important;
|
||||
overflow: hidden;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
height: 420px;
|
||||
|
||||
}
|
||||
.post-img img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
+62
-75
@@ -21,7 +21,7 @@ import { PublicationFolderService } from 'src/app/store/publication-folder.servi
|
||||
})
|
||||
export class PublicationDetailPage implements OnInit {
|
||||
showLoader: boolean;
|
||||
publicationId: string;
|
||||
DocumentId: string;
|
||||
folderId: string;
|
||||
publication: Publication;
|
||||
isModal = false
|
||||
@@ -37,92 +37,79 @@ export class PublicationDetailPage implements OnInit {
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
public publicationFolderService: PublicationFolderService
|
||||
) {
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
// console.log(params["params"])
|
||||
if(params["params"]) {
|
||||
this.folderId = params["params"].folderId;
|
||||
this.publicationId = params["params"].publicationId;
|
||||
this.isModal = params["params"].isModal;
|
||||
//
|
||||
}
|
||||
});
|
||||
|
||||
this.publication = {
|
||||
DateIndex: null,
|
||||
DocumentId: null,
|
||||
ProcessId:'',
|
||||
Title:'',
|
||||
Message: '',
|
||||
/* image: null, */
|
||||
DatePublication: null,
|
||||
FileBase64: '',
|
||||
OriginalFileName: '',
|
||||
FileExtension: '',
|
||||
};
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.getPublicationDetail();
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
// console.log(params["params"])
|
||||
if(params["params"]) {
|
||||
this.folderId = params["params"].folderId;
|
||||
this.DocumentId = params["params"].publicationId;
|
||||
this.isModal = params["params"].isModal;
|
||||
//
|
||||
|
||||
console.log('params', params)
|
||||
if(this.DocumentId) {
|
||||
this.getPublicationDetail();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.publication = {
|
||||
DateIndex: null,
|
||||
DocumentId: null,
|
||||
ProcessId:'',
|
||||
Title:'',
|
||||
Message: '',
|
||||
/* image: null, */
|
||||
DatePublication: null,
|
||||
FileBase64: '',
|
||||
OriginalFileName: '',
|
||||
FileExtension: '',
|
||||
};
|
||||
}
|
||||
doRefresh(event) {
|
||||
this.getPublicationDetail();
|
||||
|
||||
setTimeout(() => {
|
||||
try {
|
||||
event?.target?.complete();
|
||||
} catch(error) {}
|
||||
}, 2000);
|
||||
event?.target?.complete();
|
||||
} catch(error) {}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
getPublicationDetail() {
|
||||
const folderId = this.folderId
|
||||
const localPublication = this.publicationFolderService.getLocalPublication(folderId, this.publicationId);
|
||||
|
||||
if(localPublication?.DocumentId) {
|
||||
|
||||
this.publication = {
|
||||
DateIndex: localPublication.DateIndex,
|
||||
DocumentId: localPublication.DocumentId,
|
||||
ProcessId:localPublication.ProcessId,
|
||||
Title:localPublication.Title,
|
||||
Message: localPublication.Message,
|
||||
DatePublication: localPublication.DatePublication,
|
||||
FileBase64: localPublication.FileBase64,
|
||||
OriginalFileName: localPublication.OriginalFileName,
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
} else {
|
||||
|
||||
this.showLoader = true;
|
||||
this.showLoader = true;
|
||||
|
||||
this.publications.GetPublicationById(this.publicationId).subscribe(res => {
|
||||
|
||||
/* this.publication = res; */
|
||||
this.publication = {
|
||||
DateIndex: res.DateIndex,
|
||||
DocumentId: res.DocumentId,
|
||||
ProcessId:res.ProcessId,
|
||||
Title:res.Title,
|
||||
Message: res.Message,
|
||||
DatePublication: res.DatePublication,
|
||||
FileBase64: "data:image/jpg;base64," + res.FileBase64,
|
||||
OriginalFileName: res.OriginalFileName,
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
}, (error) => {
|
||||
this.showLoader = false;
|
||||
|
||||
if(error.status == 404) {
|
||||
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
|
||||
}
|
||||
|
||||
this.goBack();
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
}
|
||||
this.publications.GetPublicationById(this.DocumentId).subscribe(res => {
|
||||
|
||||
/* this.publication = res; */
|
||||
this.publication = {
|
||||
DateIndex: res.DateIndex,
|
||||
DocumentId: res.DocumentId,
|
||||
ProcessId:res.ProcessId,
|
||||
Title:res.Title,
|
||||
Message: res.Message,
|
||||
DatePublication: res.DatePublication,
|
||||
FileBase64: "data:image/jpeg;base64," + res.FileBase64,
|
||||
OriginalFileName: res.OriginalFileName,
|
||||
FileExtension: res.FileExtension,
|
||||
}
|
||||
|
||||
console.log('this.publication', this.publication)
|
||||
this.showLoader = false;
|
||||
}, (error) => {
|
||||
this.showLoader = false;
|
||||
|
||||
if(error.status == 404) {
|
||||
this.publicationFolderService.deletePost(this.publication.ProcessId, this.publication.DocumentId)
|
||||
}
|
||||
|
||||
this.goBack();
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -147,18 +134,18 @@ export class PublicationDetailPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise();
|
||||
await this.publications.DeletePublication(this.folderId, this.DocumentId).toPromise();
|
||||
this.httpErrorHandle.httpsSucessMessagge('Eliminar publicação')
|
||||
|
||||
if(window['app-view-publications-page-doRefresh']) {
|
||||
window['app-view-publications-page-doRefresh']()
|
||||
}
|
||||
|
||||
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
|
||||
this.publicationFolderService.deletePost(this.folderId, this.DocumentId)
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
if(error.status == 404) {
|
||||
this.publicationFolderService.deletePost(this.folderId, this.publicationId)
|
||||
this.publicationFolderService.deletePost(this.folderId, this.DocumentId)
|
||||
this.goBack();
|
||||
}
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<p class="px-20 item-content-detail font-14-em">{{publicationFolderService.FolderDetails[folderId].Detail}}</p>
|
||||
|
||||
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index"
|
||||
(click)="goToPublicationDetail(publication.DocumentId)"
|
||||
(click)="goToPublicationDetail(publication.DocumentId, publication.ProcessId)"
|
||||
>
|
||||
<ion-card-content>
|
||||
<div class="post-img">
|
||||
|
||||
@@ -128,11 +128,14 @@
|
||||
margin: 0 auto;
|
||||
border-radius: 0px!important;
|
||||
overflow: hidden;
|
||||
background-color: white;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
.post-img img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
max-height: 420px;
|
||||
}
|
||||
.post-content{
|
||||
margin: 0 auto;
|
||||
|
||||
@@ -229,15 +229,17 @@ export class ViewPublicationsPage implements OnInit {
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
goToPublicationDetail(publicationId: string) {
|
||||
this.router.navigate(['/home/publications/view-publications', this.folderId, publicationId]);
|
||||
goToPublicationDetail(DocumentId:string, ProcessId: string) {
|
||||
|
||||
this.router.navigate(['/home/publications/view-publications', this.folderId, DocumentId]);
|
||||
}
|
||||
|
||||
async viewPublicationDetail(publicationId: string) {
|
||||
async viewPublicationDetail(DocumentId: string) {
|
||||
alert('nice');
|
||||
const modal = await this.modalController.create({
|
||||
component: PublicationDetailPage,
|
||||
componentProps: {
|
||||
publicationId: publicationId,
|
||||
DocumentId: DocumentId,
|
||||
folderId: this.folderId,
|
||||
isModal: true
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user