mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix actions bug
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
<!-- Header -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-toolbar >
|
||||
|
||||
|
||||
<div class="main-header">
|
||||
|
||||
|
||||
<div class="title-content width-100 d-flex justify-space-between">
|
||||
<div class="div-title flex-grow-1">
|
||||
<ion-label class="title ">Acções Presidenciais</ion-label>
|
||||
@@ -34,10 +34,10 @@
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
<!-- Content -->
|
||||
|
||||
|
||||
<div class="aside overflow-y-auto d-flex flex-wrap width-100">
|
||||
<!-- <ion-list class="width-100"> -->
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="item width-100 cursor-pointer"
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="item width-100 cursor-pointer"
|
||||
*ngFor="let viagem of publicationTravelFolderService.list">
|
||||
<ion-item lines="none"
|
||||
class="width-100 d-flex ion-no-border ion-no-margin ion-no-padding">
|
||||
@@ -45,7 +45,7 @@
|
||||
<ion-icon slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
</div>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-content flex-grow-1 cursor-pointer">
|
||||
<p class="item-content-date my-5">De {{viagem.DateBegin}} a {{viagem.DateEnd}}</p>
|
||||
<p class="item-content-date my-5">De {{getDate(viagem.DateBegin)}} a {{getDate(viagem.DateEnd)}}</p>
|
||||
<p class="item-content-title my-10">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail my-5">{{viagem.Detail}}</p>
|
||||
</div>
|
||||
@@ -54,20 +54,20 @@
|
||||
</div>
|
||||
</ion-item>
|
||||
<ion-item-options class="members-options" side="end">
|
||||
<ion-item-option class="edit-option" (click)="editAction(viagem.ProcessId)">
|
||||
<ion-item-option class="edit-option" (click)="editAction(viagem.ProcessId)">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||
</button>
|
||||
</button>
|
||||
</ion-item-option>
|
||||
<ion-item-option class="delete-option" (click)="deleteAction(viagem.ProcessId)">
|
||||
<ion-item-option class="delete-option" (click)="deleteAction(viagem.ProcessId)">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon class="delete" name="trash-sharp"></ion-icon>
|
||||
</button>
|
||||
</button>
|
||||
</ion-item-option>
|
||||
</ion-item-options>
|
||||
</ion-item-sliding>
|
||||
<!-- </ion-list> -->
|
||||
<!-- <div class="item width-100 d-flex"
|
||||
<!-- <div class="item width-100 d-flex"
|
||||
*ngFor="let viagem of publicationsTravelFolderList">
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-icon cursor-pointer">
|
||||
<ion-icon slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
@@ -101,15 +101,15 @@
|
||||
</div>
|
||||
</ion-item>
|
||||
<ion-item-options class="members-options" side="end">
|
||||
<ion-item-option class="edit-option" (click)="editAction(evento.ProcessId)">
|
||||
<ion-item-option class="edit-option" (click)="editAction(evento.ProcessId)">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||
</button>
|
||||
</button>
|
||||
</ion-item-option>
|
||||
<ion-item-option class="delete-option" (click)="deleteAction(evento.ProcessId)">
|
||||
<ion-item-option class="delete-option" (click)="deleteAction(evento.ProcessId)">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon class="delete" name="trash-sharp"></ion-icon>
|
||||
</button>
|
||||
</button>
|
||||
</ion-item-option>
|
||||
</ion-item-options>
|
||||
</ion-item-sliding>
|
||||
@@ -129,13 +129,13 @@
|
||||
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right -->
|
||||
<div class="content content-right d-none flex-grow-1 flex-column ">
|
||||
|
||||
<div class="width-100 height-100 d-flex align-center justify-center"
|
||||
<div class="width-100 height-100 d-flex align-center justify-center"
|
||||
*ngIf="(
|
||||
desktopComponent.showViewPublication == false &&
|
||||
desktopComponent.showAddNewPublication == false &&
|
||||
@@ -143,9 +143,9 @@
|
||||
desktopComponent.showAddActions == false &&
|
||||
desktopComponent.showEditActions == false
|
||||
)"><div>Nenhuma ação presidencial selecionada</div></div>
|
||||
|
||||
|
||||
<!-- View Publication -->
|
||||
<app-view-publications
|
||||
<app-view-publications
|
||||
*ngIf="desktopComponent.showViewPublication"
|
||||
[folderId]="folderId"
|
||||
class="height-100 d-flex flex-column overflow-hidden flex-grow-1"
|
||||
@@ -158,13 +158,13 @@
|
||||
>
|
||||
</app-view-publications>
|
||||
|
||||
<app-new-publication
|
||||
<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"
|
||||
|
||||
|
||||
(closeDesktopComponent)="closeDesktopComponent($event)"
|
||||
(goBacktoPublicationDetails)="goBacktoPublicationDetails()"
|
||||
(goBackToViewPublications)="goBackToViewPublications()"
|
||||
@@ -205,4 +205,4 @@
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
</ion-content>
|
||||
|
||||
@@ -25,6 +25,7 @@ export class PublicationsPage implements OnInit {
|
||||
publication: Publication;
|
||||
|
||||
publicationsEventFolderList: PublicationFolder[];
|
||||
actionsListStorage: PublicationFolder[] = new Array();
|
||||
publicationsTravelFolderList: PublicationFolder[];
|
||||
|
||||
theDate:any;
|
||||
@@ -35,7 +36,7 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
publicationEventFolderStorage = PublicationEventFolderStorage
|
||||
publicationTravelFolderService = PublicationTravelFolderStore
|
||||
|
||||
|
||||
desktopComponent: any = {
|
||||
showViewPublication: false,
|
||||
showAddNewPublication: false,
|
||||
@@ -55,7 +56,7 @@ export class PublicationsPage implements OnInit {
|
||||
showSlidingOptions = true;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
private animationController: AnimationController,
|
||||
private publications: PublicationsService,
|
||||
@@ -68,14 +69,14 @@ export class PublicationsPage implements OnInit {
|
||||
ngOnInit() {
|
||||
|
||||
const pathname = window.location.pathname
|
||||
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == pathname) {
|
||||
this.getActions();
|
||||
}
|
||||
});
|
||||
|
||||
this.hideRefreshButton();
|
||||
this.hideRefreshButton();
|
||||
}
|
||||
|
||||
hideRefreshButton(){
|
||||
@@ -104,7 +105,7 @@ export class PublicationsPage implements OnInit {
|
||||
this.getActions();
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
|
||||
doRefresh(event) {
|
||||
this.getActions();
|
||||
|
||||
@@ -117,6 +118,11 @@ export class PublicationsPage implements OnInit {
|
||||
return window.innerWidth
|
||||
}
|
||||
|
||||
getDate(date) {
|
||||
this.theDate = new Date(date);
|
||||
return this.theDate.getDate() +" de " + ( this.months[this.theDate.getMonth()])+" de " +this.theDate.getFullYear()
|
||||
}
|
||||
|
||||
getActions() {
|
||||
this.showLoader = true;
|
||||
this.publications.GetPublicationFolderList().subscribe(res=>{
|
||||
@@ -125,14 +131,12 @@ export class PublicationsPage implements OnInit {
|
||||
this.publicationsTravelFolderList = new Array();
|
||||
|
||||
res.forEach(data => {
|
||||
this.theDate = new Date(data.DateBegin);
|
||||
this.theEndDate = new Date(data.DateEnd);
|
||||
let folder: PublicationFolder = {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
DateBegin: this.theDate.getDate() +" de " + ( this.months[this.theDate.getMonth()])+" de " +this.theDate.getFullYear(),
|
||||
DateEnd: this.theEndDate.getDate() +" de " + ( this.months[this.theEndDate.getMonth()])+" de " +this.theEndDate.getFullYear(),
|
||||
DateBegin: data.DateBegin,
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
|
||||
@@ -145,7 +149,7 @@ export class PublicationsPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
|
||||
this.publicationEventFolderStorage.reset(this.publicationsEventFolderList)
|
||||
this.publicationTravelFolderService.reset(this.publicationsTravelFolderList)
|
||||
this.publicationTravelFolderService.reset(this.publicationsEventFolderList)
|
||||
});
|
||||
|
||||
|
||||
@@ -186,7 +190,7 @@ export class PublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
async AddPublicationFolder(item?:any) {
|
||||
|
||||
|
||||
this.closeDesktopComponent();
|
||||
if(window.innerWidth <= 1024) {
|
||||
|
||||
@@ -216,7 +220,7 @@ export class PublicationsPage implements OnInit {
|
||||
} else {
|
||||
this.closeDesktopComponent();
|
||||
this.folderId = folderId
|
||||
this.desktopComponent.showViewPublication = true;
|
||||
this.desktopComponent.showViewPublication = true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -246,7 +250,7 @@ export class PublicationsPage implements OnInit {
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.closeDesktopComponent();
|
||||
|
||||
@@ -269,12 +273,12 @@ export class PublicationsPage implements OnInit {
|
||||
} else {
|
||||
// open angular component
|
||||
this.folderId = folderId
|
||||
this.desktopComponent.showViewPublication = true;
|
||||
this.desktopComponent.showViewPublication = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// called from publications details
|
||||
// called from publications details
|
||||
// Emittter
|
||||
goBackToViewPublications(){
|
||||
|
||||
@@ -308,16 +312,16 @@ export class PublicationsPage implements OnInit {
|
||||
if (folderId != undefined) {
|
||||
this.folderId = folderId;
|
||||
}
|
||||
|
||||
|
||||
this.publication = publication;
|
||||
|
||||
|
||||
this.desktopComponent.showAddNewPublication = true;
|
||||
}
|
||||
|
||||
async openPublicationDetails(publicationId: string){
|
||||
|
||||
|
||||
this.publicationId = publicationId;
|
||||
|
||||
|
||||
this.closeDesktopComponent();
|
||||
this.desktopComponent.showPublicationDetail = true;
|
||||
|
||||
@@ -326,7 +330,7 @@ export class PublicationsPage implements OnInit {
|
||||
async updateDesktopComponent(e?:any){
|
||||
this.getActions();
|
||||
}
|
||||
|
||||
|
||||
async closeDesktopComponent (xx?: any){
|
||||
|
||||
this.desktopComponent = {
|
||||
@@ -387,4 +391,4 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,5 +87,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -28,7 +28,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
//
|
||||
publicationEventFolderStorage = PublicationEventFolderStorage
|
||||
publicationTravelFolderService = PublicationTravelFolderStore
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private publications: PublicationsService,
|
||||
@@ -39,7 +39,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.item = new PublicationFolder();
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
console.log(params);
|
||||
|
||||
|
||||
if(params["params"]) {
|
||||
this.folderId = params["params"].folderId;
|
||||
console.log(params["params"]);
|
||||
@@ -84,23 +84,24 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.modalController.dismiss();
|
||||
this.router.navigate(['/home/publications']);
|
||||
}
|
||||
|
||||
getPublicationDetail() {
|
||||
setTimeout(() => {
|
||||
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
|
||||
this.item = allActions.find((e)=> e.ProcessId == this.folderId)
|
||||
this.item = allActions.find((e)=> e.ProcessId == this.folderId);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
|
||||
getPublications() {
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
this.publications.GetPublications(this.folderId).subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
|
||||
let data = [];
|
||||
|
||||
|
||||
res.forEach(element => {
|
||||
let itemImage = {
|
||||
title: 'Title',
|
||||
@@ -119,7 +120,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
"OriginalFileName": '',
|
||||
"FileExtension": '',
|
||||
}
|
||||
|
||||
|
||||
// this.publicationList.push(item);
|
||||
data.push(item)
|
||||
|
||||
@@ -136,9 +137,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
async AddPublication(publicationType:any, folderId:any) {
|
||||
|
||||
@@ -10,13 +10,13 @@ export class PublicationEventFolderService {
|
||||
// main data
|
||||
private _list: PublicationFolder[] = []
|
||||
// local storage keyName
|
||||
private keyName: string;
|
||||
private keyName: string;
|
||||
|
||||
constructor() {
|
||||
|
||||
this.keyName = (SHA1(this.constructor.name+ 'PublicationEventFolder/local')).toString()
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(()=>{
|
||||
let restore = localstoreService.get(this.keyName, [])
|
||||
this._list = restore
|
||||
}, 10)
|
||||
@@ -34,10 +34,10 @@ export class PublicationEventFolderService {
|
||||
}
|
||||
|
||||
private save(list: PublicationFolder[]) {
|
||||
setTimeout(()=> {
|
||||
setTimeout(()=> {
|
||||
localstoreService.set(this.keyName, list)
|
||||
}, 10)
|
||||
}
|
||||
}
|
||||
|
||||
export const PublicationEventFolderStorage = new PublicationEventFolderService()
|
||||
export const PublicationEventFolderStorage = new PublicationEventFolderService()
|
||||
|
||||
Reference in New Issue
Block a user