mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
improve setup meeting from task
This commit is contained in:
+11
-12
@@ -31,29 +31,28 @@
|
||||
<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">
|
||||
<div *ngIf="utils.hasPrCalendar(calendarData) && !hasChangeCalendar " style="margin-bottom: -20px;">PR</div>
|
||||
<div *ngIf="selectedUserCalendar == sessionStore.user.UserId && !hasChangeCalendar && sessionStore.user.Profile != 'PR' " style="margin-bottom: -20px;">
|
||||
<div *ngIf="utils.hasPrCalendar(calendarData) && !hasChangeCalendar " style="margin-bottom: -20px;">PR </div>
|
||||
<div *ngIf="selectedUserCalendar == SessionStore.user.UserId && !hasChangeCalendar && SessionStore.user.Profile != 'PR'" style="margin-bottom: -20px;">
|
||||
Minha agenda
|
||||
</div>
|
||||
|
||||
<mat-select [(value)]="selectedUserCalendar" (selectionChange)="changeAgenda();changeSegmentCalendar()">
|
||||
|
||||
|
||||
<mat-option *ngFor="let calendars of calendarData" value="{{calendars.wxUserId}}">
|
||||
|
||||
|
||||
<div *ngIf="calendars.roleId == RoleIdService.PRES">PR </div>
|
||||
<div *ngIf="calendars.roleId == RoleIdService.MD && calendars.roleId != sessionStore.user.RoleID">AGENDA DO MDGPR</div>
|
||||
<div *ngIf="calendars.roleId != RoleIdService.MD && calendars.roleId != RoleIdService.PRES && calendars.wxFullName && calendars.wxUserId != sessionStore.user.UserId"> Agenda do {{calendars.wxFullName}} </div>
|
||||
<div *ngIf="calendars.wxUserId == sessionStore.user.UserId && sessionStore.user.Profile != 'PR'">
|
||||
<div *ngIf="calendars.roleId == RoleIdService.MD && calendars.roleId != SessionStore.user.RoleID">AGENDA DO MDGPR</div>
|
||||
<div *ngIf="calendars.roleId != RoleIdService.MD && calendars.roleId != RoleIdService.PRES && calendars.wxFullName && calendars.wxUserId != SessionStore.user.UserId"> Agenda {{calendars.wxFullName}} </div>
|
||||
<div *ngIf="calendars.wxUserId == SessionStore.user.UserId && SessionStore.user.Profile != 'PR'">
|
||||
Minha agenda
|
||||
</div>
|
||||
|
||||
|
||||
</mat-option>
|
||||
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+39
-33
@@ -22,13 +22,15 @@ import { RoleIdService } from 'src/app/services/role-id.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { Utils } from 'src/app/module/agenda/utils';
|
||||
import { Observable } from 'rxjs';
|
||||
import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service';
|
||||
import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service';
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { isHttpError } from 'src/app/services/http.service';
|
||||
import { AgendaService } from 'src/app/module/agenda/domain/agenda.service'
|
||||
import { RoleId } from 'src/app/core/agenda/entity/event';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
const moment = _rollupMoment || _moment;
|
||||
|
||||
@@ -108,6 +110,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
emptyTextDescription = "Selecionar intervenientes";
|
||||
|
||||
sessionStore = SessionStore;
|
||||
SessionStore=SessionStore
|
||||
environment = environment
|
||||
loggeduser: LoginUserRespose;
|
||||
eventPersons: EventPerson[];
|
||||
@@ -119,6 +122,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
allDayCheck: boolean = false;
|
||||
CalendarNameShow = true
|
||||
eventRecurence = 'never';
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -131,9 +135,9 @@ export class BookMeetingModalPage implements OnInit {
|
||||
public RoleIdService: RoleIdService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
public TaskService: TaskService,
|
||||
private contactsService: ContactsService,
|
||||
public utils: Utils,
|
||||
private agendaDataRepository: AgendaDataRepositoryService,
|
||||
private AgendaService: AgendaService
|
||||
) {
|
||||
this.taskParticipants = [];
|
||||
|
||||
@@ -177,24 +181,41 @@ export class BookMeetingModalPage implements OnInit {
|
||||
]
|
||||
}
|
||||
|
||||
this.changeAgenda();
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLiveWithOrder()
|
||||
|
||||
// Define the role priorities
|
||||
const rolePriorities: { [key: number]: number } = {
|
||||
100000014: 1, // Presidente da República
|
||||
100000011: 2, // Vice Presidente (example role ID)
|
||||
// Add other roles with their priorities here
|
||||
};
|
||||
|
||||
this.agendaDataRepository.getSharedCalendar()
|
||||
|
||||
this.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLive().pipe(
|
||||
map(data => data.sort((a, b) => {
|
||||
const priorityA = rolePriorities[a.roleId] || Infinity;
|
||||
const priorityB = rolePriorities[b.roleId] || Infinity;
|
||||
return priorityA - priorityB;
|
||||
}))
|
||||
)
|
||||
|
||||
this.setCalendarByDefault(true)
|
||||
this.postData.EventRecurrence = {
|
||||
frequency: 'never',
|
||||
until: "",
|
||||
Type: ''
|
||||
}
|
||||
|
||||
this.changeAgenda()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// console.log('TEsTEROLE',this.eventService.calendarNamesAry)
|
||||
this.adding = "intervenient";
|
||||
this.setCalendarByDefault(true)
|
||||
this.getAttachments();
|
||||
this.setDefaultTime()
|
||||
this.getRecurrenceTypes();
|
||||
// this.getRecurrenceTypes();
|
||||
this.fetchContacts("")
|
||||
|
||||
}
|
||||
@@ -206,7 +227,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
const data = await this.agendaDataRepository.geCalendars()
|
||||
|
||||
const prObject = data.find(e => e?.roleId == 100000014)
|
||||
const prObject = data.find(e => e?.roleId == RoleId.PRES)
|
||||
if(prObject) {
|
||||
this.selectedUserCalendar = prObject.wxUserId
|
||||
} else {
|
||||
@@ -231,11 +252,11 @@ export class BookMeetingModalPage implements OnInit {
|
||||
}, 1000);
|
||||
|
||||
|
||||
getRecurrenceTypes() {
|
||||
this.calendarService.getRecurrenceTypes().subscribe(res => {
|
||||
this.recurringTypes = res;
|
||||
});
|
||||
}
|
||||
// getRecurrenceTypes() {
|
||||
// this.calendarService.getRecurrenceTypes().subscribe(res => {
|
||||
// this.recurringTypes = res;
|
||||
// });
|
||||
// }
|
||||
|
||||
changeSegmentCalendar() {
|
||||
this.hasChangeCalendar = true
|
||||
@@ -666,31 +687,16 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
async fetchContacts(filter: string) {
|
||||
console.log(this.loggeduser)
|
||||
if (this.loggeduser.Profile == 'PR') {
|
||||
this.contactsService.getContacts(filter).subscribe(result => {
|
||||
if (this.eventPersons != null) {
|
||||
this.eventPersons.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
|
||||
});
|
||||
|
||||
result.splice(index, 1);
|
||||
const result = await this.AgendaService.setDefaultParticipants()
|
||||
|
||||
});
|
||||
}
|
||||
this.contacts = result;
|
||||
console.log('Attendes Email', this.loggeduser.Email)
|
||||
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
|
||||
console.log('Attendes Email', filterLoggedUserEmail)
|
||||
|
||||
this.contacts = filterLoggedUserEmail;
|
||||
const newAttendees: EventPerson[] = this.contacts;
|
||||
|
||||
this.setIntervenient(newAttendees);
|
||||
console.log('Attendes Email', this.contacts)
|
||||
if(result.isOk()) {
|
||||
if(result.value) {
|
||||
console.log('Attendes Email', result.value)
|
||||
this.setIntervenient(result.value);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from '../../../services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
@@ -44,7 +43,6 @@ export class ExpedientePage implements OnInit {
|
||||
private router: Router,
|
||||
private toastService: ToastService,
|
||||
public platform: Platform,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
|
||||
@@ -8,7 +8,6 @@ import { AlertService } from 'src/app/services/alert.service';
|
||||
import { PedidosStore } from 'src/app/store/pedidos-store.service';
|
||||
import { ModalService } from 'src/app/services/modal.service';
|
||||
|
||||
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'
|
||||
@@ -60,7 +59,6 @@ export class PedidosPage implements OnInit {
|
||||
private alertService: AlertService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private modalService: ModalService,
|
||||
private sqliteservice: SqliteService,
|
||||
private sortService: SortService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private platform: Platform,
|
||||
|
||||
@@ -10,7 +10,6 @@ import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
|
||||
Reference in New Issue
Block a user