mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
improve evento to approve
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'MDGPR' : i.OwnerUserId ">
|
||||
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'Meu calendario' : i.OwnerUserId ">
|
||||
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
|
||||
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR </div>
|
||||
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||
|
||||
@@ -49,11 +49,13 @@ export class EventListPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.segment = this.loggeduser.Profile;
|
||||
if(this.segment != "PR" && this.segment != "MDGPR") {
|
||||
this.segment = "Unknown";
|
||||
if(!this.segment) {
|
||||
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||
this.segment = 'Meu calendario';
|
||||
} else {
|
||||
this.segment = this.eventService.calendarNamesAry[0].OwnerUserId
|
||||
}
|
||||
}
|
||||
|
||||
const pathname = window.location.pathname
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
@@ -83,7 +85,7 @@ export class EventListPage implements OnInit {
|
||||
|
||||
const segment = this.segment
|
||||
|
||||
if(this.segment == 'MDGPR') {
|
||||
if(this.segment == 'Meu calendario') {
|
||||
// color
|
||||
if(SessionStore.user.Profile == 'PR') {
|
||||
this.color = 'pr'
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
Minha agenda
|
||||
</ion-segment-button> -->
|
||||
|
||||
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'MDGPR' : i.OwnerUserId">
|
||||
<ion-segment-button *ngFor="let calendars of eventService.calendarNamesAry; let i index" [value]="i === 'Meu calendario' ? 'Meu calendario' : i.OwnerUserId">
|
||||
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
|
||||
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> Agenda do PR {{ i.OwnerUserIds }}</div>
|
||||
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> Agenda do MD </div>
|
||||
|
||||
@@ -27,7 +27,6 @@ export class EventsToApprovePage implements OnInit {
|
||||
eventBody: EventBody;
|
||||
categories: string[];
|
||||
serialnumber:string;
|
||||
loggeduser: LoginUserRespose;
|
||||
segment:string;
|
||||
eventaprovacaostore = EventoAprovacaoStore;
|
||||
|
||||
@@ -44,12 +43,17 @@ export class EventsToApprovePage implements OnInit {
|
||||
private storage: Storage,
|
||||
public eventService: EventsService,
|
||||
)
|
||||
{
|
||||
this.loggeduser = SessionStore.user;
|
||||
}
|
||||
{}
|
||||
|
||||
ngOnInit() {
|
||||
this.segment = this.loggeduser.Profile;
|
||||
if(!this.segment) {
|
||||
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||
this.segment = 'Meu calendario';
|
||||
} else {
|
||||
this.segment = this.eventService.calendarNamesAry[0].OwnerUserId
|
||||
}
|
||||
}
|
||||
|
||||
this.LoadToApproveEvents();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
@@ -73,9 +77,8 @@ export class EventsToApprovePage implements OnInit {
|
||||
async LoadToApproveEvents() {
|
||||
this.showLoader = true;
|
||||
const segment = this.segment
|
||||
console.log(this.eventService.calendarNamesAry)
|
||||
|
||||
if(this.segment == 'MDGPR') {
|
||||
if(this.segment == 'Meu calendario') {
|
||||
// color
|
||||
if(SessionStore.user.Profile == 'PR') {
|
||||
this.color = 'pr'
|
||||
@@ -98,12 +101,9 @@ export class EventsToApprovePage implements OnInit {
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
this.color = 'pr'
|
||||
|
||||
let allEvents = await this.processes.eventsToApprove(segment).toPromise()
|
||||
|
||||
console.log('allEvents', allEvents)
|
||||
try {
|
||||
this.eventsList = this.sortService.sortArrayByDate(allEvents).reverse();
|
||||
} catch(error) {
|
||||
|
||||
Reference in New Issue
Block a user