mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -232,7 +232,7 @@ export class DespachoService {
|
||||
}
|
||||
|
||||
|
||||
async getList({updateStore = false}): Promise<customTask[]> | null {
|
||||
async getList({updateStore = false}) {
|
||||
|
||||
if (this.LoaderService.loading) {
|
||||
return this.despachoStore.list
|
||||
@@ -253,11 +253,8 @@ export class DespachoService {
|
||||
|
||||
});
|
||||
|
||||
console.log(despachoList);
|
||||
|
||||
|
||||
despachoList = this.sortService.sortArrayISODate(despachoList).reverse();
|
||||
|
||||
despachoList = this.sortService.sortDate(despachoList, 'CreateDate')
|
||||
|
||||
if(updateStore) {
|
||||
this.despachoStore.reset(despachoList);
|
||||
}
|
||||
|
||||
@@ -203,6 +203,26 @@ const routes = [
|
||||
{
|
||||
path: 'event-details-documents-options',
|
||||
loadChildren: () => import('./shared/popover/event-details-documents-options/event-details-documents-options.module').then( m => m.EventDetailsDocumentsOptionsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'preview-camera',
|
||||
loadChildren: () => import('./modals/preview-camera/preview-camera.module').then( m => m.PreviewCameraPageModule)
|
||||
},
|
||||
{
|
||||
path: 'group-icons',
|
||||
loadChildren: () => import('./modals/group-icons/group-icons.module').then( m => m.GroupIconsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'video-allowed',
|
||||
loadChildren: () => import('./modals/video-allowed/video-allowed.module').then( m => m.VideoAllowedPageModule)
|
||||
},
|
||||
{
|
||||
path: 'preview-photo',
|
||||
loadChildren: () => import('./modals/preview-photo/preview-photo.module').then( m => m.PreviewPhotoPageModule)
|
||||
},
|
||||
{
|
||||
path: 'custom-image-cache',
|
||||
loadChildren: () => import('./services/file/custom-image-cache/custom-image-cache.module').then( m => m.CustomImageCachePageModule)
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@ 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';
|
||||
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
@@ -39,20 +41,30 @@ export class AppComponent {
|
||||
/* private splashScreen: SplashScreen, */
|
||||
private statusBar: StatusBar,
|
||||
private screenOrientation: ScreenOrientation,
|
||||
private sqliteservice: SqliteService
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private storageservice: StorageService
|
||||
) {
|
||||
// this.createCacheFolder()
|
||||
this.initializeApp();
|
||||
}
|
||||
|
||||
// async createCacheFolder(){
|
||||
// await Filesystem.mkdir({
|
||||
// directory: Directory.Cache,
|
||||
// path: `CACHED-IMG`
|
||||
// })
|
||||
// }
|
||||
|
||||
initializeApp() {
|
||||
this.platform.ready().then(() => {
|
||||
this.statusBar.styleDefault();
|
||||
/* this.splashScreen.hide(); */
|
||||
|
||||
if (this.platform.is("tablet")) {
|
||||
this.screenOrientation.unlock();
|
||||
window.screen.orientation.unlock();
|
||||
} else if( this.platform.is("mobile")) {
|
||||
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT_PRIMARY);
|
||||
window.screen.orientation.lock('portrait');
|
||||
console.log('Orientation locked')
|
||||
}
|
||||
|
||||
@@ -65,6 +77,16 @@ export class AppComponent {
|
||||
console.log("Error creating local database: ", error)
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
+13
-2
@@ -38,6 +38,7 @@ import { Network } from '@ionic-native/network/ngx';
|
||||
import { File } from '@ionic-native/file/ngx';
|
||||
|
||||
|
||||
|
||||
import {
|
||||
NgxMatDatetimePickerModule,
|
||||
NgxMatNativeDateModule,
|
||||
@@ -64,6 +65,8 @@ import { MediaCapture } from '@ionic-native/media-capture/ngx';
|
||||
import { Media } from '@ionic-native/media/ngx';
|
||||
import { StreamingMedia } from '@ionic-native/streaming-media/ngx';
|
||||
import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
|
||||
import {NgxImageCompressService} from 'ngx-image-compress';
|
||||
import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module';
|
||||
|
||||
/* import { FCM } from '@ionic-native/fcm/ngx';
|
||||
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
@@ -80,7 +83,11 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
useFactory: adapterFactory
|
||||
}),
|
||||
IonicModule.forRoot({animated: false}),
|
||||
IonicStorageModule.forRoot(),
|
||||
IonicStorageModule.forRoot({
|
||||
name: '__mydb',
|
||||
driverOrder: ['indexeddb', 'sqlite', 'websql']
|
||||
}),
|
||||
|
||||
AppRoutingModule,
|
||||
FontAwesomeModule,
|
||||
HttpClientModule,
|
||||
@@ -102,6 +109,9 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
//
|
||||
PdfViewerModule,
|
||||
HammerModule,
|
||||
CustomImageCachePageRoutingModule
|
||||
|
||||
|
||||
],
|
||||
providers: [
|
||||
{ provide: MAT_DATE_LOCALE, useValue: 'pt' },
|
||||
@@ -128,7 +138,8 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||
MediaCapture,
|
||||
Media,
|
||||
StreamingMedia,
|
||||
PhotoViewer
|
||||
PhotoViewer,
|
||||
NgxImageCompressService
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<ion-tab-button tab="events">
|
||||
<!-- <ion-icon name="home"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
|
||||
<ion-badge color="danger">{{toDayEventStorage.eventsList.length + expedienteGdStore.count}}</ion-badge>
|
||||
<!-- <ion-badge color="danger">{{toDayEventStorage.eventsList.length + expedienteGdStore.count}}</ion-badge> -->
|
||||
<ion-label>Início</ion-label>
|
||||
</ion-tab-button>
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<ion-tab-button (click)="goto('/home/gabinete-digital')">
|
||||
<!-- <ion-icon name="file-tray-stacked"></ion-icon> -->
|
||||
<ion-icon class="nav-icon" src="assets/images/icons-nav-gabinete-inactive.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-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>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
import { Component, OnInit, NgZone } from '@angular/core';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Event } from '../models/event.model';
|
||||
import { NotificationsService } from '../services/notifications.service';
|
||||
/*import { WebNotificationsService } from '../services/webnotifications.service'; */
|
||||
@@ -22,7 +22,10 @@ import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Device } from '@capacitor/device';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -66,7 +69,6 @@ export class HomePage implements OnInit {
|
||||
status: string = "";
|
||||
audioName: string = "";
|
||||
constructor(
|
||||
private zone: NgZone,
|
||||
private router: Router,
|
||||
public modalCtrl: AlertController,
|
||||
private notificationsService: NotificationsService,
|
||||
@@ -83,19 +85,26 @@ export class HomePage implements OnInit {
|
||||
private offlinemanager: OfflineManagerService,
|
||||
private storage: Storage,
|
||||
private eventservice: EventsService,
|
||||
private screenOrientation: ScreenOrientation,) {
|
||||
private processservice: ProcessesService,
|
||||
private screenOrientation: ScreenOrientation,
|
||||
private sqliteservice: SqliteService) {
|
||||
|
||||
/* this.webNotificationPopupService.askNotificationPermission() */
|
||||
|
||||
this.router.events.subscribe((val) => {
|
||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||
document.querySelectorAll('popover-viewport').forEach((e: any) => e.remove())
|
||||
});
|
||||
|
||||
window['platform'] = platform
|
||||
|
||||
window['inactivity/function'] = () => {
|
||||
|
||||
if (window.location.pathname != '/inactivity') {
|
||||
|
||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||
document.querySelectorAll('.popover-viewport').forEach((e: any) => e.remove())
|
||||
|
||||
const pathname = window.location.pathname
|
||||
SessionStore.setUrlBeforeInactivity(pathname)
|
||||
this.router.navigate(['/inactivity']);
|
||||
@@ -103,6 +112,7 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
goto(url) {
|
||||
@@ -113,6 +123,8 @@ export class HomePage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.logDeviceInfo();
|
||||
|
||||
this.notificationsService.onReciveForeground();
|
||||
this.notificationsService.onReciveBackground();
|
||||
|
||||
@@ -121,8 +133,7 @@ export class HomePage implements OnInit {
|
||||
this.backgroundservice.online()
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
/* this.notificationsService.onReceviNotification(); */
|
||||
this.offlinemanager.synchnize()
|
||||
this.synchWhenOnline()
|
||||
}
|
||||
});
|
||||
window.addEventListener('offline', () => {
|
||||
@@ -141,6 +152,12 @@ export class HomePage implements OnInit {
|
||||
myWorker.postMessage('ali'); */
|
||||
}
|
||||
|
||||
logDeviceInfo = async () => {
|
||||
const info = await Device.getInfo();
|
||||
|
||||
console.log('Device info',info);
|
||||
};
|
||||
|
||||
updateList() {
|
||||
|
||||
/* this.notificationsService.registerCallback(
|
||||
@@ -160,4 +177,50 @@ export class HomePage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async synchWhenOnline() {
|
||||
try {
|
||||
await this.storage.get('eventEdit').then((req) => {
|
||||
JSON.parse(req).forEach(element => {
|
||||
this.eventservice.editEvent(element, 2, 3).subscribe((res) => {
|
||||
this.storage.remove('eventEdit')
|
||||
this.sqliteservice.deleteEventTable();
|
||||
console.log('eventEdit synchnize', res)
|
||||
})
|
||||
});
|
||||
})
|
||||
} catch (error) {
|
||||
console.log('error synch eventedit')
|
||||
}
|
||||
|
||||
try {
|
||||
await this.storage.get('eventDelete').then((req) => {
|
||||
JSON.parse(req).forEach(element => {
|
||||
console.log('DELETE data SYNC', element)
|
||||
this.eventservice.deleteEvent(element.eventid, element.eventDeleteType, element.calendarName).subscribe((res) => {
|
||||
this.storage.remove('eventDelete')
|
||||
this.sqliteservice.deleteEventTable();
|
||||
console.log('eventDelete synchnize', res)
|
||||
})
|
||||
});
|
||||
})
|
||||
} catch (error) {
|
||||
console.log('error delete event synch')
|
||||
}
|
||||
|
||||
try {
|
||||
await this.storage.get('event-listRever').then((req) => {
|
||||
JSON.parse(req).forEach(element => {
|
||||
console.log('REVER data SYNC', element)
|
||||
this.processservice.PostTaskAction(element).subscribe((res) => {
|
||||
this.storage.remove('event-listRever')
|
||||
this.sqliteservice.deleteEventTable();
|
||||
console.log('event-listRever synchnize', res)
|
||||
})
|
||||
});
|
||||
})
|
||||
} catch (error) {
|
||||
console.log('error event-list rever synch')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ export class CreateProcessPage implements OnInit {
|
||||
|
||||
this.modalController.dismiss();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
|
||||
} finally {
|
||||
loader.remove()
|
||||
@@ -319,10 +319,10 @@ export class CreateProcessPage implements OnInit {
|
||||
}
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Pedido de Parecer enviado');
|
||||
this.toastService._successMessage('Pedido de Parecer enviado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -344,10 +344,10 @@ export class CreateProcessPage implements OnInit {
|
||||
await this.pedidoService.taskCompleteDeferimento({serialNumber:this.task.serialNumber}).toPromise();
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Pedido de Deferimento criado');
|
||||
this.toastService._successMessage('Pedido de Deferimento criado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -376,16 +376,16 @@ export class CreateProcessPage implements OnInit {
|
||||
await this.despachoService.CompleteTask({serialNumber: this.task.serialNumber}).toPromise();
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Despacho criado');
|
||||
this.toastService._successMessage('Despacho criado');
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
} finally {
|
||||
//loader.remove();
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.validateField = true;
|
||||
this.toastService.badRequest('Por favor adicione uma descrição');
|
||||
this.toastService._badRequest('Por favor adicione uma descrição');
|
||||
}
|
||||
loader.remove();
|
||||
break;
|
||||
@@ -411,10 +411,10 @@ export class CreateProcessPage implements OnInit {
|
||||
}
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Pedido de Parecer criado');
|
||||
this.toastService._successMessage('Pedido de Parecer criado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -436,10 +436,10 @@ export class CreateProcessPage implements OnInit {
|
||||
await this.pedidoService.taskCompleteDeferimento({serialNumber:this.task.serialNumber}).toPromise();
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Pedido de Deferimento criado');
|
||||
this.toastService._successMessage('Pedido de Deferimento criado');
|
||||
}
|
||||
catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -494,9 +494,9 @@ export class CreateProcessPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage(message);
|
||||
this.toastService._successMessage(message);
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado');
|
||||
this.toastService._badRequest('Processo não efectuado');
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -69,9 +69,9 @@ export class DarParecerPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.modalController.dismiss();
|
||||
this.toastService.successMessage('Parecer enviado');
|
||||
this.toastService._successMessage('Parecer enviado');
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Parecer não solicitado");
|
||||
this.toastService._badRequest("Parecer não solicitado");
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -88,10 +88,10 @@ export class DelegarPage implements OnInit {
|
||||
|
||||
async saveTask() {
|
||||
if(this.taskParticipants.length < 1){
|
||||
this.toastService.badRequest("Selecione um destinatário");
|
||||
this.toastService._badRequest("Selecione um destinatário");
|
||||
}
|
||||
else if(this.taskParticipants.length > 1){
|
||||
this.toastService.badRequest("Selecione apenas um destinatário");
|
||||
this.toastService._badRequest("Selecione apenas um destinatário");
|
||||
}
|
||||
else {
|
||||
let body = {
|
||||
@@ -109,11 +109,11 @@ export class DelegarPage implements OnInit {
|
||||
this.processes.DelegateTask(body).subscribe(res=>{
|
||||
|
||||
console.log(res);
|
||||
this.toastService.successMessage('Processo delegado')
|
||||
this.toastService._successMessage('Processo delegado')
|
||||
this.close();
|
||||
},
|
||||
(error)=>{
|
||||
this.toastService.badRequest("Processo não delegado")
|
||||
this.toastService._badRequest("Processo não delegado")
|
||||
},
|
||||
()=>{
|
||||
loader.remove()
|
||||
|
||||
@@ -224,11 +224,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
|
||||
this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => {
|
||||
laoder.remove()
|
||||
this.toastService.successMessage('Reunião criada')
|
||||
this.toastService._successMessage('Reunião criada')
|
||||
this.modalController.dismiss()
|
||||
}, (error) => {
|
||||
laoder.remove()
|
||||
this.toastService.badRequest('Não foi possível marcar a reunião');
|
||||
this.toastService._badRequest('Não foi possível marcar a reunião');
|
||||
}, ()=>{
|
||||
laoder.remove()
|
||||
});
|
||||
|
||||
@@ -124,7 +124,7 @@ export class ForwardPage implements OnInit {
|
||||
}
|
||||
|
||||
if(this.taskParticipants.length < 1){
|
||||
this.toastService.badRequest("Selecione um destinatário");
|
||||
this.toastService._badRequest("Selecione um destinatário");
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -150,11 +150,11 @@ export class ForwardPage implements OnInit {
|
||||
console.log(body);
|
||||
this.processes.CompleteParecerPrTask(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.toastService.successMessage('Processo delegado');
|
||||
this.toastService._successMessage('Processo delegado');
|
||||
this.goBack();
|
||||
},
|
||||
(error)=>{
|
||||
this.toastService.badRequest("Processo não delegado")
|
||||
this.toastService._badRequest("Processo não delegado")
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { GroupIconsPage } from './group-icons.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: GroupIconsPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class GroupIconsPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { GroupIconsPageRoutingModule } from './group-icons-routing.module';
|
||||
|
||||
import { GroupIconsPage } from './group-icons.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
GroupIconsPageRoutingModule
|
||||
],
|
||||
declarations: [GroupIconsPage]
|
||||
})
|
||||
export class GroupIconsPageModule {}
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
<ion-card class="cardconteudo" (click)= "dismiss()" >
|
||||
<ion-card-header>
|
||||
</ion-card-header>
|
||||
<ion-card-content >
|
||||
<ion-row>
|
||||
<ion-item>Tem certeza que apagar imagem?</ion-item>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-item ><ion-chip>
|
||||
<ion-label color="danger">Sim</ion-label>
|
||||
</ion-chip>
|
||||
|
||||
<ion-chip class="placed">
|
||||
<ion-label color="secondary" (click)= "dismiss()">Não</ion-label>
|
||||
</ion-chip >
|
||||
</ion-item>
|
||||
</ion-row>
|
||||
</ion-card-content>
|
||||
</ion-card>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
// .animated{
|
||||
// animation: duration 5s;
|
||||
// animation-fill-mode: both;
|
||||
// }
|
||||
|
||||
// @keyframes bounceInUp{
|
||||
// 0%{
|
||||
// opacity:0;
|
||||
// transform: translateY(300px);
|
||||
|
||||
// }
|
||||
// 60%{
|
||||
// opacity:0;
|
||||
// transform: translateY(-30px);
|
||||
// }
|
||||
// 80%{
|
||||
// opacity:0;
|
||||
// transform: translateY(10px);
|
||||
// }
|
||||
// 100%{
|
||||
// opacity:0;
|
||||
// transform: translateY(0);
|
||||
// }
|
||||
// }
|
||||
// .bounceInUp{
|
||||
// animation-name: bounceInUp;
|
||||
// }
|
||||
|
||||
// @keyframes bounceInUp{
|
||||
// from{down:0px}
|
||||
// 30% {top: 100px !important;} /* ignored */
|
||||
// from{down:200px}
|
||||
// }
|
||||
|
||||
|
||||
.rollover {
|
||||
position: relative;
|
||||
animation: mymove 5s infinite;
|
||||
}
|
||||
|
||||
@keyframes mymove {
|
||||
from {bottom: 0px; }
|
||||
to {bottom: 100px;}
|
||||
}
|
||||
|
||||
@media only screen and (min-height: 600px) and (min-width: 768px)
|
||||
{
|
||||
.custom-modal {
|
||||
.modal-wrapper {
|
||||
|
||||
position: absolute !important;
|
||||
height: 500px !important;
|
||||
top: calc(100% - (500px));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.redla{
|
||||
|
||||
color: rgb(255, 38, 0);
|
||||
// background-color: rgb(255, 72, 0);
|
||||
}
|
||||
|
||||
.placed{
|
||||
float:right
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { GroupIconsPage } from './group-icons.page';
|
||||
|
||||
describe('GroupIconsPage', () => {
|
||||
let component: GroupIconsPage;
|
||||
let fixture: ComponentFixture<GroupIconsPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ GroupIconsPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(GroupIconsPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { IonSlides, ModalController, NavParams } from '@ionic/angular';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-icons',
|
||||
templateUrl: './group-icons.page.html',
|
||||
styleUrls: ['./group-icons.page.scss'],
|
||||
})
|
||||
export class GroupIconsPage implements OnInit {
|
||||
|
||||
constructor( private modalController: ModalController,
|
||||
private navParams:NavParams,
|
||||
private publicService:PublicationsService ) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
removerIcone(){
|
||||
|
||||
}
|
||||
openGaleria(){
|
||||
|
||||
}
|
||||
OpenCamera(){
|
||||
|
||||
}
|
||||
pesquizarWeb(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
dismiss() {
|
||||
// using the injected ModalController this page
|
||||
// can "dismiss" itself and optionally pass back data
|
||||
this.modalController.dismiss({
|
||||
'dismissed': true
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
// delete(){
|
||||
// this.publicService.DeletePublication()
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { PreviewCameraPage } from './preview-camera.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PreviewCameraPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class PreviewCameraPageRoutingModule {}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { PreviewCameraPageRoutingModule } from './preview-camera-routing.module';
|
||||
|
||||
import { PreviewCameraPage } from './preview-camera.page';
|
||||
import { ImageCropperModule } from 'ngx-image-cropper';
|
||||
import { GroupIconsPage } from '../group-icons/group-icons.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
ImageCropperModule,
|
||||
PreviewCameraPageRoutingModule
|
||||
],
|
||||
declarations: [PreviewCameraPage],
|
||||
|
||||
|
||||
})
|
||||
export class PreviewCameraPageModule {}
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
<ion-card class="cardconteudo" >
|
||||
|
||||
<ion-card-content >
|
||||
<ion-card-header >
|
||||
|
||||
|
||||
<ion-text color="dark" size="6">{{username}} <span>{{_updatedAt | date}}</span><div class="right" (click)="getIconGallery()"><ion-icon name="pencil-outline" ></ion-icon></div></ion-text>
|
||||
|
||||
|
||||
|
||||
</ion-card-header>
|
||||
|
||||
<img src="{{image}}" />
|
||||
|
||||
</ion-card-content>
|
||||
<!-- <image-cropper [imageBase64]="myimage"
|
||||
[maintainAspectRatio]="true"
|
||||
[aspectRatio]="4 / 3"
|
||||
outputType = "base64"
|
||||
format="png"
|
||||
[resizeToWidth]="true"
|
||||
(imageCropped)="imageCropped($event)"
|
||||
|
||||
></image-cropper> -->
|
||||
|
||||
<ion-footer color="light">
|
||||
<ion-row>
|
||||
<ion-col size="3" class="ion-text-center">
|
||||
<ion-button (click)="close()" fill="clear" color="light">
|
||||
<!-- <ion-icon name="remove" slot="start"></ion-icon> -->
|
||||
<ion-icon src="assets/icon/chat/circle-xmark-solid 1.svg" ></ion-icon>
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<ion-col size="3" class="ion-text-center">
|
||||
<ion-button (click)="deleteImage()" fill="clear" color="light">
|
||||
<ion-icon src="assets/icon/chat/Ellipse 8.svg" ></ion-icon>
|
||||
<!-- <ion-icon class="redla" name="flower-outline"></ion-icon> -->
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<ion-col size="3" class="ion-text-center">
|
||||
<ion-button (click)="redirPage()" fill="clear" color="light">
|
||||
|
||||
<ion-icon src="assets/icon/chat/Ellipselast.svg" ></ion-icon>
|
||||
|
||||
|
||||
</ion-button>
|
||||
</ion-col>
|
||||
<ion-col size="3" class="ion-text-center">
|
||||
|
||||
<ion-button (click)="getIconShare()" fill="clear" color="light">
|
||||
|
||||
|
||||
|
||||
<ion-icon src="assets/icon/chat/Ellipse 9.svg" ></ion-icon>
|
||||
|
||||
|
||||
</ion-button>
|
||||
|
||||
</ion-col>
|
||||
<!-- <ion-col size="3" class="ion-text-center">
|
||||
<ion-button (click)="zoom(true)" fill="clear" color="light">
|
||||
<ion-icon class="redla" name="alert-circle"></ion-icon>
|
||||
|
||||
</ion-button>
|
||||
</ion-col> -->
|
||||
</ion-row>
|
||||
</ion-footer>
|
||||
</ion-card>
|
||||
@@ -0,0 +1,60 @@
|
||||
ion-footer {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
ion-slides {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.redla{
|
||||
color: rgb(250, 250, 4);
|
||||
background-color: rgb(255, 238, 0);
|
||||
border-radius: 120px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
.blacking{
|
||||
background-color: rgb(168, 41, 41);
|
||||
}
|
||||
|
||||
.cardconteudo {
|
||||
background: rgb(253, 252, 252);
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
}
|
||||
|
||||
.whiter{
|
||||
color: white;
|
||||
|
||||
}
|
||||
.right{
|
||||
float: right;
|
||||
}
|
||||
.center{
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
circle-xmark-solid{
|
||||
|
||||
// position: relative;
|
||||
width: 512px;
|
||||
height: 515px;
|
||||
position: absolute;
|
||||
left: 0%;
|
||||
right: 0%;
|
||||
top: 0%;
|
||||
bottom: 0%;
|
||||
|
||||
background: #FCD13A;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Vector */
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { PreviewCameraPage } from './preview-camera.page';
|
||||
|
||||
describe('PreviewCameraPage', () => {
|
||||
let component: PreviewCameraPage;
|
||||
let fixture: ComponentFixture<PreviewCameraPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PreviewCameraPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(PreviewCameraPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,148 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { IonSlides, ModalController, NavParams } from '@ionic/angular';
|
||||
import { ImageCroppedEvent } from 'ngx-image-cropper';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { GroupIconsPage } from '../group-icons/group-icons.page';
|
||||
import { Share } from '@capacitor/share';
|
||||
import { Router } from '@angular/router';
|
||||
import { Directory, Filesystem } from '@capacitor/filesystem';
|
||||
|
||||
@Component({
|
||||
selector: 'app-preview-camera',
|
||||
templateUrl: './preview-camera.page.html',
|
||||
styleUrls: ['./preview-camera.page.scss'],
|
||||
})
|
||||
export class PreviewCameraPage implements OnInit {
|
||||
|
||||
constructor( private modalController: ModalController,
|
||||
private navParams:NavParams,
|
||||
public router: Router,
|
||||
private publicService: PublicationsService) { }
|
||||
|
||||
|
||||
@ViewChild(IonSlides) slides : IonSlides
|
||||
image: any;
|
||||
username: string
|
||||
_updatedAt: string
|
||||
|
||||
|
||||
// myimage: null
|
||||
// croppedImageBase64: any
|
||||
|
||||
// @Input('img') img: any
|
||||
// @Input() username: string;
|
||||
// @Input() date: string;
|
||||
|
||||
slideOpts = {
|
||||
zoom: true
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.image = this.navParams.get('image')
|
||||
this.username = this.navParams.get('username')
|
||||
this._updatedAt = this.navParams.get('_updatedAt')
|
||||
console.log(this.image)
|
||||
// this.image = this.myimage
|
||||
}
|
||||
|
||||
ionViewDidEnter(){
|
||||
this.slides.update()
|
||||
}
|
||||
|
||||
async zoom(zoomIn: boolean){
|
||||
const slider = await this.slides.getSwiper() //is swipper =!
|
||||
const zoom = slider.zoom
|
||||
zoomIn ? zoom.in(): zoom.out()
|
||||
}
|
||||
|
||||
close(){
|
||||
this.modalController.dismiss()
|
||||
}
|
||||
|
||||
// imageCropped(ev: ImageCroppedEvent){
|
||||
// this.croppedImageBase64 = ev.base64
|
||||
// }
|
||||
|
||||
|
||||
// async grupo(){
|
||||
// const modal = await this.modalController.create({
|
||||
// component: GroupIconsPage,
|
||||
// cssClass: 'transparent-modal',
|
||||
// });
|
||||
// modal.present();
|
||||
// }
|
||||
|
||||
async getIconGallery(){
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupIconsPage ,
|
||||
animated: true,
|
||||
cssClass: 'transparent-modal',
|
||||
});
|
||||
modal.present();
|
||||
}
|
||||
|
||||
openChat(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
clear() {
|
||||
this.getIconGallery()
|
||||
|
||||
}
|
||||
|
||||
openChatVideo(){
|
||||
|
||||
}
|
||||
deleteImage(){
|
||||
document.addEventListener('DOMContentLoaded', ()=>{
|
||||
document.querySelector('img').addEventListener('click',removeImage)
|
||||
})
|
||||
function removeImage(ev){
|
||||
console.log(ev.target, ev.currentTarget)
|
||||
let img = ev.currentTarget
|
||||
let src = ev.target.closest('.img')
|
||||
src?.parentElement.removeChild(src)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async getIconShare(){
|
||||
|
||||
|
||||
await Share.share({
|
||||
title: 'See cool stuff',
|
||||
text: 'Really awesome thing you need to see right meow',
|
||||
url: this.image,
|
||||
dialogTitle: 'Share with buddies',
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
redirPage(){
|
||||
this.router.navigateByUrl('/chat')
|
||||
}
|
||||
|
||||
async deleteFile(entry){
|
||||
if(entry.isFile){
|
||||
await Filesystem.deleteFile({
|
||||
directory: Directory.Documents,
|
||||
path: this.image.src + '/' + entry.name
|
||||
})
|
||||
}else{
|
||||
await Filesystem.rmdir({
|
||||
directory: Directory.Documents,
|
||||
path: this.image.src + '/' + entry.name,
|
||||
recursive:true //remove all file as well
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { PreviewPhotoPage } from './preview-photo.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: PreviewPhotoPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class PreviewPhotoPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { PreviewPhotoPageRoutingModule } from './preview-photo-routing.module';
|
||||
|
||||
import { PreviewPhotoPage } from './preview-photo.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
PreviewPhotoPageRoutingModule
|
||||
],
|
||||
declarations: [PreviewPhotoPage]
|
||||
})
|
||||
export class PreviewPhotoPageModule {}
|
||||
@@ -0,0 +1,15 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>
|
||||
<ion-icon></ion-icon>
|
||||
</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<img src="{{image}}" />
|
||||
<ion-footer>
|
||||
<ion-icon></ion-icon>
|
||||
<ion-icon></ion-icon>
|
||||
</ion-footer>
|
||||
</ion-content>
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { PreviewPhotoPage } from './preview-photo.page';
|
||||
|
||||
describe('PreviewPhotoPage', () => {
|
||||
let component: PreviewPhotoPage;
|
||||
let fixture: ComponentFixture<PreviewPhotoPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ PreviewPhotoPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(PreviewPhotoPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-preview-photo',
|
||||
templateUrl: './preview-photo.page.html',
|
||||
styleUrls: ['./preview-photo.page.scss'],
|
||||
})
|
||||
export class PreviewPhotoPage implements OnInit {
|
||||
|
||||
constructor(private modalController: ModalController,
|
||||
private navParams:NavParams) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
image: any;
|
||||
|
||||
exit( ){ this.modalController.dismiss()
|
||||
|
||||
}
|
||||
save(img){
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
canvas.width=300
|
||||
canvas.height=234
|
||||
ctx.drawImage(img.attachments[0].image_url, 0, 0, 300, 234);
|
||||
document.body.appendChild(canvas);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -72,9 +72,9 @@
|
||||
<img style="width: 40px;" src="assets/images/logo-removebg-preview.png"/>
|
||||
</div>
|
||||
|
||||
<div hidden class="btn-close d-flex cursor-pointer pr-10" (click)="changeTheme('tribunal')" >
|
||||
<!-- <div hidden class="btn-close d-flex cursor-pointer pr-10" (click)="changeTheme('tribunal')" >
|
||||
<img style="width: 40px;" src="assets/images/theme/tribunal/tribunal-constitucional-logo.png"/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<div class="approve-event-detail">
|
||||
<p *ngIf = "item.Service == 'agenda'">{{item.Location}}</p>
|
||||
<h3 id="profile-title">{{item.title}}</h3>
|
||||
<p *ngIf = "item.Service != 'agenda'">{{item.body}}</p>
|
||||
<p id="profile-title" *ngIf = "item.Service != 'agenda'">{{item.body}}</p>
|
||||
</div>
|
||||
<!-- <div class="notification-label-MD-official" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'official' && item.Role == '100000011'" ></div>
|
||||
<div class="notification-label-MD-pessoal" *ngIf = "item.Service == 'agenda' && item.TypeAgenda == 'pessoal' && item.Role == '100000011'" ></div>
|
||||
|
||||
@@ -1,60 +1,58 @@
|
||||
.profile-header{
|
||||
.profile-header {
|
||||
margin: 0 em(20px);
|
||||
// background-color: #0782c9;
|
||||
padding: 20px 20px;
|
||||
border: 0!important;
|
||||
border: 0 !important;
|
||||
|
||||
.div-logo{
|
||||
.div-logo {
|
||||
background: transparent;
|
||||
width: calc(100% - 40px) !important;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
float: left;
|
||||
|
||||
.logo{
|
||||
.logo {
|
||||
width: 140px;
|
||||
.img{
|
||||
.img {
|
||||
width: 100%;
|
||||
margin: 0px auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.btn-close{
|
||||
.btn-close {
|
||||
float: right !important;
|
||||
}
|
||||
.profile-content{
|
||||
padding: 20px 20px;
|
||||
//color: var(--profile-text-color) !important;
|
||||
|
||||
.profile-content {
|
||||
padding: 20px 20px;
|
||||
//color: var(--profile-text-color) !important;
|
||||
}
|
||||
|
||||
.icon{
|
||||
font-size: 40px;
|
||||
.icon {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.profile-title{
|
||||
.profile-title {
|
||||
font-weight: 300;
|
||||
font-size: 20px !important;
|
||||
margin-bottom: 40px !important;
|
||||
color: var(--profile-text-color) !important;
|
||||
|
||||
}
|
||||
|
||||
.line{
|
||||
.line {
|
||||
width: 100% !important;
|
||||
margin-top: 15px;
|
||||
border-top: 1px solid #d8d8d8;
|
||||
color: var(--profile-title-color-RoleDescription) !important;
|
||||
}
|
||||
|
||||
.btn-delete{
|
||||
background:#ffe0e0 !important;
|
||||
.btn-delete {
|
||||
background: #ffe0e0 !important;
|
||||
width: 40% !important;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.btn-cancel{
|
||||
.btn-cancel {
|
||||
width: 40% !important;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
@@ -63,14 +61,13 @@
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
ion-list{
|
||||
ion-list {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
|
||||
.notifications-content{
|
||||
.notifications-content {
|
||||
padding: 0px 20px;
|
||||
.item{
|
||||
.item {
|
||||
border-radius: 15px;
|
||||
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
|
||||
border: solid 1px #e9e9e9;
|
||||
@@ -81,37 +78,38 @@ ion-list{
|
||||
color: #000;
|
||||
overflow: hidden;
|
||||
|
||||
.notification-item{
|
||||
.notification-item {
|
||||
width: fit-content;
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
padding: 0 !important;
|
||||
overflow: auto;
|
||||
|
||||
|
||||
}
|
||||
.notification-icon{
|
||||
.notification-icon {
|
||||
font-size: 35px !important;
|
||||
}
|
||||
.approve-event-time{
|
||||
.approve-event-time {
|
||||
width: fit-content !important;
|
||||
float: left;
|
||||
}
|
||||
.approve-event-detail{
|
||||
.approve-event-detail {
|
||||
width: calc(100% - 115px) !important;
|
||||
float: left;
|
||||
#profile-title{
|
||||
#profile-title {
|
||||
width: 250px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
.notification-label-MD-official{
|
||||
.notification-label-MD-official {
|
||||
float: right;
|
||||
width: 5px;
|
||||
height: 100%;
|
||||
border-radius: 0% 100% 100% 0%;
|
||||
background-color: #ffb703;
|
||||
}
|
||||
.notification-label-MD-pessoal{
|
||||
.notification-label-MD-pessoal {
|
||||
float: right;
|
||||
width: 5px;
|
||||
height: 100%;
|
||||
@@ -119,21 +117,19 @@ ion-list{
|
||||
background-color: #ff0303;
|
||||
}
|
||||
|
||||
.item-conten{
|
||||
.item-conten {
|
||||
border-right: 5px solid var(--notificationtypeagenda);
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.notification-label-PR-official{
|
||||
.notification-label-PR-official {
|
||||
float: right;
|
||||
width: 5px;
|
||||
height: 100%;
|
||||
border-radius: 0% 100% 100% 0%;
|
||||
background-color: #03d838;
|
||||
}
|
||||
.notification-label-PR-pessoal{
|
||||
.notification-label-PR-pessoal {
|
||||
float: right;
|
||||
width: 5px;
|
||||
height: 100%;
|
||||
@@ -141,8 +137,7 @@ ion-list{
|
||||
background-color: #8b0ae0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.item-inner{
|
||||
.item-inner {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { NotificationsService } from '../../services/notifications.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { EventTrigger } from '../../services/eventTrigger.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profile',
|
||||
@@ -41,7 +42,8 @@ export class ProfilePage implements OnInit {
|
||||
private notificationservice: NotificationsService,
|
||||
private platform: Platform,
|
||||
private eventtrigger: EventTrigger,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
@@ -134,7 +136,7 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
getFormatedTime(dateString) {
|
||||
var date = new Date(dateString);
|
||||
var hours = date.getHours() > 12 ? date.getHours() - 12 : date.getHours();
|
||||
var hours = date.getHours() /* > 12 ? date.getHours() - 12 : date.getHours() */;
|
||||
var am_pm = date.getHours() >= 12 ? "pm" : "am";
|
||||
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
|
||||
let time = hours + ":" + minutes /* + " " + am_pm */;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { VideoAllowedPage } from './video-allowed.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: VideoAllowedPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class VideoAllowedPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { VideoAllowedPageRoutingModule } from './video-allowed-routing.module';
|
||||
|
||||
import { VideoAllowedPage } from './video-allowed.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
VideoAllowedPageRoutingModule
|
||||
],
|
||||
declarations: [VideoAllowedPage]
|
||||
})
|
||||
export class VideoAllowedPageModule {}
|
||||
@@ -0,0 +1,9 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>videoAllowed</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
|
||||
</ion-content>
|
||||
@@ -0,0 +1,24 @@
|
||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { VideoAllowedPage } from './video-allowed.page';
|
||||
|
||||
describe('VideoAllowedPage', () => {
|
||||
let component: VideoAllowedPage;
|
||||
let fixture: ComponentFixture<VideoAllowedPage>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ VideoAllowedPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(VideoAllowedPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-video-allowed',
|
||||
templateUrl: './video-allowed.page.html',
|
||||
styleUrls: ['./video-allowed.page.scss'],
|
||||
})
|
||||
export class VideoAllowedPage implements OnInit {
|
||||
modalController: any;
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
dismiss() {
|
||||
// using the injected ModalController this page
|
||||
// can "dismiss" itself and optionally pass back data
|
||||
this.modalController.dismiss({
|
||||
'dismissed': true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -123,8 +123,6 @@ export class customTask {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export interface expedienteTask {
|
||||
SerialNumber: string
|
||||
Folio : string
|
||||
@@ -143,8 +141,6 @@ export interface expedienteTask {
|
||||
InstanceID: any
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface ExpedienteTask {
|
||||
SerialNumber: string
|
||||
Senders : string
|
||||
|
||||
@@ -216,9 +216,9 @@
|
||||
|
||||
<!-- List -->
|
||||
<ul *ngIf="showTimelineFilterState">
|
||||
<li [class.active]="segment == 'Combinado' " (click)="changeSegment('Combinado')" class="cursor-pointer">Todos</li>
|
||||
<li [class.active]="segment == 'Oficial' " (click)="changeSegment('Oficial')" class="cursor-pointer">Oficial</li>
|
||||
<li [class.active]="segment == 'Pessoal' " (click)="changeSegment('Pessoal')" class="cursor-pointer">Pessoal</li>
|
||||
<li class="changeText" [class.active]="segment == 'Combinado' " (click)="changeSegment('Combinado')" class="cursor-pointer">Todos</li>
|
||||
<li class="changeText" [class.active]="segment == 'Oficial' " (click)="changeSegment('Oficial')" class="cursor-pointer">Oficial</li>
|
||||
<li class="changeText" [class.active]="segment == 'Pessoal' " (click)="changeSegment('Pessoal')" class="cursor-pointer">Pessoal</li>
|
||||
</ul>
|
||||
|
||||
</ion-row>
|
||||
|
||||
@@ -292,6 +292,11 @@ td.monthview-primary-with-event {
|
||||
|
||||
.segment {
|
||||
|
||||
}
|
||||
|
||||
div ion-raw > ul > li{
|
||||
font-size: 11pt;
|
||||
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
|
||||
}
|
||||
|
||||
/* Timeline */
|
||||
@@ -794,4 +799,17 @@ app-approve-event{
|
||||
border-top-right-radius: 25px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
|
||||
$font-size: 11pt;
|
||||
|
||||
.changeText{
|
||||
font-family: $font-family;
|
||||
font-size: $font-size;
|
||||
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@ export class AgendaPage implements OnInit {
|
||||
dropdownScrollWeal = false
|
||||
CalendarStore = CalendarStore
|
||||
listToPresent
|
||||
array = []
|
||||
|
||||
constructor(
|
||||
private alertCtrl: AlertController,
|
||||
@@ -232,6 +233,8 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.getFromDB();
|
||||
|
||||
const pathname = window.location.pathname
|
||||
let realoadCounter = 0
|
||||
this.router.events.forEach((event) => {
|
||||
@@ -240,14 +243,14 @@ export class AgendaPage implements OnInit {
|
||||
this.segment = "Combinado";
|
||||
}
|
||||
if (realoadCounter != 0) {
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
//this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
realoadCounter++;
|
||||
}
|
||||
});
|
||||
|
||||
this.backgroundservice.registerBackService('Online', () => {
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
//this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
});
|
||||
|
||||
window.onresize = (event) => {
|
||||
@@ -487,6 +490,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
loadRangeEvents(startTime: Date, endTime: Date) {
|
||||
this.array = [];
|
||||
|
||||
this.rangeStartDate = startTime
|
||||
this.rangeEndDate = endTime
|
||||
@@ -514,6 +518,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
console.log('check list to present data', this.listToPresent);
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
@@ -540,13 +545,17 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
console.log('check list to present data', this.listToPresent);
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
}).finally(() => {
|
||||
}).catch((error) => {
|
||||
this.getFromDB()
|
||||
})
|
||||
.finally(() => {
|
||||
this.showLoader = false;
|
||||
})
|
||||
|
||||
@@ -567,6 +576,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
console.log('check list to present data', this.listToPresent);
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
@@ -603,6 +613,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
console.log('check list to present data', this.listToPresent);
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
@@ -614,7 +625,10 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
}).finally(() => {
|
||||
}).catch((error) => {
|
||||
this.getFromDB()
|
||||
})
|
||||
.finally(() => {
|
||||
counter++;
|
||||
if (counter == 2) {
|
||||
this.showLoader = false;
|
||||
@@ -633,6 +647,8 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
console.log('check list to present data', this.listToPresent);
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
@@ -644,7 +660,10 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
}).finally(() => {
|
||||
}).catch((error) => {
|
||||
this.getFromDB()
|
||||
})
|
||||
.finally(() => {
|
||||
counter++;
|
||||
if (counter == 2) {
|
||||
this.showLoader = false;
|
||||
@@ -674,6 +693,7 @@ export class AgendaPage implements OnInit {
|
||||
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
|
||||
|
||||
console.log('check list to present data', this.listToPresent);
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
@@ -685,7 +705,10 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
}).finally(() => {
|
||||
}).catch((error) => {
|
||||
this.getFromDB()
|
||||
})
|
||||
.finally(() => {
|
||||
if (counter == 1 || this.loggeduser.Profile == 'PR') {
|
||||
this.showLoader = false;
|
||||
}
|
||||
@@ -697,7 +720,6 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
trasnformData(response,profile) {
|
||||
let array = []
|
||||
response.forEach(element => {
|
||||
let event = {
|
||||
startTime: new Date(element.StartDate),
|
||||
@@ -708,10 +730,9 @@ export class AgendaPage implements OnInit {
|
||||
profile: profile,
|
||||
id: element.EventId,
|
||||
}
|
||||
array.push(event)
|
||||
this.array.push(event)
|
||||
});
|
||||
|
||||
this.listToPresent = array;
|
||||
this.listToPresent = this.array;
|
||||
console.log('LIST TO PRESET', this.listToPresent)
|
||||
}
|
||||
|
||||
@@ -952,7 +973,7 @@ export class AgendaPage implements OnInit {
|
||||
// });
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
// this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
|
||||
this.cloneAllmobileComponent();
|
||||
@@ -992,7 +1013,6 @@ export class AgendaPage implements OnInit {
|
||||
this.postEvent = data.event;
|
||||
|
||||
this.mobileComponent.showEditEvent = true;
|
||||
|
||||
}
|
||||
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
@@ -1147,6 +1167,7 @@ export class AgendaPage implements OnInit {
|
||||
async closeComponentEditEventOrAdd() {
|
||||
|
||||
if (this.IsEvent = 'edit') {
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
this.eventClicked(this.viewingEventObject);
|
||||
} else if (this.IsEvent = 'add') {
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
@@ -281,12 +281,12 @@ export class NewEventPage implements OnInit {
|
||||
});
|
||||
|
||||
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
this.modalController.dismiss(this.postEvent);
|
||||
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -171,9 +171,9 @@ export class ViewEventPage implements OnInit {
|
||||
loader.remove()
|
||||
}, (error) => {
|
||||
|
||||
console.log('errorstatus',error.status)
|
||||
console.log('errorstatus ss',error.status)
|
||||
|
||||
if (error.status == 0) {
|
||||
if (error.status === 0) {
|
||||
this.getFromDb();
|
||||
} else {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
@@ -205,6 +205,8 @@ export class ViewEventPage implements OnInit {
|
||||
() => {
|
||||
loader.remove();
|
||||
});
|
||||
|
||||
loader.remove();
|
||||
}
|
||||
|
||||
|
||||
@@ -421,8 +423,9 @@ export class ViewEventPage implements OnInit {
|
||||
const loader = this.toastService.loading();
|
||||
this.sqliteservice.getEventById(this.eventId).then((event) => {
|
||||
let arrayevent = [];
|
||||
console.log('EVENT ATTENDEES',event[0].Attendees)
|
||||
let elemet = {
|
||||
Attendees: JSON.parse(event[0].Attendees) || "",
|
||||
Attendees: (typeof JSON.parse(event[0].Attendees) === 'undefined') ? "" : JSON.parse(event[0].Attendees),
|
||||
Body: JSON.parse(event[0].Body) || "",
|
||||
CalendarId: event[0].CalendarId,
|
||||
CalendarName: event[0].CalendarName,
|
||||
|
||||
@@ -29,6 +29,7 @@ import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
import { NewEventPageModule } from 'src/app/shared/agenda/new-event/new-event.module';
|
||||
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import { ImageCropperModule } from 'ngx-image-cropper';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -48,6 +49,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
GroupContactsPageModule,
|
||||
EmptyChatPageModule,
|
||||
NewEventPageModule,
|
||||
ImageCropperModule,
|
||||
AttendeeModalPageModule,
|
||||
],
|
||||
declarations: [
|
||||
|
||||
@@ -97,8 +97,6 @@
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && group._id != idSelected " class="icon" slot="start" src="assets/images/theme/gov/icons-chat-group-chat-40.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && group._id == idSelected " class="icon" slot="start" src="assets/images/theme/gov/icons-chat-group-chat-40-hover.svg"></ion-icon>
|
||||
|
||||
|
||||
</div>
|
||||
<div
|
||||
(click)="openGroupMessagesPage(group._id)" class="item-content flex-grow-1 cursor-pointer">
|
||||
@@ -125,6 +123,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
|
||||
</ion-list>
|
||||
</div>
|
||||
<!-- <button (click)="sendMsg()" style="height: 41px;">Send message</button> -->
|
||||
|
||||
@@ -32,6 +32,7 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { DataService } from 'src/app/services/data.service';
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-chat',
|
||||
templateUrl: './chat.page.html',
|
||||
@@ -119,6 +120,7 @@ export class ChatPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private dataService:DataService,
|
||||
private router: Router,
|
||||
|
||||
){
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.headers = new HttpHeaders();
|
||||
@@ -549,4 +551,10 @@ hideRefreshButton(){
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
}
|
||||
// this.crop.crop('path/to/image.jpg', {quality: 75})
|
||||
// .then(
|
||||
// newImage => console.log('new image path is: ' + newImage),
|
||||
// error => console.error('Error cropping image', error)
|
||||
// );
|
||||
|
||||
}
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="main-content">
|
||||
<div *ngIf="members">
|
||||
<ion-label class="members-label">Contactos selecção:</ion-label>
|
||||
|
||||
@@ -13,6 +13,8 @@ import { ChatPopoverPageModule } from 'src/app/shared/popover/chat-popover/chat-
|
||||
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
|
||||
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import { ImageCropperModule } from 'ngx-image-cropper';
|
||||
import { AngularCropperjsModule } from 'angular-cropperjs';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -24,6 +26,9 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
GroupMessagesPageRoutingModule,
|
||||
ChatPopoverPageModule,
|
||||
BtnModalDismissPageModule,
|
||||
ImageCropperModule,
|
||||
AngularCropperjsModule
|
||||
|
||||
],
|
||||
declarations: [GroupMessagesPage]
|
||||
})
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
||||
</div>
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of messages; let last = last" [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
|
||||
<div *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}'>
|
||||
<div *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' (click)="openPreview(msg)">
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
@@ -66,7 +66,7 @@
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
<div *ngIf="msg.attachments" class="message-attachments">
|
||||
<div *ngFor="let file of msg.attachments">
|
||||
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
||||
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image" >
|
||||
<div>
|
||||
<div>
|
||||
<div class="file">
|
||||
@@ -90,7 +90,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{last ? scrollToBottom() : ''}}
|
||||
</div>
|
||||
@@ -152,4 +154,5 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-footer>
|
||||
|
||||
@@ -278,3 +278,36 @@
|
||||
}
|
||||
|
||||
}
|
||||
.preview-slides {
|
||||
margin-top: 20%;
|
||||
background: #e6e6e6;
|
||||
|
||||
img {
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.transparent-modal {
|
||||
.modal-wrapper {
|
||||
--background: rgba(44, 39, 45, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.image-slide,
|
||||
.image-card {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.image-card {
|
||||
z-index: 9;
|
||||
}
|
||||
|
||||
.backdrop {
|
||||
height: 200%;
|
||||
width: 100%;
|
||||
background: black;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, ElementRef, OnInit, ViewChild, AfterViewChecked, AfterViewInit, OnDestroy, } from '@angular/core';
|
||||
import { ActionSheetController, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { Component, ElementRef, OnInit, ViewChild, AfterViewChecked, AfterViewInit, OnDestroy, ChangeDetectorRef, } from '@angular/core';
|
||||
import { ActionSheetController, IonSlides, MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ChatService } from 'src/app/services/chat.service';
|
||||
@@ -20,6 +20,7 @@ import { NewEventPage } from '../../agenda/new-event/new-event.page';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
@@ -27,6 +28,9 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
styleUrls: ['./group-messages.page.scss'],
|
||||
})
|
||||
export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
|
||||
|
||||
showLoader: boolean;
|
||||
isGroupCreated:boolean;
|
||||
loggedUser: any;
|
||||
@@ -75,7 +79,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private fileToBase64Service: FileToBase64Service,
|
||||
private fileService: FileService,
|
||||
private toastService: ToastService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private changeDetectorRef: ChangeDetectorRef
|
||||
) {
|
||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||
this.isGroupCreated = true;
|
||||
@@ -464,7 +469,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
//this.loadPicture();
|
||||
}
|
||||
else if(res['data'] == 'add-picture'){
|
||||
this.fileService.addPictureToChat(this.roomId);
|
||||
this.fileService.addPictureToChatMobile(this.roomId);
|
||||
//this.loadPicture();
|
||||
}
|
||||
else if(res['data'] == 'add-document'){
|
||||
@@ -580,4 +585,59 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
sliderOpts = {
|
||||
zoom: false,
|
||||
slidesPerView: 1.5,
|
||||
spaceBetween: 20,
|
||||
centeredSlides: true
|
||||
};
|
||||
zoomActive = false;
|
||||
zoomScale = 1;
|
||||
|
||||
sliderZoomOpts = {
|
||||
allowSlidePrev: false,
|
||||
allowSlideNext: false,
|
||||
zoom: {
|
||||
maxRatio: 5
|
||||
},
|
||||
on: {
|
||||
zoomChange: (scale, imageEl, slideEl) => {
|
||||
this.zoomActive = true;
|
||||
this.zoomScale = scale/5;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async touchEnd(zoomslides: IonSlides, card) {
|
||||
// Zoom back to normal
|
||||
const slider = await zoomslides.getSwiper();
|
||||
const zoom = slider.zoom;
|
||||
zoom.out();
|
||||
|
||||
// Card back to normal
|
||||
card.el.style['z-index'] = 9;
|
||||
|
||||
this.zoomActive = false;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
touchStart(card) {
|
||||
// Make card appear above backdrop
|
||||
card.el.style['z-index'] = 11;
|
||||
}
|
||||
|
||||
async openPreview(img) {
|
||||
const modal = await this.modalController.create({
|
||||
component: PreviewCameraPage,
|
||||
cssClass: 'transparent-modal',
|
||||
componentProps: {
|
||||
image: img.attachments[0].image_url,
|
||||
username: img.u.username,
|
||||
_updatedAt: img._updatedAt
|
||||
}
|
||||
});
|
||||
modal.present();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
</ion-refresher> -->
|
||||
<div (click)="handleClick()" class="messages" #scrollMe>
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last"
|
||||
[class.messages-list-item-wrapper-active]="msg._id == selectedMsgId">
|
||||
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}'>
|
||||
[class.messages-list-item-wrapper-active]="msg._id == selectedMsgId" >
|
||||
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' (click)="openPreview(msg)">
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
@@ -60,7 +60,7 @@
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
<div *ngIf="msg.attachments" class="message-attachments">
|
||||
<div *ngFor="let file of msg.attachments let i = index">
|
||||
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
||||
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image" (click)="imageSize(file.image_url)">
|
||||
<div>
|
||||
<div>
|
||||
<div class="file">
|
||||
@@ -138,6 +138,7 @@
|
||||
<button (click)="stopRecording()">Stop Recording</button> -->
|
||||
<div class="container width-100 d-flex">
|
||||
<div>
|
||||
|
||||
<button class="btn-no-color" (click)="openChatOptions()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-options" src="assets/images/icons-add.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-options" src="assets/images/theme/gov/icons-add.svg"></ion-icon>
|
||||
@@ -163,4 +164,5 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-footer>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AfterViewChecked, AfterViewInit, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router'
|
||||
import { GestureController, Gesture, ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||
import { GestureController, Gesture, ModalController, NavParams, PopoverController, IonSlides } from '@ionic/angular';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
@@ -23,6 +23,11 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
||||
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
||||
import { Haptics, ImpactStyle } from '@capacitor/haptics';
|
||||
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
|
||||
// import { SocialSharing } from '@ionic-native/social-sharing/ngx';
|
||||
//import { Share } from '@capacitor/share';
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
@Component({
|
||||
selector: 'app-messages',
|
||||
@@ -36,8 +41,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
/* @ViewChild('messageContainer') messageContainer: ElementRef; */
|
||||
@ViewChild('rectangle') private rectangle: ElementRef;
|
||||
|
||||
canvas: any
|
||||
ctx: any
|
||||
loggedUser: any;
|
||||
|
||||
message = '';
|
||||
messages:any;
|
||||
userPresence='';
|
||||
@@ -83,7 +89,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private fileService: FileService,
|
||||
private gestureController: GestureController,
|
||||
private processes: ProcessesService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private changeDetectorRef: ChangeDetectorRef,
|
||||
// private socialSharing: SocialSharing
|
||||
) {
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
@@ -101,6 +109,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
this.loadFiles();
|
||||
VoiceRecorder.requestAudioRecordingPermission();
|
||||
Filesystem.mkdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
recursive: true
|
||||
});
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
@@ -583,8 +596,95 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
openPreview(){
|
||||
|
||||
sliderOpts = {
|
||||
zoom: false,
|
||||
slidesPerView: 1.5,
|
||||
spaceBetween: 20,
|
||||
centeredSlides: true
|
||||
};
|
||||
zoomActive = false;
|
||||
zoomScale = 1;
|
||||
|
||||
sliderZoomOpts = {
|
||||
allowSlidePrev: false,
|
||||
allowSlideNext: false,
|
||||
zoom: {
|
||||
maxRatio: 5
|
||||
},
|
||||
on: {
|
||||
zoomChange: (scale, imageEl, slideEl) => {
|
||||
this.zoomActive = true;
|
||||
this.zoomScale = scale/5;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async touchEnd(zoomslides: IonSlides, card) {
|
||||
// Zoom back to normal
|
||||
const slider = await zoomslides.getSwiper();
|
||||
const zoom = slider.zoom;
|
||||
zoom.out();
|
||||
|
||||
// Card back to normal
|
||||
card.el.style['z-index'] = 9;
|
||||
|
||||
this.zoomActive = false;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
touchStart(card) {
|
||||
// Make card appear above backdrop
|
||||
card.el.style['z-index'] = 11;
|
||||
}
|
||||
|
||||
|
||||
async openPreview(msg) {
|
||||
const modal = await this.modalController.create({
|
||||
component: PreviewCameraPage,
|
||||
cssClass: 'transparent-modal',
|
||||
componentProps: {
|
||||
image: msg.attachments[0].image_url,
|
||||
username: msg.u.username,
|
||||
_updatedAt: msg._updatedAt,
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
modal.present();
|
||||
}
|
||||
|
||||
|
||||
imageSize(img){
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
canvas.width=300
|
||||
canvas.height=234
|
||||
ctx.drawImage(img.attachments[0].image_url, 0, 0, 300, 234);
|
||||
document.body.appendChild(canvas);
|
||||
}
|
||||
|
||||
getPicture(img){
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
canvas.width=300
|
||||
canvas.height=234
|
||||
ctx.drawImage(img.attachments[0].image_url, 0, 0, 300, 234);
|
||||
document.body.appendChild(canvas);
|
||||
|
||||
}
|
||||
|
||||
// async ShareEmail(msg){
|
||||
// // Check if sharing via email is supported
|
||||
// await Share.share({
|
||||
// title: msg.u.username,
|
||||
// text: msg._updatedAt,
|
||||
// url: msg.attachments[0].image_url,
|
||||
// dialogTitle: 'Share with buddies',
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<ion-header class="ion-no-border ">
|
||||
<ion-header class="ion-no-border">
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
<ion-header class="ion-no-border text-white">
|
||||
<ion-header class="ion-no-border init-event-header">
|
||||
<ion-label>
|
||||
<p class="time ion-text-center">{{customDate}}</p>
|
||||
</ion-label>
|
||||
|
||||
@@ -275,6 +275,7 @@ ion-toolbar{
|
||||
// new
|
||||
.main{
|
||||
padding: 0px em(20px);
|
||||
background: linear-gradient(270deg, var(--color2) 100%, var(--color3) 100%, var(--color4) 100%, var(--color5) 100%) !important;
|
||||
}
|
||||
|
||||
.event-number{
|
||||
@@ -402,8 +403,8 @@ ion-toolbar{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: transparent !important;
|
||||
--background: transparent !important;
|
||||
background-color: transparent;
|
||||
--background: transparent;
|
||||
.schedule-time{
|
||||
margin-right: 10px;
|
||||
.time-start{
|
||||
|
||||
@@ -318,6 +318,36 @@ export class EventsPage implements OnInit {
|
||||
if (list.length > 0) {
|
||||
list.forEach(element => {
|
||||
this.sqliteservice.addEvent(element)
|
||||
|
||||
this.sqliteservice.getAllEvents().then((event: any[]) => {
|
||||
let todayEvents = new Array()
|
||||
event.forEach((element) => {
|
||||
let eventObject = {
|
||||
AppointmentState: element.AppointmentState,
|
||||
Attachments: element.Attachments,
|
||||
Attendees: element.Attendees,
|
||||
CalendarId: element.CalendarId,
|
||||
CalendarName: element.CalendarName,
|
||||
Category: element.Category,
|
||||
EndDate: element.EndDate,
|
||||
EventId: element.EventId,
|
||||
EventRecurrence: element.EventRecurrence,
|
||||
EventType: element.EventType,
|
||||
HasAttachments: element.HasAttachments,
|
||||
HumanDate: element.HumanDate,
|
||||
IsAllDayEvent: element.IsAllDayEvent,
|
||||
IsMeeting: element.IsMeeting,
|
||||
IsRecurring: element.IsRecurring,
|
||||
Location: element.Location,
|
||||
Organizer: element.Organizer,
|
||||
Profile: element.Profile,
|
||||
StartDate: element.StartDate,
|
||||
Subject: element.Subject
|
||||
}
|
||||
todayEvents.push(eventObject);
|
||||
})
|
||||
console.log('JIFJSOSDJSDONS',todayEvents)
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<ion-header class="ion-no-border px-20">
|
||||
<ion-header class="ion-no-border">
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
|
||||
@@ -157,7 +157,7 @@ export class DespachoPrPage implements OnInit {
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
}
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
|
||||
}
|
||||
});
|
||||
@@ -272,9 +272,9 @@ export class DespachoPrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -297,10 +297,10 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage('Processo arquivado')
|
||||
this.toastService._successMessage('Processo arquivado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não arquivado')
|
||||
this.toastService._badRequest('Processo não arquivado')
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -320,10 +320,10 @@ export class DespachoPrPage implements OnInit {
|
||||
documents
|
||||
}).toPromise()
|
||||
|
||||
this.toastService.successMessage('Processo criado')
|
||||
this.toastService._successMessage('Processo criado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não criado')
|
||||
this.toastService._badRequest('Processo não criado')
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -346,10 +346,10 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage('')
|
||||
this.toastService._successMessage('')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -373,10 +373,10 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -391,11 +391,11 @@ export class DespachoPrPage implements OnInit {
|
||||
sendExpedienteToPending() {
|
||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
|
||||
this.popoverController.dismiss('close')
|
||||
this.toastService.successMessage('Processo enviado para pendentes')
|
||||
this.toastService._successMessage('Processo enviado para pendentes')
|
||||
this.goBack()
|
||||
}, () => {
|
||||
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -448,6 +448,7 @@ export class DespachoPrPage implements OnInit {
|
||||
else if (actionName == 'Reexecução') {
|
||||
await this.reexecutar(res.data.note, docs);
|
||||
}
|
||||
|
||||
this.goBack();
|
||||
}
|
||||
});
|
||||
@@ -535,7 +536,15 @@ export class DespachoPrPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then(res => {
|
||||
if(res){
|
||||
const data = res.data;
|
||||
if(data == 'close') {
|
||||
this.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async distartExpedientModal() {
|
||||
|
||||
@@ -157,8 +157,9 @@ export class DespachosPrPage implements OnInit {
|
||||
}
|
||||
|
||||
this.despachoList.push(task);
|
||||
console.log(this.despachoList);
|
||||
});
|
||||
|
||||
this.despachoList = this.sortService.sortDate(this.despachoList, 'CreateDate')
|
||||
this.listToPresent = this.despachoList
|
||||
|
||||
}, (error) => {
|
||||
|
||||
+5
-5
@@ -117,15 +117,15 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -179,11 +179,11 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.toastService.successMessage(false, ()=>{
|
||||
this.toastService._successMessage(false, ()=>{
|
||||
this.goBack();
|
||||
})
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
|
||||
@@ -80,13 +80,14 @@ export class DiplomasAssinarPage implements OnInit {
|
||||
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
this.diplomasList = [];
|
||||
|
||||
let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||
diplomasAssinar = this.sortService.sortArrayISODate(diplomasAssinar);
|
||||
let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||
diplomasAssinar.forEach(element => {
|
||||
let task: customTask = this.customTaskPipe.transform(element)
|
||||
this.diplomasList.push(task);
|
||||
});
|
||||
|
||||
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate')
|
||||
|
||||
|
||||
this.skeletonLoader = false
|
||||
this.showLoader = false;
|
||||
|
||||
@@ -163,7 +163,7 @@ export class DiplomaPage implements OnInit {
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
}
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
});
|
||||
|
||||
@@ -282,12 +282,12 @@ export class DiplomaPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.toastService.successMessage(false, () => {
|
||||
this.toastService._successMessage(false, () => {
|
||||
this.close();
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -308,9 +308,9 @@ export class DiplomaPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -334,9 +334,9 @@ export class DiplomaPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.toastService.successMessage('Processo concluído')
|
||||
this.toastService._successMessage('Processo concluído')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="validar">
|
||||
Por validar
|
||||
Por validar ...
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="assinados">
|
||||
Assinados PR
|
||||
Assinados PR ...
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
@@ -182,7 +182,6 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
this.skeletonLoader = false
|
||||
this.showLoader = false;
|
||||
|
||||
|
||||
let diplomasValidar = diplomas.filter(data => data.activityInstanceName == "Revisar Diploma");
|
||||
let diplomasList = [];
|
||||
diplomasValidar.forEach(async element => {
|
||||
@@ -191,18 +190,19 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
diplomasList.push(task);
|
||||
|
||||
});
|
||||
this.diplomasList = this.sortService.sortArrayISODate(diplomasList.reverse());
|
||||
|
||||
this.diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate');
|
||||
|
||||
let diplomasAssinados = diplomas.filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
let diplomasAssinadoList = [];
|
||||
|
||||
let diplomasAssinados = diplomas.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
let diplomasAssinadoList = []
|
||||
diplomasAssinados.forEach(async element => {
|
||||
|
||||
let task = this.pipeTask(element);
|
||||
diplomasAssinadoList.push(task);
|
||||
});
|
||||
console.log('diplomasAssinados', diplomasAssinados)
|
||||
this.diplomasAssinadoList = this.sortService.sortArrayISODate(diplomasAssinadoList).reverse();
|
||||
|
||||
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'CreateDate')
|
||||
|
||||
}, (error) => {
|
||||
this.getFromDb()
|
||||
@@ -220,21 +220,21 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
|
||||
let task = this.pipeTaskOffline(element)
|
||||
diplomasList.push(task);
|
||||
});
|
||||
|
||||
});
|
||||
console.log(diplomasList);
|
||||
console.log(diplomasList);
|
||||
this.diplomasList = this.sortService.sortDate(diplomasList, 'taskStartDate');
|
||||
|
||||
this.diplomasList = this.sortService.sortArrayISODate(diplomasList).reverse();
|
||||
|
||||
let diplomasAssinados = process.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
let diplomasAssinados = process.filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
let diplomasAssinadoList = []
|
||||
diplomasAssinados.forEach(async element => {
|
||||
|
||||
let task = this.pipeTaskOffline(element)
|
||||
diplomasAssinadoList.push(task);
|
||||
});
|
||||
console.log('diplomasAssinados', diplomasAssinados)
|
||||
this.diplomasAssinadoList = this.sortService.sortArrayISODate(diplomasAssinadoList).reverse();
|
||||
let task = this.pipeTaskOffline(element)
|
||||
diplomasAssinadoList.push(task);
|
||||
});
|
||||
|
||||
console.log('diplomasAssinados', diplomasAssinados)
|
||||
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'taskStartDate')
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
+4
-4
@@ -110,13 +110,13 @@ export class ApproveEventModalPage implements OnInit {
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
|
||||
this.toastService.successMessage('Evento aprovado', ()=>{
|
||||
this.toastService._successMessage('Evento aprovado', ()=>{
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.modalController.dismiss(null);
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Evento não aprovado')
|
||||
this.toastService._badRequest('Evento não aprovado')
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -141,11 +141,11 @@ export class ApproveEventModalPage implements OnInit {
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
|
||||
this.toastService.successMessage('Evento rejeitado', () =>{
|
||||
this.toastService._successMessage('Evento rejeitado', () =>{
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
})
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Evento não rejeitado')
|
||||
this.toastService._badRequest('Evento não rejeitado')
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
|
||||
@@ -17,6 +17,7 @@ import { SqliteService } from '../../../../services/sqlite.service';
|
||||
import { BackgroundService } from '../../../../services/background.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -62,6 +63,7 @@ export class ApproveEventPage implements OnInit {
|
||||
private platform: Platform,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private offlineManager: OfflineManagerService
|
||||
) {
|
||||
this.activatedRoute.paramMap.subscribe(params => {
|
||||
// console.log(params["params"]);
|
||||
@@ -203,11 +205,11 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.toastService.successMessage();
|
||||
this.toastService._successMessage();
|
||||
this.goBack();
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -255,11 +257,15 @@ export class ApproveEventPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
this.toastService.successMessage('Pedido enviado');
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
.catch(() => {
|
||||
console.log('Send event to approve for revition')
|
||||
this.offlineManager.storeRequestData('event-listRever', body);
|
||||
});
|
||||
this.toastService._successMessage('Pedido enviado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest();
|
||||
this.toastService._badRequest();
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -280,10 +286,10 @@ export class ApproveEventPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
await this.toastService.successMessage('Processo rejeitado');
|
||||
await this.toastService._successMessage('Processo rejeitado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -358,10 +364,10 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.toastService._successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest();
|
||||
this.toastService._badRequest();
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -84,14 +84,13 @@ export class EventListPage implements OnInit {
|
||||
this.platform.ready().then(() => {
|
||||
|
||||
this.sqliteservice.getListOfEventAprove('Agenda Oficial MDGPR', 'Agenda Pessoal MDGPR').then((event: any[]) => {
|
||||
this.eventsMDGPRList = this.sortService.sortArrayByDate(event).reverse()
|
||||
this.eventsMDGPRList = this.sortService.sortDate(event, 'taskStartDate')
|
||||
|
||||
console.log("All evento to aprove from db ", event)
|
||||
})
|
||||
|
||||
this.sqliteservice.getListOfEventAprove('Agenda Oficial PR', 'Agenda Pessoal PR').then((event: any[]) => {
|
||||
this.eventsPRList = this.sortService.sortArrayByDate(event).reverse()
|
||||
console.log("All evento to aprove from db ", event)
|
||||
this.eventsPRList = this.sortService.sortDate(event, 'taskStartDate')
|
||||
|
||||
})
|
||||
})
|
||||
console.log('Offlineee')
|
||||
@@ -111,14 +110,14 @@ export class EventListPage implements OnInit {
|
||||
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
|
||||
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
|
||||
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
|
||||
this.eventsMDGPRList = this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse()
|
||||
this.eventsMDGPRList = this.sortService.sortDate(this.eventsMDGPRList, 'taskStartDate')
|
||||
this.eventaprovacaostore.resetmd(this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse());
|
||||
}
|
||||
else if (this.segment == 'PR') {
|
||||
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
||||
this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList).reverse();
|
||||
this.eventsPRList = this.sortService.sortDate(this.eventsPRList, 'taskStartDate')
|
||||
this.eventaprovacaostore.resetpr(this.sortService.sortArrayByDate(this.eventsPRList).reverse());
|
||||
}
|
||||
this.showLoader = false;
|
||||
|
||||
+4
-4
@@ -275,10 +275,10 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
this.modalController.dismiss();
|
||||
// this.distartExpedientModal();
|
||||
this.toastService.successMessage('Reunião criada');
|
||||
this.toastService._successMessage('Reunião criada');
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Reunião não criada')
|
||||
this.toastService._badRequest('Reunião não criada')
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -300,10 +300,10 @@ export class BookMeetingModalPage implements OnInit {
|
||||
break;
|
||||
}
|
||||
this.close();
|
||||
this.toastService.successMessage('Reunião criada');
|
||||
this.toastService._successMessage('Reunião criada');
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
+11
-11
@@ -328,11 +328,11 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
try {
|
||||
|
||||
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
await this.toastService._successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_despacho);
|
||||
|
||||
} catch (error) {
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -362,11 +362,11 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
try {
|
||||
this.taskResult = await this.processes.postParecer(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Pedido enviado');
|
||||
await this.toastService._successMessage('Pedido enviado');
|
||||
this.modalController.dismiss(action_parecer);
|
||||
|
||||
} catch (error) {
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -394,10 +394,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
try {
|
||||
|
||||
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
|
||||
this.toastService.successMessage('Processo efetuado');
|
||||
this.toastService._successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_deferimento);
|
||||
} catch (error) {
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -436,18 +436,18 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
if(this.postData.DispatchFolder.Message){
|
||||
try {
|
||||
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
await this.toastService._successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
} catch (error) {
|
||||
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
} finally {
|
||||
//loader.remove()
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.validateField = true;
|
||||
this.toastService.badRequest('Por favor adicione uma descrição');
|
||||
this.toastService._badRequest('Por favor adicione uma descrição');
|
||||
}
|
||||
loader.remove();
|
||||
break;
|
||||
@@ -474,11 +474,11 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
try {
|
||||
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Pedido enviado');
|
||||
await this.toastService._successMessage('Pedido enviado');
|
||||
this.modalController.dismiss(action_parecer_pr);
|
||||
} catch (error) {
|
||||
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
await this.toastService._badRequest('Processo não efetuado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
+2
-3
@@ -111,7 +111,7 @@
|
||||
|
||||
<div *ngIf="task && p.userRole(['PR'])" class="aside-right flex-column height-100 overflow-y-auto">
|
||||
|
||||
<div class="buttons">
|
||||
<!-- <div class="buttons">
|
||||
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
||||
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
||||
<div class="solid"></div>
|
||||
@@ -121,8 +121,7 @@
|
||||
<button (click)="openNewGroupPage(task)" class="btn-cancel" shape="round" >Iniciar Conversa</button>
|
||||
<div hidden class="solid"></div>
|
||||
<button hidden class="btn-cancel" shape="round" >Delegar</button>
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
+17
-17
@@ -171,9 +171,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.close();
|
||||
this.toastService.successMessage('Processo aprovado')
|
||||
this.toastService._successMessage('Processo aprovado')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não aprovado')
|
||||
this.toastService._badRequest('Processo não aprovado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -196,9 +196,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -293,11 +293,11 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
sendExpedienteToPending() {
|
||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
|
||||
console.log(res);
|
||||
this.toastService.successMessage('Processo enviado para pendentes')
|
||||
this.toastService._successMessage('Processo enviado para pendentes')
|
||||
this.goBack();
|
||||
},
|
||||
(error) => {
|
||||
this.toastService.badRequest('Processo não enviado para pendentes')
|
||||
this.toastService._badRequest('Processo não enviado para pendentes')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -349,12 +349,12 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.getFromDB();
|
||||
} else {
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
}
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
});
|
||||
|
||||
@@ -441,9 +441,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
this.attachmentsService.AddAttachment(body).subscribe((res) => {
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
}, () => {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}, () => {
|
||||
loader.remove()
|
||||
});
|
||||
@@ -479,7 +479,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -510,10 +510,10 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.expedienteService.discard({ SerialNumber: this.task.SerialNumber }).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.toastService._successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -529,10 +529,10 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.expedienteService.CompleteTask(body).toPromise();
|
||||
//this.toastService.successMessage('Processo descartado');
|
||||
//this.toastService._successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -543,10 +543,10 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.toastService._successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from '../../../services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente',
|
||||
@@ -38,7 +38,8 @@ export class ExpedientePage implements OnInit {
|
||||
public platform: Platform,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
@@ -70,7 +71,7 @@ export class ExpedientePage implements OnInit {
|
||||
const result = res
|
||||
|
||||
this.taskslist = new Array();
|
||||
let ress = result.reverse().filter((data: any) => data.workflowInstanceDataFields.Status == "Active");
|
||||
let ress = result.filter((data: any) => data.workflowInstanceDataFields.Status == "Active");
|
||||
|
||||
ress.forEach((element: any) => {
|
||||
|
||||
@@ -78,7 +79,7 @@ export class ExpedientePage implements OnInit {
|
||||
this.taskslist.push(task);
|
||||
this.addProcessTODb(task);
|
||||
});
|
||||
this.listToPresent = this.taskslist
|
||||
this.listToPresent = this.sortService.sortDate(this.taskslist, 'taskStartDate')
|
||||
console.log('expediente list', this.listToPresent)
|
||||
|
||||
this.skeletonLoader = false;
|
||||
|
||||
@@ -135,11 +135,11 @@ export class ExpedientePrPage implements OnInit {
|
||||
sendExpedienteToPending() {
|
||||
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.toastService.successMessage('Processo enviado para pendentes')
|
||||
this.toastService._successMessage('Processo enviado para pendentes')
|
||||
this.goBack();
|
||||
},
|
||||
(error)=>{
|
||||
this.toastService.badRequest('Processo não enviado para pendentes')
|
||||
this.toastService._badRequest('Processo não enviado para pendentes')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -184,15 +184,15 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
}, (error)=>{
|
||||
try {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
} finally {
|
||||
if(error.status == 0) {
|
||||
this.toastService.badRequest('Não é possível visualizar este processo no modo offline')
|
||||
this.toastService._badRequest('Não é possível visualizar este processo no modo offline')
|
||||
} else {
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -303,9 +303,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.close();
|
||||
this.toastService.successMessage('Processo aprovado')
|
||||
this.toastService._successMessage('Processo aprovado')
|
||||
} catch(error) {
|
||||
this.toastService.badRequest('Processo não aprovado')
|
||||
this.toastService._badRequest('Processo não aprovado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -328,9 +328,9 @@ export class ExpedientePrPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
} catch(error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -448,10 +448,10 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(otherbody).toPromise()
|
||||
this.toastService.successMessage('Processo descartado');
|
||||
this.toastService._successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não descartado')
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -468,10 +468,10 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
// this.toastService.successMessage('Processo descartado');
|
||||
// this.toastService._successMessage('Processo descartado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
// this.toastService.badRequest('Processo não descartado')
|
||||
// this.toastService._badRequest('Processo não descartado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -485,10 +485,10 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.toastService._successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Location } from '@angular/common'
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expedientes-pr',
|
||||
@@ -41,7 +41,8 @@ export class ExpedientesPrPage implements OnInit {
|
||||
private authService: AuthService,
|
||||
private router: Router,
|
||||
private location: Location,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
}
|
||||
@@ -80,6 +81,8 @@ export class ExpedientesPrPage implements OnInit {
|
||||
this.taskslist.push(task);
|
||||
});
|
||||
console.log(this.taskslist);
|
||||
|
||||
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
|
||||
this.expedienteGdStore.reset(this.taskslist);
|
||||
this.skeletonLoader = false
|
||||
})
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
|
||||
|
||||
<!-- <div *ngIf="p.userRole(['MDGPR'])" (click)="openExpedientesPrPage(); selectedElement='ExpedientesPr'" [class.active]="selectedElement == 'ExpedientesPr'" class="exp-card-long justify-center width-100 white-background">
|
||||
<div class="center-div">
|
||||
<div class="center-div">F
|
||||
<div class="exp-card-icon">
|
||||
<ion-icon src="assets/images/icons-expediente-presidente.svg"></ion-icon>
|
||||
</div>
|
||||
|
||||
@@ -29,6 +29,7 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SqliteService } from '../../services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-gabinete-digital',
|
||||
@@ -130,7 +131,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
private platform: Platform,
|
||||
private changeProfileService: ChangeProfileService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
) {
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
@@ -146,10 +148,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
};
|
||||
this.checkRoutes();
|
||||
|
||||
|
||||
// this.eventoaprovacaostore.resetmd([])
|
||||
// this.eventoaprovacaostore.resetpr([])
|
||||
|
||||
}
|
||||
|
||||
ngDoCheck(): void {
|
||||
@@ -209,63 +207,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
}
|
||||
|
||||
async loadAllProcesses() {
|
||||
|
||||
this.processesbackend.GetTasksList("", false).subscribe(async res => {
|
||||
|
||||
let allProcessesList = await this.processesbackend.GetTasksList("", false).toPromise();
|
||||
|
||||
|
||||
if (!this.p.userRole(['PR'])) {
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Assinar Diplomas')
|
||||
} else if (this.p.userRole(['PR'])) {
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Diploma Assinado')
|
||||
}
|
||||
|
||||
console.log('allProcessesList', allProcessesList);
|
||||
|
||||
this.addProcessToDB(allProcessesList)
|
||||
this.skeletonLoader = true;
|
||||
|
||||
this.allProcessesList = [];
|
||||
|
||||
allProcessesList.forEach(element => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
//"CreateDate": taskDate,
|
||||
"CreateDate": new Date(element.taskStartDate),
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": element.workflowInstanceDataFields.DispatchDocId,
|
||||
"FolderID": element.workflowInstanceDataFields.FolderID,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"Status": element.workflowInstanceDataFields.Status,
|
||||
"Agenda": element.workflowInstanceDataFields.Agenda,
|
||||
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
|
||||
}
|
||||
|
||||
this.allProcessesList.push(task);
|
||||
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
||||
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
}, (error) => {
|
||||
console.log('gabinete digital offline', error)
|
||||
this.getAllProcessFromDB();
|
||||
})
|
||||
|
||||
this.skeletonLoader = false;
|
||||
|
||||
this.LoadCounts();
|
||||
}
|
||||
|
||||
addProcessToDB(data) {
|
||||
@@ -329,7 +271,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
this.allProcessesList.push(task);
|
||||
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
||||
this.allProcessesList = this.sortArrayISODate(this.allProcessesList).reverse();
|
||||
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||
|
||||
});
|
||||
console.log("All process from db ", allprocess)
|
||||
@@ -344,21 +286,18 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
setFormatDate(start: any, end: any, allday: boolean) {
|
||||
let customDate;
|
||||
/* start = new Date();
|
||||
end= new Date("2021-08-04T18:01:04.753Z"); */
|
||||
//end = new Date("2021-09-04T18:01:04.753Z");
|
||||
|
||||
const totalSeconds = Math.floor((end - (start)) / 1000);;
|
||||
const totalMinutes = Math.floor(totalSeconds / 60);
|
||||
const totalHours = Math.floor(totalMinutes / 60);
|
||||
const totalDays = Math.floor(totalHours / 24);
|
||||
|
||||
const hours = totalHours - (totalDays * 24);
|
||||
const minutes = totalMinutes - (totalDays * 24 * 60) - (hours * 60);
|
||||
const seconds = totalSeconds - (totalDays * 24 * 60 * 60) - (hours * 60 * 60) - (minutes * 60);
|
||||
//const hours = totalHours - (totalDays * 24);
|
||||
//const minutes = totalMinutes - (totalDays * 24 * 60) - (hours * 60);
|
||||
// const seconds = totalSeconds - (totalDays * 24 * 60 * 60) - (hours * 60 * 60) - (minutes * 60);
|
||||
|
||||
let diffDays = totalDays;
|
||||
let diffMinutes = minutes;
|
||||
// let diffDays = totalDays;
|
||||
// let diffMinutes = minutes;
|
||||
|
||||
if (totalDays == 0) {
|
||||
if (allday) {
|
||||
@@ -384,6 +323,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
(thedate.getMonth() + 1) + "/" +
|
||||
thedate.getFullYear();
|
||||
}
|
||||
|
||||
getCustomHours(thedate: Date) {
|
||||
return thedate.getHours() + ":" +
|
||||
thedate.getMinutes();
|
||||
@@ -550,8 +490,49 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.showLoader = true;
|
||||
|
||||
let allPreocesses_ = await this.processesbackend.GetTasksList("", false).toPromise();
|
||||
let count_all_processes = Object.keys(allPreocesses_).length;
|
||||
let allProcessesList = allPreocesses_;
|
||||
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Conhecimento')
|
||||
|
||||
if (!this.p.userRole(['PR'])) {
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Assinar Diplomas')
|
||||
} else if (this.p.userRole(['PR'])) {
|
||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Diploma Assinado')
|
||||
}
|
||||
|
||||
this.addProcessToDB(allProcessesList)
|
||||
this.skeletonLoader = true;
|
||||
|
||||
this.allProcessesList = [];
|
||||
|
||||
allProcessesList.forEach(element => {
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
|
||||
let task = {
|
||||
"SerialNumber": element.serialNumber,
|
||||
"Folio": element.workflowInstanceDataFields.Subject,
|
||||
"Senders": element.workflowInstanceDataFields.Sender,
|
||||
//"CreateDate": taskDate,
|
||||
"CreateDate": new Date(element.taskStartDate),
|
||||
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||
"DocumentsQty": element.totalDocuments,
|
||||
"DocId": element.workflowInstanceDataFields.DispatchDocId,
|
||||
"FolderID": element.workflowInstanceDataFields.FolderID,
|
||||
"WorkflowName": element.workflowDisplayName,
|
||||
"activityInstanceName": element.activityInstanceName,
|
||||
"Status": element.workflowInstanceDataFields.Status,
|
||||
"Agenda": element.workflowInstanceDataFields.Agenda,
|
||||
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
|
||||
}
|
||||
|
||||
this.allProcessesList.push(task);
|
||||
this.allProcessesList = removeDuplicate(this.allProcessesList);
|
||||
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||
|
||||
});
|
||||
|
||||
let expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise();
|
||||
expedientes = expedientes.filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
@@ -581,6 +562,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
let despachospr = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
let despachosPr;
|
||||
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
despachosPr = despachospr.filter(data => data.activityInstanceName == "Tarefa de Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active");
|
||||
@@ -594,23 +576,18 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
|
||||
let mdEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
|
||||
const eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
|
||||
this.eventoaprovacaostore.countMd = eventsMDGPRList.length
|
||||
this.eventoaprovacaostore.resetmd(eventsMDGPRList);
|
||||
|
||||
|
||||
|
||||
let prEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||
let prEventsPessoal = await this.processesbackend.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||
const eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
||||
this.eventoaprovacaostore.countPr = eventsPRList.length
|
||||
this.eventoaprovacaostore.resetpr(eventsPRList);
|
||||
|
||||
|
||||
|
||||
let diplomasValidar = despachospr.filter(data => data.activityInstanceName == "Revisar Diploma");
|
||||
this.count_dip_pv = Object.keys(diplomasValidar).length;
|
||||
this.deplomasStore.resetDiplomasReview(diplomasValidar)
|
||||
@@ -618,8 +595,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
let diplomasAssinar = despachospr.filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||
this.count_dip_as = Object.keys(diplomasAssinar).length;
|
||||
this.deplomasStore.resetDiplomasList(diplomasAssinar)
|
||||
|
||||
this.deplomasStore.resetDiplomasList(diplomasAssinar)
|
||||
|
||||
let diplomasAssinados = despachospr.filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
this.count_dip_as_pr = Object.keys(diplomasAssinados).length;
|
||||
@@ -639,22 +616,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
|
||||
doRefresh(event) {
|
||||
console.log(event);
|
||||
|
||||
// this.closeAllDesktopComponents();
|
||||
/* switch(this.loggeduser.Profile){
|
||||
case 'MDGPR':
|
||||
this.selectedElement='Correspondence';
|
||||
this.showExpedients = true;
|
||||
this.expedientesPage.doRefresh();
|
||||
break;
|
||||
case 'PR':
|
||||
this.selectedElement='ExpedientesPr';
|
||||
this.showExpedientesPr = true;
|
||||
break;
|
||||
} */
|
||||
this.LoadCounts();
|
||||
this.loadAllProcesses();
|
||||
//this.refreshExpedientes();
|
||||
|
||||
this.LoadCounts();
|
||||
|
||||
if (event) {
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -185,7 +185,7 @@ export class PedidoPage implements OnInit {
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
}
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
|
||||
});
|
||||
@@ -373,10 +373,10 @@ export class PedidoPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -393,10 +393,10 @@ export class PedidoPage implements OnInit {
|
||||
note
|
||||
}).toPromise()
|
||||
|
||||
this.toastService.successMessage('Processo arquivado')
|
||||
this.toastService._successMessage('Processo arquivado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -418,10 +418,10 @@ export class PedidoPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.toastService.successMessage('Processo arquivado')
|
||||
this.toastService._successMessage('Processo arquivado')
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -433,7 +433,7 @@ export class PedidoPage implements OnInit {
|
||||
this.goBack();
|
||||
}, () => {
|
||||
|
||||
this.toastService.badRequest('Processo não encontrado')
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -567,7 +567,15 @@ export class PedidoPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then(res => {
|
||||
if(res){
|
||||
const data = res.data;
|
||||
if(data == 'close') {
|
||||
this.goBack();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
async openForwardModal(task: any) {
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<div [ngSwitch]="segment">
|
||||
<div *ngSwitchCase="'parecer'" class="centered-div d-flex height-100 align-center justify-content-center" >
|
||||
<div
|
||||
*ngIf="!skeletonLoader && pedidosstorage.listparecer.length == 0"
|
||||
*ngIf="pedidosstorage.listparecer.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
<div *ngSwitchCase="'deferimento'" class="centered-div d-flex height-100 align-center justify-content-center">
|
||||
<div
|
||||
*ngIf="!skeletonLoader && pedidosstorage.listdeferimento.length == 0"
|
||||
*ngIf="pedidosstorage.listdeferimento.length == 0"
|
||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||
>
|
||||
<span>Lista vazia</span>
|
||||
|
||||
@@ -163,7 +163,9 @@ export class PedidosPage implements OnInit {
|
||||
this.parecerList.push(task);
|
||||
});
|
||||
this.addPedidoToDb(this.parecerList);
|
||||
this.listToPresentparecerList = this.sortService.sortArrayISODate(this.parecerList);
|
||||
|
||||
this.listToPresentparecerList = this.sortService.sortDate(this.parecerList, 'CreateDate')
|
||||
this.pedidosstorage.resetparecer(this.listToPresentparecerList);
|
||||
|
||||
}
|
||||
else if (this.segment == 'deferimento') {
|
||||
@@ -203,7 +205,9 @@ export class PedidosPage implements OnInit {
|
||||
});
|
||||
});
|
||||
this.addPedidoToDb(this.deferimentoList);
|
||||
this.listToPresentdeferimentoList = this.sortService.sortArrayISODate(this.deferimentoList);
|
||||
this.listToPresentdeferimentoList = this.sortService.sortDate(this.deferimentoList, 'CreateDate')
|
||||
this.pedidosstorage.resetdeferimento(this.listToPresentdeferimentoList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ export class PendentesPage implements OnInit {
|
||||
});
|
||||
|
||||
pendentesList = removeDuplicate(pendentesList)
|
||||
pendentesList = this.sortService.sortArrayISODate(pendentesList);
|
||||
pendentesList = this.sortService.sortDate(pendentesList, 'CreateDate');
|
||||
this.listToPresent = pendentesList;
|
||||
this.skeletonLoader = false;
|
||||
|
||||
@@ -138,7 +138,7 @@ export class PendentesPage implements OnInit {
|
||||
}
|
||||
});
|
||||
|
||||
pendingList = pendingList;
|
||||
pendingList = this.sortService.sortDate(pendingList, 'CreateDate');
|
||||
this.listToPresent = pendingList;
|
||||
console.log('pendentes', pendingList)
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<div class="div-top-header">
|
||||
|
||||
<div class="div-logo">
|
||||
<img src='assets/images/logo-bg-removebg-preview.png' alt='logo'>
|
||||
<img style="max-width: 90px;" *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-bg-removebg-preview.png' alt='logo'>
|
||||
<img style="max-width: 80px;" *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
|
||||
<img style="max-width: 90px;" *ngIf="ThemeService.currentTheme == 'tribunal'" src='assets/images/theme/tribunal/tribunal-constitucional-logo-removebg-preview.png' alt='logo'>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -42,11 +44,11 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="SessionStore.hasPin" class="voltar d-flex align-center justify-center pt-25 clear" (click)="enterWithPasswordButton()" >
|
||||
<div *ngIf="SessionStore.hasPin" class="voltar cursor-pointer d-flex align-center justify-center pt-25 clear" (click)="enterWithPasswordButton()" >
|
||||
Entrar com senha
|
||||
</div>
|
||||
|
||||
<div id="clear" class="cy-clear voltar d-flex align-center justify-center pt-25 clear" (click)="clearCode()">
|
||||
<div id="clear" class="cy-clear voltar cursor-pointer d-flex align-center justify-center pt-25 clear" (click)="clearCode()">
|
||||
Limpar
|
||||
</div>
|
||||
|
||||
|
||||
@@ -9,12 +9,11 @@ ion-content{
|
||||
}
|
||||
|
||||
.main-wrapper{
|
||||
background: var(--login-background);
|
||||
background: var(--PinBackground);
|
||||
display: flex;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
overflow: auto;
|
||||
background: white !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -142,7 +141,7 @@ ion-item{
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 19pt;
|
||||
background: #44b5ea;
|
||||
background: var(--PinDots);;
|
||||
border-radius: 56px;
|
||||
margin-bottom: 15px;
|
||||
user-select: none;
|
||||
@@ -163,7 +162,7 @@ ion-item{
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-image: url(/assets/background/auth.svg);
|
||||
background-image: var(--PinCircleBackground);
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
width: 100%;
|
||||
@@ -172,19 +171,20 @@ ion-item{
|
||||
}
|
||||
|
||||
.clear{
|
||||
color: #44b5ea;
|
||||
color: var(--PinTextColor);
|
||||
font-size: 12pt;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.dot-active{
|
||||
background: #44b5ea;
|
||||
background: var(--PinDots);
|
||||
}
|
||||
|
||||
.dot{
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin: 0 10px 0 0;
|
||||
border: 3px solid #44b5ea;
|
||||
border: 3px solid var(--PinDots);
|
||||
box-sizing: border-box;
|
||||
border-radius: 50px;
|
||||
-webkit-border-radius: 50px;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { environment } from 'src/environments/environment';
|
||||
import { AlertController } from '@ionic/angular';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-inactivity',
|
||||
@@ -29,7 +29,8 @@ export class InactivityPage implements OnInit {
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private toastService: ToastService,
|
||||
public alertController: AlertController
|
||||
public alertController: AlertController,
|
||||
public ThemeService: ThemeService,
|
||||
) {}
|
||||
|
||||
loop = false
|
||||
@@ -132,11 +133,11 @@ export class InactivityPage implements OnInit {
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('Por favor, insira a sua palavra-passe');
|
||||
this.toastService._badRequest('Por favor, insira a sua palavra-passe');
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('Por favor, insira o seu nome de utilizador');
|
||||
this.toastService._badRequest('Por favor, insira o seu nome de utilizador');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +183,7 @@ export class InactivityPage implements OnInit {
|
||||
}, 1000)
|
||||
|
||||
} else {
|
||||
this.toastService.badRequest('Pin incorreto')
|
||||
this.toastService._badRequest('Pin incorreto')
|
||||
this.code = []
|
||||
}
|
||||
|
||||
@@ -191,9 +192,9 @@ export class InactivityPage implements OnInit {
|
||||
goback() {
|
||||
const pathName = this.SessionStore.user.UrlBeforeInactivity
|
||||
if(pathName) {
|
||||
this.router.navigate([pathName]);
|
||||
this.router.navigate([pathName],{replaceUrl: true});
|
||||
} else {
|
||||
this.router.navigate(['/home/events']);
|
||||
this.router.navigate(['/home/events'], {replaceUrl: true});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ClearStoreService } from 'src/app/services/clear-store.service';
|
||||
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { StorageService } from 'src/app/services/storage.service'
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@@ -39,7 +39,7 @@ export class LoginPage implements OnInit {
|
||||
private clearStoreService: ClearStoreService,
|
||||
private changeProfileService: ChangeProfileService,
|
||||
public ThemeService: ThemeService,
|
||||
private storageservice: StorageService
|
||||
private storageservice: StorageService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -123,15 +123,14 @@ export class LoginPage implements OnInit {
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('Por favor, insira a sua palavra-passe');
|
||||
this.toastService._badRequest('Por favor, insira a sua palavra-passe');
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.toastService.badRequest('Por favor, insira o seu nome de utilizador');
|
||||
this.toastService._badRequest('Por favor, insira o seu nome de utilizador');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
goback() {
|
||||
const pathName = SessionStore.user.UrlBeforeInactivity
|
||||
if(pathName) {
|
||||
|
||||
@@ -104,9 +104,9 @@ export class EditActionPage implements OnInit {
|
||||
await this.publicationsService.UpdatePresidentialAction(body).toPromise()
|
||||
this.close();
|
||||
this.updateDesktopComponent.emit();
|
||||
this.toastService.successMessage('Acção presidencial atualizada')
|
||||
this.toastService._successMessage('Acção presidencial atualizada')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Não foi possivel atualizar a acção presidencial')
|
||||
this.toastService._badRequest('Não foi possivel atualizar a acção presidencial')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
<ion-content>
|
||||
<div class="content-container d-flex flex-column">
|
||||
<div class="title-content width-100">
|
||||
@@ -23,12 +22,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="capturedImage != '' " class="ion-item-container-no-border">
|
||||
<ion-label class="attached-title">Fotografia Anexada </ion-label>
|
||||
|
||||
<ion-item lines="none">
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="capturedImage"></ion-img>
|
||||
|
||||
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="capturedImage" (click)="imageSize(capturedImage)" ></ion-img>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<img src="" #imageElement/>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-thumbnail>
|
||||
<ion-label>
|
||||
<p>{{capturedImageTitle}}</p>
|
||||
@@ -68,8 +74,8 @@
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="ion-item-container-no-border">
|
||||
<ion-label (click)="laodPicture()" class="cursor-pointer">
|
||||
<!-- <div class="ion-item-container-no-border">
|
||||
<ion-label (click)="selectImage()" class="cursor-pointer">
|
||||
<div class="attach-icon">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-add-photos.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-add-photos.svg"></ion-icon>
|
||||
@@ -77,15 +83,14 @@
|
||||
<div class="attach-document cursor-pointer">
|
||||
<ion-label>Anexar Fotografia</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
</ion-label>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
|
||||
<ion-footer class="ion-no-border">
|
||||
<ion-toolbar class="footer-toolbar">
|
||||
<ion-buttons slot="start">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { ModalController, NavParams, Platform, LoadingController } from '@ionic/angular';
|
||||
|
||||
/* import {Plugins, CameraResultType, CameraSource} from '@capacitor/core'; */
|
||||
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
|
||||
@@ -16,14 +16,25 @@ import { formatDate } from 'src/plugin/momentG.js'
|
||||
import { FileLoaderService } from 'src/app/services/file/file-loader.service';
|
||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera';
|
||||
import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
|
||||
|
||||
import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { NgxImageCompressService } from "ngx-image-compress";
|
||||
import { SocialSharing } from '@ionic-native/social-sharing/ngx';
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
interface LocalFile {
|
||||
name: string;
|
||||
path: string;
|
||||
data: string;
|
||||
}
|
||||
@Component({
|
||||
selector: 'app-new-publication',
|
||||
templateUrl: './new-publication.page.html',
|
||||
styleUrls: ['./new-publication.page.scss'],
|
||||
})
|
||||
export class NewPublicationPage implements OnInit {
|
||||
images: LocalFile[] = [];
|
||||
|
||||
// date picker
|
||||
public date: any;
|
||||
@@ -32,7 +43,7 @@ export class NewPublicationPage implements OnInit {
|
||||
public showSeconds = false;
|
||||
public touchUi = false;
|
||||
public enableMeridian = false;
|
||||
public minDate = new Date().toISOString().slice(0,10)
|
||||
public minDate = new Date().toISOString().slice(0, 10)
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
@@ -48,20 +59,23 @@ export class NewPublicationPage implements OnInit {
|
||||
folderId: string;
|
||||
image: Image = new Image();
|
||||
|
||||
publicationType:string;
|
||||
publicationTitle:string;
|
||||
imgUrl:any;
|
||||
publicationType: string;
|
||||
publicationTitle: string;
|
||||
imgUrl: any;
|
||||
|
||||
Defaultimage:any = '';
|
||||
Defaultimage: any = '';
|
||||
|
||||
photo: SafeResourceUrl;
|
||||
|
||||
guestPicture:any;
|
||||
guestPicture: any;
|
||||
|
||||
capturedImage:any = '';
|
||||
capturedImageTitle:any;
|
||||
capturedImage: any = '';
|
||||
capturedImageTitle: any;
|
||||
public photos: any[] = [];
|
||||
|
||||
imgResultBeforeCompress: string;
|
||||
imgResultAfterCompress: string;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
public photoService: PhotoService,
|
||||
@@ -70,49 +84,64 @@ export class NewPublicationPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private fileLoaderService: FileLoaderService,
|
||||
private fileToBase64Service: FileToBase64Service,
|
||||
public ThemeService: ThemeService
|
||||
) {
|
||||
public ThemeService: ThemeService,
|
||||
private platform: Platform,
|
||||
private loadingCtrl: LoadingController,
|
||||
public imageCompress: NgxImageCompressService,
|
||||
private socialSharing: SocialSharing
|
||||
) {
|
||||
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
this.folderId = this.navParams.get('folderId');
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
}
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
this.folderId = this.navParams.get('folderId');
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.setTitle();
|
||||
console.log(this.folderId);
|
||||
Filesystem.mkdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
recursive: true
|
||||
});
|
||||
|
||||
// this.takePicture();
|
||||
}
|
||||
|
||||
async takePicture() {
|
||||
const capturedImage = await Camera.getPhoto({
|
||||
quality: 90,
|
||||
// allowEditing: true,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera
|
||||
async takePicture() {
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 20,
|
||||
allowEditing: false,
|
||||
width:50,
|
||||
height: 50,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera // Camera, Photos or Prompt!
|
||||
|
||||
});
|
||||
const response = await fetch(capturedImage.webPath!);
|
||||
const blob = await response.blob();
|
||||
|
||||
this.photos.unshift({
|
||||
filepath: "soon...",
|
||||
webviewPath: capturedImage.webPath
|
||||
});
|
||||
|
||||
this.capturedImage = await this.convertBlobToBase64(blob);
|
||||
this.capturedImageTitle = new Date().getTime() + '.jpeg';
|
||||
if (image) {
|
||||
this.saveImage(image)
|
||||
}
|
||||
|
||||
//console.log(this.capturedImage);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
imageSize(image) {
|
||||
var canvas = document.createElement('canvas');
|
||||
var ctx = canvas.getContext('2d');
|
||||
canvas.width = 100
|
||||
canvas.height = 34
|
||||
ctx.drawImage(image, 0, 0, 100, 34);
|
||||
document.body.appendChild(canvas);
|
||||
}
|
||||
|
||||
convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
|
||||
const reader = new FileReader;
|
||||
reader.onerror = reject;
|
||||
reader.onload = () => {
|
||||
resolve(reader.result);
|
||||
resolve(reader.result);
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
});
|
||||
@@ -121,7 +150,7 @@ async takePicture() {
|
||||
async laodPicture() {
|
||||
const capturedImage = await Camera.getPhoto({
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Photos,
|
||||
source: CameraSource.Camera,
|
||||
quality: 90,
|
||||
width: 1080,
|
||||
height: 720,
|
||||
@@ -159,7 +188,7 @@ async takePicture() {
|
||||
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true
|
||||
this.validateFrom = true
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
@@ -185,18 +214,18 @@ async takePicture() {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) return false
|
||||
if (this.Form.invalid) return false
|
||||
|
||||
|
||||
|
||||
if(this.publicationType == '3') {
|
||||
if (this.publicationType == '3') {
|
||||
console.log(this.navParams.get('publication'));
|
||||
|
||||
if(this.capturedImage != ''){
|
||||
if (this.capturedImage != '') {
|
||||
this.publication = {
|
||||
DateIndex: this.publication.DateIndex,
|
||||
DocumentId:this.publication.DocumentId,
|
||||
ProcessId:this.publication.ProcessId,
|
||||
DocumentId: this.publication.DocumentId,
|
||||
ProcessId: this.publication.ProcessId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: this.publication.DatePublication,
|
||||
@@ -225,8 +254,8 @@ async takePicture() {
|
||||
|
||||
this.publication = {
|
||||
DateIndex: this.publication.DateIndex,
|
||||
DocumentId:this.publication.DocumentId,
|
||||
ProcessId:this.publication.ProcessId,
|
||||
DocumentId: this.publication.DocumentId,
|
||||
ProcessId: this.publication.ProcessId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: this.publication.DatePublication,
|
||||
@@ -247,15 +276,15 @@ async takePicture() {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
this.publication = {
|
||||
DateIndex: this.publication.DateIndex,
|
||||
DocumentId:this.publication.DocumentId,
|
||||
ProcessId:this.publication.ProcessId,
|
||||
DocumentId: this.publication.DocumentId,
|
||||
ProcessId: this.publication.ProcessId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: this.publication.DatePublication,
|
||||
@@ -275,7 +304,7 @@ async takePicture() {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -283,15 +312,15 @@ async takePicture() {
|
||||
}
|
||||
else {
|
||||
|
||||
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
|
||||
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
|
||||
console.log(date);
|
||||
console.log(this.folderId);
|
||||
|
||||
|
||||
this.publication = {
|
||||
DateIndex: date,
|
||||
DocumentId:null,
|
||||
ProcessId:this.folderId,
|
||||
DocumentId: null,
|
||||
ProcessId: this.folderId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: date,
|
||||
@@ -312,7 +341,7 @@ async takePicture() {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
} finally {
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
@@ -321,8 +350,8 @@ async takePicture() {
|
||||
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss().then(()=>{
|
||||
this.showLoader=true;
|
||||
this.modalController.dismiss().then(() => {
|
||||
this.showLoader = true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -331,13 +360,13 @@ async takePicture() {
|
||||
}
|
||||
|
||||
setTitle() {
|
||||
if(this.publicationType == '1') {
|
||||
if (this.publicationType == '1') {
|
||||
this.publicationTitle = 'Nova Publicação Rápida';
|
||||
}
|
||||
else if(this.publicationType == '2') {
|
||||
else if (this.publicationType == '2') {
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
}
|
||||
else if(this.publicationType == '3') {
|
||||
else if (this.publicationType == '3') {
|
||||
this.publicationTitle = 'Editar Publicação';
|
||||
this.pub = this.navParams.get('publication');
|
||||
|
||||
@@ -357,16 +386,156 @@ async takePicture() {
|
||||
modal.onDidDismiss();
|
||||
} */
|
||||
|
||||
/* async takePicture(){
|
||||
const image = await Plugins.Camera.getPhoto({
|
||||
quality: 100,
|
||||
allowEditing: false,
|
||||
resultType: CameraResultType.DataUrl,
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
console.log(image);
|
||||
/* async takePicture(){
|
||||
const image = await Plugins.Camera.getPhoto({
|
||||
quality: 100,
|
||||
allowEditing: false,
|
||||
resultType: CameraResultType.DataUrl,
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
console.log(image);
|
||||
|
||||
this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl));
|
||||
} */
|
||||
|
||||
async selectImage() {
|
||||
const image = await Camera.getPhoto({
|
||||
quality: 20,
|
||||
allowEditing: false,
|
||||
resultType: CameraResultType.Uri,
|
||||
source: CameraSource.Camera // Camera, Photos or Prompt!
|
||||
});
|
||||
if (image) {
|
||||
this.saveImage(image)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Create a new file from a capture image
|
||||
async saveImage(photo: Photo) {
|
||||
const base64Data = await this.readAsBase64(photo);
|
||||
|
||||
const fileName = new Date().getTime() + '.jpeg';
|
||||
const savedFile = await Filesystem.writeFile({
|
||||
path: `${IMAGE_DIR}/${fileName}`,
|
||||
data: base64Data,
|
||||
directory: Directory.Data
|
||||
});
|
||||
|
||||
//this.loadFiles(fileName);
|
||||
this.loadFileData(fileName);
|
||||
}
|
||||
|
||||
private async readAsBase64(photo: Photo) {
|
||||
if (this.platform.is('hybrid')) {
|
||||
const file = await Filesystem.readFile({
|
||||
path: photo.path
|
||||
});
|
||||
|
||||
return file.data;
|
||||
}
|
||||
else {
|
||||
// Fetch the photo, read as a blob, then convert to base64 format
|
||||
const response = await fetch(photo.webPath);
|
||||
const blob = await response.blob();
|
||||
|
||||
return await this.convertBlobToBase64(blob) as string;
|
||||
}
|
||||
}
|
||||
|
||||
async loadFiles(fileName) {
|
||||
this.images = [];
|
||||
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Loading data...',
|
||||
});
|
||||
await loading.present();
|
||||
|
||||
/* Filesystem.readdir({
|
||||
path: `${IMAGE_DIR}/${fileName}`,
|
||||
directory: Directory.Data,
|
||||
}).then(result => {
|
||||
console.log('ALL RESULTS', result.files)
|
||||
let lastphoto = result.files[result.files.length - 1]
|
||||
this.loadFileData(lastphoto);
|
||||
},
|
||||
async (err) => {
|
||||
console.log('ERROR FILE DOSENT EXIST', err)
|
||||
// Folder does not yet exists!
|
||||
await Filesystem.mkdir({
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
recursive: true
|
||||
});
|
||||
}
|
||||
).then(_ => {
|
||||
loading.dismiss();
|
||||
}); */
|
||||
}
|
||||
|
||||
async loadFileData(fileName: string) {
|
||||
console.log('ALL PHOTOT FILE', fileName)
|
||||
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Loading data...',
|
||||
});
|
||||
await loading.present();
|
||||
|
||||
const filePath = `${IMAGE_DIR}/${fileName}`;
|
||||
|
||||
const readFile = await Filesystem.readFile({
|
||||
path: filePath,
|
||||
directory: Directory.Data,
|
||||
});
|
||||
|
||||
this.images.push({
|
||||
name: fileName,
|
||||
path: filePath,
|
||||
data: `data:image/jpeg;base64,${readFile.data}`,
|
||||
});
|
||||
|
||||
console.log('ALL IMAGE', this.images)
|
||||
|
||||
this.capturedImage = this.images[0].data
|
||||
|
||||
this.compressFile();
|
||||
|
||||
loading.dismiss();
|
||||
|
||||
}
|
||||
|
||||
/* compressImage() {
|
||||
let image = this.capturedImage;
|
||||
this.imageCompress.compressFile(image, orientation, 50, 50,).then(() => {
|
||||
|
||||
this.imgResultBeforeCompress = image;
|
||||
console.log('Size in bytes was:', this.imageCompress.byteCount(image));
|
||||
|
||||
this.imageCompress.compressFile(image, orientation, 50, 50).then(
|
||||
result => {
|
||||
this.imgResultAfterCompress = result;
|
||||
console.log('Size in bytes is now:', this.imageCompress.byteCount(result));
|
||||
}
|
||||
);
|
||||
})
|
||||
} */
|
||||
|
||||
compressFile() {
|
||||
|
||||
//this.imgResultBeforeCompress = image;
|
||||
this.imageCompress.getOrientation(this.capturedImage).then((orientation) => {
|
||||
console.log('Size in bytes was:', this.imageCompress.byteCount(this.capturedImage));
|
||||
this.imageCompress.compressFile(this.capturedImage, orientation, 20, 20).then(
|
||||
result => {
|
||||
this.capturedImage = result;
|
||||
console.log('Size in bytes is now:', this.imageCompress.byteCount(result));
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl));
|
||||
} */
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface Photos {
|
||||
filepath: string;
|
||||
webviewPath: string;
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import { PublicationDetailPageModule } from 'src/app/shared/publication/view-pub
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
import { EditActionPageModule } from 'src/app/shared/publication/edit-action/edit-action.module';
|
||||
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import { LazyLoadImageModule } from 'ng-lazyload-image'; // <-- import it
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -29,6 +30,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
PublicationDetailPageModule,
|
||||
NewActionPageModule,
|
||||
EditActionPageModule,
|
||||
LazyLoadImageModule
|
||||
],
|
||||
declarations: [
|
||||
PublicationsPage,
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<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/cons-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>
|
||||
@@ -77,7 +77,6 @@
|
||||
</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"
|
||||
|
||||
@@ -17,6 +17,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-publications',
|
||||
templateUrl: './publications.page.html',
|
||||
@@ -68,7 +69,8 @@ export class PublicationsPage implements OnInit {
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private platform: Platform,
|
||||
public ThemeService: ThemeService
|
||||
public ThemeService: ThemeService,
|
||||
|
||||
) {
|
||||
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"];
|
||||
@@ -91,6 +93,8 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
hideRefreshButton() {
|
||||
window.onresize = (event) => {
|
||||
if (window.innerWidth < 801) {
|
||||
@@ -238,9 +242,9 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
try {
|
||||
await this.publications.DeletePresidentialAction(id).toPromise();
|
||||
this.toastService.successMessage()
|
||||
this.toastService._successMessage()
|
||||
} catch (e) {
|
||||
this.toastService.badRequest()
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
@@ -452,4 +456,10 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
// this.crop.crop('path/to/image.jpg', {quality: 75})
|
||||
// .then(
|
||||
// newImage => console.log('new image path is: ' + newImage),
|
||||
// error => console.error('Error cropping image', error)
|
||||
// );
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
|
||||
<div class="post-item overflow-y-auto">
|
||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||
<img src="{{publication.FileBase64}}" alt="image" tappable (click)="openPreview(publication.FileBase64)">
|
||||
<img src="{{publication.FileBase64}}" alt="image" >
|
||||
</div>
|
||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
||||
|
||||
@@ -10,6 +10,9 @@ import { ViewPublicationsPage } from './view-publications.page';
|
||||
|
||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
|
||||
import { LazyLoadImageModule } from 'ng-lazyload-image'; // <-- import it
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
@@ -18,6 +21,7 @@ import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||
|
||||
ViewPublicationsPageRoutingModule,
|
||||
HeaderPageModule,
|
||||
LazyLoadImageModule
|
||||
],
|
||||
exports: [ViewPublicationsPage],
|
||||
declarations: [ViewPublicationsPage]
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
<div class="main-container background-white height-100 overflow-y-auto">
|
||||
<ion-list>
|
||||
<!-- [routerLink]="['/home/publications/view-publications/publication-detail', publication.publicationId]" -->
|
||||
<div class="post-item"
|
||||
<div class="post-item cursor-pointer"
|
||||
*ngFor="let publication of getpublication"
|
||||
(click)="goToPublicationDetail(publication.DocumentId)"
|
||||
>
|
||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||
<img src="{{publication.FileBase64}}" alt="image">
|
||||
<ion-img src="{{publication.FileBase64}}" alt="image"></ion-img>
|
||||
</div>
|
||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
}
|
||||
.post-img{
|
||||
width: 100%;
|
||||
//height: 400px;
|
||||
height: 400px;
|
||||
margin: 0 auto;
|
||||
border-radius: 0px!important;
|
||||
overflow: hidden;
|
||||
|
||||
@@ -13,6 +13,7 @@ import { PublicationDetailPage } from './publication-detail/publication-detail.p
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { forkJoin } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -25,7 +26,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
publicationList: Publication[] = new Array();
|
||||
item: PublicationFolder;
|
||||
defaultImage = "https://governo.gov.ao/ao/noticias/presidente-joao-lourenco-ouviu-a-voz-da-igreja/"
|
||||
folderId: string;
|
||||
id: string;
|
||||
error: any;
|
||||
|
||||
publicationListStorage = PublicationListStorage
|
||||
@@ -65,15 +68,15 @@ export class ViewPublicationsPage implements OnInit {
|
||||
if (typeof (this.folderId) == 'object') {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
this.testForkJoin()
|
||||
this.getPublicationDetail();
|
||||
setTimeout(() => {
|
||||
this.getPublications();
|
||||
}, 5000);
|
||||
this.getPublicationsIds();
|
||||
}, 1000);
|
||||
|
||||
this.backgroundservice.registerBackService('Online',() => {
|
||||
this.backgroundservice.registerBackService('Online', () => {
|
||||
this.getPublicationDetail();
|
||||
this.getPublications();
|
||||
this.testForkJoin()
|
||||
|
||||
})
|
||||
|
||||
@@ -85,14 +88,19 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
// if (typeof (this.id == 'object') {
|
||||
// this.id = this.id['ProcessId']
|
||||
// }
|
||||
this.testForkJoin()
|
||||
this.getPublicationDetail();
|
||||
this.getPublications();
|
||||
// this.getPublicationsIds();
|
||||
}
|
||||
|
||||
doRefresh = (event) => {
|
||||
setTimeout(() => {
|
||||
this.testForkJoin()
|
||||
this.getPublicationDetail();
|
||||
this.getPublications();
|
||||
// this.getPublicationsIds();
|
||||
event.target.complete();
|
||||
}, 3000);
|
||||
|
||||
@@ -110,50 +118,125 @@ export class ViewPublicationsPage implements OnInit {
|
||||
getPublicationDetail() {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
|
||||
this.item = allActions.find((e) => e.ProcessId == this.folderId);
|
||||
this.publicationDitails = this.item
|
||||
console.log('item', this.item)
|
||||
|
||||
}, 100);
|
||||
|
||||
}
|
||||
// goes to fork
|
||||
// getPublicationsIds() {
|
||||
|
||||
// this.showLoader = true;
|
||||
// const folderId = this.folderId
|
||||
|
||||
// this.publications.GetIdsPublicationsImages(this.id).subscribe(res => {
|
||||
|
||||
// console.log(this.id)
|
||||
|
||||
// this.publicationList = new Array();
|
||||
|
||||
getPublicationsIds() {
|
||||
|
||||
getPublications() {
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
this.publications.GetPublications(this.folderId).subscribe(res => {
|
||||
console.log(this.folderId)
|
||||
|
||||
this.publications.GetPublicationsImages(this.folderId).subscribe(res => {
|
||||
|
||||
console.log('publications ids', res)
|
||||
this.publicationList = new Array();
|
||||
|
||||
for(let i of res) {
|
||||
this.publications.GetPublicationById(i).subscribe(ress => {
|
||||
console.log('publications by ids', ress)
|
||||
let item: Publication = this.publicationPipe.itemList(ress)
|
||||
console.log('publications by ids 2', item)
|
||||
this.publicationList.push(item);
|
||||
})
|
||||
}
|
||||
|
||||
/* res.forEach(element => {
|
||||
console.log('publications elements', element)
|
||||
this.publications.GetPublicationById(element).subscribe(ress => {
|
||||
console.log('publications by ids', ress)
|
||||
let item: Publication = this.publicationPipe.itemList(ress)
|
||||
console.log('publications by ids 2', item)
|
||||
this.publicationList.push(ress);
|
||||
})
|
||||
|
||||
}); */
|
||||
|
||||
res.forEach(element => {
|
||||
console.log('getPublications', element)
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
this.publicationList.push(item);
|
||||
});
|
||||
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
|
||||
|
||||
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
this.getpublication = this.publicationList;
|
||||
|
||||
this.showLoader = false;
|
||||
},
|
||||
(error) => {
|
||||
if(error.status == '0') {
|
||||
this.getFromDB();
|
||||
}
|
||||
if (error.status == '404') {
|
||||
this.error = 'Sem publicações disponíveis!';
|
||||
this.publicationList = [];
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
/* this.publicationList = new Array();
|
||||
|
||||
res.forEach(element => {
|
||||
console.log('getPublications', element)
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
this.publicationList.push(item);
|
||||
});
|
||||
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
|
||||
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
this.getpublication = this.publicationList; */
|
||||
});
|
||||
}
|
||||
|
||||
getPublications() {
|
||||
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
|
||||
this.publications.GetPublications(this.folderId).subscribe(res => {
|
||||
|
||||
console.log(this.folderId)
|
||||
|
||||
this.publicationList = new Array();
|
||||
|
||||
res.forEach(element => {
|
||||
console.log('getPublications', element)
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
this.publicationList.push(item);
|
||||
console.log('getPublications 222', item)
|
||||
|
||||
});
|
||||
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
|
||||
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
this.getpublication = this.publicationList;
|
||||
|
||||
this.showLoader = false;
|
||||
}, (error) => {
|
||||
|
||||
if (error.status == '0') {
|
||||
this.getFromDB();
|
||||
}
|
||||
if (error.status == '404') {
|
||||
this.error = 'Sem publicações disponíveis!';
|
||||
this.publicationList = [];
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
}
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
testForkJoin(){
|
||||
forkJoin([
|
||||
this.getPublicationsIds(),
|
||||
this.getPublications(),
|
||||
|
||||
|
||||
]).subscribe(allResults =>{
|
||||
this.publicationList = allResults[2]
|
||||
})
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
@@ -223,7 +306,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.getPublications();
|
||||
this.getPublicationsIds();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ import { DateService } from '../date.service';
|
||||
export class ListBoxService {
|
||||
|
||||
constructor(
|
||||
private dateService: DateService
|
||||
){}
|
||||
private dateService: DateService
|
||||
){}
|
||||
|
||||
|
||||
filterProfile(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all') {
|
||||
filterProfile(eventSource: EventListStore[] = [], profile: 'md' | 'pr' | 'all') {
|
||||
return eventSource.filter((e) => e.profile == profile)
|
||||
}
|
||||
|
||||
@@ -26,32 +26,34 @@ export class ListBoxService {
|
||||
})
|
||||
}
|
||||
|
||||
filterSegment(eventSource: EventListStore[], segment): EventListStore[] {
|
||||
return eventSource.filter( data => data.calendarName == segment)
|
||||
}
|
||||
|
||||
filterSegment(eventSource: EventListStore[], segment): EventListStore[] {
|
||||
return eventSource.filter( data => data.calendarName == segment)
|
||||
}
|
||||
|
||||
daysBetween(){ }
|
||||
|
||||
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) {
|
||||
|
||||
// filter range
|
||||
if(selectedDate) {
|
||||
eventSource = eventSource.filter(data =>
|
||||
data.startTime.toLocaleDateString('pt')>= selectedDate.toLocaleDateString('pt') &&
|
||||
data.endTime.toLocaleDateString('pt')>= selectedDate.toLocaleDateString('pt')
|
||||
)
|
||||
}
|
||||
// console.log('eventSource', eventSource ,'rangeStartDate', new Date(rangeStartDate).toLocaleDateString('pt') , 'randEndDate', new Date(randEndDate).toLocaleDateString('pt'))
|
||||
|
||||
if(segment!='Combinado') {
|
||||
eventSource = this.filterSegment(eventSource, segment)
|
||||
}
|
||||
// // filter range
|
||||
// if(selectedDate) {
|
||||
// eventSource = eventSource.filter(data =>
|
||||
// data.startTime.toLocaleDateString('pt') >= new Date(rangeStartDate).toLocaleDateString('pt') &&
|
||||
// data.startTime.toLocaleDateString('pt') <= new Date(rangeStartDate).toLocaleDateString('pt')
|
||||
// )
|
||||
// }
|
||||
|
||||
|
||||
if(segment!='Combinado') {
|
||||
eventSource = this.filterSegment(eventSource, segment)
|
||||
}
|
||||
|
||||
if(profile != 'all') {
|
||||
eventSource = this.filterProfile(eventSource, profile)
|
||||
}
|
||||
|
||||
let newStracture:CustomCalendarEvent[];
|
||||
let newStracture:CustomCalendarEvent[];
|
||||
|
||||
if(profile == 'md') {
|
||||
newStracture = this.encapsulation(eventSource, 'mdgpr');
|
||||
@@ -92,12 +94,12 @@ export class ListBoxService {
|
||||
if (diffDays >= 1) {
|
||||
|
||||
const StartEvent = this.transForm(event, {startMany: true,endMany: false, middle: false, profile})
|
||||
|
||||
if(this.push(event, selectedDate)) days[day].push(StartEvent)
|
||||
|
||||
if(this.push(event, selectedDate)) days[day].push(StartEvent)
|
||||
|
||||
let i = 1;
|
||||
|
||||
// create event between date
|
||||
// create event between date
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate()) {
|
||||
@@ -130,12 +132,15 @@ export class ListBoxService {
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if(this.push(event, selectedDate)) days[day].push(event)
|
||||
}
|
||||
} else {
|
||||
|
||||
if(this.push(event, selectedDate)) days[day].push(event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.push(event, selectedDate)) days[day].push(event)
|
||||
|
||||
@@ -155,10 +160,12 @@ export class ListBoxService {
|
||||
}
|
||||
|
||||
|
||||
push(event: any, selectedDate: Date) {
|
||||
return new Date(event.start).getMonth() == selectedDate.getMonth() &&
|
||||
new Date(event.start).getFullYear() == selectedDate.getFullYear()
|
||||
}
|
||||
push(event: any, selectedDate: Date) {
|
||||
|
||||
return new Date(event.start).getMonth() == selectedDate.getMonth() &&
|
||||
new Date(event.start).getFullYear() == selectedDate.getFullYear() &&
|
||||
new Date(event.start).getDate() >= selectedDate.getDate()
|
||||
}
|
||||
|
||||
encapsulation(eventsList:EventListStore[], profile): CustomCalendarEvent[] {
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { StorageService} from 'src/app/services/storage.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -13,7 +14,8 @@ export class BackgroundService {
|
||||
}[] = []
|
||||
|
||||
constructor(
|
||||
private themeservice: ThemeService
|
||||
private themeservice: ThemeService,
|
||||
private storageservice: StorageService
|
||||
) { }
|
||||
|
||||
online() {
|
||||
@@ -24,6 +26,7 @@ export class BackgroundService {
|
||||
document.body.style.setProperty(`--color3`, "#d9d9d9");
|
||||
document.body.style.setProperty(`--color4`, "#d9d9d9ee");
|
||||
document.body.style.setProperty(`--color5`, "#ececec");
|
||||
this.storageservice.store('networkCheckStore','online');
|
||||
|
||||
} else {
|
||||
document.body.style.setProperty(`--color`, "#0782C9");
|
||||
@@ -31,6 +34,7 @@ export class BackgroundService {
|
||||
document.body.style.setProperty(`--color3`, "#0782C9");
|
||||
document.body.style.setProperty(`--color4`, "#0782c9f0");
|
||||
document.body.style.setProperty(`--color5`, "#45BAFF");
|
||||
this.storageservice.store('networkCheckStore','online');
|
||||
}
|
||||
|
||||
this.callBacks.forEach((e) => {
|
||||
@@ -46,6 +50,7 @@ export class BackgroundService {
|
||||
document.body.style.setProperty(`--color3`, "#ffb703");
|
||||
document.body.style.setProperty(`--color4`, "#ffb703");
|
||||
document.body.style.setProperty(`--color5`, "#ffb703");
|
||||
this.storageservice.store('networkCheckStore','offline');
|
||||
this.callBacks.forEach((e) => {
|
||||
if (e.type == 'Offline') {
|
||||
e.funx()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user