This commit is contained in:
Peter Maquiran
2022-06-22 16:37:51 +01:00
103 changed files with 36031 additions and 1762 deletions
+5 -1
View File
@@ -1 +1,5 @@
{}
{
"server": {
"url": "http://192.168.0.95:8100"
}
}
+1
View File
@@ -9,5 +9,6 @@ COPY ./ /app/
RUN ionic build --prod
FROM nginx:alpine
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
RUN rm -rf /usr/share/nginx/html/*
COPY --from=build /app/www/ /usr/share/nginx/html/
+11
View File
@@ -0,0 +1,11 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri /index.html;
}
}
+32903 -667
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -238,6 +238,10 @@ const routes = [
},
{
path: 'set-room-owner',
loadChildren: () => import('./modals/set-room-owner/set-room-owner.module').then( m => m.SetRoomOwnerPageModule)
},
{
path: 'diplomas-gerar',
loadChildren: () => import('./shared/gabinete-digital/diplomas-gerar/diplomas-gerar.module').then( m => m.DiplomasGerarPageModule)
}
+4 -2
View File
@@ -12,7 +12,8 @@ import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service';
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
import { StorageService } from 'src/app/services/storage.service';
import { MessageModel } from './models/beast-orm'
import { MessageModel } from './models/beast-orm';
import { InativityService } from "src/app/services/inativity.service";
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -43,7 +44,8 @@ export class AppComponent {
private screenOrientation: ScreenOrientation,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService,
private storageservice: StorageService
private storageservice: StorageService,
private InativityService: InativityService
) {
// this.createCacheFolder()
this.initializeApp();
-3
View File
@@ -19,9 +19,6 @@ export class LoginGuard implements CanActivate {
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
// console.log(SessionStore.exist, SessionStore.user.Inactivity, SessionStore.user.LoginPreference)
console.log(SessionStore.exist, SessionStore.user.Inactivity, SessionStore.user.LoginPreference)
if(SessionStore.exist && SessionStore.user.Inactivity && SessionStore.user.LoginPreference != 'Pin' ) {
this.router.navigate(['/home/events']);
return false
+13 -11
View File
@@ -75,17 +75,6 @@ const routes: Routes = [
],
},
// {
// path: 'login',
// children: [
// {
// path:'',
// loadChildren: ()=> import('../pages/login/login.module').then(m => m.LoginPageModule)
// },
// ],
// canActivate: [LoginGuard]
// },
{
path: 'agenda',
children: [
@@ -244,6 +233,19 @@ const routes: Routes = [
},
]
},
{
path: 'diplomas-gerar',
children: [
{
path: '',
loadChildren: ()=> import('../pages/gabinete-digital/diplomas-gerar/diplomas-gerar.module').then(m => m.DiplomasGerarPageModule),
},
{
path:':SerialNumber/:caller',
loadChildren: ()=> import('../pages/gabinete-digital/diplomas-gerar/diplomas-gerar/diplomas-gerar-routing.module').then(m => m.DiplomasGerarPageRoutingModule),
},
]
},
{
path:'event-list',
children: [
+6 -1
View File
@@ -118,7 +118,12 @@ export class HomePage implements OnInit {
const pathname = window.location.pathname
SessionStore.setUrlBeforeInactivity(pathname)
this.router.navigate(['/inactivity']);
if (this.platform.is('mobileweb')) {
this.router.navigate(['/inactivity']);
}else{
this.router.navigate(['/']);
}
}
}
+1 -1
View File
@@ -47,7 +47,7 @@ export class AddNotePage implements OnInit {
component: SearchPage,
cssClass: 'modal-width-100-width-background modal',
componentProps: {
typety: 'AccoesPresidenciais & ArquivoDespachoElect',
type: 'AccoesPresidenciais & ArquivoDespachoElect',
showSearchInput: true,
select: true
}
@@ -10,6 +10,7 @@ import { FileLoaderService } from 'src/app/services/file/file-loader.service';
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
import { environment } from 'src/environments/environment';
import { ThemeService } from 'src/app/services/theme.service'
import { HttpErrorResponse } from '@angular/common/http';
@Component({
selector: 'app-chat-options-features',
@@ -47,7 +48,7 @@ export class ChatOptionsFeaturesPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
}
notImplemented() {
@@ -117,8 +118,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
this.chatService.sendMessage(body).subscribe(res=> {
//
},(error) => {
});
//
};
@@ -144,8 +143,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
this.chatService.sendMessage(body).subscribe(res=> {
},(error) => {
});
}
@@ -50,6 +50,28 @@
</div>
</div> -->
<div class="container-div" (click)="changeAgenda()">
<div class="ion-item-class-2 d-flex">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs " [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
<mat-select [(value)]="CalendarName" (selectionChange)="changeAgenda()">
<mat-option *ngFor="let calendars of _eventService.calendarNamesAry" value="{{calendars}}">
<div *ngIf="calendars != 'Meu calendario' "> Calendário de {{calendars}} </div>
<div *ngIf="calendars == 'Meu calendario'"> {{calendars}} </div>
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</div>
<div class="container-div">
<div class="ion-item-class-2">
<div class="ion-icon-class">
@@ -61,7 +83,9 @@
[(ngModel)]="postData.CalendarName"
placeholder="Selecione repetição"
interface="action-sheet"
Cancel-text="Cancelar" required>
Cancel-text="Cancelar" required
(selectionChange)="changeAgenda()"
>
<ion-select-option value="Oficial">Oficial</ion-select-option>
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
</ion-select>
@@ -90,6 +90,9 @@ export class DocumentSetUpMeetingPage implements OnInit {
docs:any[] = [];
eventPipe = new EventPipe()
CalendarName;
CalendarNameShow = true
CalendarNamesOptions
constructor(
private modalController: ModalController,
@@ -99,7 +102,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
private toastService: ToastService,
private calendarService: EventsService,
private eventService: EventService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
public _eventService: EventsService,
) {
this.loggeduser = authService.ValidatedUser;
this.document = this.navParams.get('document')
@@ -165,6 +169,33 @@ export class DocumentSetUpMeetingPage implements OnInit {
})
}
changeAgenda() {
this.CalendarNameShow = false
setTimeout(() => {
this.CalendarNameShow = true
if(this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
} else if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial']) {
this.CalendarNamesOptions = ['Oficial']
this.postData.CalendarName = 'Oficial'
} else if (this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
this.CalendarNamesOptions = ['Pessoal']
this.postData.CalendarName = 'Pessoal'
} else {
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
}
}, 50)
}
async saveTask() {
if(this.loggeduser.Profile == 'MDGPR') {
@@ -175,7 +206,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
if(this.document.Documents){
if(this.document.Documents) {
this.document.Documents.forEach((e)=> {
this.docs.push({
ApplicationId: e.ApplicationId || e.ApplicationType,
@@ -33,7 +33,7 @@ export class SetRoomOwnerPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
}
async close(){
@@ -15,15 +15,16 @@ export class EmendMessageModalPage implements OnInit {
public ThemeService: ThemeService
) {
this.emendMessage = '';
}
}
ngOnInit() {
ngOnInit() {}
close() {
this.modalController.dismiss({option:'close', note: this.emendMessage});
}
close(){
this.modalController.dismiss('');
}
save(){
this.modalController.dismiss(this.emendMessage);
save() {
this.modalController.dismiss({option:'save', note: this.emendMessage});
}
}
@@ -106,7 +106,7 @@ export class EventActionsPopoverPage implements OnInit {
.then( async (res) => {
if(res.data !== ''){
if(res.data.note !== ''){
let body = { "serialNumber": this.serialNumber,
"action": "Emendar",
"dataFields": {
+1 -1
View File
@@ -128,7 +128,7 @@
<ion-label>{{group.name.split('-').join(' ')}}</ion-label>
</div>
<div class="item-date" [class.item-date-active]="group.id ==idSelected" *ngIf="group.lastMessage && !group.customFields.countDownDate">{{group.duration}}</div>
<div class="item-date" [class.item-date-active]="group.id ==idSelected" *ngIf="group.customFields.countDownDate">{{countDownDate(group.customFields.countDownDate, group.id)}}</div>
<div class="item-date" [class.item-date-active]="group.id ==idSelected" *ngIf="group.customFields.countDownDate">{{group.countDownTime}}</div>
</div>
<div *ngIf="group.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group.id ==idSelected">
<div class="item-message" *ngIf="group.otherUserType == false">{{group.lastMessage.u.name}}: {{group.lastMessage.msg}} </div>
+16 -44
View File
@@ -1,4 +1,4 @@
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
import {
Component,
OnInit,
@@ -44,7 +44,6 @@ export class ChatPage implements OnInit {
X_Auth_Token: any;
loggedUser: any;
/* Set segment variable */
segment: string;
allGroups: any[];
privateGroups: any[];
@@ -90,8 +89,6 @@ export class ChatPage implements OnInit {
"support": ["1"]
};
/* Fim websockets variables*/
loggedUserChat: any;
hideRefreshBtn = true;
@@ -128,11 +125,22 @@ export class ChatPage implements OnInit {
this.showLoader = true;
//this.load()
}
ngOnInit() {
/* let data = {
status: "success",
data: {
userId: "CqYSKR5hrAumZihs7",
authToken: "bvh5BH98Av5ShMnEW94Cwm1Hf-yHEHbl121ijq5Odc_sdvs"
}
}
SessionStore.user.ChatData = data
SessionStore.save() */
console.log(SessionStore.user.ChatData.data.authToken)
this.chatService.refreshtoken();
this.segment = "Contactos";
this.authService.userData$.subscribe((res: any) => {
@@ -497,16 +505,11 @@ export class ChatPage implements OnInit {
}
async getChatMembers() {
//return await this.chatService.getMembers(roomId).toPromise();
this.chatService.getAllUsers().subscribe(res => {
//
this.transformDataUserList(res['users'])
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
//
}*/
});
}
@@ -563,23 +566,6 @@ export class ChatPage implements OnInit {
})
/* this.sqlservice.getAllChatUsers().then((userslist: any) => {
let chatusersArray = [];
userslist.forEach(element => {
let userListDB = {
_id: element.Id,
name: element.Name,
username: element.Username
}
chatusersArray.push(userListDB);
});
this.dmUsers = chatusersArray.filter(data => data.username != this.loggedUserChat.me.username);
}) */
}
}
@@ -635,16 +621,7 @@ export class ChatPage implements OnInit {
this.privateGroups = res.groups;
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
this.publicGroups = res.channels; */
//let all = this.privateGroups.concat(this.publicGroups);
/* this.allGroups = this.privateGroups.sort((a, b) => {
var dateA = new Date(a._updatedAt).getTime();
var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA;
}); */
//
/* }); */
if (this.route.url != "/home/chat") {
//
}
@@ -735,10 +712,5 @@ export class ChatPage implements OnInit {
modal.onDidDismiss();
}
// this.crop.crop('path/to/image.jpg', {quality: 75})
// .then(
// newImage =>
// error => console.error('Error cropping image', error)
// );
}
@@ -1,3 +1,4 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PickerController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service';
@@ -28,6 +29,7 @@ export class EditGroupPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
this.getRoomInfo();
}
@@ -1,4 +1,4 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';
import * as _ from 'lodash';
@@ -56,6 +56,7 @@ export class GroupContactsPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
this.loadUsers();
this.getMembers();
@@ -31,6 +31,7 @@ import { MessageService } from 'src/app/services/chat/message.service';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorResponse } from '@angular/common/http';
@Component({
selector: 'app-group-messages',
@@ -132,6 +133,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
ngOnInit() {
this.chatService.refreshtoken();
this.loggedUser = this.loggedUserChat;
this.getRoomInfo();
@@ -1,4 +1,4 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
@@ -43,6 +43,7 @@ export class ContactsPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
this.loadUsers();
}
@@ -36,6 +36,7 @@ import { FileToBase64Service } from 'src/app/services/file/file-to-base64.servic
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
import { DomSanitizer } from '@angular/platform-browser';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorResponse } from '@angular/common/http';
const IMAGE_DIR = 'stored-images';
@@ -156,6 +157,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
ngOnInit() {
this.chatService.refreshtoken();
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
})
@@ -43,6 +43,7 @@ export class NewGroupPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
console.log(this.documents)
}
@@ -276,7 +276,6 @@ export class DespachoPrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
@@ -303,7 +302,6 @@ export class DespachoPrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage('Processo arquivado')
this.close();
} catch (error) {
this.toastService._badRequest('Processo não arquivado')
}
@@ -326,7 +324,6 @@ export class DespachoPrPage implements OnInit {
}).toPromise()
this.toastService._successMessage('Processo criado')
this.close();
} catch (error) {
this.toastService._badRequest('Processo não criado')
}
@@ -352,7 +349,6 @@ export class DespachoPrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage('')
this.close();
} catch (error) {
this.toastService._badRequest()
}
@@ -379,7 +375,6 @@ export class DespachoPrPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage()
this.close();
} catch (error) {
this.toastService._badRequest()
}
@@ -394,12 +389,14 @@ export class DespachoPrPage implements OnInit {
}
sendExpedienteToPending() {
const loader = this.toastService.loading()
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
this.popoverController.dismiss('close')
this.toastService._successMessage('Processo enviado para pendentes')
this.goBack()
loader.remove()
}, () => {
loader.remove()
this.toastService._badRequest('Processo não encontrado')
});
}
@@ -18,6 +18,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service';
import { SortService } from 'src/app/services/functions/sort.service';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-despachos-pr',
@@ -124,7 +125,16 @@ export class DespachosPrPage implements OnInit {
let despachos = this.sortService.sortArrayByDate(result);
if(this.loggeduser.Profile != "PR") {
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
if(SessionStore.user.Profile != 'Consultant') {
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
} else {
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Gerar Diploma" || data.activityInstanceName == "Retificar Diploma");
}
} else if (this.loggeduser.Profile == "PR") {
despachosPr = await despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
}
@@ -277,26 +287,6 @@ export class DespachosPrPage implements OnInit {
}
// async distartExpedientModal() {
// const modal = await this.modalController.create({
// component: DiscartExpedientModalPage,
// componentProps: {
// action: 'complete',
// },
// cssClass: 'discart-expedient-modal',
// backdropDismiss: false
// });
// await modal.present();
// modal.onDidDismiss().then(res=>{
// if(res['data']=='close'){
// }
// });
// }
docIndex(index: number) {
this.dicIndex = index;
}
@@ -186,7 +186,7 @@ ion-button{
}
}
@media only screen and (min-width: 1140px){
@media only screen and (min-width: 1140px) {
.content{
width: 75%;
}
@@ -98,34 +98,8 @@ export class DespachoPage implements OnInit {
goBack() {
//this.navigationService.back()
this.RouteService.goBack();
// if(this.task.Status == "Pending" && this.caller == 'gabinete-digital'){
// if (window.innerWidth < 801) {
// this.router.navigate(['/home/gabinete-digital/pendentes']);
// }
// else {
// let navigationExtras: NavigationExtras = {
// queryParams: {
// "pendentes": true,
// }
// }
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
// }
// }
// else{
// if (window.innerWidth < 801) {
// this.router.navigate(['/home/gabinete-digital/despachos']);
// } else {
// let navigationExtras: NavigationExtras = {
// queryParams: {
// 'despachos': true
// }
// }
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
// }
// }
}
async LoadTaskDetail(serial: string) {
@@ -387,15 +361,17 @@ export class DespachoPage implements OnInit {
}
async sendExpedienteToPending() {
const loader = this.toastService.loading()
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => {
this.goBack();
this.toastService._successMessage()
loader.remove()
this.toastService.successMessage()
},
error => {
this.toastService._badRequest("Processo não enviado para despacho")
loader.remove()
this.toastService.badRequest("Processo não enviado para despacho")
});
// loader.remove()
}
async openAddNoteModal(actionName: string) {
@@ -1,10 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { AnimationController, ModalController, PopoverController } from '@ionic/angular';
import { ModalController, PopoverController } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service';
import { momentG } from 'src/plugin/momentG';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ActivatedRoute, Router } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
import { ToastService } from 'src/app/services/toast.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
@@ -93,9 +92,6 @@ export class DiplomaAssinarPage implements OnInit {
}
this.fulltask = res;
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
@@ -188,7 +184,6 @@ export class DiplomaAssinarPage implements OnInit {
}
toDateString(e) {
return new Date(e).toDateString()
}
@@ -196,5 +191,4 @@ export class DiplomaAssinarPage implements OnInit {
this.modalController.dismiss();
}
}
@@ -78,8 +78,9 @@ export class DiplomasAssinarPage implements OnInit {
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.diplomasList = [];
let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
diplomasAssinar.forEach(element => {
// let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
diplomas.forEach(element => {
let task: customTask = this.customTaskPipe.transform(element)
this.diplomasList.push(task);
});
@@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DiplomasGerarPage } from './diplomas-gerar.page';
const routes: Routes = [
{
path: '',
component: DiplomasGerarPage
},
{
path: 'diplomas-gerar',
loadChildren: () => import('./diplomas-gerar/diplomas-gerar.module').then( m => m.DiplomasGerarPageModule)
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class DiplomasGerarPageRoutingModule {}
@@ -0,0 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { DiplomasGerarPageRoutingModule } from './diplomas-gerar-routing.module';
import { DiplomasGerarPage } from './diplomas-gerar.page';
import { HeaderPageModule } from 'src/app/shared/header/header.module';
import { BtnModalDismissPageModule } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
DiplomasGerarPageRoutingModule,
HeaderPageModule,
BtnModalDismissPageModule
],
declarations: [DiplomasGerarPage]
})
export class DiplomasGerarPageModule {}
@@ -0,0 +1,111 @@
<ion-header class="ion-no-border">
<app-header > </app-header>
</ion-header>
<ion-header class="ion-no-border header-2">
<div class="title">
<app-btn-modal-dismiss (click)="goBack()"></app-btn-modal-dismiss>
<div class="thetitle"><ion-label >Diplomas</ion-label></div>
<div class="theicon btn-refresh">
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
<div class="bottom-title d-flex"><h3 class="bottom-text">Diplomas por Assinar</h3></div>
</div>
</ion-header>
<ion-content>
<div class="main-content width-100 overflow-y-auto height-100">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div class="width-100" *ngIf="diplomasList.length >= 1">
<div *ngIf="diplomasList">
<ion-list >
<!-- *ngFor = "let task of parecerList; let i = index"
(click)="viewExpedientDetail(task.SerialNumber)" -->
<div
class="expediente ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of diplomasList"
(click)="goToDiploma(task.SerialNumber)"
>
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
<div class="item width-100">
<div class="exp-top-detail">
<div class="subject">
<ion-label>{{ task.Folio }}</ion-label>
</div>
<div class="exp-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-expediente-attachment.svg"></ion-icon>
<label *ngIf="task.DocumentsQty != 0">{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
</div>
<div class="exp-middle-detail">
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
</div>
</div>
</div>
</div>
</ion-list>
</div>
</div>
<!-- Empty -->
<div
*ngIf="!skeletonLoader && diplomasList.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
<div *ngIf="skeletonLoader && diplomasList.length == 0">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,256 @@
@import '~src/function.scss';
:host{
margin: 0;
}
.header-2 {
border-top-right-radius: 24px;
border-top-left-radius: 24px;
}
ion-content, .header-2, .main-content{
padding: 30px 20px 0 20px !important;
}
.main-content {
padding-top: 0px !important;
}
.main-content{
background-color: #fff !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
}
.color-red{
font-weight: 500;
color:#d30a0a !important;
}
.btn-size{
font-size: 18px !important;
}
.main-header{
font-family: Roboto;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
background-color: #fff;
overflow:auto;
color:#000;
transform: translate3d(0, 1px, 0);
.header-top{
margin: 0px auto;
overflow: auto;
padding: 0 !important;
background: #fff;
.middle{
padding: 0!important;
float: left;
width: 280px;
margin: 2.5px 0 0 5px;
display: flex;
align-items: center;
}
.right{
padding: 0!important;
float: right;
font-size: 25px;
color: #0782c9;
margin: 5px 0 0 0;
}
}
.header-bottom{
width: 310px;
overflow: auto;
margin: 0 auto;
.header-bottom-icon{
width: 30px;
font-size: 25px;
float: left;
padding: 2px;
}
.header-bottom-contacts{
width: 275px;
font-size: 15px;
color: #797979;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
float: left;
padding: 5px;
margin: 1px;
}
}
.title{
font-size: 25px;
overflow: auto;
float: left;
padding-top: 4px;
padding-left: 5px;
}
.div-icon{
width: 40px;
float: right;
font-size: 35px;
overflow: auto;
padding: 1px;
}
}
ion-item-group{
margin: 15px;
}
ion-button{
display: block;
width: 80%;
margin: 20px auto;
}
.upper-content{
font-family: Roboto;
margin-left: 41px;
font-size: 18px;
.label{
border-radius: 20px;
background: #ffb703;
float: right;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
}
.button-calendar-type ion-button{
height: 25px;
}
.content-details{
font-size: 17px;
.date{
color: #797979;
}
}
}
.middle-conten{
.middle-content p{
font-size: 16px;
}
}
.bottom-content{
//width: 360px;
margin: 0 auto;
.bottom-content h3{
font-size: 16px;
margin: 0 0 0 10px;
}
.attach-document{
font-size: 15px;
color: var(--title-text-color);
margin: 5px 5px 5px 10px;
padding: 5px;
float: left;
}
.attach-icon{
width: 37px;
font-size: 35px;
float: left;
}
.attach-title-item{
font-size: 18px;
width: 100%;
color:#0d89d1;
padding-bottom: 5px;
}
/* SPAN */
.span-left{
float: left;
font-size: 15x;
}
.span-right{
text-align: right;
float: right;
font-size: 13px;
}
}
.aside-right{
padding: 30px 20px 0 20px !important;
.arrow-right{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
.arrow-right-icon{
width: 37px;
float: right;
font-size: 35px;
overflow: hidden;
}
}
.buttons{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.btn-ok, .btn-cancel, .btn-delete{
height: auto !important;
font-size: 16px !important;
width: 100% !important;
margin-bottom: 10px !important;
padding: 15px !important;
}
}
.solid {
display: block;
width: 90%;
border-top: 1px solid #ebebeb;
margin: 0 auto !important;
margin-bottom: 10px !important;
}
}
@media only screen and (max-width: 800px) {
.content{
width: 100% !important;
}
.aside-right{
display: none;
}
}
@media only screen and (min-width: 801px) {
.div-icon{
display: none;
}
.content{
width: 65%;
border-right: 1px solid #d8d8d8;
}
.aside-right{
width: 35%;
}
}
@media only screen and (min-width: 1024px){
.content{
width: 70%;
}
.aside-right{
width: 30%;
}
}
@media only screen and (min-width: 1140px){
.content{
width: 75%;
}
.aside-right{
width: 25%;
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { DiplomasGerarPage } from './diplomas-gerar.page';
describe('DiplomasGerarPage', () => {
let component: DiplomasGerarPage;
let fixture: ComponentFixture<DiplomasGerarPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DiplomasGerarPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(DiplomasGerarPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,102 @@
import { Component, Input, OnInit } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { SortService } from 'src/app/services/functions/sort.service';
import { ThemeService } from 'src/app/services/theme.service'
@Component({
selector: 'app-diplomas-gerars',
templateUrl: './diplomas-gerar.page.html',
styleUrls: ['./diplomas-gerar.page.scss'],
})
export class DiplomasGerarPage implements OnInit {
//profile:string;
diplomasList:DailyWorkTask[] = [];
showLoader: boolean;
totalDocs:any;
serialNumber:string;
@Input() profile:string;
@Input() segment:string;
customTaskPipe = new CustomTaskPipe()
skeletonLoader = true
constructor(
private processes:ProcessesService,
private modalController: ModalController,
private alertService: AlertService,
private router: Router,
private sortService: SortService,
public ThemeService: ThemeService) {
}
ngOnInit() {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing()
} else {
this.LoadList()
}
}
});
}
goToDiploma(serialNumber:any){
this.router.navigate(['/home/gabinete-digital/diplomas-gerar',serialNumber,'gabinete-digital']);
}
async refreshing() {
setTimeout(() => {
this.LoadList();
}, 1000);
}
doRefresh(event) {
setTimeout(() => {
this.LoadList();
}, 1000);
}
async LoadList(){
this.skeletonLoader = true
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.diplomasList = [];
// let diplomasAssinar = diplomas.filter(data => data.activityInstanceName == "Assinar Diploma");
diplomas.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;
}
goBack() {
this.router.navigate(['/home/gabinete-digital']);
// window.history.back()
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DiplomasGerarPage } from './diplomas-gerar.page';
const routes: Routes = [
{
path: '',
component: DiplomasGerarPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class DiplomasGerarPageRoutingModule {}
@@ -0,0 +1,22 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { DiplomasGerarPageRoutingModule } from './diplomas-gerar-routing.module';
import { DiplomasGerarPage } from './diplomas-gerar.page';
import { HeaderPageModule } from 'src/app/shared/header/header.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
DiplomasGerarPageRoutingModule,
HeaderPageModule
],
declarations: [DiplomasGerarPage]
})
export class DiplomasGerarPageModule {}
@@ -0,0 +1,130 @@
<ion-header class="ion-no-border pb-20">
<app-header > </app-header>
</ion-header>
<ion-content class="container-wrapper">
<div class="main-content d-flex height-100 width-100 overflow-hidden">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content width-100 d-flex justify-space-between">
<div class="font-30 cursor-pointer" (click)="goBack()" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
</div>
<div class="middle d-flex align-center flex-grow-1 ">
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions()">
<ion-icon class="font-25 cursor-pointer" name="ellipsis-vertical-outline"></ion-icon>
</div>
</div>
</div>
<div class="upper-content">
<div class="content-details">
<ion-label>
<p><span class="date">{{customDate}}</span><span class="label">{{ task.activityInstanceName }}</span></p>
<p><span class="color-red">{{ task.DeadlineType }}</span></p>
</ion-label>
</div>
</div>
<div class="line"></div>
<div class="middle-content">
<h5 *ngIf="intervenientes">Intervenientes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let interveniente of intervenientes">
<p>{{interveniente.Name}}</p>
</div>
</ion-label>
</ion-item>
<div *ngIf="cc.length > 0">
<h5>Com conhecimento</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let c of cc">
<p>{{c.Name}}</p>
</div>
</ion-label>
</ion-item>
</div>
<div *ngIf="fulltask.workflowInstanceDataFields.TaskMessage">
<h5>Detalhes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<p [innerHTML]="fulltask.workflowInstanceDataFields.TaskMessage"></p>
</ion-item>
</div>
</div>
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item *ngFor="let attachment of attachments"
class="ion-no-margin ion-no-padding cursor-pointer"
>
<ion-label
(click)="viewDocument(attachment.DocId, attachment)"
>
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p *ngIf="!attachment.Assunto" class="attach-title-item">{{ attachment.DocNumber }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{attachment.Sender}}</span><span class="span-right">{{ attachment.DocDate | date: 'dd/MM/yy' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="task" class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons">
<button (click)="enviarDiploma({note: '', documents: [], serialnumber: task.SerialNumber})" class="btn-cancel" shape="round" >Enviar Diploma</button>
<button (click)="openDelegarModal()" class="btn-cancel" shape="round" >Delegar</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para pendentes</button>
<div class="solid"></div>
</div>
</div>
<div *ngIf="!task">
<ion-list>
<ion-list-header>
<ion-label>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</ion-label>
</ion-list-header>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<button color="medium" shape="round" expand="block">
<!-- <ion-icon color="medium" name="attach" slot="start"></ion-icon> -->
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</button>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,256 @@
@import '~src/function.scss';
:host{
margin: 0;
}
.header-2 {
border-top-right-radius: 24px;
border-top-left-radius: 24px;
}
ion-content, .header-2, .main-content{
padding: 30px 20px 0 20px !important;
}
.main-content {
padding-top: 0px !important;
}
.main-content{
background-color: #fff !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
}
.color-red{
font-weight: 500;
color:#d30a0a !important;
}
.btn-size{
font-size: 18px !important;
}
.main-header{
font-family: Roboto;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
background-color: #fff;
overflow:auto;
color:#000;
transform: translate3d(0, 1px, 0);
.header-top{
margin: 0px auto;
overflow: auto;
padding: 0 !important;
background: #fff;
.middle{
padding: 0!important;
float: left;
width: 280px;
margin: 2.5px 0 0 5px;
display: flex;
align-items: center;
}
.right{
padding: 0!important;
float: right;
font-size: 25px;
color: #0782c9;
margin: 5px 0 0 0;
}
}
.header-bottom{
width: 310px;
overflow: auto;
margin: 0 auto;
.header-bottom-icon{
width: 30px;
font-size: 25px;
float: left;
padding: 2px;
}
.header-bottom-contacts{
width: 275px;
font-size: 15px;
color: #797979;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
float: left;
padding: 5px;
margin: 1px;
}
}
.title{
font-size: 25px;
overflow: auto;
float: left;
padding-top: 4px;
padding-left: 5px;
}
.div-icon{
width: 40px;
float: right;
font-size: 35px;
overflow: auto;
padding: 1px;
}
}
ion-item-group{
margin: 15px;
}
ion-button{
display: block;
width: 80%;
margin: 20px auto;
}
.upper-content{
font-family: Roboto;
margin-left: 41px;
font-size: 18px;
.label{
border-radius: 20px;
background: #ffb703;
float: right;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
}
.button-calendar-type ion-button{
height: 25px;
}
.content-details{
font-size: 17px;
.date{
color: #797979;
}
}
}
.middle-conten{
.middle-content p{
font-size: 16px;
}
}
.bottom-content{
//width: 360px;
margin: 0 auto;
.bottom-content h3{
font-size: 16px;
margin: 0 0 0 10px;
}
.attach-document{
font-size: 15px;
color: var(--title-text-color);
margin: 5px 5px 5px 10px;
padding: 5px;
float: left;
}
.attach-icon{
width: 37px;
font-size: 35px;
float: left;
}
.attach-title-item{
font-size: 18px;
width: 100%;
color:#0d89d1;
padding-bottom: 5px;
}
/* SPAN */
.span-left{
float: left;
font-size: 15x;
}
.span-right{
text-align: right;
float: right;
font-size: 13px;
}
}
.aside-right{
padding: 30px 20px 0 20px !important;
.arrow-right{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
.arrow-right-icon{
width: 37px;
float: right;
font-size: 35px;
overflow: hidden;
}
}
.buttons{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.btn-ok, .btn-cancel, .btn-delete{
height: auto !important;
font-size: 16px !important;
width: 100% !important;
margin-bottom: 10px !important;
padding: 15px !important;
}
}
.solid {
display: block;
width: 90%;
border-top: 1px solid #ebebeb;
margin: 0 auto !important;
margin-bottom: 10px !important;
}
}
@media only screen and (max-width: 800px) {
.content{
width: 100% !important;
}
.aside-right{
display: none;
}
}
@media only screen and (min-width: 801px) {
.div-icon{
display: none;
}
.content{
width: 65%;
border-right: 1px solid #d8d8d8;
}
.aside-right{
width: 35%;
}
}
@media only screen and (min-width: 1024px){
.content{
width: 70%;
}
.aside-right{
width: 30%;
}
}
@media only screen and (min-width: 1140px){
.content{
width: 75%;
}
.aside-right{
width: 25%;
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { DiplomasGerarPage } from './diplomas-gerar.page';
describe('DiplomasGerarPage', () => {
let component: DiplomasGerarPage;
let fixture: ComponentFixture<DiplomasGerarPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DiplomasGerarPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(DiplomasGerarPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,331 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, PopoverController } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service';
import { momentG } from 'src/plugin/momentG';
import { ActivatedRoute } from '@angular/router';
import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
import { ToastService } from 'src/app/services/toast.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
import { DespachoService } from 'src/app/Rules/despacho.service'
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
@Component({
selector: 'app-diplomas-gerar',
templateUrl: './diplomas-gerar.page.html',
styleUrls: ['./diplomas-gerar.page.scss'],
})
export class DiplomasGerarPage implements OnInit {
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
serialnumber: string;
profile: string;
task: any
fulltask: any
intervenientes: any;
cc: any = [];
attachments:any;
customDate: any;
caller:string;
constructor(
private processes: ProcessesService,
public popoverController: PopoverController,
private modalController: ModalController,
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
private RouteService: RouteService,
public ThemeService: ThemeService,
private despachoService: DespachoService,
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber;
}
if(params["params"].caller) {
this.caller = params["params"].caller;
}
});
}
ngOnInit() {
this.profile = "mdgpr";
this.LoadTaskDetail(this.serialnumber);
}
goBack() {
this.RouteService.goBack();
}
async openOptions(taskAction?: any) {
const popover = await this.popoverController.create({
component: DeplomaOptionsPage,
cssClass: 'exp-options',
componentProps: {
serialNumber: this.task.SerialNumber,
task: this.task,
showEnviarPendentes: false
},
translucent: true
});
return await popover.present();
}
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
this.task = {
"SerialNumber": res.serialNumber,
"Folio": res.workflowInstanceDataFields.Subject,
"Senders": res.originator.email,
"CreateDate": momentG(new Date(res.taskStartDate),'yyyy-MM-dd HH:mm:ss'),
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
"Remetente": res.workflowInstanceDataFields.Sender,
"Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note,
"FolderId": res.workflowInstanceDataFields.FolderID,
"FsId": '361',
"DocId": res.workflowInstanceDataFields.DispatchDocId,
"WorkflowName": res.workflowDisplayName,
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"activityInstanceName": res.activityInstanceName,
}
this.fulltask = res;
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
this.intervenientes = users.filter(user=>{
return user.Type == 'I';
});
this.cc = users.filter(user=>{
return user.Type == 'CC';
});
});
this.getDocumentDetails(this.task.FolderId, '361');
}, (error)=>{
try {
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')
} else {
this.toastService._badRequest('Processo não encontrado')
}
}
});
}
async openDelegarModal() {
let classs;
if (window.innerWidth <= 800) {
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: DelegarPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res => {
if(res){
const data = res.data;
if(data == 'close') {
this.goBack();
}
}
});
}
async openBookMeetingModal() {
let classs;
if (window.innerWidth <= 800) {
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async sendExpedienteToPending() {
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => {
this.goBack();
this.toastService.successMessage()
},
error => {
this.toastService.badRequest("Processo não enviado para despacho")
});
}
async enviarDiploma({note = '', documents = [], serialnumber}) {
let classs;
if (window.innerWidth <= 800) {
classs = 'modal modal-desktop'
} else {
classs = 'add-note-modal-no-height'
}
const modal = await this.modalController.create({
component: AddNotePage,
componentProps: {
showAttachmentBtn: true,
},
cssClass: classs,
backdropDismiss: true
});
await modal.present();
modal.onDidDismiss().then(async (res) => {
if (res.data) {
const DocumentToSave = res.data.documents.map((e) => {
return {
ApplicationId: e.ApplicationType,
SourceId: e.Id,
}
});
let docs = {
ProcessInstanceID: "",
Attachments: DocumentToSave,
}
let body = {
"serialNumber": serialnumber,
"action": "Enviar diploma",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComment": res.data.note,
},
"AttachmentList" : docs,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise();
this.modalController.dismiss('sucess');
this.toastService._successMessage();
this.goBack()
} catch (error) {
this.toastService._badRequest();
} finally {
loader.remove()
}
}
});
}
async viewDocument(DocId:string, Document) {
const modal = await this.modalController.create({
component: ViewDocumentPage,
componentProps: {
trustedUrl: '',
file: {
title: Document.Assunto,
url: '',
title_link: '',
},
Document,
applicationId: Document.ApplicationId,
docId: Document.DocId || Document.SourceId,
folderId: this.task.FolderId,
task: this.fulltask
},
cssClass: 'modal modal-desktop'
});
await modal.present();
}
getDocumentDetails(forlderId:string, applicationId:string) {
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents;
})
}
async Assinar(){
let body = {
"serialNumber": this.serialnumber,
"action": "Assinado",
"ActionTypeId": 99999842,
"dataFields": {
"ReviewUserComment": '',
},
"AttachmentList": {},
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService._successMessage(false, ()=>{
this.goBack();
})
} catch (error) {
this.toastService._badRequest()
}
finally {
loader.remove()
}
}
toDateString(e) {
return new Date(e).toDateString()
}
close() {
this.modalController.dismiss();
}
}
@@ -178,7 +178,7 @@ export class ApproveEventModalPage implements OnInit {
await modal.present();
modal.onDidDismiss().then( async (res) => {
if(res.data !== '') {
if(res.data.note !== '') {
let body = {
"serialNumber": serialNumber,
"action": "Emendar",
@@ -193,9 +193,9 @@ export class ApproveEventModalPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.toastService.successMessage()
this.toastService._successMessage()
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
this.router.navigate(['/home/gabinete-digital/event-list']);
}
finally {
@@ -2,12 +2,9 @@ import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
import { Event } from 'src/app/models/event.model';
import { AlertService } from 'src/app/services/alert.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page';
import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page';
import { ToastService } from 'src/app/services/toast.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
@@ -81,8 +78,6 @@ export class ApproveEventPage implements OnInit {
ngOnInit() {
this.getTask();
this.backgroundservice.registerBackService('Online', () => {
this.getTask();
@@ -126,7 +121,6 @@ export class ApproveEventPage implements OnInit {
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
this.loadedAttachments = this.loadedEvent.Documents;
})
@@ -230,16 +224,6 @@ export class ApproveEventPage implements OnInit {
loader.remove()
}
/* this.approveEventDismiss.emit({
"serialNumber": serialNumber,
"action": "Aprovar",
"saveData": {
loadedEvent: this.loadedEvent,
today: this.today,
customDate: this.customDate
}
}); */
}
async emendTask(serialNumber: string) {
@@ -287,12 +271,9 @@ export class ApproveEventPage implements OnInit {
}
else {
//this.alertService.presentAlert('Operação cancelada!');
}
});
//this.openEmendMessageModal(serialNumber);
//this.goBack();
}
async rejeitar(serialNumber: string) {
@@ -352,6 +333,7 @@ export class ApproveEventPage implements OnInit {
openMenu() {
this.menu.open();
}
async openEmendMessageModal(serialNumber: string) {
const modal = await this.modalController.create({
component: EmendMessageModalPage,
@@ -366,7 +348,7 @@ export class ApproveEventPage implements OnInit {
modal.onDidDismiss().then(async (res) => {
if (res.data !== '') {
if (res.data.note !== '') {
let body = {
"serialNumber": serialNumber,
"action": "Emendar",
@@ -412,8 +394,7 @@ export class ApproveEventPage implements OnInit {
serialNumber: serialNumber,
InstanceId: this.InstanceId
},
cssClass: 'modal modal-desktop',
// backdropDismiss: false
cssClass: 'modal modal-desktop'
});
await modal.present();
@@ -1,59 +1,63 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { GabineteDigitalPage } from './gabinete-digital.page';
const routes: Routes = [
{
path: '',
component: GabineteDigitalPage
},
{
path: 'expediente',
loadChildren: () => import('./expediente/expediente.module').then( m => m.ExpedientePageModule)
},
{
path: 'event-list',
loadChildren: () => import('./event-list/event-list.module').then( m => m.EventListPageModule)
},
{
path: 'discart-expedient-modal',
loadChildren: () => import('./discart-expedient-modal/discart-expedient-modal.module').then( m => m.DiscartExpedientModalPageModule)
},
{
path: 'despachos',
loadChildren: () => import('./despachos/despachos.module').then( m => m.DespachosPageModule)
},
{
path: 'pedidos',
loadChildren: () => import('./pedidos/pedidos.module').then( m => m.PedidosPageModule)
},
{
path: 'pendentes',
loadChildren: () => import('./pendentes/pendentes.module').then( m => m.PendentesPageModule)
},
{
path: 'despachos-pr',
loadChildren: () => import('./despachos-pr/despachos-pr.module').then( m => m.DespachosPrPageModule)
},
{
path: 'diplomas',
loadChildren: () => import('./diplomas/diplomas.module').then( m => m.DiplomasPageModule)
},
{
path: 'expedientes-pr',
loadChildren: () => import('./expedientes-pr/expedientes-pr.module').then( m => m.ExpedientesPrPageModule)
},
{
path: 'diplomas-assinar',
loadChildren: () => import('./diplomas-assinar/diplomas-assinar.module').then( m => m.DiplomasAssinarPageModule)
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { GabineteDigitalPage } from './gabinete-digital.page';
const routes: Routes = [
{
path: '',
component: GabineteDigitalPage
},
{
path: 'expediente',
loadChildren: () => import('./expediente/expediente.module').then( m => m.ExpedientePageModule)
},
{
path: 'event-list',
loadChildren: () => import('./event-list/event-list.module').then( m => m.EventListPageModule)
},
{
path: 'discart-expedient-modal',
loadChildren: () => import('./discart-expedient-modal/discart-expedient-modal.module').then( m => m.DiscartExpedientModalPageModule)
},
{
path: 'despachos',
loadChildren: () => import('./despachos/despachos.module').then( m => m.DespachosPageModule)
},
{
path: 'pedidos',
loadChildren: () => import('./pedidos/pedidos.module').then( m => m.PedidosPageModule)
},
{
path: 'pendentes',
loadChildren: () => import('./pendentes/pendentes.module').then( m => m.PendentesPageModule)
},
{
path: 'despachos-pr',
loadChildren: () => import('./despachos-pr/despachos-pr.module').then( m => m.DespachosPrPageModule)
},
{
path: 'diplomas',
loadChildren: () => import('./diplomas/diplomas.module').then( m => m.DiplomasPageModule)
},
{
path: 'expedientes-pr',
loadChildren: () => import('./expedientes-pr/expedientes-pr.module').then( m => m.ExpedientesPrPageModule)
},
{
path: 'diplomas-assinar',
loadChildren: () => import('./diplomas-assinar/diplomas-assinar.module').then( m => m.DiplomasAssinarPageModule)
}, {
path: 'diplomas-gerar',
loadChildren: () => import('./diplomas-gerar/diplomas-gerar.module').then( m => m.DiplomasGerarPageModule)
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class GabineteDigitalPageRoutingModule {}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class GabineteDigitalPageRoutingModule {}
@@ -7,19 +7,7 @@ import { IonicModule } from '@ionic/angular';
import { GabineteDigitalPageRoutingModule } from './gabinete-digital-routing.module';
import { GabineteDigitalPage } from './gabinete-digital.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { EventListPage } from 'src/app/shared/agenda/event-list/event-list.page';
import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-container.page';
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page';
import { PedidosPage } from 'src/app/shared/gabinete-digital/pedidos/pedidos.page';
import { DespachosPage } from 'src/app/shared/gabinete-digital/despachos/despachos.page';
import { DespachosPrPage } from 'src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page';
import { DiplomasPage } from 'src/app/shared/gabinete-digital/diplomas/diplomas.page';
import { ExpedientesPrPage } from 'src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page';
import { DiplomasAssinarPage } from 'src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page';
import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module';
import { EventsToApprovePageModule } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.module';
@@ -28,6 +16,7 @@ import { PedidosPageModule } from 'src/app/shared/gabinete-digital/pedidos/pedid
import { DespachosPageModule } from 'src/app/shared/gabinete-digital/despachos/despachos.module';
import { PendentesPageModule } from 'src/app/shared/gabinete-digital/pendentes/pendentes.module';
import { DespachosPrPageModule } from 'src/app/shared/gabinete-digital/despachos-pr/despachos-pr.module';
import { DiplomasGerarPageModule } from 'src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.module';
import { DiplomasPageModule } from 'src/app/shared/gabinete-digital/diplomas/diplomas.module';
import { ExpedientesPrPageModule } from 'src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.module';
import { DiplomasAssinarPageModule } from 'src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.module';
@@ -58,6 +47,7 @@ import { AllProcessesPageModule } from 'src/app/shared/gabinete-digital/all-proc
DiplomasAssinarPageModule,
EmptyContainerPageModule,
BtnModalDismissPageModule,
DiplomasGerarPageModule
],
declarations: [
@@ -39,9 +39,6 @@
<ion-item-sliding *ngIf="loadCount">
<div class="listview" >
<ion-list *ngIf="AllProcess">
<div
class="item-wrapper box-hover ion-no-padding cursor-pointer"
*ngFor = "let task of AllProcess"
@@ -168,7 +165,6 @@
<p class="text-center exp-card-content">{{expedientegbstore.count}} <span class="title1">Documentos</span></p>
</div>
<!-- <div [class.active]="selectedElement == 'Pending'" (click)="openPendentesPage(); selectedElement='Pending'" class="exp-card d-flex flex-column justify-center" > -->
<div [class.active]="selectedElementF('Pending')" (click)="openPendentesPage(); selectedElement='Pending'" class="box-hover exp-card d-flex flex-column justify-center" >
<div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-pendente.svg"></ion-icon>
@@ -181,7 +177,6 @@
<p class="text-center exp-card-content"><span class="number">{{pendentesstore.count}} </span> <span class="title1">Documentos</span></p>
</div>
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" [class.active]="selectedElement == 'Dispatches'" class="box-hover exp-card d-flex flex-column justify-center" (click)="openDespachosPage(); selectedElement='Dispatches'">
<div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
@@ -215,8 +210,8 @@
<p class="text-center exp-card-title ">Pedidos de Deferimento</p>
<p class="text-center exp-card-content">{{pedidosstore.countdeferimento}} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks, p.permissionList.Gabinete.pr_tasks])" (click)="openDespachosPrPage(); selectedElement='showDespachosPr'" [class.active]="selectedElement == 'showDespachosPr'" class="box-hover exp-card-long width-100 d-flex flex-column justify-center">
<div class="center-div">
<div class="exp-card-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-despachos-presidente.svg"></ion-icon>
@@ -226,7 +221,7 @@
</div>
<div class="exp-card-text">
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])">Despacho do Presidente da República</p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Despachos criados por mim</p>
<p class="text-center exp-card-title " *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])">Despachos criados por mim</p>
<p class="text-center exp-card-content">{{ despachoprstore.count }} <span class="title1">Documentos</span> </p>
</div>
</div>
@@ -244,6 +239,19 @@
<p class="text-center exp-card-content">{{ deplomasStore.deplomasReviewCount }} <span class="title1">Documentos</span> </p>
</div>
<div *ngIf="SessionStore.user.Profile == 'Consultant'" (click)="openDiplomaPorElaborar('gerarDiplomas'); selectedElement='gerarDiplomas'" [class.active]="selectedElement == 'gerarDiplomas'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'gerarDiplomas'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'gerarDiplomas'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'gerarDiplomas'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
</div>
<p class="text-center exp-card-title" >Diplomas por elaborar</p>
<p class="text-center exp-card-content">{{ deplomasStore.DiplomaGerarList.length }} <span class="title1">Documentos</span></p>
</div>
<div (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
@@ -256,15 +264,15 @@
<p class="text-center exp-card-content">{{ deplomasStore.countDiplomasAssinadoListCount }} <span class="title1">Documentos</span></p>
</div>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasAssinar'" [class.active]="selectedElement == 'DiplomasAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
<div *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openDiplomasAssinarPage(); selectedElement='DiplomasParaAssinar'" [class.active]="selectedElement == 'DiplomasParaAssinar'" class="box-hover exp-card d-flex flex-column justify-center">
<div class="d-flex justify-center">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-diploma.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasAssinar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement == 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma-hover.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' && selectedElement != 'DiplomasParaAssinar' " src="assets/images/theme/gov/icons-expediente-diploma.svg"></ion-icon>
</div>
<p class="text-center exp-card-title">Diplomas para Assinar</p>
<p class="text-center exp-card-content">{{ deplomasStore.diplomasListCount }} <span class="title1">Documentos</span></p>
<p class="text-center exp-card-content">{{ deplomasStore.diplomasParaAssinartCount }} <span class="title1">Documentos</span></p>
</div>
</div>
@@ -371,6 +379,8 @@
<app-diplomas-assinar class=" height-100 flex-column" [style.display]="showDiplomasAssinar ? 'flex' : 'none'"></app-diplomas-assinar>
<app-expedientes-pr [profile]="profile" class=" height-100 flex-column" [style.display]="showExpedientesPr ? 'flex' : 'none'" ></app-expedientes-pr>
<app-signed-diploma [profile]="profile" class=" height-100 flex-column" [style.display]="showSignedDiploma ? 'flex' : 'none'" ></app-signed-diploma>
<app-diplomas-gerars [profile]="profile" class="height-100 flex-column" [style.display]="showDiplomasGerar ? 'flex' : 'none'"></app-diplomas-gerars>
</div>
</div>
</ion-content>
@@ -513,6 +513,12 @@ ion-content{
margin-top: 0px !important;
}
}
.exp-card-long{
.exp-card-title{
text-align: left !important;
}
}
}
@media only screen and (min-width: 801px) {
@@ -554,52 +560,52 @@ ion-content{
}
.active {
color: white !important;
fill: white !important;
border: var(--gabinete-active-hove-box-border) !important;
background: var(--gabinete-active-hove-background) !important;
box-sizing: border-box;
.exp-card-content, .icon-selected{
color: white !important;
}
.exp-card-title {
color: rgb(255, 255, 255) !important;
}
svg path::part(native) {
color: white !important;
fill: white !important;
}
svg path::part(button):hover {
color: white !important;
fill: rgb(255, 255, 255) !important;
}
svg{
path{
fill: rgb(255, 255, 255) !important
}
}
}
.active ion-icon::part(button) {
color: white !important;
fill: rgb(255, 255, 255) !important;
}
.active ion-icon::part(native) {
color: white !important;
fill: rgb(255, 255, 255) !important;
}
.active ion-icon{
color: white !important;
fill: red !important;
}
.active {
color: white !important;
fill: white !important;
border: var(--gabinete-active-hove-box-border) !important;
background: var(--gabinete-active-hove-background) !important;
box-sizing: border-box;
.exp-card-content, .icon-selected{
color: white !important;
}
.exp-card-title {
color: rgb(255, 255, 255) !important;
}
svg path::part(native) {
color: white !important;
fill: white !important;
}
svg path::part(button):hover {
color: white !important;
fill: rgb(255, 255, 255) !important;
}
svg{
path{
fill: rgb(255, 255, 255) !important
}
}
}
.active ion-icon::part(button) {
color: white !important;
fill: rgb(255, 255, 255) !important;
}
.active ion-icon::part(native) {
color: white !important;
fill: rgb(255, 255, 255) !important;
}
.active ion-icon{
color: white !important;
fill: red !important;
}
.item-skeleton{
@@ -19,7 +19,7 @@ import { WaitForDomService } from 'src/app/services/dom/wait-for-dom.service';
import { TotalDocumentStore } from 'src/app/store/total-document.service';
import { DeplomasStore } from 'src/app/store/deplomas.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
//import { NotificationsService } from 'src/app/services/notifications.service';
import { DespachoService } from 'src/app/Rules/despacho.service';
import { ChangeProfileService } from 'src/app/services/change-profile.service';
import { PermissionService } from 'src/app/services/permission.service';
@@ -33,6 +33,9 @@ import { SortService } from 'src/app/services/functions/sort.service';
import { DataService } from 'src/app/services/data.service';
import { Storage } from '@ionic/storage';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-gabinete-digital',
@@ -40,7 +43,7 @@ import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
styleUrls: ['./gabinete-digital.page.scss'],
})
export class GabineteDigitalPage implements OnInit, DoCheck {
export class GabineteDigitalPage implements OnInit {
segment: string;
segmentVista: string;
@@ -61,9 +64,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
count_exp_pp: string;
count_exp_pd: string;
count_dip_apr: string;
count_dip_as_pr = 0
count_dip_pv = 0;
count_dip_as = 0;
count_de_pr = 0;
count_ev_apr = 0;
count_ev_md = 0;
@@ -111,9 +112,12 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
despachoprstore = DespachosprStore;
totalDocumentStore = TotalDocumentStore
deplomasStore = DeplomasStore
showDiplomasGerar = false
//
// pipe
SessionStore = SessionStore
expedienteTaskPipe = new ExpedienteTaskPipe();
loadCount = false
@@ -144,7 +148,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
private sortService: SortService,
private dataService: DataService,
private storage: Storage,
public p: PermissionService,
public p: PermissionService
) {
this.loggeduser = authService.ValidatedUser;
@@ -161,11 +165,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.checkRoutes();
}
ngDoCheck(): void {
}
closeAllDesktopComponent() {
this.desktopComponent = {
showEventList: false,
@@ -372,6 +371,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
goToProcess(serialNumber: string, workflowName: string, activityName: string) {
if (workflowName == 'Despacho') {
if (activityName == 'Tarefa de Despacho' || activityName == 'Concluir Despacho') {
this.router.navigate(['/home/gabinete-digital/despachos', serialNumber, 'gabinete-digital']);
@@ -386,6 +387,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}
else if (activityName == 'Diploma Assinado') {
this.router.navigate(['/home/gabinete-digital/diplomas-assinar', serialNumber, 'gabinete-digital']);
} else {
alert('bug!')
}
}
else if (workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento') {
@@ -525,13 +528,14 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.showExpedientesPr = false;
this.showExpedientDetail = false;
this.showSignedDiploma = false
this.showDiplomasGerar = false
}
get AllProcess() {
return this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr)
.concat(this.deplomasStore.diplomasList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.despachoStore.list)
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.despachoStore.list).concat(this.deplomasStore.DiplomaGerarList)
}
get getAllProcessCount() {
@@ -540,70 +544,15 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
async LoadCounts() {
let allPreocesses_;
let expedientes;
try {
allPreocesses_ = await this.processesbackend.GetTasksList("", false).toPromise();
expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise();
this.loadCount = true;
} catch(error) {
this.loadCount = true;
}
let allProcessesList = allPreocesses_ || [];
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Conhecimento')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Revisar Diploma')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Gerar Diploma')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Gerar Diploma')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Prorrogar prazo')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Concluir Despacho por Delegação')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Tarefa de Despacho por Delegação')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Reexecutar Despacho por Delegação')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Editar Evento')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Retificar Expediente')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Agendar Reunião para o Ministro e Director')
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: any = await this.processesbackend.GetTaskListExpediente(false).toPromise();
expedientes = expedientes.filter(data => data.workflowInstanceDataFields.Status == "Active")
expedientes = expedientes.filter((item) => {
@@ -645,19 +594,22 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.pendentesstore.reset(pendentes);
let despachospr = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
let despachosPr;
let depachoAPI: any = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
if(this.loggeduser.Profile != 'PR') {
despachosPr = despachospr.filter(data => data.activityInstanceName == "Tarefa de Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active");
this.count_de_pr = Object.keys(despachosPr).length;
this.despachoprstore.count = this.count_de_pr;
this.despachoprstore.reset(despachosPr)
let depacho = depachoAPI.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
depacho = depacho.filter(data => data.workflowInstanceDataFields.Status == "Active");
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
this.despachoprstore.reset(depacho)
} else if(this.loggeduser.Profile == 'PR') {
despachosPr = despachospr.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
this.count_de_pr = Object.keys(despachosPr).length;
this.despachoprstore.count = this.count_de_pr;
this.despachoprstore.reset(despachosPr)
let depacho = depachoAPI.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
this.despachoprstore.reset(depacho)
}
let mdEventsOficial = await this.processesbackend.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
@@ -677,18 +629,16 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.eventoaprovacaostore.countPr = eventsPRList.length
this.eventoaprovacaostore.resetpr(eventsPRList);
let diplomasValidar = despachospr.filter(data => data.activityInstanceName == "Revisar Diploma");
let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma");
this.count_dip_pv = Object.keys(diplomasValidar).length;
this.deplomasStore.resetDiplomasReview(diplomasValidar)
this.deplomasStore.deplomasReviewCount = this.count_dip_pv
let diplomasAssinar = despachospr.filter(data => data.activityInstanceName == "Assinar Diploma");
this.count_dip_as = Object.keys(diplomasAssinar).length;
this.deplomasStore.resetDiplomasList(diplomasAssinar)
let diplomasAssinar = depachoAPI.filter(data => data.activityInstanceName == "Assinar Diploma");
let diplomasAssinados = despachospr.filter(data => data.activityInstanceName == "Diploma Assinado");
this.count_dip_as_pr = Object.keys(diplomasAssinados).length;
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
let diplomasAssinados = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
this.processesbackend.GetToApprovedEvents('Agenda', 'true').subscribe(res => {
@@ -885,6 +835,24 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}
}
openDiplomaPorElaborar(segment: string) {
let navigationExtras: NavigationExtras = { queryParams: { "gerarDiplomas": true }}
this.segment = segment;
if (window.innerWidth < 701) {
// this.router.navigate(['/home/gabinete-digital/diplomas'], navigationExtras);
}
else {
this.closeAllDesktopComponents();
this.segment = segment;
let navigationExtras: NavigationExtras = { queryParams: { "gerarDiplomas": true, } };
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
this.showDiplomasGerar = true
}
}
openDiplomasAssinarPage() {
this.closeAllDesktopComponents();
if (window.innerWidth < 701) {
@@ -426,10 +426,12 @@ export class PedidoPage implements OnInit {
}
sendExpedienteToPending() {
const loader = this.toastService.loading()
this.processes.SetTaskToPending(this.serialnumber).subscribe(res => {
this.goBack();
loader.remove()
}, () => {
loader.remove()
this.toastService._badRequest('Processo não encontrado')
});
}
@@ -28,15 +28,14 @@
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="{{minDate}}"
max="2025"
class="d-block d-md-none">
max="2025">
</ion-datetime>
<mat-form-field appearance="none" class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date*"
[formControl]="dateControlEnd"
[formControl]="folder.DateBegin"
[min]="minDate"
[disabled]="disabled"
>
@@ -68,18 +67,18 @@
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="{{minDate}}"
max="2022">
max="2025">
</ion-datetime>
<mat-form-field class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="picker1"
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date*"
[formControl]="dateControlEnd"
[min]="minDate"
[formControl]="folder.DateEnd"
[min]="maxDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
@@ -22,13 +22,14 @@ export class EditActionPage implements OnInit {
public showSeconds = false;
public touchUi = false;
public enableMeridian = false;
public minDate = new Date().toISOString().slice(0,10)
public minDate = new Date().toISOString()
public maxDate: any;
public stepHour = 1;
public stepMinute = 5;
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
currentDate = new Date();
folder: PublicationFolder;
folderId: string;
@@ -64,8 +65,15 @@ export class EditActionPage implements OnInit {
}
get dateValid() {
var validado: boolean;
if (window.innerWidth <= 800) {
return this.folder.DateBegin < this.folder.DateEnd? ['ok']: []
if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) {
validado = true;
}else{
validado = false;
}
return validado == true ? ['ok']: [];
} else {
return ['ok']
}
@@ -89,6 +97,11 @@ export class EditActionPage implements OnInit {
}
async save() {
this.injectValidation()
this.runValidation()
if(this.Form.invalid) return false
let body = {
ProcessId: this.folderId,
Description: this.folder.Description,
@@ -43,13 +43,14 @@ export class NewActionPage implements OnInit {
public showSeconds = false;
public touchUi = false;
public enableMeridian = false;
public minDate = new Date().toISOString().slice(0,10)
public minDate = new Date().toISOString()
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public stepHour = 1;
public stepMinute = 5;
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
currentDate = new Date();
showLoader = false
@@ -94,8 +95,15 @@ export class NewActionPage implements OnInit {
}
get dateValid() {
var validado: boolean;
if (window.innerWidth <= 800) {
return this.folder.DateBegin < this.folder.DateEnd? ['ok']: []
if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) {
validado = true;
}else{
validado = false;
}
return validado == true ? ['ok']: [];
} else {
return ['ok']
}
@@ -30,7 +30,7 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src='assets/images/icons-add.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="icon-only" src='assets/images/theme/gov/icons-add.svg'></ion-icon>
</button>
<button title="Atualizar" *ngIf="hideRefreshBtn" class="btn-no-color" (click)="refreshing()">
<button title="Atualizar" class="btn-no-color" (click)="refreshing()">
<ion-icon slot="icon-only" class="title-icon font-awesome" name="reload-circle" title="Actualizar"></ion-icon>
</button>
</div>
@@ -409,6 +409,7 @@ export class PublicationsPage implements OnInit {
goBackToViewPublications() {
this.closeDesktopComponent();
this.idSelected = this.folderId;
this.desktopComponent.showViewPublication = true;
}
@@ -416,6 +417,7 @@ export class PublicationsPage implements OnInit {
// Emitters
goBackToPubications() {
this.closeDesktopComponent();
this.idSelected = this.folderId;
this.desktopComponent.showViewPublication = true;
}
@@ -437,6 +439,7 @@ export class PublicationsPage implements OnInit {
// edit publication will send null
if (folderId != undefined) {
this.folderId = folderId;
this.idSelected = this.folderId;
}
this.publication = publication;
@@ -445,6 +448,7 @@ export class PublicationsPage implements OnInit {
async editPublication(foolderId: string) {
this.closeDesktopComponent();
this.idSelected = this.folderId;
this.desktopComponent.showEditActions = true;
}
@@ -453,6 +457,7 @@ export class PublicationsPage implements OnInit {
this.publicationId = publicationId;
this.closeDesktopComponent();
this.idSelected = this.folderId;
this.desktopComponent.showPublicationDetail = true;
}
-3
View File
@@ -11,10 +11,7 @@
<ion-progress-bar type="indeterminate" class="loader" *ngIf="showLoader"></ion-progress-bar>
<div class="top-box d-flex ion-justify-content-between">
<!-- search -->
<div *ngIf="!showAdvanceSearch" class="icon-z icon-most-searched-word-open cursor-pointer" (click)="showHideAdvanceSearch(true)">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-most-searched-words-open.svg" class="icon" slot="end"></ion-icon>
+8 -3
View File
@@ -242,6 +242,9 @@ export class SearchPage implements OnInit {
*/
basicSearch() {
alert('shear')
if(this.type == "Agenda" ){
@@ -640,7 +643,7 @@ export class SearchPage implements OnInit {
}
async openOrganicEntitySelection(){
async openOrganicEntitySelection() {
let classs;
if( window.innerWidth <= 1024){
@@ -694,13 +697,16 @@ export class SearchPage implements OnInit {
const ApplicationType = searchDocument.ApplicationType.toString()
const Id = searchDocument.Id
const CalendarId = searchDocument.ApplicationName.split(':')[1]
if(this.select == false) {
if(this.type == "Agenda") {
const modal = await this.modalCtrl.create({
component: ViewEventPage,
componentProps:{
componentProps: {
eventId: Id,
CalendarId: CalendarId,
isModal: true,
header: false
},
@@ -717,7 +723,6 @@ export class SearchPage implements OnInit {
if(ApplicationType == '8' || ApplicationType == '361') {
// alert('view!!')
this.viewDocumentDetail(Id, ApplicationType);
}
}
+1 -1
View File
@@ -58,7 +58,7 @@ export class AlertService {
handler: () => {
//const loader = this.toastService.loading();
this.wsChatMethodsService.deleteMessage(msgId).then(()=>{
this.wsChatMethodsService.deleteMessage(msgId).then(() => {
room.deleteMessage(msgId)
})
//this.wsChatMethodsService.subscribeToRoomUpdate(room._id, room);
+345 -315
View File
@@ -14,26 +14,338 @@ import { SessionStore } from '../store/session.service';
})
export class ChatService {
headers: HttpHeaders;
options:any;
options1:any;
X_User_Id:any;
X_Auth_Token:any;
loggedUserChat:any;
options: any;
options1: any;
X_User_Id: any;
X_Auth_Token: any;
loggedUserChat: any;
bindOnMessage: any;
constructor(
private http:HttpClient,
private http: HttpClient,
private httpService: HttpService,
private authService: AuthService,
private storage: Storage,
private storageService:StorageService,
private storageService: StorageService,
public p: PermissionService) {
if(this.p.userPermission(this.p.permissionList.Chat.access)) {
this.loggedUserChat = authService.ValidatedUserChat;
this.headers = new HttpHeaders();
this.setheader()
if(this.p.userPermission(this.p.permissionList.Chat.access)) {
}
getDocumentDetails(url: string) {
let headersc = new HttpHeaders();
headersc = headersc.set('X-User-Id', this.loggedUserChat['data'].userId);
headersc = headersc.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
headersc = headersc.set('Sec-Fetch-Dest', 'attachment');
headersc = headersc.set('Sec-Fetch-Mode', 'navigate');
headersc = headersc.set('Cookie', 'rc_uid=fsMwcNdufWvdnChj7');
headersc = headersc.set('Cookie', 'rc_token=MLbhikLQI4xo9_vL43HqheKPPbxjag7hKfwxe9AjcvY');
// headersc = headersc.set("Host", "www.tabularium.pt");
// headersc = headersc.set("Origin", "http://localhost:8100");
headersc = headersc.set('Referer', 'http://localhost:8100/');
let optionsc = {
headers: headersc,
withCredentials: true
};
// let fullUrl = "https://www.tabularium.pt/" + url;
return this.http.get(url, optionsc).subscribe(() => {
// this.fileService.viewDocumentByUrl(url)
});
}
getAllChannels() {
return this.http.get(environment.apiChatUrl + 'channels.list', this.options);
}
getAllUserChannels() {
return this.http.get(environment.apiChatUrl + 'channels.list.joined', this.options);
}
getAllRooms() {
return this.http.get(environment.apiChatUrl + 'rooms.get', this.options);
}
getRoomInfo(roomId: any) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl + 'rooms.info', opts);
}
customsRooms(params: any) {
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl + 'rooms.get', opts);
}
getAllPrivateGroups() {
return this.http.get(environment.apiChatUrl + 'groups.list', this.options);
}
getAllUsers() {
console.log(this.options)
return this.http.get(environment.apiChatUrl + 'users.list', this.options);
}
getAllConnectedUsers() {
return this.http.get(environment.apiChatUrl + 'users.presence', this.options);
}
//Load messages from roomId
getAllDirectMessages() {
return this.http.get(environment.apiChatUrl + 'im.list', this.options);
}
//Load messages from roomId
getRoomMessages(roomId: any) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params,
}
return this.http.get(environment.apiChatUrl + 'im.history', opts);
}
sendMessage(body: any) {
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl + 'chat.sendMessage', body, opts);
}
uploadFile(formData: any, rid: string) {
let url = environment.apiChatUrl + 'rooms.upload/' + rid;
let opts = {
headers: this.headers,
}
return this.http.post(url, formData, opts);
}
deleteMessage(body: any) {
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl + 'chat.delete', body, opts);
}
leaveRoom(body: any) {
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl + 'rooms.leave', body, opts);
}
//Load members from a chat
getMembers(roomId: any) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl + 'im.members', opts);
}
getMemberInfo(userId: string) {
let params = new HttpParams();
params = params.set("userId", userId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl + 'users.info', opts);
}
setUserStatus(body: any) {
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl + 'users.setStatus', body, this.options);
}
removeChatRoom(body: any) {
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl + 'im.delete', body, this.options);
}
createRoom(body: any) {
return this.http.post(environment.apiChatUrl + 'im.create', body, this.options);
}
getDirectMessage(roomId: string) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl + 'im.messages', opts);
}
/* GROUPS */
addGroup(body: any) {
return this.http.post(environment.apiChatUrl + 'groups.create', body, this.options);
}
setGroupCustomFields(body: any) {
return this.http.post(environment.apiChatUrl + 'groups.setCustomFields', body, this.options);
}
getGroupMembers(roomId: string) {
let params = new HttpParams();
let url = environment.apiChatUrl + 'groups.members';
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(url, opts);
}
getChannelMembers(roomId: string) {
let params = new HttpParams();
let url = environment.apiChatUrl + 'channels.members';
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(url, opts);
}
/* GROUP MESSAGES */
getPrivateGroupMessages(roomId: any) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl + 'groups.history', opts);
}
getPublicGroupMessages(roomId: any) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl + 'channels.history', opts);
}
closeGroup(body: any) {
return this.http.post(environment.apiChatUrl + 'groups.close', body, this.options);
}
closeChannel(body: any) {
return this.http.post(environment.apiChatUrl + 'channels.close', body, this.options);
}
leaveGroup(body: any) {
return this.http.post(environment.apiChatUrl + 'groups.leave', body, this.options);
}
leaveChannel(body: any) {
return this.http.post(environment.apiChatUrl + 'channels.leave', body, this.options);
}
removeChannelMember(body: any) {
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl + 'channels.kick', body, opts);
}
addChannelOwner(body: any) {
return this.http.post(environment.apiChatUrl + 'channels.addOwner', body, this.options);
}
addGroupOwner(body: any) {
return this.http.post(environment.apiChatUrl + 'groups.addOwner', body, this.options);
}
deleteGroup(body: any) {
return this.http.post(environment.apiChatUrl + 'groups.delete', body, this.options);
}
deleteChannel(body: any) {
return this.http.post(environment.apiChatUrl + 'channels.delete', body, this.options);
}
addUserToGroup(body: any) {
return this.http.post(environment.apiChatUrl + 'groups.invite', body, this.options);
}
getGroupInfo(roomId: any) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl + 'groups.info', opts);
}
renameGroup(body: any) {
return this.http.post(environment.apiChatUrl + 'groups.rename', body, this.options);
}
removeGroupMember(body: any) {
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl + 'groups.kick', body, opts);
}
async subscribe(roomId: any) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
this.http.get(environment.apiChatUrl + 'im.messages', opts).subscribe(async res => {
if (res == 502) {
// Connection timeout
// happens when the connection was pending for too long
// let's reconnect
await this.subscribe(roomId);
} else if (res != 200) {
// Show Error
//showMessage(response.statusText);
this.getRoomMessages(roomId)
// Reconnect in one second
await new Promise(resolve => setTimeout(resolve, 1000));
await this.subscribe(roomId);
} else {
// Got message
//let message = await response.text();
this.getRoomMessages(roomId)
await this.subscribe(roomId);
}
})
}
setheader() {
try {
if (this.p.userPermission(this.p.permissionList.Chat.access)) {
this.loggedUserChat = this.authService.ValidatedUserChat;
this.headers = new HttpHeaders();
if (this.p.userPermission(this.p.permissionList.Chat.access)) {
//
this.headers = this.headers.set('X-User-Id', SessionStore.user.ChatData.data.userId);
this.headers = this.headers.set('X-Auth-Token', SessionStore.user.ChatData.data.authToken);
@@ -41,313 +353,31 @@ export class ChatService {
headers: this.headers,
};
}
}
} catch (error) {
console.log(error)
}
}
getDocumentDetails(url:string) {
let headersc = new HttpHeaders();
headersc = headersc.set('X-User-Id', this.loggedUserChat['data'].userId);
headersc = headersc.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
headersc = headersc.set('Sec-Fetch-Dest', 'attachment');
headersc = headersc.set('Sec-Fetch-Mode', 'navigate');
headersc = headersc.set('Cookie', 'rc_uid=fsMwcNdufWvdnChj7');
headersc = headersc.set('Cookie', 'rc_token=MLbhikLQI4xo9_vL43HqheKPPbxjag7hKfwxe9AjcvY');
// headersc = headersc.set("Host", "www.tabularium.pt");
// headersc = headersc.set("Origin", "http://localhost:8100");
headersc = headersc.set('Referer', 'http://localhost:8100/');
let optionsc = {
headers: headersc,
withCredentials: true
};
// let fullUrl = "https://www.tabularium.pt/" + url;
return this.http.get(url, optionsc).subscribe(()=>{
// this.fileService.viewDocumentByUrl(url)
});
}
getAllChannels() {
return this.http.get(environment.apiChatUrl+'channels.list', this.options);
}
getAllUserChannels() {
return this.http.get(environment.apiChatUrl+'channels.list.joined', this.options);
}
getAllRooms() {
return this.http.get(environment.apiChatUrl+'rooms.get', this.options);
}
getRoomInfo(roomId:any) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'rooms.info', opts);
}
customsRooms(params:any){
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'rooms.get', opts);
}
getAllPrivateGroups(){
return this.http.get(environment.apiChatUrl+'groups.list', this.options);
}
getAllUsers(){
return this.http.get(environment.apiChatUrl+'users.list', this.options);
}
getAllConnectedUsers(){
return this.http.get(environment.apiChatUrl+'users.presence', this.options);
}
//Load messages from roomId
getAllDirectMessages(){
return this.http.get(environment.apiChatUrl+'im.list', this.options);
}
//Load messages from roomId
getRoomMessages(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params,
}
return this.http.get(environment.apiChatUrl+'im.history', opts);
}
sendMessage(body:any) {
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'chat.sendMessage', body, opts);
}
uploadFile(formData:any, rid:string){
let url = environment.apiChatUrl+'rooms.upload/'+rid;
let opts = {
headers: this.headers,
}
return this.http.post(url, formData, opts);
}
deleteMessage(body:any){
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'chat.delete', body, opts);
}
leaveRoom(body:any){
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'rooms.leave', body, opts);
}
//Load members from a chat
getMembers(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'im.members', opts);
}
getMemberInfo(userId:string){
let params = new HttpParams();
params = params.set("userId", userId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'users.info', opts);
}
setUserStatus(body:any){
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'users.setStatus', body, this.options);
}
removeChatRoom(body:any){
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'im.delete', body, this.options);
}
createRoom(body:any){
return this.http.post(environment.apiChatUrl+'im.create', body, this.options);
}
getDirectMessage(roomId:string){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'im.messages', opts);
}
/* GROUPS */
addGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.create', body, this.options);
}
setGroupCustomFields(body:any){
return this.http.post(environment.apiChatUrl+'groups.setCustomFields', body, this.options);
}
getGroupMembers(roomId:string){
let params = new HttpParams();
let url=environment.apiChatUrl+'groups.members';
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(url, opts);
}
getChannelMembers(roomId:string){
let params = new HttpParams();
let url=environment.apiChatUrl+'channels.members';
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(url, opts);
}
/* GROUP MESSAGES */
getPrivateGroupMessages(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'groups.history', opts);
}
getPublicGroupMessages(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'channels.history', opts);
}
closeGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.close', body, this.options);
}
closeChannel(body:any){
return this.http.post(environment.apiChatUrl+'channels.close', body, this.options);
}
leaveGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.leave', body, this.options);
}
leaveChannel(body:any){
return this.http.post(environment.apiChatUrl+'channels.leave', body, this.options);
}
removeChannelMember(body:any){
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'channels.kick', body, opts);
}
addChannelOwner(body:any){
return this.http.post(environment.apiChatUrl+'channels.addOwner', body, this.options);
}
addGroupOwner(body:any){
return this.http.post(environment.apiChatUrl+'groups.addOwner', body, this.options);
}
deleteGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.delete', body, this.options);
}
deleteChannel(body:any){
return this.http.post(environment.apiChatUrl+'channels.delete', body, this.options);
}
addUserToGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.invite', body, this.options);
}
getGroupInfo(roomId:any){
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
return this.http.get(environment.apiChatUrl+'groups.info', opts);
}
renameGroup(body:any){
return this.http.post(environment.apiChatUrl+'groups.rename', body, this.options);
}
removeGroupMember(body:any){
let opts = {
headers: this.headers,
}
return this.http.post(environment.apiChatUrl+'groups.kick', body, opts);
}
async subscribe(roomId:any) {
let params = new HttpParams();
params = params.set("roomId", roomId);
let opts = {
headers: this.headers,
params: params
}
this.http.get(environment.apiChatUrl+'im.messages', opts).subscribe(async res => {
if (res == 502) {
// Connection timeout
// happens when the connection was pending for too long
// let's reconnect
await this.subscribe(roomId);
} else if (res != 200) {
// Show Error
//showMessage(response.statusText);
this.getRoomMessages(roomId)
// Reconnect in one second
await new Promise(resolve => setTimeout(resolve, 1000));
await this.subscribe(roomId);
} else {
// Got message
//let message = await response.text();
this.getRoomMessages(roomId)
await this.subscribe(roomId);
refreshtoken() {
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
let options = {
headers: this.headers
};
return this.http.get(environment.apiURL + 'UserAuthentication/RegenereChatToken', options).subscribe(async res => {
let data = {
status: res['status'],
data: {
userId: res['data'].userId,
authToken: res['data'].authToken
}
})
}
}
SessionStore.user.ChatData = data
SessionStore.save()
this.setheader()
console.log(res)
console.log(SessionStore.user.ChatData)
});
}
}
+62 -6
View File
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
import { MessageService } from 'src/app/services/chat/message.service';
import { showDateDuration } from 'src/plugin/showDateDuration';
import { ToastsService } from '../toast.service';
import { chatHistory } from 'src/app/models/chatMethod';
import { Storage } from '@ionic/storage';
import { Platform } from '@ionic/angular';
@@ -16,13 +15,14 @@ import { environment } from 'src/environments/environment';
import { ChatService } from 'src/app/services/chat.service';
import { NfService } from 'src/app/services/chat/nf.service';
import { v4 as uuidv4 } from 'uuid'
import { ChatStorageService } from './chat-storage.service'
import { ChatMethodsService } from './chat-methods.service'
import { DeleteMessageModel, MessageModel } from '../../models/beast-orm'
import { AESEncrypt } from '../aesencrypt.service'
import { ChatStorageService } from './chat-storage.service';
import { ChatMethodsService } from './chat-methods.service';
import { DeleteMessageModel, MessageModel } from '../../models/beast-orm';
import { AESEncrypt } from '../aesencrypt.service';
import { IncomingChatMessage, ChatMessageInterface, falseTypingMethod } from 'src/app/models/message.model';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { ConnectionStatus, NetworkServiceService} from 'src/app/services/network-service.service';
import { WsChatMethodsService } from './ws-chat-methods.service';
@Injectable({
providedIn: 'root'
@@ -52,6 +52,7 @@ export class RoomService {
members = []
u
sessionStore = SessionStore
countDownTime = ''
scrollDown = () => { }
@@ -80,7 +81,8 @@ export class RoomService {
private ChatMethodsService: ChatMethodsService,
private AESEncrypt: AESEncrypt,
private AttachmentsService: AttachmentsService,
private NetworkServiceService: NetworkServiceService
private NetworkServiceService: NetworkServiceService,
private wsChatMethodsService: WsChatMethodsService
) {
this.NativeNotificationService.askForPermission()
@@ -157,6 +159,60 @@ export class RoomService {
this.calDateDuration()
this.restoreMessageFromDB()
if(this.customFields?.countDownDate) {
this.countDownDate(this.customFields.countDownDate);
}
}
countDownDate(date) {
let difference = new Date(date).getTime() - new Date().getTime();
let c_day = Math.floor(difference/(1000*60*60*24));
let c_hours = Math.floor((difference % (1000*60*60*24)) / (1000*60*60));
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
if(difference < 0) {
this.deleteRoom()
} else {
setTimeout(() => {
this.countDownDate(date)
}, 1000)
}
}
addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
deleteRoom() {
this.countDownTime = "Expired";
let body = { "roomId": this.id }
this.chatService.getRoomInfo(this.id).subscribe(room=>{
if(this.t === 'p') {
this.chatService.deleteGroup(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.id);
this.wsChatMethodsService.getAllRooms();
});
}
else {
this.chatService.deleteChannel(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.id);
this.wsChatMethodsService.getAllRooms();
});
}
});
}
@@ -14,7 +14,6 @@ import { SortService } from '../functions/sort.service';
import { chatUser } from 'src/app/models/chatMethod';
import { NfService } from 'src/app/services/chat/nf.service'
import { ChangeProfileService } from '../change-profile.service';
import { UserSession } from 'src/app/models/user.model';
import { AuthService } from '../auth.service';
import { ChatStorageService } from './chat-storage.service';
import { ChatMethodsService } from './chat-methods.service';
@@ -60,7 +59,7 @@ export class WsChatMethodsService {
private ChatMethodsService:ChatMethodsService,
private AESEncrypt: AESEncrypt,
private AttachmentsService:AttachmentsService,
private NetworkServiceService: NetworkServiceService
private NetworkServiceService: NetworkServiceService,
) {
this.loggedUser = authService.ValidatedUserChat['data'];
@@ -106,14 +105,14 @@ export class WsChatMethodsService {
}
async ReLoadChat() {
await this.restoreRooms()
await this.restoreRooms();
await this.getAllRooms();
this.subscribeToRoom()
this.subscribeToRoom();
//
await this.getUser()
this.getUserStatus()
await this.getUser();
this.getUserStatus();
}
clearChat() {
@@ -321,11 +320,11 @@ export class WsChatMethodsService {
members: roomData.members
}
let roomId = this.getRoomId(roomData)
let roomId = this.getRoomId(roomData);
// create room
if(!this.roomExist(roomId)) {
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this)
room.setData(setData)
room.receiveMessage()
room.getAllUsers = this.getUsers
@@ -365,10 +364,7 @@ export class WsChatMethodsService {
deleteRoom(roomId) {
delete this.group[roomId];
const index = this._group.findIndex((e)=> e.id == roomId);
this._group = this._group.splice(index, 1);
this._group = this._group.filter((e)=> e.id != roomId);
}
roomExist(roomId) {
@@ -463,7 +459,7 @@ export class WsChatMethodsService {
}
addRoomOwner(roomid, userId){
addRoomOwner(roomid, userId) {
return this.WsChatService.addRoomOwner(roomid, userId);
}
+4 -1
View File
@@ -29,7 +29,10 @@ export class ClearStoreService {
PedidosStore.resetparecer([])
DespachosprStore.reset([])
DeplomasStore.resetDiplomasAssinadoList([])
DeplomasStore.resetDiplomasList([])
DeplomasStore.resetDiplomaGerar([])
DeplomasStore.resetDiplomasAssinadoList([])
DeplomasStore.resetDiplomasReview([])
DeplomasStore.resetDiplomasParaAssinar([])
DeplomasStore.resetDiplomasReview([])
CalendarStore.delete()
CalendarStore.ResetList([])
+38 -37
View File
@@ -1,5 +1,6 @@
import { Injectable } from '@angular/core';
import { ChatService } from '../chat.service';
import { WsChatMethodsService } from '../chat/ws-chat-methods.service';
@Injectable({
providedIn: 'root'
@@ -8,14 +9,13 @@ export class TimeService {
countDownTime: any;
room: any;
constructor(private chatService: ChatService) { }
constructor(private chatService: ChatService,
public wsChatMethodsService: WsChatMethodsService,) { }
showDateDuration(start:any){
showDateDuration(start:any) {
let end;
end = new Date();
start = new Date(start);
let customizedDate;
const totalSeconds = Math.floor((end - (start))/1000);;
const totalMinutes = Math.floor(totalSeconds/60);
@@ -26,51 +26,51 @@ export class TimeService {
const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );
const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );
if(totalDays == 0){
if(start.getDate() == new Date().getDate()){
if(totalDays == 0) {
if(start.getDate() == new Date().getDate()) {
let time = start.getHours() + ":" + this.addZero(start.getUTCMinutes());
return time;
}
else{
else {
return 'Ontem';
}
}
else{
else {
let date = this.addZero(start.getDate()) + "/" + this.addZero(start.getMonth()+1) + "/" + start.getFullYear();
return date;
}
}
countDownDate(date:any, roomId:string){
/* let timer = setInterval(() =>{ */
let difference = new Date(date).getTime() - new Date().getTime();
let c_day = Math.floor(difference/(1000*60*60*24));
let c_hours = Math.floor((difference % (1000*60*60*24)) / (1000*60*60));
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
let difference = new Date(date).getTime() - new Date().getTime();
let c_day = Math.floor(difference/(1000*60*60*24));
let c_hours = Math.floor((difference % (1000*60*60*24)) / (1000*60*60));
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
if(difference < 0){
//clearInterval(timer);
this.countDownTime = "Expired";
let body = { "roomId":roomId, }
this.chatService.getRoomInfo(roomId).subscribe(room=>{
this.room = room['room'];
if(difference < 0){
if(this.room.t === 'p'){
this.chatService.deleteGroup(body).subscribe(res=>{
});
}
else{
this.chatService.deleteChannel(body).subscribe(res=>{
});
}
});
}
//})
this.countDownTime = "Expired";
let body = { "roomId":roomId, }
this.chatService.getRoomInfo(roomId).subscribe(room=>{
this.room = room['room'];
if(this.room.t === 'p'){
this.chatService.deleteGroup(body).subscribe(res=>{
});
}
else{
this.chatService.deleteChannel(body).subscribe(res=>{
});
}
});
}
return this.countDownTime;
}
@@ -84,7 +84,7 @@ export class TimeService {
this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
if(difference < 0){
if(difference < 0) {
clearInterval(timer);
this.countDownTime = "Expired";
let body = { "roomId":roomId, }
@@ -93,12 +93,13 @@ export class TimeService {
if(this.room.t === 'p'){
this.chatService.deleteGroup(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(roomId)
});
}
else{
this.chatService.deleteChannel(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(roomId)
});
}
});
+3 -3
View File
@@ -11,7 +11,7 @@ export class InativityService {
private router: Router,
) {
var t;
var time;
window.onload = resetTimer;
window.onmousemove = resetTimer;
window.onmousedown = resetTimer; // catches touchscreen presses as well
@@ -28,8 +28,8 @@ export class InativityService {
}
function resetTimer() {
clearTimeout(t);
t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds
clearTimeout(time);
time = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds
}
}
}
@@ -66,9 +66,14 @@
<ion-label>
<p>{{customDate}}</p>
<p *ngIf="toDateString(loadedEvent.workflowInstanceDataFields.StartDate) == toDateString(loadedEvent.workflowInstanceDataFields.EndDate)">das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'HH:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
<p *ngIf="toDateString(loadedEvent.workflowInstanceDataFields.StartDate) != toDateString(loadedEvent.workflowInstanceDataFields.EndDate)">{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.StartDate | date: 'dd/M/yy'}} </p>
<p *ngIf="!loadedEvent.workflowInstanceDataFields.IsRecurring">(Não se repete)</p>
<p *ngIf="loadedEvent.workflowInstanceDataFields.IsRecurring">Repete</p>
<p *ngIf="toDateString(loadedEvent.workflowInstanceDataFields.StartDate) != toDateString(loadedEvent.workflowInstanceDataFields.EndDate)">{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} </p>
<p>
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 0">Diário</span>
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 1">Semanal</span>
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 2">Mensal</span>
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 3">Anual</span>
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == -1">(Não se repete)</span>
</p>
</ion-label>
</div>
@@ -71,6 +71,7 @@ export class ApproveEventPage implements OnInit {
this.processes.GetTask(this.serialNumber).subscribe(res => {
this.loadedEvent = res;
console.log(this.loadedEvent);
this.today = new Date(res.workflowInstanceDataFields.StartDate);
//
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
@@ -86,9 +87,9 @@ export class ApproveEventPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.modalController.dismiss(serialNumber);
this.toastService.successMessage()
this.toastService._successMessage()
} catch (error) {
this.toastService.badRequest()
this.toastService._badRequest()
} finally {
this.close()
loader.remove()
@@ -105,9 +106,9 @@ export class ApproveEventPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage('Evento rejeitado')
this.toastService._successMessage('Evento rejeitado')
} catch (error) {
this.toastService.badRequest('Processo não efectuado')
this.toastService._badRequest('Processo não efectuado')
} finally {
loader.remove()
this.close()
@@ -171,8 +172,7 @@ export class ApproveEventPage implements OnInit {
modal.onDidDismiss()
.then( async (res) => {
if(res.data !== '') {
if(res.data.note !== '') {
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
@@ -184,17 +184,19 @@ export class ApproveEventPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService.successMessage('Pedido enviado');
this.toastService._successMessage('Pedido enviado');
this.close();
} catch (error) {
this.toastService.badRequest();
this.toastService._badRequest();
} finally {
loader.remove()
}
}
else{
}
else {
if(res.data.option == 'save') {
this.toastService._badRequest('É necessário adicionar uma nota');
}
}
});
}
@@ -2,14 +2,13 @@
<!-- Edit event for Inicio -->
<div class="main-content height-100 d-flex">
<div class="content d-flex flex-column width-md-100 height-100">
<div class="main-header pt-30 px-20 background-white pb-15">
<ion-header>
<div class="title-content">
<div class="middle">
<ion-label class="title">Editar evento por aprovar </ion-label>
<ion-label class="title">Editar evento por aprovar</ion-label>
</div>
</div>
</ion-header>
@@ -157,7 +156,8 @@
<mat-form-field appearance="none" class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date"
[formControl]="dateControlStart"
[(ngModel)]="eventProcess.workflowInstanceDataFields.StartDate"
[min]="minDate" [max]="maxDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
@@ -192,7 +192,8 @@
<mat-form-field appearance="none" class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date"
[formControl]="dateControlEnd"
[(ngModel)]="eventProcess.workflowInstanceDataFields.EndDate"
[min]="endMinDate" [max]="maxDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
@@ -366,6 +367,6 @@
<ion-footer class="background-whit">
<div class="buttons">
<button class="btn-cancel cursor-pointer" shape="round" (click)="close()">Cancelar</button>
<button class="btn-ok cursor-pointer" shape="round" (click)="save()">Gravar</button>
<button class="btn-ok cursor-pointer" shape="round" (click)="gravasAction()">Gravar</button>
</div>
</ion-footer>
@@ -41,7 +41,7 @@ export class EditEventToApprovePage implements OnInit {
public showSeconds = false;
public touchUi = false;
public enableMeridian = false;
public minDate = new Date().toISOString().slice(0,10)
public minDate = new Date()
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
public maxDate: any;
public stepHour = 1;
@@ -150,7 +150,7 @@ export class EditEventToApprovePage implements OnInit {
async getTask() {
this.processes.GetTask(this.serialNumber).subscribe( (result) =>{
this.processes.GetTask(this.serialNumber).subscribe( (result) => {
this.eventProcess = result
this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence)
@@ -179,6 +179,9 @@ export class EditEventToApprovePage implements OnInit {
}
onSelectedRecurringChanged(ev:any) {
this.calculetedLastOccurrence(ev);
if(ev.length > 1) {
this.eventProcess.workflowInstanceDataFields.OccurrenceType = ev.filter(data => data != '-1');
@@ -188,6 +191,44 @@ export class EditEventToApprovePage implements OnInit {
}
}
calculetedLastOccurrence(type:number){
var valor;
var opcao: boolean;
if (type == 0) {
valor = 7;
opcao = true;
} else if(type == 1){
valor = 30;
opcao = true;
} else if(type == 2){
valor = 1;
opcao = false;
}else if(type == 3){
valor = 5;
opcao = false;
}
this.defineLastOccurrence(valor, opcao);
}
defineLastOccurrence(valor:number, opcao:boolean){
var time = new Date(this.eventProcess.workflowInstanceDataFields.EndDate);
if (opcao == true) {
time.setDate(time.getDate() + valor);
this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;
} else {
time = new Date(
time.getFullYear() + valor,
time.getMonth(),
time.getDate(),
time.getHours(),
time.getMinutes()
);
this.eventProcess.workflowInstanceDataFields.LastOccurrence = time;
}
}
setOtherData() {
if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) {
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
@@ -223,14 +264,12 @@ export class EditEventToApprovePage implements OnInit {
this.setIntervenientCC.emit([]);
this.clearContact.emit();
this.approveEventDismiss.emit({
"serialNumber": this.eventProcess.serialNumber,
"action": "Aprovar",
"saveData": this.eventProcess
serialNumber: this.eventProcess.serialNumber,
action: "Aprovar",
saveData: this.eventProcess
});
}
@@ -276,7 +315,10 @@ export class EditEventToApprovePage implements OnInit {
if(this.Form.invalid) return false
// set dates to eventProcess object
this.getDatepickerData()
this.dateControlStart = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)).add(1, 'hours'));
this.dateControlEnd = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)).add(1, 'hours'));
// this.restoreDatepickerData()
// this.getDatepickerData()
this.taskParticipantsCc.forEach( e => {
e.IsRequired = false
@@ -291,13 +333,14 @@ export class EditEventToApprovePage implements OnInit {
}
})
const event: EventToApproveEdit = {
SerialNumber: this.eventProcess.serialNumber,
Body: this.eventProcess.workflowInstanceDataFields.Body,
Location: this.eventProcess.workflowInstanceDataFields.Location,
Subject: this.eventProcess.workflowInstanceDataFields.Subject,
StartDate: this.eventProcess.workflowInstanceDataFields.StartDate,
EndDate: this.eventProcess.workflowInstanceDataFields.EndDate,
StartDate: this.dateControlStart.value,
EndDate: this.dateControlEnd.value,
ReviewUserComment: '',
Agenda: this.eventProcess.workflowInstanceDataFields.Agenda,
MDName: this.eventProcess.workflowInstanceDataFields.MDName,
@@ -330,14 +373,14 @@ export class EditEventToApprovePage implements OnInit {
if(document['action'] == 'add') {
delete document.action
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
// this.toastService.successMessage();
}, error =>{
this.toastService.badRequest();
});
} else if(document['action'] == 'delete') {
delete document.action
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
// this.toastService.successMessage()
}, error =>{
this.toastService.badRequest()
})
@@ -347,6 +390,42 @@ export class EditEventToApprovePage implements OnInit {
}
async gravasAction() {
await this.save();
if(this.eventProcess['activityInstanceName'] == 'Editar Evento') {
this.reenviar();
}
}
async reenviar() {
let body = {
serialNumber: this.eventProcess.serialNumber,
action: "Reenviar",
dataFields: {
ReviewUserComment: "",
}
}
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService._successMessage();
this.goToApproveEventList();
} catch (error) {
this.toastService._badRequest();
} finally {
loader.remove()
}
}
goToApproveEventList() {
this.closeEventToApprove.emit();
this.modalController.dismiss();
}
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) {
this.taskParticipants = removeDuplicate(taskParticipants) ;
@@ -472,7 +551,6 @@ export class EditEventToApprovePage implements OnInit {
}
getDatepickerData() {
this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart
this.eventProcess.workflowInstanceDataFields.EndDate = this.dateEnd
@@ -118,6 +118,7 @@
[(ngModel)]="postEvent.StartDate"
[max]="maxDate"
[disabled]="disabled"
[min]="currentDate"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
@@ -146,6 +147,7 @@
[(ngModel)]="postEvent.EndDate"
[max]="maxDate"
[disabled]="disabled"
[min]="currentDate"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim
@@ -48,6 +48,7 @@ export class EditEventPage implements OnInit {
public stepHour = 1;
public stepMinute = 5;
public stepSecond = 5;
currentDate = new Date();
Form: FormGroup;
validateFrom = false
@@ -118,14 +119,6 @@ export class EditEventPage implements OnInit {
this.setIntervenient.emit(this.taskParticipants);
this.setIntervenientCC.emit(this.taskParticipantsCc);
this.isEventEdited = false;
if(this.postEvent.IsRecurring == false) {
this.isRecurring = "Não se repete";
}
else{
this.isRecurring = "Repete";
}
}
this.initCalendarName = this.postEvent.CalendarName;
@@ -136,6 +129,8 @@ export class EditEventPage implements OnInit {
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
this.postEvent.EventRecurrence.LastOccurrence = this.currentDate;
setTimeout(() => {
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
@@ -225,6 +220,8 @@ export class EditEventPage implements OnInit {
}
onSelectedRecurringChanged(ev:any){
this.calculetedLastOccurrence(ev);
if(ev.length > 1){
@@ -235,6 +232,45 @@ export class EditEventPage implements OnInit {
}
}
calculetedLastOccurrence(type:number){
console.log(type);
var valor;
var opcao: boolean;
if (type == 0) {
valor = 7;
opcao = true;
} else if(type == 1){
valor = 30;
opcao = true;
} else if(type == 2){
valor = 1;
opcao = false;
}else if(type == 3){
valor = 5;
opcao = false;
}
this.defineLastOccurrence(valor, opcao);
}
defineLastOccurrence(valor:number, opcao:boolean){
var time = new Date(this.postEvent.EndDate);
if (opcao == true) {
time.setDate(time.getDate() + valor);
this.postEvent.EventRecurrence.LastOccurrence = time;
} else {
time = new Date(
time.getFullYear() + valor,
time.getMonth(),
time.getDate(),
time.getHours(),
time.getMinutes()
);
this.postEvent.EventRecurrence.LastOccurrence = time;
}
}
async save() {
@@ -98,6 +98,7 @@
font-style: normal;
line-height: normal;
letter-spacing: normal;
text-transform: none ;
color: var(--title-text-color);
margin: 0;
padding: 0;
@@ -128,6 +128,7 @@
placeholder="Choose a date"
[(ngModel)]="postEvent.StartDate"
[disabled]="disabled"
[min]="currentDate"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
@@ -159,6 +160,7 @@
placeholder="Choose a date"
[(ngModel)]="postEvent.EndDate"
[disabled]="disabled"
[min]="currentDate"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim
@@ -63,6 +63,7 @@ export class NewEventPage implements OnInit {
public stepHour = 1;
public stepMinute = 5;
public stepSecond = 5;
currentDate = new Date();
public color: ThemePalette = 'primary';
recurringTypes = []
selectedRecurringType: any;
@@ -364,6 +365,8 @@ export class NewEventPage implements OnInit {
onSelectedRecurringChanged(ev:any){
this.calculetedLastOccurrence(ev);
if(ev.length > 1){
this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
@@ -373,8 +376,45 @@ export class NewEventPage implements OnInit {
}
}
calculetedLastOccurrence(type:number){
console.log(type);
var valor;
var opcao: boolean;
if (type == 0) {
valor = 7;
opcao = true;
} else if(type == 1){
valor = 30;
opcao = true;
} else if(type == 2){
valor = 1;
opcao = false;
}else if(type == 3){
valor = 5;
opcao = false;
}
this.defineLastOccurrence(valor, opcao);
}
defineLastOccurrence(valor:number, opcao:boolean){
var time = new Date(this.postEvent.EndDate);
if (opcao == true) {
time.setDate(time.getDate() + valor);
this.postEvent.EventRecurrence.LastOccurrence = time;
} else {
time = new Date(
time.getFullYear() + valor,
time.getMonth(),
time.getDate(),
time.getHours(),
time.getMinutes()
);
this.postEvent.EventRecurrence.LastOccurrence = time;
}
}
async save() {
this.injectValidation()
@@ -53,13 +53,12 @@
<p>{{customDate}}</p>
<p *ngIf="toDateString(loadedEvent.StartDate) == toDateString(loadedEvent.EndDate)">das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}</p>
<p *ngIf="toDateString(loadedEvent.StartDate) != toDateString(loadedEvent.EndDate)">{{loadedEvent.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.StartDate | date: 'dd/M/yy'}} </p>
<p *ngIf="!loadedEvent.IsRecurring">(Não se repete)</p>
<p *ngIf="loadedEvent.IsRecurring">
<p>
<span *ngIf="loadedEvent.EventRecurrence.Type == 0">Diário</span>
<span *ngIf="loadedEvent.EventRecurrence.Type == 1">Semanal</span>
<span *ngIf="loadedEvent.EventRecurrence.Type == 2">Mensal</span>
<span *ngIf="loadedEvent.EventRecurrence.Type == 3">Anual</span>
<span *ngIf="loadedEvent.EventRecurrence.Type == -1">Nunca</span>
<span *ngIf="loadedEvent.EventRecurrence.Type == -1">(Não se repete)</span>
</p>
</ion-label>
@@ -105,6 +105,7 @@ export class ViewEventPage implements OnInit {
this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res;
console.log(this.loadedEvent);
this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
}, (error)=> {
@@ -1,3 +1,4 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ModalController, PickerController } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
@@ -33,6 +34,7 @@ export class EditGroupPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
this.getRoomInfo();
}
@@ -1,4 +1,4 @@
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';
import * as _ from 'lodash';
@@ -57,6 +57,7 @@ export class GroupContactsPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
//this.getRoomInfo();
this.loadUsers();
@@ -34,6 +34,7 @@ import { AlertController } from '@ionic/angular';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorResponse } from '@angular/common/http';
/*
@@ -74,6 +75,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
scrollToBottomBtn = false;
roomCountDownDate: string;
roomCountDownTime: string;
isAdmin = false;
@Input() roomId: string;
@Output() closeAllDesktopComponents: EventEmitter<any> = new EventEmitter<any>();
@@ -159,10 +161,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
ngOnInit() {
this.chatService.refreshtoken();
console.log(this.roomId)
this.loggedUser = this.loggedUserChat;
//setTimeout(() => {
this.getRoomInfo();
this.getRoomInfo()
//}, 1000);
this.getChatMembers();
//this.getMessageDB();
@@ -399,10 +402,18 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
async getRoomInfo() {
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
console.log('ROOM',room)
this.room = room['room'];
if (this.room.name) {
this.roomName = this.room.name.split('-').join(' ');
}
if(SessionStore.user.ChatData.data.userId == this.room.u._id){
this.isAdmin = true
} else {
this.isAdmin = false
}
if (this.room.customFields.countDownDate) {
this.roomCountDownDate = this.room.customFields.countDownDate;
@@ -501,82 +512,84 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
async openGroupMessagesOptions() {
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!)
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
const wrapperAnimation = this.animationController.create()
.addElement(baseEl.querySelector('.modal-wrapper')!)
.keyframes([
{ offset: 0, opacity: '1', right: '-100%' },
{ offset: 1, opacity: '1', right: '0px' }
]);
return this.animationController.create()
.addElement(baseEl)
.easing('ease-out')
.duration(500)
.addAnimation([backdropAnimation, wrapperAnimation]);
}
const leaveAnimation = (baseEl: any) => {
return enterAnimation(baseEl).direction('reverse');
}
/* const popover = await this.popoverController.create({
component: MessagesOptionsPage,
componentProps: {
roomId: this.dm._id,
},
cssClass: 'messages-options',
event: ev,
translucent: true,
});
return await popover.present(); */
const enterAnimation = (baseEl: any) => {
const backdropAnimation = this.animationController.create()
.addElement(baseEl.querySelector('ion-backdrop')!)
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
const wrapperAnimation = this.animationController.create()
.addElement(baseEl.querySelector('.modal-wrapper')!)
.keyframes([
{ offset: 0, opacity: '1', right: '-100%' },
{ offset: 1, opacity: '1', right: '0px' }
]);
return this.animationController.create()
.addElement(baseEl)
.easing('ease-out')
.duration(500)
.addAnimation([backdropAnimation, wrapperAnimation]);
}
const leaveAnimation = (baseEl: any) => {
return enterAnimation(baseEl).direction('reverse');
}
/* const popover = await this.popoverController.create({
component: MessagesOptionsPage,
componentProps: {
roomId: this.dm._id,
},
cssClass: 'messages-options',
event: ev,
translucent: true,
});
return await popover.present(); */
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
component: ChatPopoverPage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
roomId: this.roomId,
members: this.members,
isAdmin: this.isAdmin
}
});
await modal.present();
modal.onDidDismiss().then(res => {
if (res.data == 'leave') {
this.getRoomInfo();
this.closeAllDesktopComponents.emit();
this.showEmptyContainer.emit();
this.wsChatMethodsService.hidingRoom(this.roomId);
}
else if (res.data == 'delete') {
this.closeAllDesktopComponents.emit();
this.showEmptyContainer.emit();
}
else if (res.data == 'cancel') {
}
else if (res.data == 'edit') {
//this.closeAllDesktopComponents.emit();
this.openEditGroupPage.emit(this.roomId);
}
else {
this.roomName = res.data.name.split('-').join(' ');
};
});
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
component: ChatPopoverPage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
roomId: this.roomId,
members: this.members,
}
});
await modal.present();
modal.onDidDismiss().then(res => {
if (res.data == 'leave') {
this.getRoomInfo();
this.closeAllDesktopComponents.emit();
this.showEmptyContainer.emit();
this.wsChatMethodsService.hidingRoom(this.roomId);
}
else if (res.data == 'delete') {
this.closeAllDesktopComponents.emit();
this.showEmptyContainer.emit();
}
else if (res.data == 'cancel') {
}
else if (res.data == 'edit') {
//this.closeAllDesktopComponents.emit();
this.openEditGroupPage.emit(this.roomId);
}
else {
this.roomName = res.data.name.split('-').join(' ');
};
});
}
openSendGroupMessageOptions(ev?: any) {
@@ -1,4 +1,4 @@
import { HttpHeaders } from '@angular/common/http';
import { HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
@@ -42,7 +42,9 @@ export class ContactsPage implements OnInit {
}
ngOnInit() {
this.loadUsers();
this.chatService.refreshtoken();
}
onChange(event){
@@ -31,6 +31,7 @@ import { AlertController, Platform } from '@ionic/angular';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorResponse } from '@angular/common/http';
const IMAGE_DIR = 'stored-images';
@@ -154,6 +155,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
ngOnInit() {
this.chatService.refreshtoken();
this.scrollToBottom();
this.getChatMembers();
@@ -14,6 +14,7 @@ import { TotalDocumentStore } from 'src/app/store/total-document.service';
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
import { PedidosStore } from 'src/app/store/pedidos-store.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
@@ -50,14 +51,14 @@ export class AllProcessesPage implements OnInit {
ngOnInit() {
this.loadAllProcesses();
// this.loadAllProcesses();
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/gabinete-digital')) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing();
} else {
this.loadAllProcesses();
// this.loadAllProcesses();
}
}
});
@@ -66,7 +67,7 @@ export class AllProcessesPage implements OnInit {
doRefresh() {
setTimeout(() => {
this.loadAllProcesses();
}, 1000);
}
@@ -77,62 +78,11 @@ export class AllProcessesPage implements OnInit {
}, 1000);
}
async loadAllProcesses() {
let allProcessesList = await this.processesService.GetTasksList("", false).toPromise();
//
allProcessesList = allProcessesList || [];
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Conhecimento')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Revisar Diploma')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Gerar Diploma')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Gerar Diploma')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Prorrogar prazo')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Concluir Despacho por Delegação')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Tarefa de Despacho por Delegação')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Reexecutar Despacho por Delegação')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Editar Evento')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Retificar Expediente')
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Agendar Reunião para o Ministro e Director')
this.skeletonLoader = true;
this.allProcessesList = [];
allProcessesList.forEach(element => {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"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');
});
this.skeletonLoader = false;
}
get AllProcess() {
return this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr)
.concat(this.deplomasStore.diplomasList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.despachoStore.list)
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.despachoStore.list)
}
get getAllProcessCount() {
@@ -147,9 +97,6 @@ export class AllProcessesPage implements OnInit {
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);
@@ -160,8 +107,6 @@ export class AllProcessesPage implements OnInit {
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;
if (totalDays == 0) {
if (allday) {
@@ -193,6 +138,8 @@ export class AllProcessesPage implements OnInit {
}
goToProcess(serialNumber: string, workflowName: string, activityName: string) {
if (workflowName == 'Despacho') {
if (activityName == 'Tarefa de Despacho' || activityName == 'Concluir Despacho') {
this.router.navigate(['/home/gabinete-digital/despachos', serialNumber, 'gabinete-digital']);
@@ -207,6 +154,8 @@ export class AllProcessesPage implements OnInit {
}
else if (activityName == 'Diploma Assinado') {
this.router.navigate(['/home/gabinete-digital/diplomas-assinar', serialNumber, 'gabinete-digital']);
} else {
alert('Bug!');
}
}
else if (workflowName == 'Pedido de Parecer' || workflowName == 'Pedido de Deferimento') {
@@ -221,9 +170,6 @@ export class AllProcessesPage implements OnInit {
else if (workflowName == "Pedido de Parecer do Presidente") {
this.router.navigate(['/home/gabinete-digital/pedidos', serialNumber, 'gabinete-digital']);
}
/* else if (workflowName == "Expediente") {
this.router.navigate(['/home/gabinete-digital/pedidos',serialNumber,'gabinete-digital']);
} */
else if (workflowName == 'Agenda Pessoal PR' || workflowName == 'Agenda Oficial PR' || workflowName == 'Agenda Oficial MDGPR' || workflowName == 'Agenda Pessoal MDGPR') {
this.router.navigate(['/home/gabinete-digital/event-list/approve-event', serialNumber, 'gabinete-digital']);
}
@@ -57,10 +57,9 @@ constructor (
let despachosPr;
if(this.loggeduser.Profile != 'PR') {
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
} else if(this.loggeduser.Profile != 'PR') {
} else if(this.loggeduser.Profile == 'PR') {
despachosPr = result.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
}
@@ -1,7 +1,7 @@
<ion-header class="ion-no-border">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div class="title">
<div class="thetitle"><ion-label >Diplomas</ion-label></div>
<div class="thetitle"><ion-label >Diplomas para assinar</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
@@ -30,7 +30,7 @@
(click)="viewExpedientDetail(task.SerialNumber)" -->
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of deplomasStore.diplomasAssinadoList"
*ngFor = "let task of deplomasStore.diplomasParaAssinarList"
(click)="goToDiploma(task.SerialNumber)"
>
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
@@ -75,7 +75,7 @@ export class DiplomasAssinarPage implements OnInit {
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate')
this.deplomasStore.resetDiplomasList(this.diplomasList);
this.deplomasStore.resetDiplomasParaAssinar(this.diplomasList);
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DiplomasGerarPage } from './diplomas-gerar.page';
const routes: Routes = [
{
path: '',
component: DiplomasGerarPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class DiplomasGerarPageRoutingModule {}
@@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { DiplomasGerarPageRoutingModule } from './diplomas-gerar-routing.module';
import { DiplomasGerarPage } from './diplomas-gerar.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
DiplomasGerarPageRoutingModule
],
declarations: [DiplomasGerarPage],
exports: [DiplomasGerarPage]
})
export class DiplomasGerarPageModule {}
@@ -0,0 +1,100 @@
<ion-header class="ion-no-border">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div class="title">
<div class="thetitle"><ion-label >Diplomas por gerar</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<div class="main-container width-100 overflow-y-auto height-100">
<div *ngIf="diplomasList.length >= 1">
<ion-list >
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of deplomasStore.DiplomaGerarList"
(click)="goToDiploma(task.SerialNumber)"
>
<div class="item width-100">
<div class="exp-top-detail">
<div class="subject">
<ion-label>{{ task.Folio }}</ion-label>
</div>
<div class="exp-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-expediente-attachment.svg"></ion-icon>
<label *ngIf="task.DocumentsQty != 0">{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
</div>
<div class="exp-middle-detail">
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
</div>
</div>
</div>
</div>
</ion-list>
</div>
<div
*ngIf="!skeletonLoader && diplomasList.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
<div *ngIf="skeletonLoader && diplomasList.length == 0">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,240 @@
@import '~src/function.scss';
/* CONTENT */
/* :host{
padding: 30px 20px 0 20px !important;
margin: 0;
border: 1px solid red;
} */
.title{
padding: 30px 20px 0 20px !important;
font-family: Roboto;
font-size: 25px;
color:#000;
overflow: auto;
.thetitle{
width: fit-content;
float: left;
}
.theicon{
width: fit-content;
float: right;
}
}
.bottom-title{
width: calc(100% - 40px);
margin-left: 20px !important;
margin-right: 20px !important;
margin: 0 auto;
align-items: center;
justify-content: center;
border-bottom: 5px solid #42b9fe;
.bottom-text{
font-size: 15px !important;
font-family: Roboto !important;
color: #0d89d1 !important;
}
}
.main-container{
padding: 0px 20px 0 20px !important;
margin: 0;
color:#000;
}
.item-list-small{
font-size: 11px;
overflow: hidden;
}
.ion-item-class{
padding: 0;
}
.label-text{
width: 100%;
padding: 0;
margin: 0;
}
//DIV
ion-item{
--background: none;
}
.item {
//background-color: var(--white);
margin: 0 auto;
overflow: hidden;
}
.div-content-expediente{
width: 100%;
float: left;
border-left: 3px solid #dae3f3;
padding:5px 5px 15px 5px;
margin: 10px 0 10px 0;
background: #dae3f3;
border-radius: 20px;
}
.div-content-pendentes{
width: 100%;
float: left;
border-left: 3px solid #d9d9d9;
padding: 5px;
}
.div-content-expediente h3, .div-content-pendentes h3{
margin: 0;
padding: 0;
font-size: 14pt;
width: 100%;
}
.div-icon{
width: 10%;
font-size: 20px;
float: left;
color: #808080;
}
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-expediente p, .div-content-pendentes p{
font-size: 14pt;
color: rgb(94, 92, 92);
padding: 0;
margin: 0;
}
.span-left{
float: left;
font-size: 12px;
padding-left: 18px;
}
.span-right{
text-align: right;
float: right;
font-size: 12px;
padding-right: 18px;
}
/* New CSS */
.expediente{
border-radius: 15px;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
border:1px solid #e9e9e9 !important;
background-color: var(--white);
margin-bottom: 10px !important;
padding: 15px;
}
.exp-list-item{
//width: 368px;
overflow: auto;
/* border-bottom: 1px solid gray; */
margin: 10px auto;
}
.exp-top-detail{
width: 100%;
float: left;
font-family: Roboto;
font-size: 12pt;
font-weight: 700;
color: var(--title-text-color);
padding-left: 3px;
.subject{
width: 84%;
float: left;
}
.exp-icon{
width: fit-content;
float: right;
/* font-size: 13px; */
margin: 0 !important;
padding: 0 !important;
ion-icon{
font-size: 12pt;
color: #42b9fe;
float: left;
}
label{
font-size: 10pt;
}
}
}
.exp-middle-detail, .exp-bottom-detail{
margin-bottom: 5px;
}
.exp-middle-detail{
font-size: 12pt;
width: 100%;
overflow: auto;
.exp-workflow{
float: left;
margin: 0 !important;
.label{
border-radius: 15px;
background: #ffb703;
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
color: #fff;
}
}
.exp-date{
width: auto;
font-family: Roboto;
font-size: 10pt;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #797979;
float: right;
}
}
.exp-bottom-detail{
font-size: 8pt;
width: 100%;
overflow: auto;
padding-left: 3px;
.exp-remetente{
//width: 200px;
font-family: Roboto;
/* font-size: 13px; */
font-weight: normal;
color: #000000;
float: left;
/* border: 1px solid red; */
}
}
.div-top-header{
width: 400px;
margin: 6px auto;
background-color: #0782c9;
overflow: auto;
}
.div-search{
font-size: 45px;
float: left;
margin: 0 0 0 10px
}
.div-logo{
background: transparent;
width: 150px;
margin: 2.5px 0 2.5px 71px;
float: left;
}
.div-logo img{
width: 100%;
}
.div-profile{
font-size: 45px;
float: right;
margin-right: 10px;
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { DiplomasGerarPage } from './diplomas-gerar.page';
describe('DiplomasGerarPage', () => {
let component: DiplomasGerarPage;
let fixture: ComponentFixture<DiplomasGerarPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DiplomasGerarPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(DiplomasGerarPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,72 @@
import { Component, OnInit } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { DeplomasStore } from 'src/app/store/deplomas.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { SortService } from 'src/app/services/functions/sort.service';
import { ThemeService } from 'src/app/services/theme.service'
@Component({
selector: 'app-diplomas-gerars',
templateUrl: './diplomas-gerar.page.html',
styleUrls: ['./diplomas-gerar.page.scss'],
})
export class DiplomasGerarPage implements OnInit {
diplomasList:DailyWorkTask[] = [];
serialNumber:string;
skeletonLoader = true
deplomasStore = DeplomasStore
customTaskPipe = new CustomTaskPipe()
constructor(
private processes:ProcessesService,
private router: Router,
private sortService: SortService,
public ThemeService: ThemeService
) {}
ngOnInit() {
this.LoadList()
}
goToDiploma(serialNumber:any){
this.router.navigate(['/home/gabinete-digital/diplomas-gerar', serialNumber, 'gabinete-digital']);
}
doRefresh() {
setTimeout(() => {
this.LoadList();
}, 1000);
}
async LoadList() {
this.skeletonLoader = true
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.diplomasList = new Array();
this.skeletonLoader = false;
let gerarDiploma = diplomas.reverse().filter(data => data.activityInstanceName == "Gerar Diploma" || data.activityInstanceName == "Retificar Diploma");
gerarDiploma.forEach(element => {
let task: customTask = this.customTaskPipe.transform(element);
this.diplomasList.push(task);
});
this.diplomasList = this.sortService.sortDate(this.diplomasList, 'CreateDate')
this.deplomasStore.resetDiplomaGerar(this.diplomasList);
}
}
@@ -23,11 +23,11 @@
<div class="main-container width-100 overflow-y-auto height-100" [ngSwitch]="segment">
<div *ngIf="deplomasStore.diplomasList.length >= 1 && p.userPermission([p.permissionList.Gabinete.md_tasks])">
<div *ngIf="deplomasStore.diplomasReviewList.length >= 1 && p.userPermission([p.permissionList.Gabinete.md_tasks])">
<ion-list *ngSwitchCase="'validar'">
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of deplomasStore.diplomasList"
*ngFor = "let task of deplomasStore.diplomasReviewList"
(click)="goToDiploma(task.SerialNumber)"
>
<div class="item width-100">
@@ -97,13 +97,13 @@
</div>
<div
*ngIf="!skeletonLoader && deplomasStore.diplomasList.length == 0 && deplomasStore.diplomasAssinadoList.length == 0"
*ngIf="!skeletonLoader && deplomasStore.diplomasReviewList.length == 0 && deplomasStore.diplomasAssinadoList.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
<div *ngIf="skeletonLoader && deplomasStore.diplomasAssinadoList.length == 0 && skeletonLoader && deplomasStore.diplomasList.length == 0">
<div *ngIf="skeletonLoader && deplomasStore.diplomasAssinadoList.length == 0 && skeletonLoader && deplomasStore.diplomasReviewList.length == 0">
<ion-list>
<ion-item>
@@ -14,26 +14,26 @@ import { PermissionService } from 'src/app/services/permission.service';
styleUrls: ['./diplomas.page.scss'],
})
export class DiplomasPage implements OnInit {
//profile:string;
diplomasList:DailyWorkTask[] = [];
diplomasAssinadoList:DailyWorkTask[] = [];
showLoader: boolean;
serialNumber:string;
skeletonLoader = false
@Input() segment:string;
diplomasList:DailyWorkTask[] = [];
diplomasAssinadoList:DailyWorkTask[] = [];
showLoader: boolean;
serialNumber:string;
skeletonLoader = false
@Input() segment:string;
deplomasStore = DeplomasStore
customTaskPipe = new CustomTaskPipe()
deplomasStore = DeplomasStore
customTaskPipe = new CustomTaskPipe()
constructor(
private processes:ProcessesService,
private router: Router,
private activatedRoute: ActivatedRoute,
public ThemeService: ThemeService,
private sortService: SortService,
public p: PermissionService,
constructor(
private processes:ProcessesService,
private router: Router,
private activatedRoute: ActivatedRoute,
public ThemeService: ThemeService,
private sortService: SortService,
public p: PermissionService,
) {}
ngOnInit() {
@@ -69,18 +69,20 @@ constructor(
this.diplomasList = [];
let diplomasList = [];
let diplomasValidar = diplomas.filter(data => data.activityInstanceName == "Revisar Diploma");
diplomasValidar.forEach(element => {
// let diplomasReview = diplomas.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
diplomas.forEach(element => {
let task = this.pipeTask(element)
diplomasList.push(task);
});
this.diplomasList = this.sortService.sortDate(diplomasList, 'CreateDate')
this.deplomasStore.resetDiplomasList(this.diplomasList)
this.deplomasStore.resetDiplomasReview(this.diplomasList)
let diplomasAssinadoList = []
let diplomasAssinados = diplomas.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
diplomasAssinados.forEach(async element => {
let task = this.pipeTask(element)
@@ -131,6 +131,10 @@
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class width-100">
<<<<<<< HEAD
=======
>>>>>>> secrete-group
<mat-form-field appearance="none"
class="width-100 date-hour-picker">
@@ -7,9 +7,9 @@
</div>
<div class="buttons">
<button (click)="leaveGroup()" class="btn-cancel" shape="round" >Sair do Grupo</button>
<button (click)="openChangeGroupName()" class="btn-cancel" shape="round" >Alterar nome do grupo</button>
<button *ngIf="isAdmin" (click)="openChangeGroupName()" class="btn-cancel" shape="round" >Alterar nome do grupo</button>
<div class="solid"></div>
<button (click)="close('cancel')" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
<button (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
<button (click)="close('cancel')" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
<button *ngIf="isAdmin" (click)="deleteGroup()" class="btn-delete" shape="round">Apagar grupo</button>
</div>
</ion-content>
@@ -5,6 +5,8 @@ import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'
import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
import { HttpErrorResponse } from '@angular/common/http';
import { SessionStore } from 'src/app/store/session.service';
@Component({
@@ -16,6 +18,7 @@ export class ChatPopoverPage implements OnInit {
roomId:string;
room: any;
members:any;
isAdmin = false;
constructor(
private popoverController: PopoverController,
@@ -28,10 +31,11 @@ export class ChatPopoverPage implements OnInit {
) {
this.roomId = this.navParams.get('roomId');
this.members = this.navParams.get('members');
this.isAdmin = this.navParams.get('isAdmin');
}
ngOnInit() {
this.chatService.refreshtoken();
}
close(action:any){
@@ -62,6 +66,7 @@ export class ChatPopoverPage implements OnInit {
componentProps: {
roomId: this.roomId,
members: this.members,
isAdmin: this.isAdmin
}
});
await modal.present();
@@ -79,9 +84,6 @@ export class ChatPopoverPage implements OnInit {
let res:any = await this.wsChatMethodsService.leaveRoom(this.roomId);
this.wsChatMethodsService.deleteRoom(this.roomId)
if(res.error){
if(res.error.error = "error-you-are-last-owner"){
@@ -101,55 +103,7 @@ export class ChatPopoverPage implements OnInit {
}
this.close('leave');
//this.wsChatMethodsService.subscribeToRoomUpdate(this.roomId, res.result);
/* this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room'];
if(this.room.t === 'p'){
this.chatService.leaveGroup(body).subscribe(res=>{
this.close('leave');
},
(e)=>{
if(e.error.errorType = "error-you-are-last-owner"){
this.toastService._badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo.");
this.close('cancel');
this.setRoomOwner();
}
else{
this.toastService._badRequest("Não foi possível sair do grupo");
this.close('cancel');
}
},
()=>{
//loader.remove()
});
}
else{
this.chatService.leaveChannel(body).subscribe(res=>{
this.close('leave');
},
(e)=>{
if(e.error.errorType = "error-you-are-last-owner"){
this.toastService._badRequest("Você é o último administrador do grupo. Por favor, defina o novo administrador antes de sair da grupo.");
this.close('cancel');
}
else{
this.toastService._badRequest("Não foi possível sair do grupo");
this.close('cancel');
}
},
()=>{
//loader.remove()
});
}
}); */
}
//Delete
@@ -160,12 +114,12 @@ export class ChatPopoverPage implements OnInit {
if(this.room.t === 'p'){
this.chatService.deleteGroup(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.roomId)
});
}
else{
this.chatService.deleteChannel(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.roomId)
});
}
});
@@ -1,3 +1,4 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service';
@@ -24,6 +25,7 @@ export class MessagesOptionsPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
}
close(){
@@ -28,16 +28,15 @@
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="{{minDate}}"
max="2025"
class="d-block d-md-none">
max="2025">
</ion-datetime>
<mat-form-field appearance="none" class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date*"
[formControl]="dateControlEnd"
[min]="minDate"
[(ngModel)]="folder.DateBegin"
[min]="currentDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
@@ -67,19 +66,19 @@
displayFormat="D MMM YYYY H:mm"
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="{{minDate}}"
max="2022">
min="{{endMinDate}}"
max="2025">
</ion-datetime>
<mat-form-field appearance="none" class="width-100 date-hour-picker d-none d-md-block">
<input matInput [ngxMatDatetimePicker]="picker1"
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date*"
[formControl]="dateControlEnd"
[min]="minDate"
[(ngModel)]="folder.DateEnd"
[min]="endMinDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
@@ -29,6 +29,7 @@ export class EditActionPage implements OnInit {
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
public currentDate = new Date();
folder: PublicationFolder;
@Input() folderId: string;
@@ -87,6 +88,9 @@ export class EditActionPage implements OnInit {
}
async save() {
this.injectValidation();
this.runValidation();
let body = {
ProcessId: this.folderId,
Description: this.folder.Description,
@@ -95,7 +99,7 @@ export class EditActionPage implements OnInit {
DateEnd: this.folder.DateEnd,
ActionType: this.folder.ActionType,
}
console.log(this.folder.DateEnd);
const loader = this.toastService.loading()
@@ -46,6 +46,7 @@
placeholder="Choose a date*"
[(ngModel)]="folder.DateBegin"
[disabled]="disabled"
[min]="currentDate"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
@@ -82,6 +83,7 @@
placeholder="Choose a date*"
[(ngModel)]="folder.DateEnd"
[disabled]="disabled"
[min]="currentDate"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker2"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker2
@@ -25,6 +25,7 @@ export class NewActionPage implements OnInit {
public stepHour = 1;
public stepMinute = 5;
public stepSecond = 5;
currentDate = new Date();
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
Form: FormGroup;

Some files were not shown because too many files have changed in this diff Show More