mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
pull of Peter changes
This commit is contained in:
+2
-1
@@ -76,4 +76,5 @@ _android/
|
|||||||
_www/
|
_www/
|
||||||
www2020
|
www2020
|
||||||
android copy/
|
android copy/
|
||||||
report.*
|
report.*
|
||||||
|
src/plugin/src/
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { ModalController, NavParams } from '@ionic/angular';
|
import { NavParams } from '@ionic/angular';
|
||||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||||
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
import { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page';
|
import { EventDetailsDocumentsOptionsPage } from 'src/app/shared/popover/event-details-documents-options/event-details-documents-options.page';
|
||||||
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
|
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
|
||||||
|
import { AlertService } from 'src/app/services/alert.service';
|
||||||
|
import { AlertController, ModalController } from '@ionic/angular';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-view-document',
|
selector: 'app-view-document',
|
||||||
templateUrl: './view-document.page.html',
|
templateUrl: './view-document.page.html',
|
||||||
@@ -27,6 +27,7 @@ export class ViewDocumentPage implements OnInit {
|
|||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
private sanitazer: DomSanitizer,
|
private sanitazer: DomSanitizer,
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
|
private alertController: AlertController,
|
||||||
) {
|
) {
|
||||||
this.file = this.navParams.get('file');
|
this.file = this.navParams.get('file');
|
||||||
this.applicationId = this.navParams.get('applicationId');
|
this.applicationId = this.navParams.get('applicationId');
|
||||||
@@ -44,10 +45,27 @@ export class ViewDocumentPage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.processes.GetViewer(this.docId, this.applicationId).subscribe(res=> {
|
this.processes.GetViewer(this.docId, this.applicationId).subscribe(async(res)=> {
|
||||||
console.log(res)
|
|
||||||
const link: string = res.replace('//pdfjs/web/', '/pdfjs/web/')
|
const link: string = res.replace('//pdfjs/web/', '/pdfjs/web/')
|
||||||
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
|
this.trustedUrl = this.sanitazer.bypassSecurityTrustResourceUrl(link);
|
||||||
|
|
||||||
|
if(res == "") {
|
||||||
|
const alert = await this.alertController.create({
|
||||||
|
cssClass: 'my-custom-class',
|
||||||
|
//header: 'Apagar evento!',
|
||||||
|
message: 'Sem imagem',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: 'Sim',
|
||||||
|
handler: () => {
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}, ()=>{
|
}, ()=>{
|
||||||
this.close();
|
this.close();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -153,8 +153,8 @@ export class ViewEventPage implements OnInit {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
if(this.CalendarId) {
|
if(this.CalendarId) {
|
||||||
|
console.log('calendar id')
|
||||||
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
||||||
this.loadedEvent = res;
|
this.loadedEvent = res;
|
||||||
this.addEventToDb(res);
|
this.addEventToDb(res);
|
||||||
@@ -172,6 +172,8 @@ export class ViewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
loader.remove()
|
loader.remove()
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
console.log('no calendar id')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,6 @@ export class ChatPage implements OnInit {
|
|||||||
public ChatSystemService: ChatSystemService,
|
public ChatSystemService: ChatSystemService,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.loggedUserChat = SessionStore.user.ChatData?.data;
|
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
window.onresize = (event) => {
|
window.onresize = (event) => {
|
||||||
if (window.innerWidth > 701) {
|
if (window.innerWidth > 701) {
|
||||||
@@ -591,11 +590,8 @@ export class ChatPage implements OnInit {
|
|||||||
return dateB - dateA;
|
return dateB - dateA;
|
||||||
});
|
});
|
||||||
//
|
//
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -617,7 +613,6 @@ export class ChatPage implements OnInit {
|
|||||||
_updatedAt: element._updatedAt
|
_updatedAt: element._updatedAt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
groupsArray.push(roomList)
|
groupsArray.push(roomList)
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -636,7 +631,6 @@ export class ChatPage implements OnInit {
|
|||||||
updatedat: element._updatedAt
|
updatedat: element._updatedAt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.sqlservice.addChatListRoom(roomList);
|
this.sqlservice.addChatListRoom(roomList);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -331,6 +331,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
async goToEvent(event: any) {
|
async goToEvent(event: any) {
|
||||||
|
|
||||||
|
// console.log(event)
|
||||||
|
|
||||||
let classs;
|
let classs;
|
||||||
if (window.innerWidth < 701) {
|
if (window.innerWidth < 701) {
|
||||||
classs = 'modal modal-desktop'
|
classs = 'modal modal-desktop'
|
||||||
|
|||||||
@@ -261,7 +261,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div (click)="openDiplomasPage('assinados'); selectedElement='DiplomasAssinados'" [class.active]="selectedElement == 'DiplomasAssinados'" class="box-hover exp-card d-flex flex-column justify-center">
|
<div *ngIf="deplomasStore.countDiplomasAssinadoListCount >= 1" (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">
|
<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 == 'default' " src="assets/images/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && selectedElement != 'DiplomasAssinados'" src="assets/images/theme/gov/icons-diplomas-assinados-presidente.svg"></ion-icon>
|
||||||
@@ -374,7 +374,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
|
|
||||||
AllProcess = []
|
AllProcess = []
|
||||||
|
|
||||||
|
workerList : Worker
|
||||||
|
|
||||||
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
@ViewChild(ExpedientsPage) expedientesPage: ExpedientsPage;
|
||||||
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
|
@ViewChild(PendentesPage) pendentesListPage: PendentesPage;
|
||||||
@ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage;
|
@ViewChild(EventsToApprovePage) eventsToApprove: EventsToApprovePage;
|
||||||
@@ -126,6 +128,12 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
public NotificationsService: NotificationsService
|
public NotificationsService: NotificationsService
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
this.workerList = new Worker(new URL('./list.worker.js', import.meta.url));
|
||||||
|
|
||||||
|
this.workerList.onmessage = (oEvent) => {
|
||||||
|
this.AllProcess = oEvent.data
|
||||||
|
}
|
||||||
|
|
||||||
window.onresize = (event) => {
|
window.onresize = (event) => {
|
||||||
// if not mobile remove all component
|
// if not mobile remove all component
|
||||||
if (window.innerWidth < 701) {
|
if (window.innerWidth < 701) {
|
||||||
@@ -571,6 +579,20 @@ export class GabineteDigitalPage implements OnInit {
|
|||||||
this.AllProcess = this.expedientegbstore.list.concat(this.pedidosstore.listparecer).concat(this.pedidosstore.listdeferimento)
|
this.AllProcess = 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.despachoStore.list)
|
.concat(this.despachoprstore.list).concat(this.eventoaprovacaostore.listmd).concat(this.eventoaprovacaostore.listpr).concat(this.despachoStore.list)
|
||||||
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList)
|
.concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList)
|
||||||
|
|
||||||
|
// try{
|
||||||
|
// this.workerList.postMessage([
|
||||||
|
// this.expedientegbstore.list,this.pedidosstore.listparecer,this.pedidosstore.listdeferimento,
|
||||||
|
// this.despachoprstore.list, this.eventoaprovacaostore.listmd, this.eventoaprovacaostore.listpr, this.despachoStore.list,
|
||||||
|
// this.deplomasStore.diplomasParaAssinarList, this.deplomasStore.diplomasAssinadoList, this.deplomasStore.DiplomaGerarList
|
||||||
|
// ])
|
||||||
|
// } catch (e) {
|
||||||
|
// this.AllProcess = 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.despachoStore.list)
|
||||||
|
// .concat(this.deplomasStore.diplomasParaAssinarList).concat(this.deplomasStore.diplomasAssinadoList).concat(this.deplomasStore.DiplomaGerarList)
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get getAllProcessCount() {
|
get getAllProcessCount() {
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
onmessage = function(oEvent) {
|
||||||
|
|
||||||
|
|
||||||
|
const list = Event.data
|
||||||
|
var a = []
|
||||||
|
postMessage(
|
||||||
|
a.concat.apply([], [list])
|
||||||
|
);
|
||||||
|
|
||||||
|
};
|
||||||
@@ -123,6 +123,7 @@ export class LoginPage implements OnInit {
|
|||||||
if (attempt.UserId == SessionStore.user.UserId) {
|
if (attempt.UserId == SessionStore.user.UserId) {
|
||||||
|
|
||||||
await this.authService.SetSession(attempt, this.userattempt);
|
await this.authService.SetSession(attempt, this.userattempt);
|
||||||
|
this.changeProfileService.run();
|
||||||
|
|
||||||
if(attempt.ChatData) {
|
if(attempt.ChatData) {
|
||||||
|
|
||||||
|
|||||||
@@ -24,22 +24,16 @@ export class AttachmentsService {
|
|||||||
private changeProfileService: ChangeProfileService) {
|
private changeProfileService: ChangeProfileService) {
|
||||||
|
|
||||||
this.changeProfileService.registerCallback(() => {
|
this.changeProfileService.registerCallback(() => {
|
||||||
this.loggeduser = SessionStore.user
|
this.setHeader()
|
||||||
this.headers = new HttpHeaders();
|
});
|
||||||
|
this.setHeader()
|
||||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
|
||||||
})
|
|
||||||
this.changeProfileService.registerLoginCallback(() => {
|
|
||||||
this.loggeduser = SessionStore.user
|
|
||||||
this.headers = new HttpHeaders();
|
|
||||||
|
|
||||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
|
||||||
})
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
setHeader() {
|
||||||
this.loggeduser = SessionStore.user
|
this.loggeduser = SessionStore.user
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadFile(formData:any) {
|
uploadFile(formData:any) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
|
|||||||
export class AuthService {
|
export class AuthService {
|
||||||
userData$ = new BehaviorSubject<any>('');
|
userData$ = new BehaviorSubject<any>('');
|
||||||
userId$ = new BehaviorSubject<any>('');
|
userId$ = new BehaviorSubject<any>('');
|
||||||
headers: HttpHeaders;
|
headers: HttpHeaders = new HttpHeaders();
|
||||||
public wsValidatedUserChat:any;
|
public wsValidatedUserChat:any;
|
||||||
public isWsAuthenticated: boolean = false;
|
public isWsAuthenticated: boolean = false;
|
||||||
opts:any;
|
opts:any;
|
||||||
@@ -43,9 +43,7 @@ export class AuthService {
|
|||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private initialsService: InitialsService,
|
private initialsService: InitialsService,
|
||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
public ChatSystemService: ChatSystemService, ) {
|
public ChatSystemService: ChatSystemService) {
|
||||||
|
|
||||||
this.headers = new HttpHeaders();
|
|
||||||
|
|
||||||
if (SessionStore.exist) {
|
if (SessionStore.exist) {
|
||||||
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) {
|
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export class ChatMethodsService {
|
|||||||
"end_date": data.end,
|
"end_date": data.end,
|
||||||
"venue": data.venue,
|
"venue": data.venue,
|
||||||
"id": data.id,
|
"id": data.id,
|
||||||
|
"calendarId": data.calendarId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -317,8 +317,12 @@ export class ChatSystemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.RochetChatConnectorService.streamNotifyLogged().then((subscription=>{
|
this.RochetChatConnectorService.streamNotifyLogged().then((subscription=>{
|
||||||
|
console.log(subscription)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
// this.RochetChatConnectorService.subStreamNotifyUser().then((subscription=>{
|
||||||
|
// console.log(subscription)
|
||||||
|
// }))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -406,7 +410,7 @@ export class ChatSystemService {
|
|||||||
|
|
||||||
let roomId = this.getRoomId(roomData);
|
let roomId = this.getRoomId(roomData);
|
||||||
|
|
||||||
if (setData.name != 'Rocket Cat') {
|
if (setData.name != 'Rocket Cat' && setData.name != 'general' ) {
|
||||||
// create room
|
// create room
|
||||||
if(!this.roomExist(roomId)) {
|
if(!this.roomExist(roomId)) {
|
||||||
let room:RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.ViewedMessageService)
|
let room:RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.ViewedMessageService)
|
||||||
|
|||||||
@@ -446,9 +446,11 @@ export class MessageService {
|
|||||||
|
|
||||||
async delateDB() {
|
async delateDB() {
|
||||||
|
|
||||||
const message = await MessageModel.get({id: this.id})
|
if(!this.rowInstance) {
|
||||||
await message.delete()
|
this.rowInstance = await this.getRowInstance()
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.rowInstance.delete()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -437,6 +437,35 @@ export class RochetChatConnectorService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
subStreamNotifyUser(param?: any) {
|
||||||
|
|
||||||
|
const requestId = uuidv4()
|
||||||
|
|
||||||
|
let message = {
|
||||||
|
msg: "sub",
|
||||||
|
id: requestId,
|
||||||
|
name: "stream-notify-user",
|
||||||
|
params:[
|
||||||
|
`${SessionStore.user.ChatData.data.userId}/notification`,
|
||||||
|
param
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.ws.send({message, requestId})
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
|
||||||
|
if(message.id == requestId ) { // same request send
|
||||||
|
resolve(message)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}})
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
receiveStreamNotifyRoom(funx: Function) {
|
receiveStreamNotifyRoom(funx: Function) {
|
||||||
|
|
||||||
this.ws.registerCallback({
|
this.ws.registerCallback({
|
||||||
|
|||||||
@@ -452,7 +452,13 @@ export class RoomService {
|
|||||||
"stream-notify-room",
|
"stream-notify-room",
|
||||||
async (ChatMessage) => {
|
async (ChatMessage) => {
|
||||||
const DeletedMessageId = ChatMessage.fields.args[0]._id;
|
const DeletedMessageId = ChatMessage.fields.args[0]._id;
|
||||||
this.deleteMessage(DeletedMessageId)
|
|
||||||
|
const message = this.messages.find((e) => e._id == DeletedMessageId)
|
||||||
|
|
||||||
|
if(message.delate == false) {
|
||||||
|
this.deleteMessage(DeletedMessageId)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { environment } from 'src/environments/environment';
|
|||||||
import { AuthService } from '../services/auth.service';
|
import { AuthService } from '../services/auth.service';
|
||||||
import { LoginUserRespose } from '../models/user.model';
|
import { LoginUserRespose } from '../models/user.model';
|
||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
|
import { ChangeProfileService } from './change-profile.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -16,7 +17,18 @@ export class ContactsService {
|
|||||||
loggeduser: LoginUserRespose;
|
loggeduser: LoginUserRespose;
|
||||||
headers: HttpHeaders;
|
headers: HttpHeaders;
|
||||||
|
|
||||||
constructor(private http: HttpClient, user: AuthService) {
|
constructor(
|
||||||
|
private http: HttpClient,
|
||||||
|
user: AuthService,
|
||||||
|
private changeProfileService: ChangeProfileService) {
|
||||||
|
|
||||||
|
this.setHeader()
|
||||||
|
this.changeProfileService.registerCallback(() => {
|
||||||
|
this.setHeader()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setHeader() {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|||||||
import { Observable, from } from 'rxjs';
|
import { Observable, from } from 'rxjs';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
import { AuthService } from '../services/auth.service';
|
import { AuthService } from '../services/auth.service';
|
||||||
import { UserSession } from '../models/user.model';
|
|
||||||
import { EventList } from '../models/agenda/AgendaEventList';
|
import { EventList } from '../models/agenda/AgendaEventList';
|
||||||
import { ChangeProfileService } from './change-profile.service';
|
import { ChangeProfileService } from './change-profile.service';
|
||||||
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
||||||
@@ -20,7 +19,6 @@ import { SessionStore } from '../store/session.service';
|
|||||||
export class EventsService {
|
export class EventsService {
|
||||||
|
|
||||||
authheader = {};
|
authheader = {};
|
||||||
loggeduser: UserSession;
|
|
||||||
headers: HttpHeaders;
|
headers: HttpHeaders;
|
||||||
|
|
||||||
headersPrOficial: HttpHeaders;
|
headersPrOficial: HttpHeaders;
|
||||||
@@ -37,25 +35,17 @@ export class EventsService {
|
|||||||
|
|
||||||
headersSharedOficial: HttpHeaders;
|
headersSharedOficial: HttpHeaders;
|
||||||
headersSharedPessoal: HttpHeaders;
|
headersSharedPessoal: HttpHeaders;
|
||||||
|
|
||||||
hasSharedCalendar = false
|
|
||||||
hasOwnCalendar = false
|
|
||||||
|
|
||||||
|
|
||||||
calendarIds = []
|
calendarIds = []
|
||||||
usersCalendarIds = []
|
usersCalendarIds = []
|
||||||
|
|
||||||
|
hasSharedCalendar = false;
|
||||||
hasSharedOficial: boolean = false;
|
hasSharedOficial: boolean = false;
|
||||||
hasSharedPessoal: boolean = false;
|
hasSharedPessoal: boolean = false;
|
||||||
|
|
||||||
hasOwnOficial: boolean = false;
|
hasOwnOficial: boolean = false;
|
||||||
hasOwnPessoal: boolean = false;
|
hasOwnPessoal: boolean = false;
|
||||||
|
hasOwnCalendar = false
|
||||||
|
|
||||||
|
|
||||||
userCalendarNameSharedOficial = '';
|
|
||||||
userCalendarNameSharedPessoal = '';
|
|
||||||
userCalendarNameOwnOficial = '';
|
|
||||||
userCalendarNameOwnPessoal = '';
|
|
||||||
|
|
||||||
calendarNames = {}
|
calendarNames = {}
|
||||||
|
|
||||||
@@ -73,7 +63,14 @@ export class EventsService {
|
|||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private backgroundservice: BackgroundService) {
|
private backgroundservice: BackgroundService) {
|
||||||
|
|
||||||
this.loggeduser = SessionStore.user;
|
this.setHeader()
|
||||||
|
this.changeProfileService.registerCallback(() => {
|
||||||
|
this.setHeader()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async setHeader () {
|
||||||
|
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
this.headersMdOficial = new HttpHeaders();
|
this.headersMdOficial = new HttpHeaders();
|
||||||
@@ -92,16 +89,14 @@ export class EventsService {
|
|||||||
this.headerSharedOficial= new HttpHeaders();
|
this.headerSharedOficial= new HttpHeaders();
|
||||||
this.headerSharedPessoal= new HttpHeaders();
|
this.headerSharedPessoal= new HttpHeaders();
|
||||||
|
|
||||||
|
this.headers = this.headers.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
|
|
||||||
this.setHeader()
|
this.usersCalendarIds = [];
|
||||||
this.changeProfileService.registerCallback(() => {
|
this.calendarNames = {}
|
||||||
this.loggeduser = SessionStore.user;
|
this.calendarIds = []
|
||||||
this.setHeader()
|
|
||||||
})
|
this.calendarNamesAry = []
|
||||||
|
this.calendarNamesType = {}
|
||||||
}
|
|
||||||
|
|
||||||
async setHeader () {
|
|
||||||
|
|
||||||
this.hasSharedCalendar = false
|
this.hasSharedCalendar = false
|
||||||
this.hasSharedOficial = false
|
this.hasSharedOficial = false
|
||||||
@@ -110,32 +105,11 @@ export class EventsService {
|
|||||||
this.hasOwnCalendar = false
|
this.hasOwnCalendar = false
|
||||||
this.hasOwnOficial = false
|
this.hasOwnOficial = false
|
||||||
this.hasOwnPessoal = false
|
this.hasOwnPessoal = false
|
||||||
|
|
||||||
this.headers = new HttpHeaders();
|
|
||||||
|
|
||||||
this.headerOwnOficial= new HttpHeaders();
|
if (SessionStore.user) {
|
||||||
this.headerOwnPessoal= new HttpHeaders();
|
if (SessionStore.user.Profile == 'MDGPR') {
|
||||||
|
|
||||||
this.headerSharedOficial= new HttpHeaders();
|
|
||||||
this.headerSharedPessoal= new HttpHeaders();
|
|
||||||
|
|
||||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
for (let calendar of SessionStore.user.OwnerCalendars) {
|
||||||
|
|
||||||
this.userCalendarNameSharedOficial = '';
|
|
||||||
this.userCalendarNameSharedPessoal = '';
|
|
||||||
this.userCalendarNameOwnOficial = '';
|
|
||||||
this.userCalendarNameOwnPessoal = '';
|
|
||||||
|
|
||||||
this.usersCalendarIds = [];
|
|
||||||
this.calendarNames = {}
|
|
||||||
|
|
||||||
this.calendarNamesAry = []
|
|
||||||
this.calendarNamesType = {}
|
|
||||||
|
|
||||||
if (this.loggeduser) {
|
|
||||||
if (this.loggeduser.Profile == 'MDGPR') {
|
|
||||||
|
|
||||||
for (let calendar of this.loggeduser.OwnerCalendars) {
|
|
||||||
this.hasAnyCalendar = false
|
this.hasAnyCalendar = false
|
||||||
|
|
||||||
if (calendar.CalendarName == 'Oficial') {
|
if (calendar.CalendarName == 'Oficial') {
|
||||||
@@ -143,7 +117,7 @@ export class EventsService {
|
|||||||
this.hasOwnOficial = true
|
this.hasOwnOficial = true
|
||||||
|
|
||||||
|
|
||||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headersMdOficial = this.headersMdOficial.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
||||||
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
}
|
}
|
||||||
@@ -151,21 +125,21 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasOwnPessoal = true
|
this.hasOwnPessoal = true
|
||||||
|
|
||||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
||||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
|
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||||
this.hasAnyCalendar = false
|
this.hasAnyCalendar = false
|
||||||
|
|
||||||
if (sharedCalendar.CalendarName == 'Oficial') {
|
if (sharedCalendar.CalendarName == 'Oficial') {
|
||||||
|
|
||||||
this.hasSharedOficial = true
|
this.hasSharedOficial = true
|
||||||
|
|
||||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
}
|
}
|
||||||
@@ -173,7 +147,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasSharedPessoal = true
|
this.hasSharedPessoal = true
|
||||||
|
|
||||||
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
}
|
}
|
||||||
@@ -181,15 +155,15 @@ export class EventsService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (this.loggeduser.Profile == 'PR') {
|
else if (SessionStore.user.Profile == 'PR') {
|
||||||
|
|
||||||
for (let calendar of this.loggeduser.OwnerCalendars) {
|
for (let calendar of SessionStore.user.OwnerCalendars) {
|
||||||
this.hasAnyCalendar = false
|
this.hasAnyCalendar = false
|
||||||
if (calendar.CalendarName == 'Oficial') {
|
if (calendar.CalendarName == 'Oficial') {
|
||||||
|
|
||||||
this.hasOwnOficial = true
|
this.hasOwnOficial = true
|
||||||
|
|
||||||
this.headersPrOficial = this.headersPrOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headersPrOficial = this.headersPrOficial.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
|
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
|
||||||
this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
}
|
}
|
||||||
@@ -197,7 +171,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasOwnPessoal = true
|
this.hasOwnPessoal = true
|
||||||
|
|
||||||
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId);
|
this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId);
|
||||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
|
|
||||||
@@ -206,7 +180,7 @@ export class EventsService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let calendar of this.loggeduser.OwnerCalendars) {
|
for (let calendar of SessionStore.user.OwnerCalendars) {
|
||||||
this.hasAnyCalendar = false
|
this.hasAnyCalendar = false
|
||||||
if(!this.usersCalendarIds.includes(calendar.OwnerUserId)) {
|
if(!this.usersCalendarIds.includes(calendar.OwnerUserId)) {
|
||||||
this.usersCalendarIds.push(calendar.OwnerUserId)
|
this.usersCalendarIds.push(calendar.OwnerUserId)
|
||||||
@@ -222,7 +196,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasOwnOficial = true
|
this.hasOwnOficial = true
|
||||||
|
|
||||||
this.headerOwnOficial = this.headerOwnOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headerOwnOficial = this.headerOwnOficial.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
this.headerOwnOficial = this.headerOwnOficial.set('CalendarId', calendar.CalendarId);
|
this.headerOwnOficial = this.headerOwnOficial.set('CalendarId', calendar.CalendarId);
|
||||||
this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName);
|
this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName);
|
||||||
@@ -231,14 +205,14 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasOwnPessoal = true
|
this.hasOwnPessoal = true
|
||||||
|
|
||||||
this.headerOwnPessoal = this.headerOwnPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headerOwnPessoal = this.headerOwnPessoal.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarId', calendar.CalendarId);
|
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarId', calendar.CalendarId);
|
||||||
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
|
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
|
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||||
this.hasAnyCalendar = false
|
this.hasAnyCalendar = false
|
||||||
|
|
||||||
if(!this.usersCalendarIds.includes(sharedCalendar.OwnerUserId)) {
|
if(!this.usersCalendarIds.includes(sharedCalendar.OwnerUserId)) {
|
||||||
@@ -254,7 +228,7 @@ export class EventsService {
|
|||||||
if (sharedCalendar.CalendarName == 'Oficial') {
|
if (sharedCalendar.CalendarName == 'Oficial') {
|
||||||
this.hasSharedOficial = true
|
this.hasSharedOficial = true
|
||||||
|
|
||||||
this.headerSharedOficial = this.headerSharedOficial.set('Authorization',this.loggeduser.BasicAuthKey);
|
this.headerSharedOficial = this.headerSharedOficial.set('Authorization',SessionStore.user.BasicAuthKey);
|
||||||
this.headerSharedOficial = this.headerSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
this.headerSharedOficial = this.headerSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||||
this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName);
|
this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName);
|
||||||
@@ -263,7 +237,7 @@ export class EventsService {
|
|||||||
|
|
||||||
this.hasSharedPessoal = true
|
this.hasSharedPessoal = true
|
||||||
|
|
||||||
this.headerSharedPessoal = this.headerSharedPessoal.set('Authorization',this.loggeduser.BasicAuthKey);
|
this.headerSharedPessoal = this.headerSharedPessoal.set('Authorization',SessionStore.user.BasicAuthKey);
|
||||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
|
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
|
||||||
@@ -271,7 +245,7 @@ export class EventsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
|
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||||
this.hasAnyCalendar = false
|
this.hasAnyCalendar = false
|
||||||
if(sharedCalendar?.OwnerUserId) {
|
if(sharedCalendar?.OwnerUserId) {
|
||||||
this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> {
|
this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> {
|
||||||
@@ -291,7 +265,7 @@ export class EventsService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let sharedCalendar of this.loggeduser.OwnerCalendars) {
|
for (let sharedCalendar of SessionStore.user.OwnerCalendars) {
|
||||||
this.hasAnyCalendar = false
|
this.hasAnyCalendar = false
|
||||||
|
|
||||||
this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario'
|
this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario'
|
||||||
@@ -326,13 +300,13 @@ export class EventsService {
|
|||||||
|
|
||||||
isMyEvent(event: any) {
|
isMyEvent(event: any) {
|
||||||
|
|
||||||
for (let calendar of this.loggeduser.OwnerCalendars) {
|
for (let calendar of SessionStore.user.OwnerCalendars) {
|
||||||
if(event.CalendarId == calendar.CalendarId) {
|
if(event.CalendarId == calendar.CalendarId) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
|
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||||
if(event.CalendarId == sharedCalendar.CalendarId) {
|
if(event.CalendarId == sharedCalendar.CalendarId) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@@ -438,7 +412,7 @@ export class EventsService {
|
|||||||
|
|
||||||
let prO = [], prP = [];
|
let prO = [], prP = [];
|
||||||
|
|
||||||
for (let calendar of this.loggeduser.OwnerCalendars) {
|
for (let calendar of SessionStore.user.OwnerCalendars) {
|
||||||
if (calendar.CalendarName == 'Oficial') {
|
if (calendar.CalendarName == 'Oficial') {
|
||||||
prO = await this.getAllMdOficialEvents(startdate, enddate).toPromise();
|
prO = await this.getAllMdOficialEvents(startdate, enddate).toPromise();
|
||||||
if(!Array.isArray(prO)) {
|
if(!Array.isArray(prO)) {
|
||||||
@@ -521,10 +495,10 @@ export class EventsService {
|
|||||||
|
|
||||||
let result = []
|
let result = []
|
||||||
|
|
||||||
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
|
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||||
|
|
||||||
var header = new HttpHeaders();
|
var header = new HttpHeaders();
|
||||||
header = header.set('Authorization', this.loggeduser.BasicAuthKey);
|
header = header.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||||
header = header.set('CalendarId', sharedCalendar.CalendarId);
|
header = header.set('CalendarId', sharedCalendar.CalendarId);
|
||||||
header = header.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
header = header.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
header = header.set('CalendarName', sharedCalendar.CalendarName);
|
header = header.set('CalendarName', sharedCalendar.CalendarName);
|
||||||
@@ -591,7 +565,7 @@ export class EventsService {
|
|||||||
|
|
||||||
let prO = [], prP = [];
|
let prO = [], prP = [];
|
||||||
|
|
||||||
for(let calendar of this.loggeduser.SharedCalendars) {
|
for(let calendar of SessionStore.user.SharedCalendars) {
|
||||||
if (calendar.CalendarName == 'Oficial') {
|
if (calendar.CalendarName == 'Oficial') {
|
||||||
prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
|
prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
|
||||||
}
|
}
|
||||||
@@ -608,8 +582,6 @@ export class EventsService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getAllSharedOficialEvents(startdate: string, enddate: string): Observable<Event[]> {
|
getAllSharedOficialEvents(startdate: string, enddate: string): Observable<Event[]> {
|
||||||
let geturl = environment.apiURL + 'calendar/pr';
|
let geturl = environment.apiURL + 'calendar/pr';
|
||||||
geturl = geturl.replace('/V4/', '/V5/')
|
geturl = geturl.replace('/V4/', '/V5/')
|
||||||
@@ -745,10 +717,10 @@ export class EventsService {
|
|||||||
this.headers['CalendarName'] = event.CalendarName
|
this.headers['CalendarName'] = event.CalendarName
|
||||||
|
|
||||||
if (event.CalendarName == 'Oficial') {
|
if (event.CalendarName == 'Oficial') {
|
||||||
if (this.loggeduser.Profile == 'MDGPR') {
|
if (SessionStore.user.Profile == 'MDGPR') {
|
||||||
this.headers = this.headersMdOficial;
|
this.headers = this.headersMdOficial;
|
||||||
}
|
}
|
||||||
else if (this.loggeduser.Profile == 'PR') {
|
else if (SessionStore.user.Profile == 'PR') {
|
||||||
this.headers = this.headersPrOficial;
|
this.headers = this.headersPrOficial;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -767,10 +739,10 @@ export class EventsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (this.loggeduser.Profile == 'MDGPR') {
|
if (SessionStore.user.Profile == 'MDGPR') {
|
||||||
this.headers = this.headersMdPessoal;
|
this.headers = this.headersMdPessoal;
|
||||||
}
|
}
|
||||||
else if (this.loggeduser.Profile == 'PR') {
|
else if (SessionStore.user.Profile == 'PR') {
|
||||||
this.headers = this.headersPrPessoal;
|
this.headers = this.headersPrPessoal;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -916,7 +888,7 @@ export class EventsService {
|
|||||||
|
|
||||||
let options;
|
let options;
|
||||||
|
|
||||||
switch (this.loggeduser.Profile) {
|
switch (SessionStore.user.Profile) {
|
||||||
case 'MDGPR':
|
case 'MDGPR':
|
||||||
if (calendarName == 'Pessoal') {
|
if (calendarName == 'Pessoal') {
|
||||||
options = {
|
options = {
|
||||||
@@ -974,7 +946,7 @@ export class EventsService {
|
|||||||
|
|
||||||
let options;
|
let options;
|
||||||
|
|
||||||
if(this.loggeduser.Profile == 'MDGPR') {
|
if(SessionStore.user.Profile == 'MDGPR') {
|
||||||
if (calendarName == 'Pessoal') {
|
if (calendarName == 'Pessoal') {
|
||||||
options = {
|
options = {
|
||||||
headers: this.headersMdPessoal,
|
headers: this.headersMdPessoal,
|
||||||
@@ -988,7 +960,7 @@ export class EventsService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.loggeduser.Profile == 'PR') {
|
else if (SessionStore.user.Profile == 'PR') {
|
||||||
if (calendarName == 'Pessoal') {
|
if (calendarName == 'Pessoal') {
|
||||||
options = {
|
options = {
|
||||||
headers: this.headersPrPessoal,
|
headers: this.headersPrPessoal,
|
||||||
@@ -1050,7 +1022,7 @@ export class EventsService {
|
|||||||
params = params.set("SerialNumber", serialNumber);
|
params = params.set("SerialNumber", serialNumber);
|
||||||
params = params.set("applicationID", applicationID);
|
params = params.set("applicationID", applicationID);
|
||||||
|
|
||||||
switch (this.loggeduser.Profile) {
|
switch (SessionStore.user.Profile) {
|
||||||
case 'MDGPR':
|
case 'MDGPR':
|
||||||
if (body.CalendarName == 'Pessoal') {
|
if (body.CalendarName == 'Pessoal') {
|
||||||
options = {
|
options = {
|
||||||
@@ -1121,7 +1093,7 @@ export class EventsService {
|
|||||||
params = params.set("SerialNumber", serialNumber);
|
params = params.set("SerialNumber", serialNumber);
|
||||||
params = params.set("applicationID", applicationID);
|
params = params.set("applicationID", applicationID);
|
||||||
|
|
||||||
switch (this.loggeduser.Profile) {
|
switch (SessionStore.user.Profile) {
|
||||||
case 'MDGPR':
|
case 'MDGPR':
|
||||||
if (body.CalendarName == 'Pessoal') {
|
if (body.CalendarName == 'Pessoal') {
|
||||||
options = {
|
options = {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { AuthService } from '../services/auth.service';
|
|||||||
import { LoginUserRespose } from '../models/user.model';
|
import { LoginUserRespose } from '../models/user.model';
|
||||||
import { OrganicEntity } from 'src/app/models/organic-entity.model';
|
import { OrganicEntity } from 'src/app/models/organic-entity.model';
|
||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
|
import { ChangeProfileService } from './change-profile.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -17,7 +18,18 @@ export class OrganicEntityService {
|
|||||||
loggeduser: LoginUserRespose;
|
loggeduser: LoginUserRespose;
|
||||||
headers: HttpHeaders;
|
headers: HttpHeaders;
|
||||||
|
|
||||||
constructor(private http: HttpClient, user: AuthService) {
|
constructor(
|
||||||
|
private http: HttpClient,
|
||||||
|
user: AuthService,
|
||||||
|
private changeProfileService: ChangeProfileService) {
|
||||||
|
|
||||||
|
this.setHeader()
|
||||||
|
this.changeProfileService.registerCallback(() => {
|
||||||
|
this.setHeader()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setHeader() {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { Publication } from '../models/publication';
|
|||||||
import { getUrl } from 'ionicons/dist/types/components/icon/utils';
|
import { getUrl } from 'ionicons/dist/types/components/icon/utils';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
|
import { ChangeProfileService } from './change-profile.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -23,11 +24,20 @@ export class PublicationsService {
|
|||||||
|
|
||||||
constructor(private http: HttpClient, user: AuthService,
|
constructor(private http: HttpClient, user: AuthService,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private changeProfileService: ChangeProfileService,) {
|
||||||
|
|
||||||
|
this.setHeader()
|
||||||
|
this.changeProfileService.registerCallback(() => {
|
||||||
|
this.setHeader()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
setHeader () {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GetPublicationFolderList(){
|
GetPublicationFolderList(){
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { LoginUserRespose } from '../models/user.model';
|
|||||||
import { EventSearch } from "src/app/models/event-search";
|
import { EventSearch } from "src/app/models/event-search";
|
||||||
import { TopSearch } from 'src/app/models/top-search';
|
import { TopSearch } from 'src/app/models/top-search';
|
||||||
import { SessionStore } from '../store/session.service';
|
import { SessionStore } from '../store/session.service';
|
||||||
|
import { ChangeProfileService } from './change-profile.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -21,7 +22,20 @@ export class SearchService {
|
|||||||
categories= Array;
|
categories= Array;
|
||||||
|
|
||||||
// setup
|
// setup
|
||||||
constructor(private http: HttpClient, user: AuthService) {
|
constructor(
|
||||||
|
private http: HttpClient,
|
||||||
|
user: AuthService,
|
||||||
|
private changeProfileService: ChangeProfileService) {
|
||||||
|
|
||||||
|
this.setHeader();
|
||||||
|
|
||||||
|
this.changeProfileService.registerCallback(() => {
|
||||||
|
this.setHeader()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setHeader() {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
|
|||||||
@@ -585,7 +585,6 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
this.postEvent.CalendarName
|
this.postEvent.CalendarName
|
||||||
|
|
||||||
|
|
||||||
const CalendarId = this.selectedCalendarId()
|
const CalendarId = this.selectedCalendarId()
|
||||||
let loader = this.toastService.loading();
|
let loader = this.toastService.loading();
|
||||||
|
|
||||||
@@ -643,15 +642,18 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
selectedCalendarId () {
|
selectedCalendarId () {
|
||||||
|
console.log('1:1',this.eventService.calendarNamesType,'2', this.CalendarName)
|
||||||
|
|
||||||
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
|
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
|
||||||
|
console.log('1')
|
||||||
return this.eventService.calendarNamesType[this.CalendarName]['OficialId']
|
return this.eventService.calendarNamesType[this.CalendarName]['OficialId']
|
||||||
|
|
||||||
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') {
|
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') {
|
||||||
|
console.log('2')
|
||||||
return this.eventService.calendarNamesType[this.CalendarName]['PessoalId']
|
return this.eventService.calendarNamesType[this.CalendarName]['PessoalId']
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
console.log('1:1',this.eventService.calendarNamesType,'2', this.CalendarName)
|
||||||
return '11:11'
|
return '11:11'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<ion-header class="ion-no-border">
|
<ion-header class="ion-no-border">
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
<!-- <ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar> -->
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<div class="thetitle"><ion-label >Todas as tarefas</ion-label></div>
|
<div class="thetitle"><ion-label >Todas as tarefas</ion-label></div>
|
||||||
<div class="theicon">
|
<div class="theicon">
|
||||||
@@ -120,6 +120,4 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import { versionData } from '../../version/git-version'
|
import { versionData } from '../../version/git-version'
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
// apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
|
// apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
|
||||||
apiURL: 'https://API.DONEIT.CO.AO/api/',
|
apiURL: 'https://API.DONEIT.CO.AO/api/',
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "d8b443add",
|
"shortSHA": "0144b306a",
|
||||||
"SHA": "d8b443add6a64568c3078b6b7d90a0732e85de92",
|
"SHA": "0144b306a87b09f30811af394d85fd2c3942e894",
|
||||||
"branch": "no_bug_movemente",
|
"branch": "no_bug_movemente",
|
||||||
"lastCommitAuthor": "'Eudes Inácio'",
|
"lastCommitAuthor": "'Eudes Inácio'",
|
||||||
"lastCommitTime": "'Wed Jan 18 14:20:23 2023 +0100'",
|
"lastCommitTime": "'Wed Jan 18 17:07:25 2023 +0100'",
|
||||||
"lastCommitMessage": "Intervinientes bug solved",
|
"lastCommitMessage": "Text change to doneIT",
|
||||||
"lastCommitNumber": "4651",
|
"lastCommitNumber": "4652",
|
||||||
"change": "",
|
"change": "",
|
||||||
"changeStatus": "On branch no_bug_movemente\nYour branch is ahead of 'origin/no_bug_movemente' by 1 commit.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/modals/profile/profile.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/shared/chat/messages/messages.page.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.html\n\tmodified: src/app/shared/header/header.page.html",
|
"changeStatus": "On branch no_bug_movemente\nYour branch and 'origin/no_bug_movemente' have diverged,\nand have 2 and 4 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: .gitignore\n\tmodified: src/app/modals/view-document/view-document.page.ts\n\tmodified: src/app/modals/view-event/view-event.page.ts\n\tmodified: src/app/pages/chat/chat.page.ts\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tnew file: src/app/pages/gabinete-digital/list.worker.js\n\tmodified: src/app/pages/login/login.page.ts\n\tmodified: src/app/services/attachments.service.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/services/chat/chat-methods.service.ts\n\tmodified: src/app/services/chat/chat-system.service.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/chat/rochet-chat-connector.service.ts\n\tmodified: src/app/services/chat/room.service.ts\n\tmodified: src/app/services/contacts.service.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/services/organic-entity.service.ts\n\tmodified: src/app/services/publications.service.ts\n\tmodified: src/app/services/search.service.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.html\n\tmodified: src/environments/environment.prod.ts\n\tnew file: version/git-static-version.ts",
|
||||||
"changeAuthor": "eudes.inacio"
|
"changeAuthor": "eudes.inacio"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user