mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
fix bugs
This commit is contained in:
@@ -44,40 +44,7 @@
|
||||
<!-- Content -->
|
||||
|
||||
<div *ngIf="!skeletonLoader" class="aside overflow-y-auto d-flex flex-wrap width-100">
|
||||
<!-- <ion-list class="width-100"> -->
|
||||
<!-- <ion-item-sliding disabled="{{showSlidingOptions}}" class="width-100"
|
||||
*ngFor="let viagem of publicationsTravelFolderList">
|
||||
<ion-item lines="none"
|
||||
class="item width-100 d-flex ion-no-border ion-no-margin ion-no-padding"
|
||||
[class.item-active]="viagem.ProcessId == idSelected"
|
||||
>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-icon cursor-pointer">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-plane-active.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && viagem.ProcessId != idSelected " slot="end" src='assets/images/theme/gov/icons-plane-active.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && viagem.ProcessId == idSelected " slot="end" src='assets/images/theme/gov/icons-plane-active-hover.svg'></ion-icon>
|
||||
|
||||
</div>
|
||||
<div (click)="goToPublicationsList(viagem.ProcessId)" class="item-content flex-grow-1 cursor-pointer">
|
||||
<p class="item-content-date my-5" [class.item-content-date-active]="viagem.ProcessId == idSelected">De {{getDate(viagem.DateBegin)}} a {{getDate(viagem.DateEnd)}}</p>
|
||||
<p class="item-content-title my-10" [class.item-content-title-active]="viagem.ProcessId == idSelected">{{viagem.Description}}</p>
|
||||
<p class="item-content-detail my-5" [class.item-content-detail-active]="viagem.ProcessId == idSelected">{{viagem.Detail}}</p>
|
||||
</div>
|
||||
</ion-item>
|
||||
<ion-item-options class="members-options" side="end">
|
||||
<ion-item-option class="edit-option" (click)="editAction(viagem.ProcessId)">
|
||||
<button class="btn-no-color">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon>
|
||||
|
||||
</button>
|
||||
</ion-item-option>
|
||||
<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>
|
||||
</ion-item-option>
|
||||
</ion-item-options>
|
||||
</ion-item-sliding> -->
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="width-100"
|
||||
*ngFor="let evento of publicationsEventFolderList">
|
||||
<ion-item lines="none"
|
||||
@@ -116,7 +83,7 @@
|
||||
</ion-item-sliding>
|
||||
</div>
|
||||
<!-- Sart Skeleton -->
|
||||
<div *ngIf="showLoader">
|
||||
<div *ngIf="showLoader && publicationsEventFolderList.length == 0">
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="width-100">
|
||||
<ion-item lines="none"
|
||||
class="item width-100 d-flex ion-no-border ion-no-margin ion-no-padding">
|
||||
|
||||
@@ -28,9 +28,9 @@ export class PublicationsPage implements OnInit {
|
||||
publicationFolder: PublicationFolder;
|
||||
publication: Publication;
|
||||
|
||||
publicationsEventFolderList: PublicationFolder[];
|
||||
publicationsEventFolderList: PublicationFolder[] = [];
|
||||
actionsListStorage: PublicationFolder[] = new Array();
|
||||
publicationsTravelFolderList: PublicationFolder[];
|
||||
publicationsTravelFolderList: PublicationFolder[] = [];
|
||||
|
||||
theDate: any;
|
||||
theEndDate: any;
|
||||
@@ -91,10 +91,6 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
this.hideRefreshButton();
|
||||
|
||||
/* this.backgroundservice.registerBackService('Online', () => {
|
||||
this.getActions();
|
||||
}) */
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -142,55 +138,67 @@ export class PublicationsPage implements OnInit {
|
||||
return this.theDate.getDate() + " de " + (this.months[this.theDate.getMonth()]) + " de " + this.theDate.getFullYear()
|
||||
}
|
||||
|
||||
loadList = false
|
||||
|
||||
getActions() {
|
||||
this.showLoader = true;
|
||||
this.skeletonLoader = true;
|
||||
this.getFromDB()
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
|
||||
|
||||
|
||||
let publicationsEventFolderList = new Array();
|
||||
let publicationsTravelFolderList = new Array();
|
||||
|
||||
res.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
DateBegin: data.DateBegin,
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
if(this.loadList == false) {
|
||||
this.loadList = true
|
||||
this.showLoader = true;
|
||||
this.skeletonLoader = true;
|
||||
this.getFromDB()
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
|
||||
|
||||
|
||||
let publicationsEventFolderList = new Array();
|
||||
let publicationsTravelFolderList = new Array();
|
||||
|
||||
res.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
DateBegin: data.DateBegin,
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
|
||||
this.addActionToDB(folder)
|
||||
|
||||
if (data.ActionType == "Evento") {
|
||||
|
||||
publicationsEventFolderList.push(folder);
|
||||
}
|
||||
else {
|
||||
|
||||
publicationsTravelFolderList.push(folder);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
await this.storage.set('actionsEvents', publicationsEventFolderList);
|
||||
await this.storage.set('actionsViagens', publicationsTravelFolderList);
|
||||
this.getFromDB()
|
||||
} else {
|
||||
this.getFromDB()
|
||||
}
|
||||
|
||||
this.addActionToDB(folder)
|
||||
|
||||
if (data.ActionType == "Evento") {
|
||||
|
||||
publicationsEventFolderList.push(folder);
|
||||
}
|
||||
else {
|
||||
|
||||
publicationsTravelFolderList.push(folder);
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false;
|
||||
this.loadList = false
|
||||
|
||||
}, (error) => {
|
||||
// this.getFromDB();
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false;
|
||||
this.loadList = false
|
||||
});
|
||||
}
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
await this.storage.set('actionsEvents', publicationsEventFolderList);
|
||||
await this.storage.set('actionsViagens', publicationsTravelFolderList);
|
||||
this.getFromDB()
|
||||
} else {
|
||||
this.getFromDB()
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
}/* , (error) => {
|
||||
this.getFromDB();
|
||||
} */);
|
||||
this.skeletonLoader = false;
|
||||
}
|
||||
|
||||
addActionToStorage(events, viagens) {
|
||||
@@ -253,7 +261,7 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
});
|
||||
} else {
|
||||
this.sqliteservice.getAllActions().then((actions: any[]) => {
|
||||
this.sqliteservice.getAllActions().then((actions: any[] = []) => {
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user