mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
fix publication loaders
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<!-- Left -->
|
||||
<div class="aside-left app-default-padding d-flex flex-grow-1 flex-column width-30 ">
|
||||
<!-- Header -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader || skeletonLoader"></ion-progress-bar>
|
||||
<ion-toolbar >
|
||||
|
||||
<div class="main-header">
|
||||
@@ -37,14 +37,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> -->
|
||||
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
<!-- Content -->
|
||||
|
||||
<div *ngIf="!skeletonLoader" class="aside overflow-y-auto d-flex flex-wrap width-100">
|
||||
|
||||
<div class="aside overflow-y-auto d-flex flex-wrap width-100">
|
||||
<ion-item-sliding disabled="{{showSlidingOptions}}" class="width-100"
|
||||
*ngFor="let evento of publicationsEventFolderList">
|
||||
<ion-item lines="none"
|
||||
|
||||
@@ -75,7 +75,6 @@ export class PublicationsPage implements OnInit {
|
||||
) {
|
||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
this.skeletonLoader = true;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -148,13 +147,8 @@ export class PublicationsPage implements OnInit {
|
||||
this.getFromDB()
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
|
||||
|
||||
|
||||
let publicationsEventFolderList = new Array();
|
||||
let publicationsTravelFolderList = new Array();
|
||||
|
||||
res.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
const folders: any = res.map((data): PublicationFolder => {
|
||||
return {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
@@ -162,24 +156,14 @@ export class PublicationsPage implements OnInit {
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
|
||||
this.addActionToDB(folder)
|
||||
|
||||
if (data.ActionType == "Evento") {
|
||||
|
||||
publicationsEventFolderList.push(folder);
|
||||
}
|
||||
else {
|
||||
|
||||
publicationsTravelFolderList.push(folder);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento')
|
||||
this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento')
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
await this.storage.set('actionsEvents', publicationsEventFolderList);
|
||||
await this.storage.set('actionsViagens', publicationsTravelFolderList);
|
||||
await this.storage.set('actionsEvents', this.publicationsEventFolderList);
|
||||
await this.storage.set('actionsViagens', this.publicationsTravelFolderList);
|
||||
this.getFromDB()
|
||||
} else {
|
||||
this.getFromDB()
|
||||
@@ -190,7 +174,6 @@ export class PublicationsPage implements OnInit {
|
||||
this.loadList = false
|
||||
|
||||
}, (error) => {
|
||||
// this.getFromDB();
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false;
|
||||
this.loadList = false
|
||||
@@ -217,16 +200,10 @@ export class PublicationsPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.publicationsEventFolderList = new Array();
|
||||
this.publicationsTravelFolderList = new Array();
|
||||
this.storage.get('actionsEvents').then((events = []) => {
|
||||
|
||||
if(Array.isArray(events)) {
|
||||
events.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
getPublicationFolderMap(events: any):PublicationFolder[] {
|
||||
return events.map((data) : PublicationFolder => {
|
||||
return {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
@@ -234,18 +211,36 @@ export class PublicationsPage implements OnInit {
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
|
||||
this.publicationsEventFolderList.push(folder);
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.storage.get('actionsEvents').then((events = []) => {
|
||||
|
||||
if(Array.isArray(events)) {
|
||||
const folders: PublicationFolder[] = events.map((data) : PublicationFolder => {
|
||||
return {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
DateBegin: data.DateBegin,
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
});
|
||||
|
||||
this.showLoader = false;
|
||||
this.publicationsEventFolderList = folders
|
||||
}
|
||||
|
||||
});
|
||||
this.storage.get('actionsViagens').then((viagens = []) => {
|
||||
|
||||
if(Array.isArray(viagens)) {
|
||||
viagens.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
const folders: PublicationFolder[] = viagens.map((data): PublicationFolder => {
|
||||
return {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
@@ -253,23 +248,18 @@ export class PublicationsPage implements OnInit {
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
|
||||
this.publicationsTravelFolderList.push(folder);
|
||||
this.showLoader = false;
|
||||
});
|
||||
|
||||
this.publicationsTravelFolderList = folders
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
this.sqliteservice.getAllActions().then((actions: any[] = []) => {
|
||||
|
||||
|
||||
|
||||
this.publicationsEventFolderList = new Array();
|
||||
this.publicationsTravelFolderList = new Array();
|
||||
|
||||
actions.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
const folders: any = actions.map((data): PublicationFolder => {
|
||||
return {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
@@ -277,16 +267,12 @@ export class PublicationsPage implements OnInit {
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
|
||||
if (data.ActionType == "Evento") {
|
||||
this.publicationsEventFolderList.push(folder);
|
||||
}
|
||||
else {
|
||||
this.publicationsTravelFolderList.push(folder);
|
||||
}
|
||||
this.showLoader = false;
|
||||
});
|
||||
|
||||
this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento')
|
||||
this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento')
|
||||
this.showLoader = false;
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,6 @@ export const environment = {
|
||||
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket',
|
||||
// apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
// apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
/* apiChatUrl: 'https://www.tabularium.pt/api/v1/',
|
||||
apiWsChatUrl: 'wss://www.tabularium.pt/websocket', */
|
||||
// apiChatUrl: 'https://www.tabularium.pt/api/v1/',
|
||||
production: true,
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: 'eqformacao@oapr.gov.ao',//paulo.pinto@gabinetedigital.local
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
import { versionData } from '../../version/git-version'
|
||||
export const environment = {
|
||||
// apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
|
||||
apiURL: 'https://gd-api.oapr.gov.ao/api/',
|
||||
//apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/',
|
||||
//apiURL: 'https://gd-api.oapr.gov.ao/api/',
|
||||
apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/',
|
||||
// apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
|
||||
// apiChatUrl: 'http://192.168.0.29:3000/api/v1/',
|
||||
// apiWsChatUrl: 'wss://192.168.0.29:3000/websocket',
|
||||
apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
|
||||
apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket',
|
||||
//apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
//apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
/* apiChatUrl: 'https://www.tabularium.pt/api/v1/',
|
||||
apiWsChatUrl: 'wss://www.tabularium.pt/websocket', */
|
||||
// apiChatUrl: 'https://www.tabularium.pt/api/v1/',
|
||||
//apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
|
||||
//apiWsChatUrl: 'wss://gd-chat.oapr.gov.ao/websocket',
|
||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
production: true,
|
||||
domain: 'paulo.pinto@gabinetedigital.local',
|
||||
defaultuser: 'eqformacao@oapr.gov.ao',//paulo.pinto@gabinetedigital.local
|
||||
defaultuserpwd: 'M@p2022', //tabteste@006,
|
||||
defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto@gabinetedigital.local
|
||||
defaultuserpwd: 'tabteste@006', //tabteste@006,
|
||||
chatOffline: true,
|
||||
presidencia: false,
|
||||
version: versionData,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "e350cd24d",
|
||||
"SHA": "e350cd24da31173a89cef80b84961576a8d7cebe",
|
||||
"shortSHA": "fe6a3099a",
|
||||
"SHA": "fe6a3099a9e52ebc4417844b213e0206f27d71e5",
|
||||
"branch": "develop_bitOut-fix",
|
||||
"lastCommitAuthor": "'Peter Maquiran'",
|
||||
"lastCommitTime": "'Wed Dec 28 14:05:59 2022 +0100'",
|
||||
"lastCommitMessage": "add husky",
|
||||
"lastCommitNumber": "4589",
|
||||
"lastCommitTime": "'Wed Dec 28 14:15:49 2022 +0100'",
|
||||
"lastCommitMessage": "add prepare script",
|
||||
"lastCommitNumber": "4590",
|
||||
"change": "",
|
||||
"changeStatus": "On branch develop_bitOut-fix\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: package.json",
|
||||
"changeStatus": "On branch develop_bitOut-fix\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/publications/publications.page.html\n\tmodified: src/app/pages/publications/publications.page.ts\n\tmodified: src/environments/environment.prod.ts\n\tmodified: src/environments/environment.ts",
|
||||
"changeAuthor": "peter.maquiran"
|
||||
}
|
||||
Reference in New Issue
Block a user