mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
show calendar field by default
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="(sharedCalendar | async) as calendarData" class="container-div" (click)="changeAgenda()">
|
||||
<div *ngIf="(sharedCalendar | async) as calendarData" class="container-div" >
|
||||
<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>
|
||||
@@ -38,7 +38,13 @@
|
||||
<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()">
|
||||
<div *ngIf="hasPrCalendar(calendarData) && !hasChangeCalendar " style="margin-bottom: -20px;">PR </div>
|
||||
<div *ngIf="selectedUserCalendar == SessionStore.user.UserId && !hasChangeCalendar " style="margin-bottom: -20px;">
|
||||
Minha agenda
|
||||
</div>
|
||||
|
||||
|
||||
<mat-select [(value)]="selectedUserCalendars" (selectionChange)="changeAgenda();changeSegmentCalendar()">
|
||||
|
||||
<mat-option *ngFor="let calendars of calendarData" value="{{calendars.wxUserId}}">
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ export class NewEventPage implements OnInit {
|
||||
sharedCalendar: Observable<TableSharedCalendar[]>
|
||||
selectedUserCalendar:any;
|
||||
SessionStore = SessionStore
|
||||
|
||||
hasChangeCalendar = false
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -191,6 +191,17 @@ export class NewEventPage implements OnInit {
|
||||
this.setCalendarByDefault(true)
|
||||
}
|
||||
|
||||
|
||||
hasPrCalendar(data: TableSharedCalendar[]) {
|
||||
for(const e of data) {
|
||||
if(e.roleId == this.RoleIdService.PRES) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
async setCalendarByDefault(force) {
|
||||
if (!this.selectedUserCalendar || force) {
|
||||
|
||||
@@ -428,6 +439,11 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
changeSegmentCalendar() {
|
||||
this.hasChangeCalendar = true
|
||||
}
|
||||
|
||||
changeAgenda() {
|
||||
|
||||
this.CalendarNameShow = false
|
||||
|
||||
Reference in New Issue
Block a user