improve publicações

This commit is contained in:
Peter Maquiran
2023-01-02 15:42:15 +01:00
parent 3e110c9e93
commit f7aae9aa00
7 changed files with 40 additions and 67 deletions
+1 -34
View File
@@ -1,17 +1,10 @@
import { Component, Inject } from '@angular/core';
import { Component } from '@angular/core';
import { Platform } from '@ionic/angular';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import * as _moment from 'moment';
import * as _rollupMoment from 'moment';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
const moment = _rollupMoment || _moment;
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service';
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { StorageService } from 'src/app/services/storage.service';
import { MessageModel } from './models/beast-orm';
import { InativityService } from "src/app/services/inativity.service";
import { ThemeService } from 'src/app/services/theme.service';
import { environment } from 'src/environments/environment';
@@ -41,30 +34,16 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
export class AppComponent {
constructor(
private platform: Platform,
/* private splashScreen: SplashScreen, */
private statusBar: StatusBar,
private screenOrientation: ScreenOrientation,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService,
private storageservice: StorageService,
private InativityService: InativityService,
public ThemeService: ThemeService,
private storage: Storage,
) {
// this.createCacheFolder()
this.initializeApp();
console.log('version: '+ environment.version)
this.storage.set('version', environment.version).then(() => {})
}
// async createCacheFolder(){
// await Filesystem.mkdir({
// directory: Directory.Cache,
// path: `CACHED-IMG`
// })
// }
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
@@ -87,18 +66,6 @@ export class AppComponent {
}
}
/* this.storageservice.get('networkCheckStore').then((network) => {
if(network === 'online') {
console.log('Network app componente check', network)
this.backgroundservice.online()
} else {
console.log('Network app componente check', network)
this.backgroundservice.offline();
}
}).catch((error) => {
console.error('storage initialize: ',error)
}) */
});
}
}
-3
View File
@@ -7,7 +7,6 @@
<!-- <ion-icon name="home"></ion-icon> -->
<ion-icon *ngIf="pathname != '/home/events'" class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
<ion-icon *ngIf="pathname == '/home/events'" class="nav-icon" src="assets/images/nav-hover/icons-nav-home-active.svg"></ion-icon>
<!-- <ion-badge color="danger">{{toDayEventStorage.eventsList.length + expedienteGdStore.count}}</ion-badge> -->
<ion-label>Início</ion-label>
</ion-tab-button>
@@ -22,8 +21,6 @@
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
<ion-icon *ngIf="pathname != '/home/gabinete-digital'" class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.svg"></ion-icon>
<ion-icon *ngIf="pathname == '/home/gabinete-digital'" class="nav-icon" src="assets/images/nav-hover/icons-nav-gabinete-active.svg"></ion-icon>
<!-- <ion-badge color="danger" *ngIf="!p.userRole(['PR'])" >{{ documentCounterService.mdTotalDocument }}</ion-badge>
<ion-badge color="danger" *ngIf="p.userRole(['PR'])" >{{ documentCounterService.prTotalDocument }}</ion-badge> -->
<ion-label>Gabinete</ion-label>
</ion-tab-button>
+8 -14
View File
@@ -163,7 +163,7 @@ export class HomePage implements OnInit {
}
clearTabButtonSelection(){
clearTabButtonSelection() {
this.tabButton.home = false;
this.tabButton.agenda = false;
this.tabButton.gabinete = false;
@@ -179,13 +179,13 @@ export class HomePage implements OnInit {
else if(url == '/home/agenda'){
this.tabButton.agenda = true;
}
else if(url =='/home/gabinete-digital'){
else if(url =='/home/gabinete-digital') {
this.tabButton.gabinete = true;
}
else if(url =='/home/publications'){
else if(url =='/home/publications') {
this.tabButton.actions = true;
}
else if(url == '/home/chat'){
else if(url == '/home/chat') {
this.tabButton.chat = true;
}
else{
@@ -193,17 +193,12 @@ export class HomePage implements OnInit {
}
}
logDeviceInfo = async () => {
logDeviceInfo = async () => {
const info = await Device.getInfo();
};
get pathname(){
return window.location.pathname
}
get color() {
return '#797979'
get pathname() {
return window.location.pathname
}
updateList() {
@@ -266,5 +261,4 @@ export class HomePage implements OnInit {
this.sqliteservice.deleteAllTables();
}
}
}
+14
View File
@@ -0,0 +1,14 @@
onconnect = (ev) => {
const [port] = ev.ports;
port.onmessage = e => {
const [first, second] = e.data;
let sum = +first + +second;
if (isNaN(sum)) {
port.postMessage("Both inputs should be numbers");
}
else {
const workerResult = `Result: ${sum} `;
port.postMessage(workerResult);
}
};
};
@@ -89,6 +89,7 @@ export class PublicationsPage implements OnInit {
}
});
this.hideRefreshButton();
this.getFromDB()
}
@@ -144,7 +145,6 @@ export class PublicationsPage implements OnInit {
this.loadList = true
this.showLoader = true;
this.skeletonLoader = true;
this.getFromDB()
this.publications.GetPublicationFolderList().subscribe(async res => {
const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
@@ -155,9 +155,10 @@ export class PublicationsPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
await this.storage.set('actionsEvents', this.publicationsEventFolderList);
await this.storage.set('actionsViagens', this.publicationsTravelFolderList);
this.getFromDB()
} else {
this.getFromDB()
folders.forEach((folder)=> {
this.addActionToDB(folder);
})
}
this.showLoader = false;
+6 -6
View File
@@ -1,17 +1,17 @@
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://gdchat-dev.dyndns.info/api/v1/',
//apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/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://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: 'gabinetedigital.local',
defaultuser: 'eqformacao@oapr.gov.ao',//paulo.pinto@gabinetedigital.local
File diff suppressed because one or more lines are too long