commit para fazer test

This commit is contained in:
Eudes Inácio
2022-04-13 22:39:08 +01:00
8 changed files with 192 additions and 101 deletions
+4 -4
View File
@@ -104,7 +104,7 @@
<ion-row class="ion-align-items-center">
<!-- <div *ngIf="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR'" class="calendar-letters"> -->
<div class="calendar-letters cal-reverse" *ngIf="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR' && eventService.calendarOwnerIds.length >= 2" class="calendar-letters" [class.cal-reverse]="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR' && profile == 'mdgpr' " (click)="changeProfile()">
<div class="calendar-letters cal-reverse" *ngIf="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR' && eventService.calendarIds.length >= 2" class="calendar-letters" [class.cal-reverse]="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR' && profile == 'mdgpr' " (click)="changeProfile()">
<div class="text" *ngIf="profile == 'mdgpr'">
{{ sessionStore.getInitials }}
</div>
@@ -116,11 +116,11 @@
</div>
<button *ngIf="profile == 'mdgpr' && eventService.calendarOwnerIds.length >= 2 && ( loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR') " (click)="changeProfile()" class="d-md-none btn-no-color resize">
<button *ngIf="profile == 'mdgpr' && eventService.calendarIds.length >= 2 && ( loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR') " (click)="changeProfile()" class="d-md-none btn-no-color resize">
<ion-icon class="right-icons" src="assets/images/icons-profile-calendar-md.svg"></ion-icon>
</button>
<button title="Mudar de Agenda" *ngIf="profile == 'pr'&& eventService.calendarOwnerIds.length >= 2 && ( loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR')" (click)="changeProfile()" class="btn-no-color resize">
<button title="Mudar de Agenda" *ngIf="profile == 'pr'&& eventService.calendarIds.length >= 2 && ( loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR')" (click)="changeProfile()" class="btn-no-color resize">
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
</button>
@@ -294,7 +294,7 @@
</div>
</div>
<div class="fs-timeline flex-grow-1 d-none d-md-block d-md-block text-black pr-20 width-100 height-100 overflow-y-auto" *ngIf="eventService.calendarOwnerIds.length >= 2">
<div class="fs-timeline flex-grow-1 d-none d-md-block d-md-block text-black pr-20 width-100 height-100 overflow-y-auto" *ngIf="eventService.calendarIds.length >= 2">
<div *ngFor="let events of TimelineMDList | keyvalue;" >
<div class="EventListBox-container" >
+1 -1
View File
@@ -208,7 +208,7 @@ export class AgendaPage implements OnInit {
} else if (this.loggeduser.Profile == 'PR') {
this.profile = "pr";
} else {
if(this.eventService.calendarOwnerIds.length >= 2) {
if(this.eventService.calendarIds.length >= 2) {
this.profile = "mdgpr";
} else if (this.eventService.hasOwnCalendar) {
this.profile = "mdgpr";
+2 -2
View File
@@ -94,7 +94,7 @@
</div>
</div>
</ion-item-sliding>
<ion-item-sliding *ngIf=" wsChatMethodsService.dmCount < 1">
<ion-item-sliding *ngIf="wsChatMethodsService.loadingWholeList == true">
<div *ngFor="let n of numSequence(8); let i = index;" class="item item-hover width-100 d-flex ion-no-padding ion-no-margin">
<div class="item-icon"><ion-icon class="icon" slot="start" src="assets/icon/icons-chat-grey.svg"></ion-icon></div>
<div class="item-content flex-grow-1 cursor-pointer">
@@ -150,7 +150,7 @@
</div>
</div>
</ion-item-sliding>
<ion-item-sliding *ngIf="wsChatMethodsService.groupCount < 1">
<ion-item-sliding *ngIf="wsChatMethodsService.loadingWholeList == true">
<div *ngFor="let n of numSequence(8); let i = index;" class="item item-hover width-100 d-flex ion-no-padding ion-no-margin">
<div class="item-icon"><ion-icon class="icon" slot="start" src="assets/icon/icons-group-chat-grey.svg"></ion-icon></div>
<div class="item-content flex-grow-1 cursor-pointer">
@@ -140,7 +140,7 @@
</ion-item>
</div>
<div class="audio-contentainer" *ngIf="msg.file.type == 'application/audio' && file.title_link">
<audio [src]="file.title_link|safehtml" preload="metadata" class="d-flex width-100" controls
<audio [src]="file.title_link | safehtml" preload="metadata" class="d-flex width-100" controls
controlsList="nodownload noplaybackrate"></audio>
</div>
<div class="file-details-optional add-attachment-bg-color">
@@ -24,6 +24,8 @@
</div>
</div>
<div class="container-div width-100">
<div class="ion-item-class-2 width-100">
<div class="ion-icon-class">
@@ -35,16 +37,29 @@
</div>
</div>
<!-- <div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Location').invalid " class="input-errror-message">
<div *ngIf="Form.get('Location').errors?.required">
Campo obrigatório.
<div class="container-div" *ngIf="calendarService.hasOwnCalendar == true && calendarService.hasSharedCalendar == true" >
<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 *ngIf="Form.get('Location').errors?.minlength">
O campo deve ter pelo menos 4 caracteres.
<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" >
<!-- <mat-select [(value)]="postEvent.CalendarName" > -->
<mat-option value="myCalendar">
Meu Calendário
</mat-option>
<mat-option value="sharedCalendar">
Calendário de {{ sessionStore.user.ManagerName}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</div> -->
</div>
<div class="container-div">
<div class="ion-item-class-2">
@@ -20,6 +20,7 @@ import * as _rollupMoment from 'moment';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
const moment = _rollupMoment || _moment;
@@ -117,23 +118,26 @@ export class BookMeetingModalPage implements OnInit {
loggeduser: LoginUserRespose;
emptyTextDescription = "Sem intervenientes selecionados";
CalendarName: 'myCalendar' | 'sharedCalendar' = 'myCalendar'
sessionStore = SessionStore;
constructor(
private modalController: ModalController,
private router:Router,
private navParams: NavParams,
private processes:ProcessesService,
private attachmentsService: AttachmentsService,
private calendarService: EventsService,
public calendarService: EventsService,
authService: AuthService,
private toastService: ToastService,
private activatedRoute: ActivatedRoute,
public ThemeService: ThemeService
public ThemeService: ThemeService,
) {
this.taskParticipants = [];
this.loggeduser = authService.ValidatedUser;
this.task = this.navParams.get('task');
console.log(this.task)
this.postData = new Event();
this.eventBody = { BodyType : "1", Text : ""};
this.postData.Body = this.eventBody;
@@ -145,11 +149,23 @@ export class BookMeetingModalPage implements OnInit {
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
this.postData.Category = 'Reunião'
if(this.calendarService.hasOwnCalendar == false || !this.calendarService.hasSharedCalendar == false) {
if(this.calendarService.hasOwnCalendar == false && this.calendarService.hasSharedCalendar == true) {
this.CalendarName = 'sharedCalendar'
} else if (this.calendarService.hasOwnCalendar == true && this.calendarService.hasSharedCalendar == false) {
this.CalendarName = 'myCalendar'
}
}
}
ngOnInit() {
this.adding = "intervenient";
console.log(this.task);
this.getAttachments();
this.setDefaultTime()
this.getRecurrenceTypes();
@@ -262,19 +278,12 @@ export class BookMeetingModalPage implements OnInit {
if(this.task.FsId == '8') {
const loader = this.toastService.loading()
try {
switch (this.loggeduser.Profile) {
case 'MDGPR':
await this.calendarService.postExpedientEvent(this.task.DocId, this.postData, "md",this.task.SerialNumber, this.task.FsId).toPromise();
break;
case 'PR':
await this.calendarService.postExpedientEvent(this.task.DocId, this.postData, "pr",this.task.SerialNumber, this.task.FsId).toPromise()
break;
}
await this.calendarService.genericPostExpedientEvent(this.task.DocId, this.postData, "",this.task.SerialNumber, this.task.FsId, this.CalendarName).toPromise();
this.modalController.dismiss();
// this.distartExpedientModal();
this.toastService._successMessage('Reunião criada');
} catch (error) {
@@ -290,15 +299,9 @@ export class BookMeetingModalPage implements OnInit {
const loader = this.toastService.loading()
try {
switch (this.loggeduser.Profile) {
case 'MDGPR':
await this.calendarService.createTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "md",this.task.SerialNumber, this.task.FsId).toPromise();
break;
case 'PR':
await this.calendarService.createTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "pr",this.task.SerialNumber, this.task.FsId).toPromise();
break;
}
await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "",this.task.SerialNumber, this.task.FsId, this.CalendarName).toPromise();
this.close();
this.toastService._successMessage('Reunião criada');
+3
View File
@@ -126,6 +126,9 @@ export class AuthService {
session.BasicAuthKey = user.BasicAuthKey
console.log(session)
SessionStore.reset(session)
this.ValidatedUser = SessionStore.user;
this.storageService.store(AuthConnstants.USER, response);
+134 -64
View File
@@ -41,7 +41,7 @@ export class EventsService {
hasOwnCalendar = false
calendarOwnerIds = []
calendarIds = []
constructor(
private http: HttpClient,
@@ -83,19 +83,13 @@ export class EventsService {
this.hasSharedCalendar = false
this.hasOwnCalendar = false
this.calendarOwnerIds = []
this.calendarIds = []
if (this.loggeduser) {
if (this.loggeduser.Profile == 'MDGPR') {
this.loggeduser.OwnerCalendars.forEach(calendar => {
if(!this.calendarOwnerIds.includes(calendar.OwnerUserId)) {
this.calendarOwnerIds.push(calendar.OwnerUserId)
}
this.hasOwnCalendar = true
if (calendar.CalendarName == 'Oficial') {
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey);
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
@@ -111,12 +105,6 @@ export class EventsService {
this.loggeduser.SharedCalendars.forEach(sharedCalendar => {
if(!this.calendarOwnerIds.includes(sharedCalendar.OwnerUserId)) {
this.calendarOwnerIds.push(sharedCalendar.OwnerUserId)
}
this.hasSharedCalendar = true
if (sharedCalendar.CalendarName == 'Oficial') {
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
@@ -129,16 +117,11 @@ export class EventsService {
}
});
}
else if (this.loggeduser.Profile == 'PR') {
this.loggeduser.OwnerCalendars.forEach(calendar => {
if(!this.calendarOwnerIds.includes(calendar.OwnerUserId)) {
this.calendarOwnerIds.push(calendar.OwnerUserId)
}
this.hasOwnCalendar = true
if (calendar.CalendarName == 'Oficial') {
this.headersPrOficial = this.headersPrOficial.set('Authorization', this.loggeduser.BasicAuthKey);
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
@@ -151,55 +134,54 @@ export class EventsService {
}
});
} else {
this.loggeduser.OwnerCalendars.forEach(calendar => {
if(!this.calendarOwnerIds.includes(calendar.OwnerUserId)) {
this.calendarOwnerIds.push(calendar.OwnerUserId)
}
this.hasOwnCalendar = true
if (calendar.CalendarName == 'Oficial') {
this.headerOwnOficial = this.headerOwnOficial.set('Authorization', this.loggeduser.BasicAuthKey);
this.headerOwnOficial = this.headerOwnOficial.set('CalendarId', calendar.CalendarId);
this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId);
this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName);
}
else if (calendar.CalendarName == 'Pessoal') {
this.headerOwnPessoal = this.headerOwnPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarId', calendar.CalendarId);
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
}
});
}
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
this.loggeduser.OwnerCalendars.forEach(calendar => {
if(!this.calendarOwnerIds.includes(sharedCalendar.OwnerUserId)) {
this.calendarOwnerIds.push(sharedCalendar.OwnerUserId)
}
this.hasSharedCalendar = true
if (sharedCalendar.CalendarName == 'Oficial') {
sharedCalendar.CalendarName
this.headerSharedOficial = this.headerSharedOficial.set('Authorization', 'Basic '+sharedCalendar.CalendarToken);
this.headerSharedOficial = this.headerSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName);
}
else if (sharedCalendar.CalendarName == 'Pessoal') {
this.headerSharedPessoal = this.headerSharedPessoal.set('Authorization', 'Basic '+sharedCalendar.CalendarToken);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
}
if(!this.calendarIds.includes(calendar.OwnerUserId)) {
this.calendarIds.push(calendar.OwnerUserId)
}
this.hasOwnCalendar = true
if (calendar.CalendarName == 'Oficial') {
this.headerOwnOficial = this.headerOwnOficial.set('Authorization', this.loggeduser.BasicAuthKey);
this.headerOwnOficial = this.headerOwnOficial.set('CalendarId', calendar.CalendarId);
this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId);
this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName);
}
else if (calendar.CalendarName == 'Pessoal') {
this.headerOwnPessoal = this.headerOwnPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarId', calendar.CalendarId);
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
}
});
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
if(!this.calendarIds.includes(sharedCalendar.OwnerUserId)) {
this.calendarIds.push(sharedCalendar.OwnerUserId)
}
this.hasSharedCalendar = true
if (sharedCalendar.CalendarName == 'Oficial') {
sharedCalendar.CalendarName
this.headerSharedOficial = this.headerSharedOficial.set('Authorization', 'Basic '+sharedCalendar.CalendarToken);
this.headerSharedOficial = this.headerSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName);
}
else if (sharedCalendar.CalendarName == 'Pessoal') {
this.headerSharedPessoal = this.headerSharedPessoal.set('Authorization', 'Basic '+sharedCalendar.CalendarToken);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
}
}
this.headers = new HttpHeaders();
@@ -881,6 +863,49 @@ export class EventsService {
}
return this.http.post<any>(`${geturl}`, body, options)
}
genericPostExpedientEvent(docId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any, calendar: 'myCalendar' | 'sharedCalendar') {
const geturl = environment.apiURL + 'calendar/expediente';
let params = new HttpParams();
let options;
params = params.set("DocId", docId);
params = params.set("SerialNumber", serialNumber);
params = params.set("applicationID", applicationID);
if(calendar == 'myCalendar') {
if (body.CalendarName == 'Pessoal') {
options = {
headers: this.headerOwnPessoal,
params: params
}
}
else if (body.CalendarName == 'Oficial') {
options = {
headers: this.headerOwnOficial,
params: params
}
}
} else if (calendar == 'sharedCalendar') {
if (body.CalendarName == 'Pessoal') {
options = {
headers: this.headerSharedPessoal,
params: params
};
}
else if (body.CalendarName == 'Oficial') {
options = {
headers: this.headerSharedOficial,
params: params
};
}
}
return this.http.post<any>(`${geturl}`, body, options)
}
createTaskEvent(folderId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any) {
const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente') + '/dispatch';
let params = new HttpParams();
@@ -923,6 +948,51 @@ export class EventsService {
return this.http.post<any>(`${geturl}`, body, options)
}
genericCreateTaskEvent(folderId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any, calendar: 'myCalendar' | 'sharedCalendar') {
const geturl = environment.apiURL + 'calendar/dispatch';
let params = new HttpParams();
let options;
params = params.set("FolderId", folderId);
params = params.set("SerialNumber", serialNumber);
params = params.set("applicationID", applicationID);
if(calendar == 'myCalendar') {
if (body.CalendarName == 'Pessoal') {
options = {
headers: this.headerOwnPessoal,
params: params
}
}
else if (body.CalendarName == 'Oficial') {
options = {
headers: this.headerOwnOficial,
params: params
}
}
} else if (calendar == 'sharedCalendar') {
if (body.CalendarName == 'Pessoal') {
options = {
headers: this.headerSharedPessoal,
params: params
};
}
else if (body.CalendarName == 'Oficial') {
options = {
headers: this.headerSharedOficial,
params: params
};
}
}
return this.http.post<any>(`${geturl}`, body, options)
}
postEventToApproveEdit(body: EventToApproveEdit) {
const geturl = environment.apiURL + 'Tasks/EditEventTask';