improve setup meeting from task

This commit is contained in:
Peter Maquiran
2024-10-18 16:22:45 +01:00
parent 3f41e9e9c0
commit 661b449fb4
48 changed files with 253 additions and 995 deletions
+3 -3
View File
@@ -235,9 +235,9 @@ export class HomePage implements OnInit {
throw ('Chat temporarily unavailable for ' + SessionStore.user.FullName + '. No ChatData');
}
if (this.p.userPermission([this.p.permissionList.Agenda.access]) && !this.eventService.hasAnyCalendar) {
// throw ('User ' + SessionStore.user.FullName + 'has No calendar');
}
// if (this.p.userPermission([this.p.permissionList.Agenda.access]) && !this.eventService.hasAnyCalendar) {
// // throw ('User ' + SessionStore.user.FullName + 'has No calendar');
// }
if (this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks]) && SessionStore.user.RoleID != this.RoleIdService.PRES) {
throw ('User has PRES permission but not roleId');
}
@@ -29,32 +29,34 @@
</div>
</div>
<div 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>
</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">
<mat-select [(value)]="CalendarName" (selectionChange)="changeAgenda()">
<!-- <mat-option *ngFor="let calendars of _eventService.calendarNamesAry; let i = index" value="{{calendars}}">
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Presidente da República'"> {{ environment.agendaPR}} </div>
<div *ngIf="calendars != 'Meu calendario' && calendars == 'Ministro e Director do Gabinete do PR'"> {{ environment.agendaVP}} </div>
<div *ngIf="calendars != 'Meu calendario' && calendars != 'Ministro e Director do Gabinete do PR' && calendars != 'Presidente da República'"> Agenda do {{calendars}} </div>
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div> -->
<mat-option *ngFor="let calendars of _eventService.calendarNamesAry" value="{{calendars.Fullname || calendars}}">
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> {{ environment.agendaPR}} </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> {{ environment.agendaVP}} </div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República'"> Agenda do {{calendars.Fullname}} </div>
<div *ngIf="calendars == 'Meu calendario'"> Minha agenda </div>
<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 {{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>
@@ -101,42 +103,6 @@
</div>
</div> -->
<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>
</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;">
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'">
Minha agenda
</div>
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</div>
<div class="container-div">
<div class="ion-item-class-2">
<div class="ion-icon-class">
@@ -22,7 +22,6 @@ import { SessionStore } from 'src/app/store/session.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 { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service';
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
import { Observable } from 'rxjs';
@@ -30,6 +29,8 @@ import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agen
import { isHttpError } from 'src/app/services/http.service';
import { RoleIdService } from 'src/app/services/role-id.service';
import { Utils } from 'src/app/module/agenda/utils';
import { AgendaService } from 'src/app/module/agenda/domain/agenda.service'
import { map } from 'rxjs/operators';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -110,6 +111,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
sharedCalendar: Observable<TableSharedCalendar[]>
selectedUserCalendar:any;
sessionStore = SessionStore;
SessionStore=SessionStore
hasChangeCalendar = false
eventRecurence = 'never';
@@ -125,10 +127,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
public _eventService: EventsService,
private httpErroHandle: HttpErrorHandle,
public TaskService: TaskService,
private contactsService: ContactsService,
private agendaDataRepository: AgendaDataRepositoryService,
public RoleIdService: RoleIdService,
public utils: Utils,
private AgendaService: AgendaService
) {
this.loggeduser = SessionStore.user;
this.document = this.navParams.get('document')
@@ -203,6 +205,23 @@ export class DocumentSetUpMeetingPage implements OnInit {
]
}
// 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.changeAgenda()
this.postData.EventRecurrence = {
@@ -218,7 +237,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
ngOnInit() {
this.adding = "intervenient";
this.setDefaultTime()
this.getRecurrenceTypes();
// this.getRecurrenceTypes();
this.fetchContacts("")
this.setCalendarByDefault(true)
}
@@ -258,11 +277,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
})
}, 1000);
getRecurrenceTypes() {
this.calendarService.getRecurrenceTypes().subscribe(res => {
this.recurringTypes = res;
});
}
// getRecurrenceTypes() {
// this.calendarService.getRecurrenceTypes().subscribe(res => {
// this.recurringTypes = res;
// });
// }
setDefaultTime() {
this.setStartDate()
@@ -551,20 +570,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
}
}
selectedCalendarId() {
if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postData.CalendarName == 'Oficial') {
return this._eventService.calendarNamesType[this.CalendarName]['OficialId']
} else if (this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postData.CalendarName == 'Pessoal') {
return this._eventService.calendarNamesType[this.CalendarName]['PessoalId']
} else {
return '11:11'
}
}
dynamicSetIntervenient({ taskParticipants, taskParticipantsCc }) {
this.taskParticipants = taskParticipants;
this.taskParticipantsCc = taskParticipantsCc;
@@ -612,37 +617,18 @@ export class DocumentSetUpMeetingPage implements OnInit {
return _date
}
checkRoleInArray(str) {
return this._eventService.calendarRole.includes(str);
}
async fetchContacts(filter: string) {
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()
});
const result = await this.AgendaService.setDefaultParticipants()
result.splice(index, 1);
});
}
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) {
this.setIntervenient(result.value);
console.log('Attendes Email', result.value)
}
);
}
}
@@ -6,8 +6,6 @@ import { EventMapper } from '../../domain/mapper/EventDetailsMapper';
import { Event } from 'src/app/models/event.model';
import { SessionStore } from 'src/app/store/session.service';
import { EventListToApproveMapper } from '../../domain/mapper/eventToApproveListMapper';
import { err, ok } from 'neverthrow';
import { HttpErrorResponse } from '@angular/common/http';
import { EventToApproveDetailsMapper } from '../../domain/mapper/EventToApproveDetailsMapper';
import { AgendaLocalDataSourceService, TableSharedCalendar } from '../data-source/agenda-local-data-source.service';
import { EEventFilterStatus } from '../dto/enums';
@@ -19,10 +17,10 @@ import { EventUpdateInputDTOSchema } from '../dto/eventUpdateInputDtO';
import { AttachInputDTOSchema } from '../dto/addAttachmentDTOInput';
import { EventListDataOutputDTOSchema } from '../dto/eventListDTOOutput';
import { EventSearchMapper } from '../../domain/mapper/EventSearchMapper';
import { select, Store } from '@ngrx/store';
import { CalendarState, pushEvent, removeRangeForCalendar, selectEventsInRange } from '../data-source/agenda-memory-source.service';
import { Store } from '@ngrx/store';
import { CalendarState } from '../data-source/agenda-memory-source.service';
import { NativeNotificationService } from 'src/app/services/native-notification.service';
import { ListBoxService } from 'src/app/services/agenda/list-box.service';
import { ListBoxService } from 'src/app/ui/agenda/service/list-box.service';
import { EventListStore } from 'src/app/models/agenda/AgendaEventList';
import { AttendeeInputDTOSchema } from '../dto/attendeeInputDTO';
import { EventInputDTOSchema } from '../dto/eventInputDTO';
+9 -9
View File
@@ -12,19 +12,19 @@ export class Utils {
) { }
selectedCalendarUserId(CalendarName, postEvent) {
// selectedCalendarUserId(CalendarName, postEvent) {
if (this.eventService.calendarNamesType[CalendarName]?.['Oficial'] && postEvent.CalendarName == 'Oficial') {
return this.eventService.calendarNamesType[CalendarName]['OwnerId']
// if (this.eventService.calendarNamesType[CalendarName]?.['Oficial'] && postEvent.CalendarName == 'Oficial') {
// return this.eventService.calendarNamesType[CalendarName]['OwnerId']
} else if (this.eventService.calendarNamesType[CalendarName]?.['Pessoal'] && postEvent.CalendarName == 'Pessoal') {
// } else if (this.eventService.calendarNamesType[CalendarName]?.['Pessoal'] && postEvent.CalendarName == 'Pessoal') {
return this.eventService.calendarNamesType[CalendarName]['OwnerId']
// return this.eventService.calendarNamesType[CalendarName]['OwnerId']
} else {
return '11:11'
}
}
// } else {
// return '11:11'
// }
// }
selectedCalendarOwner(roleDescription) {
@@ -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>
@@ -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';
@@ -4,7 +4,6 @@ import { ModalController, NavParams, Platform } from '@ionic/angular';
/* import {Plugins, CameraResultType, CameraSource} from '@capacitor/core'; */
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
import { Image } from 'src/app/models/image';
import { PhotoService } from 'src/app/services/photo.service';
//Capacitor
import { ToastService } from 'src/app/services/toast.service';
@@ -116,7 +115,6 @@ export class NewPublicationPage implements OnInit {
constructor(
private modalController: ModalController,
public photoService: PhotoService,
private navParams: NavParams,
private toastService: ToastService,
public ThemeService: ThemeService,
+15 -8
View File
@@ -1,8 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { ContactsService } from 'src/app/services/contacts.service';
import { EventPerson } from 'src/app/models/eventperson.model';
import { ThemeService } from 'src/app/services/theme.service'
import { AgendaService } from 'src/app/module/agenda/domain/agenda.service'
@Component({
selector: 'app-sender',
@@ -18,8 +18,9 @@ export class SenderPage implements OnInit {
selectedUser: string;
constructor(private modalController:ModalController,
private ContactsService: ContactsService,
public ThemeService: ThemeService) {
public ThemeService: ThemeService,
private AgendaService: AgendaService
) {
}
@@ -27,11 +28,17 @@ export class SenderPage implements OnInit {
this.getSender();
}
getSender(){
this.ContactsService.getContacts("").subscribe(res=>{
this.contacts = res;
this.showContacts = res
});
async getSender(){
const result = await this.AgendaService.setDefaultParticipants()
if(result.isOk()) {
if(result.value) {
console.log('Attendes Email', result.value)
this.contacts = result.value as any;
this.showContacts = result.value as any
}
}
}
filterContact(event?:any){
-39
View File
@@ -1,39 +0,0 @@
import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class CacheService {
// A HashMap to store the cache. The key is the page and the value is the data.
private cache = new Map<string, any[]>();
// BehaviorSubject that will contain the updated cache data.
public cache$ = new BehaviorSubject<any[]>(null);
// The 'set' method for storing data in the cache.
set(key: string, data: any[]): void {
// We check if data already exists for this key.
if (this.cache.has(key)) {
// If it already exists, we throw an exception to prevent overwriting the data.
throw new Error(`Data already exists for key '${key}'. Use a different key or delete the existing one first.`);
}
// If there is no data for this key, we store it in the cache and update the BehaviorSubject.
this.cache.set(key, data);
this.cache$.next(this.cache.get(key));
}
// The 'get' method for retrieving data from the cache.
get(key: string): any[] {
// We retrieve the data from the cache and update the BehaviorSubject.
const data = this.cache.get(key);
this.cache$.next(data);
return data;
}
// The 'clear' method to clear data from the cache.
clear(key: string): void {
// We remove the data from the cache and update the BehaviorSubject.
this.cache.delete(key);
this.cache$.next(null);
}
}
-53
View File
@@ -1,53 +0,0 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ChunksService {
chunkSize: number
private file: File
constructor() {
}
get totalChunks () {
return Math.ceil(this.file.size / this.chunkSize);
}
// Function to read a chunk of the file
readChunk(start: number, end: number): Promise<ArrayBuffer> {
const file = this.file
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => {
if (reader.result instanceof ArrayBuffer) {
resolve(reader.result);
} else {
reject(new Error("Failed to read chunk"));
}
};
reader.readAsArrayBuffer(file.slice(start, end));
});
}
setFile(file) {
this.file = file
}
async getChunks(i: number,chunkSize: number) {
i--
if(i < this.totalChunks) {
const start = i * chunkSize;
const end = Math.min(start + chunkSize, this.file.size);
const chunk = await this.readChunk(start, end);
return chunk
}
}
}
-16
View File
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { ContactsService } from './contacts.service';
describe('ContactsService', () => {
let service: ContactsService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ContactsService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
-61
View File
@@ -1,61 +0,0 @@
import { Injectable } from '@angular/core';
import { EventPerson } from '../models/eventperson.model';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { LoginUserRespose } from '../models/user.model';
import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({
providedIn: 'root'
})
export class ContactsService {
authheader = {};
loggeduser: LoginUserRespose;
headers: HttpHeaders;
constacts: EventPerson[] = []
constructor(
private http: HttpClient,
user: AuthService,
private changeProfileService: ChangeProfileService) {
this.setHeader()
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
this.getContacts("").subscribe( result => {
this.constacts = result
})
}
setHeader() {
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();;
this.headers = this.headers.set('Authorization', 'Bearer ' + SessionStore.user.Authorization);
}
getContacts(namefilter:string): Observable<EventPerson[]>{
/* const geturl = environment.apiURL + 'contacts/get' */;
const geturl = environment.apiURL + 'userauthentication/list'
let params = new HttpParams();
/* params = params.set("namefilter", namefilter);
params = params.set("domain", environment.domain); */
params = params.set("namefilter", namefilter);
params = params.set("domain", "");
let options = {
headers: this.headers,
params: params
};
return this.http.get<EventPerson[]>(`${geturl}`, options);
}
}
-16
View File
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { DataService } from './data.service';
describe('DataService', () => {
let service: DataService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(DataService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { ChatServiceService } from './chat-service.service';
describe('ChatServiceService', () => {
let service: ChatServiceService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(ChatServiceService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -1,9 +0,0 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class ChatServiceService {
constructor() { }
}
+84 -84
View File
@@ -16,58 +16,58 @@ import { Subscribe } from './subcribe';
})
export class EventsService {
authheader = {};
headers: HttpHeaders;
// authheader = {};
// headers: HttpHeaders;
headersPrOficial: HttpHeaders;
headersPrPessoal: HttpHeaders;
// headersPrOficial: HttpHeaders;
// headersPrPessoal: HttpHeaders;
headersMdOficial: HttpHeaders;
headersMdPessoal: HttpHeaders;
// headersMdOficial: HttpHeaders;
// headersMdPessoal: HttpHeaders;
headerOwnOficial: HttpHeaders;
headerOwnPessoal: HttpHeaders;
// headerOwnOficial: HttpHeaders;
// headerOwnPessoal: HttpHeaders;
headerSharedOficial: HttpHeaders;
headerSharedPessoal: HttpHeaders;
// headerSharedOficial: HttpHeaders;
// headerSharedPessoal: HttpHeaders;
headersSharedOficial: HttpHeaders;
headersSharedPessoal: HttpHeaders;
// headersSharedOficial: HttpHeaders;
// headersSharedPessoal: HttpHeaders;
calendarIds = []
usersCalendarIds = []
// calendarIds = []
// usersCalendarIds = []
hasSharedCalendar = false;
hasSharedOficial: boolean = false;
hasSharedPessoal: boolean = false;
// hasSharedCalendar = false;
// hasSharedOficial: boolean = false;
// hasSharedPessoal: boolean = false;
hasOwnOficial: boolean = false;
hasOwnPessoal: boolean = false;
hasOwnCalendar = false
// hasOwnOficial: boolean = false;
// hasOwnPessoal: boolean = false;
// hasOwnCalendar = false
calendarNames = {}
// calendarNames = {}
// calendarNamesAry = []
// calendarNamesAryNoPr = []
// calendarNamesAryNoPrNMD = []
// calendarNamesAryOnlyMD = []
// calendarNamesAryReverse = []
// calendarNamesAryPR = []
// // calendarNamesAry = []
// // calendarNamesAryNoPr = []
// // calendarNamesAryNoPrNMD = []
// // calendarNamesAryOnlyMD = []
// // calendarNamesAryReverse = []
// // calendarNamesAryPR = []
calendarNamesType = {}
calendarRole = []
calendrFullName = []
// calendarNamesType = {}
// calendarRole = []
// calendrFullName = []
myCalendarNames = {}
hasAnyCalendar = false
// myCalendarNames = {}
// hasAnyCalendar = false
HasMdGPR = false
// HasMdGPR = false
onLoadCalendars: Function[] =[]
loadCalendars = false
// onLoadCalendars: Function[] =[]
// loadCalendars = false
onCalendarFinishLoad = new Subscribe({execute : false, deleteOnExecute: true})
// onCalendarFinishLoad = new Subscribe({execute : false, deleteOnExecute: true})
constructor(
private http: HttpClient,
@@ -75,35 +75,35 @@ export class EventsService {
private changeProfileService: ChangeProfileService,
private offlinemanager: OfflineManagerService) {
try {
//this.setHeader()
} catch (e) {
console.log(e)
}
// try {
// //this.setHeader()
// } catch (e) {
// console.log(e)
// }
this.changeProfileService.registerCallback(() => {
try {
//this.setHeader()
} catch (e) {
console.log(e)
}
})
// this.changeProfileService.registerCallback(() => {
// try {
// //this.setHeader()
// } catch (e) {
// console.log(e)
// }
// })
}
async setHeader () {
// async setHeader () {
}
// }
registerOnLoadCalendars(e: Function) {
if( this.loadCalendars) {
e()
} else {
this.onLoadCalendars.push(e)
}
// registerOnLoadCalendars(e: Function) {
// if( this.loadCalendars) {
// e()
// } else {
// this.onLoadCalendars.push(e)
// }
}
// }
// DetectCalendars(CalendarId) {
@@ -232,21 +232,21 @@ export class EventsService {
// }
GetCalendarName(userid:string) {
// GetCalendarName(userid:string) {
let geturl = environment.apiURL + 'userauthentication/single';
// let geturl = environment.apiURL + 'userauthentication/single';
let params = new HttpParams();
// let params = new HttpParams();
params = params.set("id", userid);
// params = params.set("id", userid);
let options = {
headers: this.headers,
params: params
}
// let options = {
// headers: this.headers,
// params: params
// }
return this.http.get<any>(`${geturl}`, options)
}
// return this.http.get<any>(`${geturl}`, options)
// }
// async getAllMdEvents(startdate: string, enddate: string) {
@@ -515,13 +515,13 @@ export class EventsService {
// }
getRecurrenceTypes(): any {
const geturl = environment.apiURL + 'Calendar/RecurrenceTypes';
let options = {
headers: this.headers,
};
return this.http.get<any>(`${geturl}`, options);
}
// getRecurrenceTypes(): any {
// const geturl = environment.apiURL + 'Calendar/RecurrenceTypes';
// // let options = {
// // headers: this.headers,
// // };
// return this.http.get<any>(`${geturl}`, options);
// }
// getEvents(calendarname: string, startdate: string, enddate: string): Observable<Event[]> {
@@ -539,19 +539,19 @@ export class EventsService {
// return this.http.get<Event[]>(`${geturl}`, options);
// }
getEvent(eventid: string): Observable<Event> {
let geturl = environment.apiURL + 'calendar/GetEvent';
let params = new HttpParams();
// getEvent(eventid: string): Observable<Event> {
// let geturl = environment.apiURL + 'calendar/GetEvent';
// let params = new HttpParams();
params = params.set("EventId", eventid);
// params = params.set("EventId", eventid);
let options = {
headers: this.headers,
params: params
};
// let options = {
// headers: this.headers,
// params: params
// };
return this.http.get<Event>(`${geturl}`, options);
}
// return this.http.get<Event>(`${geturl}`, options);
// }
// genericGetEvent(eventid: string, calendarId: string) {
// let geturl = environment.apiURL + 'calendar/GetEvent';
-16
View File
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { FcmService } from './fcm.service';
describe('FcmService', () => {
let service: FcmService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(FcmService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
-23
View File
@@ -1,23 +0,0 @@
import { Injectable } from '@angular/core';
/* import {
Plugins,
PushNotification,
PushNotificationToken,
PushNotificationActionPerformed,
Capacitor
} from '@capacitor/core'; */
import { Router } from '@angular/router';
/* const { PushNotifications } = Plugins; */
@Injectable({
providedIn: 'root'
})
export class FcmService {
constructor(private router: Router) { }
}
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { FileExprorerService } from './file-exprorer.service';
describe('FileExprorerService', () => {
let service: FileExprorerService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(FileExprorerService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -1,9 +0,0 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class FileExprorerService {
constructor() { }
}
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { NetworkConnectionService } from './network-connection.service';
describe('NetworkConnectionService', () => {
let service: NetworkConnectionService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(NetworkConnectionService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -1,28 +0,0 @@
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs'
import { Platform } from '@ionic/angular'
import { Network } from '@capacitor/network';
@Injectable({
providedIn: 'root'
})
export class NetworkConnectionService {
online: boolean = true;
constructor(){
Network.addListener('networkStatusChange', status => {
});
}
logCurrentNetworkStatus = async () => {
const status = await Network.getStatus();
return status;
};
}
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { NotificationMessageService } from './notification-message.service';
describe('NotificationMessageService', () => {
let service: NotificationMessageService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(NotificationMessageService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -1,13 +0,0 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class NotificationMessageService {
constructor() { }
/*** @description Sem acesso à internet. Por favor verifique sua conexão */
noInternetConnection = 'Sem acesso à internet. Por favor verifique sua conexão'
}
-16
View File
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { PhotoService } from './photo.service';
describe('PhotoService', () => {
let service: PhotoService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(PhotoService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
-69
View File
@@ -1,69 +0,0 @@
import { Injectable } from '@angular/core';
/* import { Plugins, CameraResultType, Capacitor, FilesystemDirectory, CameraPhoto, CameraSource } from '@capacitor/core'; */
import { Photo } from '../models/photo';
import { Platform } from '@ionic/angular';
/* import { Camera, CameraOptions } from '@ionic-native/camera/ngx'; */
/* const { Camera, Filesystem, Storage } = Plugins; */
@Injectable({
providedIn: 'root'
})
export class PhotoService {
public photos: Photo[] = [];
private PHOTO_STORAGE: string = "photos";
private platform: Platform;
constructor(platform: Platform,
/* private camera:Camera */
) {
this.platform = platform;
}
async takePicture(){
/* const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
}
this.camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64 (DATA_URL):
let base64Image = 'data:image/jpeg;base64,' + imageData;
return base64Image;
}, (err) => {
// Handle error
}); */
}
/* async addNewToGallery() {
// Take a photo using Capacitor
const capturedPhoto = await Camera.getPhoto({
resultType: CameraResultType.Base64,
source: CameraSource.Camera,
quality: 90,
width: 1080,
height: 720,
});
this.photos.unshift({
fileName: new Date().getTime() + '.png',
webviewPath: capturedPhoto.base64String,
fileFormat: capturedPhoto.format,
});
} */
}
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { SocketConnectionMCRService } from './socket-connection-mcr.service';
describe('SocketConnectionMCRService', () => {
let service: SocketConnectionMCRService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SocketConnectionMCRService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
-16
View File
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { SqliteService } from './sqlite.service';
describe('SqliteService', () => {
let service: SqliteService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(SqliteService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
-11
View File
@@ -1,11 +0,0 @@
import { Injectable } from '@angular/core';
//import { Platform } from '@ionic/angular';
//import { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';
@Injectable({
providedIn: 'root'
})
export class SqliteService {
// y
}
@@ -1,124 +0,0 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Filesystem, FilesystemDirectory } from '@capacitor/filesystem';
import { Platform } from '@ionic/angular';
declare var FFmpeg: any;
@Injectable({
providedIn: 'root'
})
export class VideoCompressionService {
constructor(
private http: HttpClient,
private platform: Platform
) { }
async compressVideo(inputFile: string, outputFileName: string, quality: string = 'medium'): Promise<void> {
// Load FFmpeg
await this.loadFFmpeg();
// Input file
const inputBuffer = await this.fetchVideo(inputFile);
// Output file path
const outputPath = await this.getOutputFilePath(outputFileName);
// Run FFmpeg command
await this.runFFmpegCommand(inputBuffer, outputPath, quality);
console.log('Video compression complete!');
}
private async loadFFmpeg(): Promise<void> {
if (!FFmpeg.isLoaded()) {
await FFmpeg.load();
}
}
private async fetchVideo(url: string): Promise<ArrayBuffer> {
const response = await this.http.get(url, { responseType: 'arraybuffer' }).toPromise();
return response;
}
private async getOutputFilePath(outputFileName: string): Promise<string> {
const dataDirectory = await Filesystem.getUri({
directory: FilesystemDirectory.Data,
path: ''
});
return `${dataDirectory.uri}/${outputFileName}`;
}
private async runFFmpegCommand(inputBuffer: ArrayBuffer, outputPath: string, quality: string): Promise<void> {
await FFmpeg.run('-i', inputBuffer, '-c:v', 'libx264', '-preset', quality, outputPath);
}
}
//Mobile
/* import { Injectable } from '@angular/core';
import { HTTP } from '@ionic-native/http/ngx';
import { Filesystem, FilesystemDirectory, FilesystemEncoding } from '@capacitor/filesystem';
import { Platform } from '@ionic/angular';
declare var FFmpeg: any;
@Injectable({
providedIn: 'root'
})
export class VideoCompressionService {
constructor(
private http: HTTP,
private platform: Platform
) { }
async compressVideo(inputFile: string, outputFileName: string, quality: string = 'medium'): Promise<void> {
// Load FFmpeg
await this.loadFFmpeg();
// Input file
const inputBuffer = await this.fetchVideo(inputFile);
// Output file path
const outputPath = await this.getOutputFilePath(outputFileName);
// Run FFmpeg command
await this.runFFmpegCommand(inputBuffer, outputPath, quality);
console.log('Video compression complete!');
}
private async loadFFmpeg(): Promise<void> {
if (!FFmpeg.isLoaded()) {
await FFmpeg.load();
}
}
private async fetchVideo(url: string): Promise<ArrayBuffer> {
const response = await this.http.sendRequest(url, {
method: 'get',
responseType: 'arraybuffer'
});
return response.data;
}
private async getOutputFilePath(outputFileName: string): Promise<string> {
const dataDirectory = await Filesystem.getUri({
directory: FilesystemDirectory.Data,
path: ''
});
return `${dataDirectory.uri}/${outputFileName}`;
}
private async runFFmpegCommand(inputBuffer: ArrayBuffer, outputPath: string, quality: string): Promise<void> {
await FFmpeg.run('-i', inputBuffer, '-c:v', 'libx264', '-preset', quality, outputPath);
}
}
*/
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { VideoconvertService } from './videoconvert.service';
describe('VideoconvertService', () => {
let service: VideoconvertService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(VideoconvertService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { WebsocketService } from './websocket.service';
describe('WebsocketService', () => {
let service: WebsocketService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(WebsocketService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
-49
View File
@@ -1,49 +0,0 @@
import { Injectable } from '@angular/core';
import * as Rx from "rxjs/Rx";
import { Observable, Subject } from "rxjs/Rx";
@Injectable({
providedIn: 'root'
})
export class WebsocketService {
message = '';
public messages: Subject<any>;
currentUser = '';
private subject: Rx.Subject<MessageEvent>;
constructor() {
}
public connect(url): Rx.Subject<MessageEvent> {
if (!this.subject) {
this.subject = this.create(url);
}
return this.subject;
}
private create(url): Rx.Subject<MessageEvent> {
let ws = new WebSocket(url);
let observable = Rx.Observable.create((obs: Rx.Observer<MessageEvent>) => {
ws.onmessage = obs.next.bind(obs);
ws.onerror = obs.error.bind(obs);
ws.onclose = obs.complete.bind(obs);
return ws.close.bind(ws);
});
let observer = {
next: (data: Object) => {
if (ws.readyState === WebSocket.OPEN) {
ws.send(JSON.stringify(data));
}
}
};
return Rx.Subject.create(observer, observable);
}
}
@@ -89,9 +89,9 @@ export class EventsToApprovePage implements OnInit {
}))
)
this.eventService.onCalendarFinishLoad.subscribe(async() => {
this.setCalendarByDefault()
})
// this.eventService.onCalendarFinishLoad.subscribe(async() => {
// this.setCalendarByDefault()
// })
this.LoadToApproveEvents()
@@ -1,7 +1,6 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { PublicationsService } from 'src/app/services/publications.service';
import { Publication } from 'src/app/models/publication';
import { PhotoService } from 'src/app/services/photo.service';
import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ThemeService } from 'src/app/services/theme.service';
@@ -14,7 +13,6 @@ import { FileValidatorService } from "src/app/services/file/file-validator.servi
import { MiddlewareServiceService } from "src/app/shared/API/middleware/middleware-service.service";
import { LakefsRepositoryService } from '../../repository/lakefs/lakefs-repository.service';
import { SocketConnectionMCRService } from "src/app/services/socket-connection-mcr.service"
import { CaptureImageOptions, MediaCapture } from '@awesome-cordova-plugins/media-capture/ngx';
import { Directory, Filesystem, FilesystemDirectory } from '@capacitor/filesystem';
import { ModalController, Platform } from '@ionic/angular';
@@ -69,7 +67,6 @@ export class NewPublicationPage implements OnInit {
constructor(
public PublicationFromMvService: PublicationFromMvService,
public photoService: PhotoService,
private publications: PublicationsService,
private toastService: ToastService,
public ThemeService: ThemeService,
@@ -79,10 +76,6 @@ export class NewPublicationPage implements OnInit {
private mediaCapture: MediaCapture,
private httpErrorHandle: HttpErrorHandle,
private platform: Platform,
private FileValidatorService: FileValidatorService,
private MiddlewareServiceService: MiddlewareServiceService,
private LakefsRepositoryService: LakefsRepositoryService,
private SocketConnectionMCRService: SocketConnectionMCRService,
private videoconvertService: VideoconvertService,
public UploadStreamingService: UploadStreamingService,
private modalController: ModalController
@@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { ok, err, Result } from 'neverthrow';
import { ObjectMergeNotification } from 'src/app/services/socket-connection-mcr.service';
import { CMAPIService } from "src/app/shared/repository/CMAPI/cmapi.service"
import { DomSanitizer } from '@angular/platform-browser';
import { v4 as uuidv4 } from 'uuid'
View File
+5 -12
View File
@@ -23,7 +23,7 @@ import { LoginUserRespose } from 'src/app/models/user.model';
import { DateAdapter } from '@angular/material/core';
import { eventSource } from 'src/app/models/agenda/eventSource';
import { CalendarStore } from 'src/app/store/calendar.service';
import { ListBoxService } from 'src/app/services/agenda/list-box.service';
import { ListBoxService } from 'src/app/ui/agenda/service/list-box.service';
import { ChangeProfileService } from 'src/app/services/change-profile.service';
import { BackgroundService } from 'src/app/services/background.service';
@@ -280,14 +280,7 @@ export class AgendaPage implements OnInit {
} else if (this.loggeduser.Profile == 'PR') {
this.profile = "pr";
} else {
if (this.eventService.usersCalendarIds.length >= 2) {
this.profile = "mdgpr";
} else if (this.eventService.hasOwnCalendar) {
this.profile = "mdgpr";
} else if (this.eventService.hasSharedCalendar) {
this.profile = "pr";
}
this.profile = "mdgpr";
}
this.calendarHeight = ["height-356"];
@@ -1315,9 +1308,9 @@ export class AgendaPage implements OnInit {
}
checkRoleInArray(str) {
return this.eventService.calendarRole.includes(str);
}
// checkRoleInArray(str) {
// return this.eventService.calendarRole.includes(str);
// }
validateEvent(year, month, day) {
console.log(year, month, day)
@@ -152,7 +152,7 @@ export class EditEventToApprovePage implements OnInit {
this.getTask();
}
this.getRecurrenceTypes();
// this.getRecurrenceTypes();
}
@@ -194,12 +194,12 @@ export class EditEventToApprovePage implements OnInit {
}
getRecurrenceTypes() {
this.eventsService.getRecurrenceTypes().subscribe(res => {
// getRecurrenceTypes() {
// this.eventsService.getRecurrenceTypes().subscribe(res => {
this.recurringTypes = res;
});
}
// this.recurringTypes = res;
// });
// }
@@ -196,7 +196,7 @@ export class NewEventPage implements OnInit {
this.initializeData()
})
this.getRecurrenceTypes();
// this.getRecurrenceTypes();
if (!this.restoreTemporaryData()) {
// clear
this.setCalendarByDefault(true)
@@ -444,12 +444,12 @@ export class NewEventPage implements OnInit {
this.cloneAllmobileComponent.emit({})
}
getRecurrenceTypes() {
this.eventService.getRecurrenceTypes().subscribe(res => {
// getRecurrenceTypes() {
// this.eventService.getRecurrenceTypes().subscribe(res => {
this.recurringTypes = res;
});
}
// this.recurringTypes = res;
// });
// }
calculetedLastOccurrence(type: number) {
@@ -18,7 +18,6 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { environment } from 'src/environments/environment';
import { ProcessesService } from 'src/app/services/processes.service';
import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, ThemePalette } from '@angular/material/core';
import { MomentDateAdapter } from '@angular/material-moment-adapter';
import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/repository/agenda-data-repository.service';
@@ -132,7 +131,6 @@ export class NewEventPage implements OnInit {
private hhtpErrorHandle: HttpErrorHandle,
private processeService: ProcessesService,
public TaskService: TaskService,
private contactsService: ContactsService,
private agendaDataRepository: AgendaDataRepositoryService,
public RoleIdService: RoleIdService,
private AgendaService: AgendaService
@@ -476,20 +474,20 @@ export class NewEventPage implements OnInit {
}
//This method return calendar onwner user id
selectedCalendarUserId() {
// //This method return calendar onwner user id
// selectedCalendarUserId() {
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
return this.eventService.calendarNamesType[this.CalendarName]['OwnerId']
// if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
// return this.eventService.calendarNamesType[this.CalendarName]['OwnerId']
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') {
// } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') {
return this.eventService.calendarNamesType[this.CalendarName]['OwnerId']
// return this.eventService.calendarNamesType[this.CalendarName]['OwnerId']
} else {
return '11:11'
}
}
// } else {
// return '11:11'
// }
// }
async changeAgenda() {
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';
import { CustomCalendarEvent, EventListStore } from 'src/app/models/agenda/AgendaEventList';
import { DateService } from '../date.service';
import { DateService } from '../../../services/date.service';
import { momentG } from 'src/plugin/momentG';
import { NativeNotificationService } from 'src/app/services/native-notification.service';
File diff suppressed because one or more lines are too long