Merge branch 'feature/agenda-new-api-eudes' into feature/agenda-new-api-eudes-backup

This commit is contained in:
Eudes Inácio
2024-06-10 09:58:33 +01:00
11 changed files with 322 additions and 67 deletions
@@ -144,6 +144,68 @@
</div> </div>
</div> </div>
<div class="container-div">
<div class="ion-item-class-2 d-flex">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs">
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(value)]="postEvent.EventRecurrence.frequency" >
<mat-option value="never">
Nunca
</mat-option>
<mat-option value="daily">
Diário
</mat-option>
<mat-option value="weekly">
Semanalmente
</mat-option>
<mat-option value="monthly">
Mensal
</mat-option>
<mat-option value="yearly">
Anual
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</div>
<div *ngIf="postEvent.EventRecurrence.frequency != 'never'" class="container-div">
<div class="ion-item-class-2 d-flex" >
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" >
<mat-form-field appearance="none" class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Data Fim de Recorrência*"
[(ngModel)]="postEvent.EventRecurrence.until"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" ></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
[stepSecond]="stepSecond"
[touchUi]="touchUi"
[hideTime]="true"
>
</ngx-mat-datetime-picker>
</mat-form-field>
</div>
</div>
</div>
<div *ngIf="allDayCheck" class="container-div width-100"> <div *ngIf="allDayCheck" class="container-div width-100">
<div class="ion-item-class-2 width-100"> <div class="ion-item-class-2 width-100">
<div class="ion-icon-class"> <div class="ion-icon-class">
@@ -20,6 +20,7 @@ import { environment } from 'src/environments/environment';
import { ContactsService } from 'src/app/services/contacts.service'; import { ContactsService } from 'src/app/services/contacts.service';
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service'; import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service'; import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
import { Utils } from 'src/app/services/Repositorys/Agenda/utils';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: { parse: {
@@ -105,7 +106,8 @@ export class EditEventPage implements OnInit {
private httpErrorHandle: HttpErrorHandle, private httpErrorHandle: HttpErrorHandle,
private contactsService: ContactsService, private contactsService: ContactsService,
private domSanitazerService: DomSanitizerService, private domSanitazerService: DomSanitizerService,
private agendaDataRepository: AgendaDataRepositoryService private agendaDataRepository: AgendaDataRepositoryService,
private utils: Utils
) { ) {
/* this.postEvent = new Event(); */ /* this.postEvent = new Event(); */
@@ -154,7 +156,7 @@ export class EditEventPage implements OnInit {
}) })
} }
if (this.postEvent.IsRecurring == false) { if (this.postEvent.EventRecurrence.frequency == 'never') {
this.isRecurring = "Não se repete"; this.isRecurring = "Não se repete";
} }
else { else {
@@ -168,6 +170,7 @@ export class EditEventPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.postEvent.EventRecurrence.frequency = this.utils.recurenceTypeSeleted(this.postEvent.EventRecurrence.frequency)
console.log(this.postEvent?.Attachments) console.log(this.postEvent?.Attachments)
console.log(this.loadedEventAttachments) console.log(this.loadedEventAttachments)
window.onresize = (event) => { window.onresize = (event) => {
@@ -19,7 +19,7 @@
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input> <ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
</div> </div>
<div class="container-div" > <div *ngIf="(sharedCalendar | async) as calendarData" class="container-div" >
<div class="ion-item-class-2 d-flex"> <div class="ion-item-class-2 d-flex">
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
@@ -29,22 +29,15 @@
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda"> <mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
<mat-select [(value)]="CalendarName" (selectionChange)="changeAgenda()"> <mat-select [(value)]="CalendarName" (selectionChange)="changeAgenda()">
<!-- <mat-option *ngFor="let calendars of _eventService.calendarNamesAry; let i = index" value="{{calendars}}"> <mat-option *ngFor="let calendars of calendarData" value="{{calendars.wxUserId}}">
<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> --> <div *ngIf="calendars.roleId == RoleIdService.PRES">PR </div>
<mat-option *ngFor="let calendars of eventService.calendarNamesAry" value="{{calendars.Fullname || calendars}}"> <div *ngIf="calendars.roleId == RoleIdService.MD && calendars.roleId != SessionStore.user.RoleID">AGENDA DO MDGPR</div>
<div *ngIf="calendars != 'Meu calendario' && calendars.Role == 'Presidente da República'"> {{ environment.agendaPR}} </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 != 'Meu calendario' && calendars.Role == 'Ministro e Director do Gabinete do PR'"> {{ environment.agendaVP}} </div> <div *ngIf="calendars.wxUserId == SessionStore.user.UserId ">
<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'">
<!-- <span *ngIf="SessionStore.user.Profile == 'PR' ">Agenda do PR</span>
<span *ngIf="SessionStore.user.Profile == 'MDGPR' ">Agenda do MDGPR</span>
<span *ngIf="SessionStore.user.Profile != 'MDGPR' && SessionStore.user.Profile != 'PR' ">Minha agenda</span> -->
Minha agenda Minha agenda
</div> </div>
</mat-option> </mat-option>
</mat-select> </mat-select>
@@ -121,6 +114,68 @@
</div> </div>
</div> </div>
<div class="container-div">
<div class="ion-item-class-2 d-flex">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs">
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(value)]="postEvent.EventRecurrence.frequency" >
<mat-option value="never">
Nunca
</mat-option>
<mat-option value="daily">
Diário
</mat-option>
<mat-option value="weekly">
Semanalmente
</mat-option>
<mat-option value="monthly">
Mensal
</mat-option>
<mat-option value="yearly">
Anual
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</div>
<div *ngIf="postEvent.EventRecurrence.frequency != 'never'" class="container-div">
<div class="ion-item-class-2 d-flex" >
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" >
<mat-form-field appearance="none" class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Data Fim de Recorrência*"
[(ngModel)]="postEvent.EventRecurrence.until"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" ></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
[stepSecond]="stepSecond"
[touchUi]="touchUi"
[hideTime]="true"
>
</ngx-mat-datetime-picker>
</mat-form-field>
</div>
</div>
</div>
<div class="container-div"> <div class="container-div">
@@ -259,7 +314,7 @@
</div> </div>
<div *ngIf="postEvent.EventRecurrence.Type != '-1'" class="container-div width-100"> <!-- <div *ngIf="postEvent.EventRecurrence.Type != '-1'" class="container-div width-100">
<div class="ion-item-class-2 d-flex"> <div class="ion-item-class-2 d-flex">
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
@@ -285,7 +340,7 @@
</div> </div>
</div> </div>
</div> </div> -->
<div class="container-div"> <div class="container-div">
<div class="ion-item-class-2"> <div class="ion-item-class-2">
@@ -29,6 +29,10 @@ import { MatDatepickerModule } from '@angular/material/datepicker';
import { MomentDateAdapter } from '@angular/material-moment-adapter'; import { MomentDateAdapter } from '@angular/material-moment-adapter';
import { EventInputDTO } from '../../../services/Repositorys/Agenda/agendaDataModels'; import { EventInputDTO } from '../../../services/Repositorys/Agenda/agendaDataModels';
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service'; import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
import { Observable } from 'rxjs';
import { TableSharedCalendar } from 'src/app/services/Repositorys/Agenda/agenda-local-data-source.service';
import { map } from 'rxjs/operators';
import { RoleIdService } from 'src/app/services/role-id.service'
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: { parse: {
@@ -116,6 +120,9 @@ export class NewEventPage implements OnInit {
eventPersons: EventPerson[]; eventPersons: EventPerson[];
contacts: EventPerson[]; contacts: EventPerson[];
allDayCheck: boolean = false; allDayCheck: boolean = false;
eventRecurence = 'never';
sharedCalendar: Observable<TableSharedCalendar[]>
selectedUserCalendar:any;
constructor( constructor(
@@ -133,7 +140,8 @@ export class NewEventPage implements OnInit {
private contactsService: ContactsService, private contactsService: ContactsService,
private domSanitazerService: DomSanitizerService, private domSanitazerService: DomSanitizerService,
private dateAdapter: DateAdapter<Date>, private dateAdapter: DateAdapter<Date>,
private agendaDataRepository: AgendaDataRepositoryService private agendaDataRepository: AgendaDataRepositoryService,
public RoleIdService: RoleIdService,
) { ) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.postEvent = new Event(); this.postEvent = new Event();
@@ -146,6 +154,40 @@ export class NewEventPage implements OnInit {
this.selectedDate = this.navParams.get('eventSelectedDate'); this.selectedDate = this.navParams.get('eventSelectedDate');
this.taskParticipants = this.navParams.get('attendees'); this.taskParticipants = this.navParams.get('attendees');
this.CalendarDate = this.navParams.get('CalendarDate') this.CalendarDate = this.navParams.get('CalendarDate')
// 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.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLive().pipe(
map(data => data.sort((a, b) => {
console.log('Raw data:', data); // Debug line
const priorityA = rolePriorities[a.roleId] || Infinity;
const priorityB = rolePriorities[b.roleId] || Infinity;
return priorityA - priorityB;
}))
)
this.setCalendarByDefault(true)
}
async setCalendarByDefault(force) {
if (!this.selectedUserCalendar || force) {
const data = await this.agendaDataRepository.geCalendars()
const prObject = data.find(e => e?.roleId == 100000014)
if(prObject) {
this.selectedUserCalendar = prObject.wxUserId
} else {
this.selectedUserCalendar = SessionStore.user.UserId
}
}
} }
ngOnInit() { ngOnInit() {
@@ -187,7 +229,8 @@ export class NewEventPage implements OnInit {
Organizer: '', Organizer: '',
Category: 'Reunião', Category: 'Reunião',
HasAttachments: false, HasAttachments: false,
EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, EventRecurrence: { frequency: this.eventRecurence, until: this.autoEndTime,
Type: '' },
}; };
} }
else { else {
@@ -209,7 +252,8 @@ export class NewEventPage implements OnInit {
Organizer: '', Organizer: '',
Category: 'Reunião', Category: 'Reunião',
HasAttachments: false, HasAttachments: false,
EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime }, EventRecurrence: { frequency: this.eventRecurence, until: this.autoEndTime,
Type: '' },
}; };
} }
@@ -21,7 +21,7 @@ export class AgendaDataRepositoryService {
private agendaDataService: AgendaDataService, private agendaDataService: AgendaDataService,
private utils: Utils, private utils: Utils,
private agendaLocalDataSourceService: AgendaLocalDataSourceService private agendaLocalDataSourceService: AgendaLocalDataSourceService
) {} ) { }
createOwnCalendar() { createOwnCalendar() {
const currentUserCalendar = { const currentUserCalendar = {
@@ -39,14 +39,14 @@ export class AgendaDataRepositoryService {
async getEventById(id: string) { async getEventById(id: string) {
try { try {
const result = await this.agendaDataService.getEvent(id).pipe( const result = await this.agendaDataService.getEvent(id).pipe(
map((response) => { map((response) => {
console.log('Response',response.data) console.log('Response', response.data)
console.log('Output',EventMapper.toDomain(response.data)) console.log('Output', EventMapper.toDomain(response.data))
return EventMapper.toDomain(response.data) return EventMapper.toDomain(response.data)
}) })
).toPromise() ).toPromise()
return ok (result) return ok(result)
} catch (e) { } catch (e) {
return err(e as HttpErrorResponse) return err(e as HttpErrorResponse)
} }
@@ -55,42 +55,42 @@ export class AgendaDataRepositoryService {
async getEventToApproveById(id: string) { async getEventToApproveById(id: string) {
try { try {
const result = await this.agendaDataService.getEvent(id).pipe( const result = await this.agendaDataService.getEvent(id).pipe(
map((response) => { map((response) => {
return EventToApproveDetailsMapper.toDomain(response.data) return EventToApproveDetailsMapper.toDomain(response.data)
}) })
).toPromise() ).toPromise()
return ok (result) return ok(result)
} catch (e) { } catch (e) {
return err(e as HttpErrorResponse) return err(e as HttpErrorResponse)
} }
} }
async EventList({userId, startDate , endDate , status= 2, category= null, type= null, calendarOwnerName = ''}) { async EventList({ userId, startDate, endDate, status = 2, category = null, type = null, calendarOwnerName = '' }) {
try { try {
const result = await this.agendaDataService.getEvents(userId, startDate, endDate, status, category, type).pipe( const result = await this.agendaDataService.getEvents(userId, startDate, endDate, status, category, type).pipe(
map((response) => { map((response) => {
return ListEventMapper.toDomain(response.data, calendarOwnerName, userId) return ListEventMapper.toDomain(response.data, calendarOwnerName, userId)
} }
)).toPromise() )).toPromise()
return ok (result) return ok(result)
} catch (e) { } catch (e) {
return err(e as HttpErrorResponse) return err(e as HttpErrorResponse)
} }
} }
async eventToApproveList({userId, startDate = null, endDate = null, status = 0, category= null, type= null, calendarOwnerName = ''}) { async eventToApproveList({ userId, startDate = null, endDate = null, status = 0, category = null, type = null, calendarOwnerName = '' }) {
try { try {
const result = await this.agendaDataService.getEvents(userId, startDate = null, endDate = null, status, category= null, type= null).pipe( const result = await this.agendaDataService.getEvents(userId, startDate = null, endDate = null, status, category = null, type = null).pipe(
map((response) => { map((response) => {
return EventListToApproveMapper.toDomain(response.data, calendarOwnerName, userId) return EventListToApproveMapper.toDomain(response.data, calendarOwnerName, userId)
} }
)).toPromise() )).toPromise()
return ok (result) return ok(result)
} catch (e) { } catch (e) {
return err(e as HttpErrorResponse) return err(e as HttpErrorResponse)
} }
@@ -122,9 +122,6 @@ export class AgendaDataRepositoryService {
} }
updateEvent(eventId, eventData) { updateEvent(eventId, eventData) {
console.log(eventData.StartDate)
console.log(eventData.EndDate)
let eventInput = { let eventInput = {
subject: eventData.Subject, subject: eventData.Subject,
body: eventData.Body.Text || eventData.Body, body: eventData.Body.Text || eventData.Body,
@@ -133,39 +130,41 @@ export class AgendaDataRepositoryService {
endDate: eventData.EndDate, endDate: eventData.EndDate,
isAllDayEvent: eventData.IsAllDayEvent, isAllDayEvent: eventData.IsAllDayEvent,
updateAllEvents: false, updateAllEvents: false,
type: this.utils.calendarTypeSeleted(eventData.Category),
category: this.utils.calendarCategorySeleted(eventData.CalendarName),
recurrence: { recurrence: {
frequency: 0, frequency: this.utils.eventRecurence(eventData.EventRecurrence.frequency),
occurrences: 0 until: eventData.EventRecurrence.until
} }
} }
return this.agendaDataService.updateEvent(eventId, eventInput) return this.agendaDataService.updateEvent(eventId, eventInput)
} }
addEventAttendee(id,attendeeData,) { addEventAttendee(id, attendeeData,) {
console.log(attendeeData) console.log(attendeeData)
console.log(this.utils.attendeesEdit(attendeeData)) console.log(this.utils.attendeesEdit(attendeeData))
return this.agendaDataService.addEventAttendee(id,{ attendees: this.utils.attendeesAdded(attendeeData) }); return this.agendaDataService.addEventAttendee(id, { attendees: this.utils.attendeesAdded(attendeeData) });
} }
addEventAttachment(id,attachmentData) { addEventAttachment(id, attachmentData) {
console.log(attachmentData) console.log(attachmentData)
console.log('post attachment',this.utils.documentAdded(attachmentData)) console.log('post attachment', this.utils.documentAdded(attachmentData))
return this.agendaDataService.addEventAttachment(id,{ attachments: this.utils.documentAdded(attachmentData) }); return this.agendaDataService.addEventAttachment(id, { attachments: this.utils.documentAdded(attachmentData) });
} }
deleteEvent(eventId) { deleteEvent(eventId) {
return this.agendaDataService.deleteEvent(eventId, false) return this.agendaDataService.deleteEvent(eventId, false)
} }
removeEventAttachment(eventId,attachmentData) { removeEventAttachment(eventId, attachmentData) {
return this.agendaDataService.removeEventAttachment(eventId,attachmentData); return this.agendaDataService.removeEventAttachment(eventId, attachmentData);
} }
async deleteEvent1(eventId) { async deleteEvent1(eventId) {
try { try {
const result = await this.agendaDataService.deleteEvent(eventId,false).toPromise() const result = await this.agendaDataService.deleteEvent(eventId, false).toPromise()
return ok (result) return ok(result)
} catch (e) { } catch (e) {
return err(e as HttpErrorResponse) return err(e as HttpErrorResponse)
} }
@@ -177,20 +176,20 @@ export class AgendaDataRepositoryService {
status: this.utils.statusEventAproval(status), status: this.utils.statusEventAproval(status),
comment: "" comment: ""
} }
return this.agendaDataService.updateEventStatus(eventId,statusObject) return this.agendaDataService.updateEventStatus(eventId, statusObject)
} }
getDocumentAttachments(applicationId,userId,subject,pageNumber,pageSize) { getDocumentAttachments(applicationId, userId, subject, pageNumber, pageSize) {
return this.agendaDataService.getDocumentAttachment(applicationId,userId,subject,pageNumber,pageSize) return this.agendaDataService.getDocumentAttachment(applicationId, userId, subject, pageNumber, pageSize)
} }
async getSharedCalendar() { async getSharedCalendar() {
const result = await this.agendaDataService.getSharedCalendar() const result = await this.agendaDataService.getSharedCalendar()
if(result.isOk()) { if (result.isOk()) {
if(result.value?.data) { if (result.value?.data) {
await this.agendaLocalDataSourceService.clearSharedCalendar() await this.agendaLocalDataSourceService.clearSharedCalendar()
await this.createOwnCalendar() await this.createOwnCalendar()
@@ -206,7 +205,7 @@ export class AgendaDataRepositoryService {
} }
async clearSharedCalendar() { async clearSharedCalendar() {
return await this.agendaLocalDataSourceService.clearSharedCalendar() return await this.agendaLocalDataSourceService.clearSharedCalendar()
} }
getShareCalendarItemsLive() { getShareCalendarItemsLive() {
@@ -66,7 +66,9 @@ export class EventMapper {
"Day": null, "Day": null,
"DayOfWeek": null, "DayOfWeek": null,
"Month": null, "Month": null,
"LastOccurrence": null "LastOccurrence": null,
"frequency": dto.eventRecurrence.frequency,
"until": dto.eventRecurrence.until
}, },
"Attachments": dto.attachments.map( e => ({ "Attachments": dto.attachments.map( e => ({
"Id": e.id, "Id": e.id,
@@ -37,6 +37,16 @@ const OrganizerSchema = z.object({
userPhoto: z.string(), userPhoto: z.string(),
}); });
const EventRecurrenceSchema = z.object({
Type: z.number(),
Day: null,
DayOfWeek: null,
Month: null,
LastOccurrence: null,
frequency: z.number(),
until: z.string()
});
export const EventOutputDTOSchema = z.object({ export const EventOutputDTOSchema = z.object({
id: z.string(), id: z.string(),
owner: OwnerSchema, owner: OwnerSchema,
@@ -47,12 +57,12 @@ export const EventOutputDTOSchema = z.object({
startDate: z.string(), startDate: z.string(),
endDate: z.string(), endDate: z.string(),
type: z.string(), type: z.string(),
category: z.enum(['Oficial','Pessoal']), category: z.enum(['Oficial', 'Pessoal']),
attendees: z.array(AttendeeSchema), attendees: z.array(AttendeeSchema),
isRecurring: z.boolean(), isRecurring: z.boolean(),
eventRecurrence: z.null(), eventRecurrence: EventRecurrenceSchema,
hasAttachments: z.boolean(), hasAttachments: z.boolean(),
attachments:z.array(AttachmentInputDTOSchema), attachments: z.array(AttachmentInputDTOSchema),
comments: z.array(CommentSchema), comments: z.array(CommentSchema),
isPrivate: z.boolean(), isPrivate: z.boolean(),
isAllDayEvent: z.boolean(), isAllDayEvent: z.boolean(),
@@ -165,4 +165,15 @@ export class Utils {
} }
return selectedType[type]; return selectedType[type];
} }
recurenceTypeSeleted(recurenceType) {
var selectedType = {
0: 'never',
1: 'daily',
2: 'weekly',
3: 'monthly',
4: 'yearly'
}
return selectedType[recurenceType];
}
} }
@@ -132,6 +132,69 @@
</div> </div>
</div> </div>
<div class="container-div">
<div class="ion-item-class-2 d-flex">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs">
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(value)]="_postEvent.EventRecurrence.frequency" >
<mat-option value="never">
Nunca
</mat-option>
<mat-option value="daily">
Diário
</mat-option>
<mat-option value="weekly">
Semanalmente
</mat-option>
<mat-option value="monthly">
Mensal
</mat-option>
<mat-option value="yearly">
Anual
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</div>
<div *ngIf="_postEvent.EventRecurrence.frequency != 'never'" class="container-div">
<div class="ion-item-class-2 d-flex" >
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs materia-top" >
<mat-form-field appearance="none" class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Data Fim de Recorrência*"
[(ngModel)]="postEvent.EventRecurrence.until"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" ></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
[showSpinners]="showSpinners"
[showSeconds]="showSeconds"
[stepHour]="stepHour" [stepMinute]="stepMinute"
[stepSecond]="stepSecond"
[touchUi]="touchUi"
[hideTime]="true"
>
</ngx-mat-datetime-picker>
</mat-form-field>
</div>
</div>
</div>
<div *ngIf="allDayCheck" class="container-div"> <div *ngIf="allDayCheck" class="container-div">
<div class="ion-item-class-2 width-100 d-flex"> <div class="ion-item-class-2 width-100 d-flex">
<div class="ion-icon-class"> <div class="ion-icon-class">
@@ -17,6 +17,7 @@ import { ContactsService } from 'src/app/services/contacts.service'
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service'; import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service'; import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
import { SearchList_v2 } from 'src/app/models/search-document'; import { SearchList_v2 } from 'src/app/models/search-document';
import { Utils } from 'src/app/services/Repositorys/Agenda/utils';
@Component({ @Component({
selector: 'app-edit-event', selector: 'app-edit-event',
@@ -107,7 +108,8 @@ export class EditEventPage implements OnInit {
private httpErrorHandle: HttpErrorHandle, private httpErrorHandle: HttpErrorHandle,
private contactsService: ContactsService, private contactsService: ContactsService,
private domSanitizeService: DomSanitizerService, private domSanitizeService: DomSanitizerService,
private agendaDataRepository: AgendaDataRepositoryService private agendaDataRepository: AgendaDataRepositoryService,
private utils: Utils
) { ) {
} }
@@ -116,6 +118,7 @@ export class EditEventPage implements OnInit {
this.loadedEventAttachments = this.postEvent.Attachments this.loadedEventAttachments = this.postEvent.Attachments
console.log(this.postEvent) console.log(this.postEvent)
this._postEvent = this.postEvent this._postEvent = this.postEvent
this._postEvent.EventRecurrence.frequency = this.utils.recurenceTypeSeleted(this.postEvent.EventRecurrence.frequency)
this.allDayCheck = this.postEvent.IsAllDayEvent; this.allDayCheck = this.postEvent.IsAllDayEvent;
if (!this.restoreTemporaryData()) { if (!this.restoreTemporaryData()) {
// clear // clear
+7 -4
View File
@@ -3,10 +3,12 @@ import { Environment } from './../../app/models/envarioment';
export const environment: Environment = { export const environment: Environment = {
id:'1', id:'1',
apiURL: 'https://gdapi-dev.dyndns.info/api/', apiURL: 'http://gpr-dev-01:83/jwt/api/',
/* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/', apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket', apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/', apiPCURL: 'http://gpr-dev-01:86/api/',
/* apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/', */
/* apiURL: 'https://API.DONEIT.CO.AO/api/', /* apiURL: 'https://API.DONEIT.CO.AO/api/',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/', apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket', apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
@@ -34,10 +36,11 @@ export const environment: Environment = {
export const doneITDev: Environment = { export const doneITDev: Environment = {
id:'1', id:'1',
apiURL: 'https://gdapi-dev.dyndns.info/api/', apiURL: 'http://gpr-dev-01:83/jwt/api/',
/* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/', apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket', apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/', apiPCURL: 'http://gpr-dev-01:86/api/',
/* apiURL: 'https://API.DONEIT.CO.AO/api/', /* apiURL: 'https://API.DONEIT.CO.AO/api/',
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/', apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket', apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',