create weakly event

This commit is contained in:
Peter Maquiran
2024-10-22 14:31:04 +01:00
parent ac1f01b15b
commit 54fb4f57d7
29 changed files with 447 additions and 225 deletions
-17
View File
@@ -153,23 +153,6 @@ registerLocaleData(localePt, 'pt');
}
);
export const increment = createAction('[Counter Component] Increment');
export const decrement = createAction('[Counter Component] Decrement');
export const reset = createAction('[Counter Component] Reset');
export const initialState = 0;
const _counterReducer = createReducer(
initialState,
on(increment, (state) => state + 1),
on(decrement, (state) => state - 1),
on(reset, (state) => 0)
);
export function counterReducer(state, action) {
return _counterReducer(state, action);
}
@NgModule({
declarations: [AppComponent, PopupQuestionPipe, InputFilterDirective],
imports: [BrowserModule,
@@ -55,5 +55,7 @@ export class EventSetDefaultParticipantsService {
}
}
return ok(null)
}
}
@@ -102,10 +102,10 @@ export class RoomSetLastMessageService {
} else {
console.log('set last message')
}
} else if (findRoom.isOk() && !findRoom.value && e.payload.receiverId) {
} else if (findRoom.isOk() && !findRoom.value && e.payload?.receiverId) {
// console.log('new room', e)
const findLocalDirectRoom = await this.roomLocalRepository.findOne({
receiverId: e.payload.receiverId
receiverId: e.payload?.receiverId
})
if(findLocalDirectRoom.isOk() && findLocalDirectRoom.value) {
@@ -159,7 +159,7 @@
Diário
</mat-option>
<mat-option value="weekly">
Semanalmente
Semanal
</mat-option>
<mat-option value="monthly">
Mensal
@@ -175,6 +175,20 @@
</div>
<div class="container-div py-2" *ngIf="postData.EventRecurrence.frequency == 'weekly' || postData.EventRecurrence.frequency == 'monthly'">
<div class="ion-item-class-2 d-flex justify-content-around font-13-em">
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.mon" (click)="daysOfWeek.mon=!daysOfWeek.mon">Seg</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.tues" (click)="daysOfWeek.tues=!daysOfWeek.tues">Terça</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.wed" (click)="daysOfWeek.wed=!daysOfWeek.wed">quarta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.thurs" (click)="daysOfWeek.thurs=!daysOfWeek.thurs">quinta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.fri" (click)="daysOfWeek.fri=!daysOfWeek.fri">Sexta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sat" (click)="daysOfWeek.sat=!daysOfWeek.sat">Sabado</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sun" (click)="daysOfWeek.sun=!daysOfWeek.sun">Domingo</div>
</div>
</div>
<div *ngIf="postData.EventRecurrence.frequency != 'never'" class="container-div">
<div class="ion-item-class-2 d-flex" >
<div class="ion-icon-class">
@@ -212,3 +212,14 @@
}
}
.segment{
box-shadow: 0px 0px 10px #b3b3b3;
padding: 3px;
border-radius: 10px;
}
.segment-active {
background-color: rgb(212, 212, 212);
}
@@ -115,6 +115,17 @@ export class DocumentSetUpMeetingPage implements OnInit {
CalendarNamesOptions = ['Oficial', 'Pessoal']
daysOfWeek = {
sun: false,
mon: false,
tues: false,
wed: false,
thurs: false,
fri: false,
sat: false,
};
constructor(
private modalController: ModalController,
private router: Router,
@@ -363,6 +374,20 @@ export class DocumentSetUpMeetingPage implements OnInit {
if (this.Form.invalid) return false
}
let i =0;
this.postData.EventRecurrence.daysOfWeek = []
for(const [key, value] of Object.entries(this.daysOfWeek)) {
if(value) {
if(!this.postData.EventRecurrence.daysOfWeek.includes(i)) {
this.postData.EventRecurrence.daysOfWeek.push(i);
}
}
i++
}
this.postData.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
const laoder = this.toastService.loading();
+1 -1
View File
@@ -6,7 +6,7 @@ import { EventPerson } from './eventperson.model';
export interface EventRecurrence {
Type?: number | string;
Day?: number;
DayOfWeek?: number;
daysOfWeek?: number[];
Month?: number | string;
LastOccurrence?: Date | string;
frequency?: string,
@@ -41,7 +41,9 @@ const OrganizerSchema = z.object({
const EventRecurrenceSchema = z.object({
Type: z.number().optional(),
Day: z.any().optional(),
DayOfWeek: z.any(),
daysOfWeek: z.object({
day: z.number()
}).array(),
Month: z.any(),
LastOccurrence: z.any().optional(),
frequency: z.number().optional(),
@@ -178,6 +178,7 @@ export class AgendaDataRepositoryService {
recurrence: {
frequency: this.utils.eventRecurence(eventData.EventRecurrence.frequency),
until:((eventData.EventRecurrence.until === "") ? this.utils.addOneHourToIsoString(eventData.EndDate.toISOString()) : eventData.EventRecurrence.until),
daysOfWeek: eventData.EventRecurrence.daysOfWeek || []
},
organizerId: SessionStore.user.UserId,
isAllDayEvent: eventData.IsAllDayEvent,
@@ -211,6 +212,7 @@ export class AgendaDataRepositoryService {
recurrence: {
frequency: this.utils.eventRecurence(eventData.EventRecurrence.frequency),
until: ((eventData.EventRecurrence.until === "") ? this.utils.addOneHourToIsoString(eventData.EndDate.toISOString()) : eventData.EventRecurrence.until),
daysOfWeek: eventData.EventRecurrence.daysOfWeek || []
}
}
@@ -105,7 +105,7 @@ export class EventMapper {
"EventRecurrence": {
"Type": -1,
"Day": null,
"DayOfWeek": null,
"daysOfWeek": dto.eventRecurrence?.daysOfWeek.map(e => e.day),
"Month": null,
"LastOccurrence": null,
"frequency": dto?.eventRecurrence?.frequency,
@@ -144,7 +144,7 @@
Diário
</mat-option>
<mat-option value="weekly">
Semanalmente
Semanal
</mat-option>
<mat-option value="monthly">
Mensal
@@ -159,6 +159,19 @@
</div>
</div>
<div class="container-div py-2" *ngIf="postData.EventRecurrence.frequency == 'weekly' || postData.EventRecurrence.frequency == 'monthly'">
<div class="ion-item-class-2 d-flex justify-content-around font-13-em">
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.mon" (click)="daysOfWeek.mon=!daysOfWeek.mon">Seg</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.tues" (click)="daysOfWeek.tues=!daysOfWeek.tues">Terça</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.wed" (click)="daysOfWeek.wed=!daysOfWeek.wed">quarta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.thurs" (click)="daysOfWeek.thurs=!daysOfWeek.thurs">quinta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.fri" (click)="daysOfWeek.fri=!daysOfWeek.fri">Sexta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sat" (click)="daysOfWeek.sat=!daysOfWeek.sat">Sabado</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sun" (click)="daysOfWeek.sun=!daysOfWeek.sun">Domingo</div>
</div>
</div>
<div *ngIf="postData.EventRecurrence.frequency != 'never'" class="container-div">
<div class="ion-item-class-2 d-flex" >
@@ -209,3 +209,14 @@
display: block !important;
}
}
.segment{
box-shadow: 0px 0px 10px #b3b3b3;
padding: 3px;
border-radius: 10px;
}
.segment-active {
background-color: rgb(212, 212, 212);
}
@@ -122,6 +122,15 @@ export class BookMeetingModalPage implements OnInit {
CalendarNameShow = true
eventRecurence = 'never';
daysOfWeek = {
sun: false,
mon: false,
tues: false,
wed: false,
thurs: false,
fri: false,
sat: false,
};
constructor(
private modalController: ModalController,
@@ -393,6 +402,18 @@ export class BookMeetingModalPage implements OnInit {
}
});
let i =0;
this.postData.EventRecurrence.daysOfWeek = []
for(const [key, value] of Object.entries(this.daysOfWeek)) {
if(value) {
if(!this.postData.EventRecurrence.daysOfWeek.includes(i)) {
this.postData.EventRecurrence.daysOfWeek.push(i);
}
}
i++
}
this.postData.Attachments = DocumentToSave as any;
let loader = this.toastService.loading();
+1 -1
View File
@@ -314,7 +314,7 @@ export class TaskService {
@XTracerAsync({name:'taskService/loadEventToAprove', bugPrint: true})
async loadEventosParaAprovacao(tracing?: TracingType) {
this.showLoaderNum++
console.log('PR')
// console.log('PR')
// PR dont have event to approve
/* if(this.SessionStore.user.Profile != 'PR') { */
try {
@@ -169,7 +169,7 @@
Diário
</mat-option>
<mat-option value="weekly">
Semanalmente
Semanal
</mat-option>
<mat-option value="monthly">
Mensal
@@ -183,6 +183,18 @@
</div>
</div>
<div class="container-div" *ngIf="_postEvent.EventRecurrence.frequency == 'weekly' || _postEvent.EventRecurrence.frequency == 'monthly'">
<div class="ion-item-class-2 d-flex justify-content-around font-13-em">
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.mon" (click)="daysOfWeek.mon=!daysOfWeek.mon">Seg</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.tues" (click)="daysOfWeek.tues=!daysOfWeek.tues">Terça</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.wed" (click)="daysOfWeek.wed=!daysOfWeek.wed">quarta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.thurs" (click)="daysOfWeek.thurs=!daysOfWeek.thurs">quinta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.fri" (click)="daysOfWeek.fri=!daysOfWeek.fri">Sexta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sat" (click)="daysOfWeek.sat=!daysOfWeek.sat">Sabado</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sun" (click)="daysOfWeek.sun=!daysOfWeek.sun">Domingo</div>
</div>
</div>
<!-- <div *ngIf="_postEvent.EventRecurrence.frequency == 'weekly'" class="container-div ion-item-class-2 d-flex pl-45 pb-20 justify-content-between">
<div class="days-to-select">Seg</div>
<div class="days-to-select">Ter</div>
@@ -231,3 +231,15 @@ ion-content{
-ms-border-radius: 50px;
-o-border-radius: 50px;
}
.segment{
box-shadow: 0px 0px 10px #b3b3b3;
padding: 3px;
border-radius: 10px;
}
.segment-active {
background-color: rgb(212, 212, 212);
}
@@ -105,6 +105,16 @@ export class EditEventPage implements OnInit {
dateDifference = 0
editAllEvent = false
daysOfWeek = {
sun: false,
mon: false,
tues: false,
wed: false,
thurs: false,
fri: false,
sat: false,
};
constructor(
private modalController: ModalController,
public alertController: AlertController,
@@ -181,7 +191,36 @@ export class EditEventPage implements OnInit {
this.changeAgenda()
this.checkForWeekDaysSelect()
}
checkForWeekDaysSelect() {
if(!this._postEvent.EventRecurrence?.daysOfWeek) {
this._postEvent.EventRecurrence.daysOfWeek = []
}
if(this._postEvent.EventRecurrence?.daysOfWeek.includes(0)) {
this.daysOfWeek.sun = true
}
if (this._postEvent.EventRecurrence?.daysOfWeek.includes(1)) {
this.daysOfWeek.mon = true
}
if (this._postEvent.EventRecurrence?.daysOfWeek.includes(2)) {
this.daysOfWeek.tues = true
}
if (this._postEvent.EventRecurrence?.daysOfWeek.includes(3)) {
this.daysOfWeek.wed = true
}
if (this._postEvent.EventRecurrence?.daysOfWeek.includes(4)) {
this.daysOfWeek.thurs = true
}
if (this._postEvent.EventRecurrence?.daysOfWeek.includes(5)) {
this.daysOfWeek.fri = true
}
if (this._postEvent.EventRecurrence?.daysOfWeek.includes(6)) {
this.daysOfWeek.sat = true
}
}
@@ -249,21 +288,6 @@ export class EditEventPage implements OnInit {
}
openInicio() {
let input: any = document.querySelector('#new-inicio')
if (input) {
input.click()
}
}
openFim() {
let input: any = document.querySelector('#new-fim')
if (input) {
input.click()
}
}
openLastOccurrence() {
let input: any = document.querySelector('#last-occurrence')
if (input) {
@@ -383,6 +407,16 @@ export class EditEventPage implements OnInit {
try {
let i =0;
this._postEvent.EventRecurrence.daysOfWeek = []
for(const [key, value] of Object.entries(this.daysOfWeek)) {
if(value) {
if(!this._postEvent.EventRecurrence.daysOfWeek.includes(i)) {
this._postEvent.EventRecurrence.daysOfWeek.push(i);
}
}
i++
}
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
@@ -535,6 +569,7 @@ export class EditEventPage implements OnInit {
eventBody: this.eventBody,
segment: this.segment,
loadedEventAttachments: this.loadedEventAttachments,
daysOfWeek: this.daysOfWeek
}
}
@@ -547,6 +582,7 @@ export class EditEventPage implements OnInit {
this.eventBody = restoredData.eventBody
this.segment = restoredData.segment
this.loadedEventAttachments = restoredData.loadedEventAttachments
this.daysOfWeek = restoredData.daysOfWeek
return true;
} else {
@@ -168,6 +168,7 @@ export class EventListPage implements OnInit {
this.showLoader = false;
} else {
this.showLoader = false;
tracing.setAttribute('run', 'to early')
console.warn('calling to early eventlistpageshared/loadtoapproveevents')
}
@@ -153,7 +153,7 @@
Diário
</mat-option>
<mat-option value="weekly">
Semanalmente
Semanal
</mat-option>
<mat-option value="monthly">
Mensal
@@ -168,6 +168,21 @@
</div>
</div>
<div class="container-div" *ngIf="postEvent.EventRecurrence.frequency == 'weekly' || postEvent.EventRecurrence.frequency == 'monthly'">
<div class="ion-item-class-2 d-flex justify-content-around font-13-em">
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.mon" (click)="daysOfWeek.mon=!daysOfWeek.mon">Seg</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.tues" (click)="daysOfWeek.tues=!daysOfWeek.tues">Terça</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.wed" (click)="daysOfWeek.wed=!daysOfWeek.wed">quarta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.thurs" (click)="daysOfWeek.thurs=!daysOfWeek.thurs">quinta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.fri" (click)="daysOfWeek.fri=!daysOfWeek.fri">Sexta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sat" (click)="daysOfWeek.sat=!daysOfWeek.sat">Sabado</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sun" (click)="daysOfWeek.sun=!daysOfWeek.sun">Domingo</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">
@@ -220,3 +220,13 @@ ion-content{
padding-top: 7px;
}
.segment{
box-shadow: 0px 0px 10px #b3b3b3;
padding: 3px;
border-radius: 10px;
}
.segment-active {
background-color: rgb(212, 212, 212);
}
@@ -1,6 +1,4 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { EventBody } from 'src/app/models/eventbody.model';
import { EventPerson } from 'src/app/models/eventperson.model';
import { Event } from 'src/app/models/event.model';
import { ModalController } from '@ionic/angular';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
@@ -14,14 +12,12 @@ import * as _rollupMoment from 'moment';
import { FormControl } from '@angular/forms';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { ThemePalette } from '@angular/material/core';
import { ViewChild } from '@angular/core';
import { FormGroup, Validators } from '@angular/forms';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { ThemeService } from 'src/app/services/theme.service'
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 { EventToAprove } from 'src/app/models/eventToAprove.model';
import { Observable } from 'rxjs';
import { TaskService } from 'src/app/services/task.service'
import { ChangeProfileService } from 'src/app/services/change-profile.service';
@@ -29,7 +25,6 @@ import { AgendaDataRepositoryService } from 'src/app/module/agenda/data/reposito
import { RoleIdService } from 'src/app/services/role-id.service'
import { TableSharedCalendar } from 'src/app/module/agenda/data/data-source/agenda-local-data-source.service';
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
import { ContactRepositoryService } from 'src/app/services/Repositorys/contacts/repository/contacts-repository.service';
import { UserList } from 'src/app/models/entiry/agenda/contact';
import { AgendaService } from 'src/app/module/agenda/domain/agenda.service'
import { RoleId } from 'src/app/core/agenda/use-case/event-set-default-participants.service';
@@ -58,9 +53,6 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
export class NewEventPage implements OnInit {
eventBody: EventBody;
segment: string = "true";
public date: any;
public disabled = false;
public showSpinners = true;
@@ -70,13 +62,10 @@ export class NewEventPage implements OnInit {
public stepHour = 1;
public stepMinute = 15;
public stepSecond = 15;
currentDate = this.roundTimeQuarterHour();
public color: ThemePalette = 'primary';
recurringTypes = []
selectedRecurringType: any;
loggedAttendDad: boolean = true;
mostrarModal = false;
eventRecurence = 'never'
@Input() attendees: []
@Input() profile: string;
@@ -91,7 +80,6 @@ export class NewEventPage implements OnInit {
@Output() setIntervenientCC = new EventEmitter<any>();
postEvent: Event;
postEventToAprove: EventToAprove;
@Output() onAddEvent = new EventEmitter<any>();
@Output() openAttendeesComponent = new EventEmitter<any>();
@Output() clearContact = new EventEmitter<any>();
@@ -102,11 +90,7 @@ export class NewEventPage implements OnInit {
documents: SearchList_v2[] = [];
loggeduser: LoginUserRespose;
@ViewChild('picker') picker: any;
@ViewChild('fim') fim: any;
@ViewChild('inicio') inicio: any;
@ViewChild('occurrence') occurrence: any;
@ViewChild('picker1') picker1: any;
Form: FormGroup;
validateFrom = false;
@@ -139,6 +123,19 @@ export class NewEventPage implements OnInit {
selectedUserCalendar:any;
SessionStore = SessionStore
hasChangeCalendar = false
daysOfWeek = {
sun: false,
mon: false,
tues: false,
wed: false,
thurs: false,
fri: false,
sat: false,
};
constructor(
private modalController: ModalController,
private toastService: ToastService,
@@ -149,7 +146,6 @@ export class NewEventPage implements OnInit {
private changeProfileService: ChangeProfileService,
private agendaDataRepository: AgendaDataRepositoryService,
public RoleIdService: RoleIdService,
private ContactRepositoryService: ContactRepositoryService,
private AgendaService: AgendaService
) {
this.dateAdapter.setLocale('pt');
@@ -198,8 +194,7 @@ export class NewEventPage implements OnInit {
if (!this.restoreTemporaryData()) {
// clear
this.setCalendarByDefault(true)
this.eventBody = { BodyType: "1", Text: "" };
this.postEvent.Body = this.eventBody;
this.postEvent.Body = { BodyType: "1", Text: "" };
this.initializeData()
@@ -233,7 +228,7 @@ export class NewEventPage implements OnInit {
this.postEvent = {
EventId: '',
Subject: '',
Body: this.eventBody,
Body: { BodyType: "1", Text: "" },
Location: '',
CalendarId: '',
CalendarName: 'Oficial',
@@ -249,8 +244,10 @@ export class NewEventPage implements OnInit {
Category: 'Meeting',
HasAttachments: false,
EventRecurrence: {
frequency: this.eventRecurence, until: "",
Type: ''
frequency: "never",
until: "",
Type: '',
daysOfWeek: []
},
}
}
@@ -307,13 +304,7 @@ export class NewEventPage implements OnInit {
return date
}
setStartDate() {
// this.postEvent.StartDate = this.roundTimeQuarterHour();
}
setEndDate() {
// this.postEvent.EndDate = this.postEvent.StartDate;
}
runValidation() {
this.validateFrom = true;
@@ -324,11 +315,6 @@ export class NewEventPage implements OnInit {
injectValidation() {
/* if (typeof (this.postEvent.EventRecurrence.Type) == 'number') {
const str: any = this.postEvent.EventRecurrence.Type.toString()
this.postEvent.EventRecurrence.Type = str
} */
this.Form = new FormGroup({
Subject: new FormControl(this.postEvent.Subject, [
Validators.required,
@@ -393,12 +379,6 @@ export class NewEventPage implements OnInit {
}
// openLastOccurrence() {
// let input: any = document.querySelector('#last-occurrence')
// if (input) {
// input.click()
// }
// }
async getDoc() {
const modal = await this.modalController.create({
@@ -442,13 +422,6 @@ export class NewEventPage implements OnInit {
this.cloneAllmobileComponent.emit({})
}
// getRecurrenceTypes() {
// this.eventService.getRecurrenceTypes().subscribe(res => {
// this.recurringTypes = res;
// });
// }
calculetedLastOccurrence(type: number) {
@@ -503,6 +476,18 @@ export class NewEventPage implements OnInit {
return false
}
let i =0;
this.postEvent.EventRecurrence.daysOfWeek = []
for(const [key, value] of Object.entries(this.daysOfWeek)) {
if(value) {
if(!this.postEvent.EventRecurrence.daysOfWeek.includes(i)) {
this.postEvent.EventRecurrence.daysOfWeek.push(i);
}
}
i++
}
let loader = this.toastService.loading();
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc) as any
this.postEvent.IsAllDayEvent = this.allDayCheck;
@@ -578,13 +563,12 @@ export class NewEventPage implements OnInit {
saveTemporaryData() {
window['temp.path:/home/agenda/new-event.component.ts'] = {
postEvent: this.postEvent,
eventBody: this.eventBody,
allDayCheck: this.allDayCheck,
segment: this.segment,
CalendarName: this.CalendarName,
documents: this.documents,
selectedUserCalendar: this.selectedUserCalendar,
hasChangeCalendar: this.hasChangeCalendar
hasChangeCalendar: this.hasChangeCalendar,
daysOfWeek: this.daysOfWeek
}
}
@@ -600,12 +584,11 @@ export class NewEventPage implements OnInit {
if (JSON.stringify(restoredData) != "{}" && undefined != restoredData) {
this.postEvent = restoredData.postEvent
this.allDayCheck = restoredData.allDayCheck
this.eventBody = restoredData.eventBody
this.segment = restoredData.segment
this.CalendarName = restoredData.CalendarName
this.documents = restoredData.documents
this.selectedUserCalendar = restoredData.selectedUserCalendar
this.hasChangeCalendar = restoredData.hasChangeCalendar
this.daysOfWeek = restoredData.daysOfWeek
// restore dater for date and hours picker
@@ -168,8 +168,8 @@
</div>
</div>
<div class="container-div" *ngIf="postEvent?.EventRecurrence?.frequency">
<div class="ion-item-class-2 d-flex">
<div class="container-div width-100" *ngIf="postEvent?.EventRecurrence?.frequency">
<div class="ion-item-class-2 d-flex width-100">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
</div>
@@ -185,7 +185,7 @@
Diário
</mat-option>
<mat-option value="weekly">
Semanalmente
Semanal
</mat-option>
<mat-option value="monthly">
Mensal
@@ -200,8 +200,20 @@
</div>
</div>
<div *ngIf="postEvent?.EventRecurrence?.frequency != 'never'" class="container-div">
<div class="ion-item-class-2 d-flex" >
<div class="container-div width-100" *ngIf="postEvent.EventRecurrence.frequency == 'weekly' || postEvent.EventRecurrence.frequency == 'monthly'">
<div class="ion-item-class-2 d-flex justify-content-around font-13-em">
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.mon" (click)="daysOfWeek.mon=!daysOfWeek.mon">Seg</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.tues" (click)="daysOfWeek.tues=!daysOfWeek.tues">Terça</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.wed" (click)="daysOfWeek.wed=!daysOfWeek.wed">quarta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.thurs" (click)="daysOfWeek.thurs=!daysOfWeek.thurs">quinta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.fri" (click)="daysOfWeek.fri=!daysOfWeek.fri">Sexta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sat" (click)="daysOfWeek.sat=!daysOfWeek.sat">Sabado</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sun" (click)="daysOfWeek.sun=!daysOfWeek.sun">Domingo</div>
</div>
</div>
<div *ngIf="postEvent?.EventRecurrence?.frequency != 'never'" class="container-div width-100">
<div class="ion-item-class-2 d-flex width-100" >
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-reapet.svg"></ion-icon>
</div>
@@ -204,3 +204,15 @@
height: 20px;
}
}
.segment{
box-shadow: 0px 0px 10px #b3b3b3;
padding: 3px;
border-radius: 10px;
}
.segment-active {
background-color: rgb(212, 212, 212);
}
@@ -112,6 +112,16 @@ export class EditEventPage implements OnInit {
editAllEvent = false
closeModal = false
daysOfWeek = {
sun: false,
mon: false,
tues: false,
wed: false,
thurs: false,
fri: false,
sat: false,
};
constructor(
private modalController: ModalController,
private navParams: NavParams,
@@ -173,8 +183,41 @@ export class EditEventPage implements OnInit {
this.changeAgenda()
this.sharedCalendar = this.agendaDataRepository.getShareCalendarItemsLiveWithOrder()
}
checkForWeekDaysSelect() {
if(!this.postEvent.EventRecurrence?.daysOfWeek) {
this.postEvent.EventRecurrence.daysOfWeek = []
}
if(this.postEvent.EventRecurrence?.daysOfWeek.includes(0)) {
this.daysOfWeek.sun = true
}
if (this.postEvent.EventRecurrence?.daysOfWeek.includes(1)) {
this.daysOfWeek.mon = true
}
if (this.postEvent.EventRecurrence?.daysOfWeek.includes(2)) {
this.daysOfWeek.tues = true
}
if (this.postEvent.EventRecurrence?.daysOfWeek.includes(3)) {
this.daysOfWeek.wed = true
}
if (this.postEvent.EventRecurrence?.daysOfWeek.includes(4)) {
this.daysOfWeek.thurs = true
}
if (this.postEvent.EventRecurrence?.daysOfWeek.includes(5)) {
this.daysOfWeek.fri = true
}
if (this.postEvent.EventRecurrence?.daysOfWeek.includes(6)) {
this.daysOfWeek.sat = true
}
}
hasPrCalendar(data: TableSharedCalendar[]) {
for(const e of data) {
if(e.roleId == this.RoleIdService.PRES) {
@@ -212,6 +255,8 @@ export class EditEventPage implements OnInit {
this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString();
}, 500);
this.checkForWeekDaysSelect()
}
ngOnDestroy() {
@@ -414,6 +459,18 @@ export class EditEventPage implements OnInit {
this.runValidation()
let i =0;
this.postEvent.EventRecurrence.daysOfWeek = []
for(const [key, value] of Object.entries(this.daysOfWeek)) {
if(value) {
if(!this.postEvent.EventRecurrence.daysOfWeek.includes(i)) {
this.postEvent.EventRecurrence.daysOfWeek.push(i);
}
}
i++
}
if (this.Form.invalid) {
return false
@@ -135,7 +135,7 @@
Diário
</mat-option>
<mat-option value="weekly">
Semanalmente
Semanal
</mat-option>
<mat-option value="monthly">
Mensal
@@ -150,6 +150,20 @@
</div>
</div>
<div class="container-div" *ngIf="postEvent.EventRecurrence.frequency == 'weekly' || postEvent.EventRecurrence.frequency == 'monthly'">
<div class="ion-item-class-2 d-flex justify-content-around font-13-em">
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.mon" (click)="daysOfWeek.mon=!daysOfWeek.mon">Seg</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.tues" (click)="daysOfWeek.tues=!daysOfWeek.tues">Terça</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.wed" (click)="daysOfWeek.wed=!daysOfWeek.wed">quarta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.thurs" (click)="daysOfWeek.thurs=!daysOfWeek.thurs">quinta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.fri" (click)="daysOfWeek.fri=!daysOfWeek.fri">Sexta</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sat" (click)="daysOfWeek.sat=!daysOfWeek.sat">Sabado</div>
<div class="segment cursor-pointer" [class.segment-active]="daysOfWeek.sun" (click)="daysOfWeek.sun=!daysOfWeek.sun">Domingo</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">
@@ -227,3 +227,15 @@ ion-content{
width: auto;
height: 30px;
}
.segment{
box-shadow: 0px 0px 10px #b3b3b3;
padding: 3px;
border-radius: 10px;
}
.segment-active {
background-color: rgb(212, 212, 212);
}
@@ -119,6 +119,16 @@ export class NewEventPage implements OnInit {
hasChangeCalendar = false
daysOfWeek = {
sun: false,
mon: false,
tues: false,
wed: false,
thurs: false,
fri: false,
sat: false,
};
constructor(
private modalController: ModalController,
@@ -219,8 +229,12 @@ export class NewEventPage implements OnInit {
Organizer: '',
Category: 'Meeting',
HasAttachments: false,
EventRecurrence: { frequency: this.eventRecurence, until: "",
Type: '' },
EventRecurrence: {
frequency: this.eventRecurence,
until: "",
Type: '',
daysOfWeek: []
},
};
window.onresize = (event) => {
@@ -404,34 +418,24 @@ export class NewEventPage implements OnInit {
})
}
openInicio() {
let input: any = document.querySelector('#new-inicio')
if (input) {
input.click()
}
}
openFim() {
let input: any = document.querySelector('#new-fim')
if (input) {
input.click()
}
}
openLastOccurrence() {
let input: any = document.querySelector('#last-occurrence')
if (input) {
input.click()
}
}
@XTracerAsync({name:'Mobile/create-event', bugPrint: true})
async save_v2(tracing?: TracingType) {
this.injectValidation()
this.runValidation()
let i =0;
this.postEvent.EventRecurrence.daysOfWeek = []
for(const [key, value] of Object.entries(this.daysOfWeek)) {
if(value) {
if(!this.postEvent.EventRecurrence.daysOfWeek.includes(i)) {
this.postEvent.EventRecurrence.daysOfWeek.push(i);
}
}
i++
}
console.log(new Date(this.postEvent.StartDate).getTime())
console.log(new Date(this.postEvent.EndDate).getTime())
console.log(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok' : null)
@@ -472,21 +476,6 @@ export class NewEventPage implements OnInit {
}
// //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']
// } else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal'] && this.postEvent.CalendarName == 'Pessoal') {
// return this.eventService.calendarNamesType[this.CalendarName]['OwnerId']
// } else {
// return '11:11'
// }
// }
async changeAgenda() {
const result = await this.agendaDataRepository.geCalendars()
@@ -591,34 +580,6 @@ export class NewEventPage implements OnInit {
}
// Deve ser removido posteriormente
eventToaproveBody(event, calendarId, role, userId, attachments) {
let toAproveObject = {
"EventProcess": {
"Body": event.Body,
"Location": event.Location,
"Subject": event.Subject,
"StartDate": event.StartDate,
"EndDate": event.EndDate,
"Status": "Active",
"IsAllDayEvent": event.IsRecurring,
"EventType": event.EventType,
"ParticipantsList": event.Attendees,
"EventRecurrence": event.EventRecurrence,
"HasAttachments": event.HasAttachments,
"CalendarId": calendarId,
"Role": role,
"wxUserID": userId,
"TimeZone": "W. Central Africa Standard Time"
},
"Attachments": attachments,
"InstanceID": "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate()
}
return toAproveObject;
}
async fetchContacts(filter: string) {
const result = await this.AgendaService.setDefaultParticipants()
+1
View File
@@ -185,3 +185,4 @@ defineCustomElements(window);
// console.log('Column:', parsedError.columnNumber);
// fetchAndHandleSourceMap(matches);
+6 -6
View File
@@ -1,11 +1,11 @@
export let versionData = {
"shortSHA": "661b449fb",
"SHA": "661b449fb4818c27a829f1ba91b0d73b2eb1e3b5",
"shortSHA": "ac1f01b15",
"SHA": "ac1f01b15b042162bee58c4d23ee56c1070553b6",
"branch": "feature/chat-new-api-peter",
"lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Fri Oct 18 16:22:45 2024 +0100'",
"lastCommitMessage": "improve setup meeting from task",
"lastCommitNumber": "6103",
"changeStatus": "On branch feature/chat-new-api-peter\nYour branch is ahead of 'origin/feature/chat-new-api-peter' by 3 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tdeleted: src/app/Rules/aprove-event.service.spec.ts\n\tdeleted: src/app/Rules/aprove-event.service.ts\n\tmodified: src/app/app-routing.module.ts\n\tmodified: src/app/home/home.page.ts\n\tdeleted: src/app/modals/chat-options-features/chat-options-features-routing.module.ts\n\tdeleted: src/app/modals/chat-options-features/chat-options-features.module.ts\n\tdeleted: src/app/modals/chat-options-features/chat-options-features.page.html\n\tdeleted: src/app/modals/chat-options-features/chat-options-features.page.scss\n\tdeleted: src/app/modals/chat-options-features/chat-options-features.page.spec.ts\n\tdeleted: src/app/modals/chat-options-features/chat-options-features.page.ts\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts\n\tmodified: src/app/modals/forward/forward.page.ts\n\tmodified: src/app/module/agenda/utils.ts\n\tmodified: src/app/pages/events/events.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/services/events.service.ts\n\tdeleted: src/app/services/hardware-go-back.service.spec.ts\n\tdeleted: src/app/services/hardware-go-back.service.ts\n\tmodified: src/app/services/notifications.service.ts\n\tdeleted: src/app/services/offline-manager.service.spec.ts\n\tdeleted: src/app/services/offline-manager.service.ts\n\tmodified: src/app/services/rules/event.service.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts\n\tmodified: src/app/shared/gabinete-digital/expedients/expedients.page.ts\n\tmodified: src/app/ui/agenda/agenda.page.ts\n\tmodified: src/app/ui/agenda/component/approve-event/approve-event.page.ts\n\tmodified: src/app/ui/agenda/component/edit-event-to-approve/edit-event-to-approve.page.ts\n\tmodified: src/app/ui/agenda/component/event-list/event-list.page.ts\n\tmodified: src/app/ui/agenda/component/new-event/new-event.page.ts\n\tmodified: src/app/ui/agenda/component/view-event/view-event.page.ts\n\tmodified: src/app/ui/agenda/modal/edit-event/edit-event.page.ts\n\tmodified: src/app/ui/agenda/modal/new-event/new-event.page.ts\n\tmodified: src/app/ui/agenda/modal/view-event/view-event.page.ts\n\tmodified: src/app/ui/chat/component/messages/messages.page.ts\n\tmodified: version/git-version.ts",
"lastCommitTime": "'Mon Oct 21 10:15:48 2024 +0100'",
"lastCommitMessage": "remove uunsed",
"lastCommitNumber": "6104",
"changeStatus": "On branch feature/chat-new-api-peter\nYour branch is up to date with 'origin/feature/chat-new-api-peter'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/app.module.ts\n\tmodified: src/app/core/agenda/use-case/event-set-default-participants.service.ts\n\tmodified: src/app/core/chat/usecase/room/room-set-last-message.service.ts\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.scss\n\tmodified: src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts\n\tmodified: src/app/models/event.model.ts\n\tmodified: src/app/module/agenda/data/dto/eventDTOOutput.ts\n\tmodified: src/app/module/agenda/data/repository/agenda-data-repository.service.ts\n\tmodified: src/app/module/agenda/domain/mapper/EventDetailsMapper.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.scss\n\tmodified: src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/ui/agenda/component/edit-event/edit-event.page.html\n\tmodified: src/app/ui/agenda/component/edit-event/edit-event.page.scss\n\tmodified: src/app/ui/agenda/component/edit-event/edit-event.page.ts\n\tmodified: src/app/ui/agenda/component/event-list/event-list.page.ts\n\tmodified: src/app/ui/agenda/component/new-event/new-event.page.html\n\tmodified: src/app/ui/agenda/component/new-event/new-event.page.scss\n\tmodified: src/app/ui/agenda/component/new-event/new-event.page.ts\n\tmodified: src/app/ui/agenda/modal/edit-event/edit-event.page.html\n\tmodified: src/app/ui/agenda/modal/edit-event/edit-event.page.scss\n\tmodified: src/app/ui/agenda/modal/edit-event/edit-event.page.ts\n\tmodified: src/app/ui/agenda/modal/new-event/new-event.page.html\n\tmodified: src/app/ui/agenda/modal/new-event/new-event.page.scss\n\tmodified: src/app/ui/agenda/modal/new-event/new-event.page.ts\n\tmodified: src/main.ts",
"changeAuthor": "peter.maquiran"
}