fix agenda list box and create event on chat

This commit is contained in:
Peter Maquiran
2022-12-16 15:44:52 +01:00
parent 9116ac4d06
commit 7e70078a0a
11 changed files with 103 additions and 88 deletions
+16 -16
View File
@@ -261,18 +261,18 @@
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent"> <div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
<div *ngIf="!event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div> <div *ngIf="!event.endMany && !event.middle" class="time-start labelb">Início</div>
<div *ngIf="event.endMany && !event.middle" class="time-start">--</div> <div *ngIf="event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
<div *ngIf="!event.startMany && !event.middle" class="time-end">{{event.event.EndDate | date: 'HH:mm'}}</div> <div *ngIf="!event.startMany && !event.middle" class="time-end labelb">Fim</div>
<div *ngIf="event.startMany && !event.middle" class="time-end"> -- </div> <div *ngIf="event.startMany && !event.middle" class="time-end">{{event.event.EndDate | date: 'HH:mm'}} </div>
<div *ngIf="event.middle" class="time-start"> Todo </div> <div *ngIf="event.middle" class="time-start"> Todo </div>
<div *ngIf="event.middle" class="time-end text-center"> o dia </div> <div *ngIf="event.middle" class="time-end text-center"> o dia </div>
</div> </div>
<div class="schedule-time" *ngIf="event.event.IsAllDayEvent"> <div class="schedule-time" *ngIf="event.event.IsAllDayEvent">
<div class="time-start">Todo</div> <div class="time-start">Todo </div>
<div class="time-end text-center">o dia</div> <div class="time-end text-center">o dia</div>
</div> </div>
<div class="schedule-details"> <div class="schedule-details">
@@ -303,18 +303,18 @@
> >
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent"> <div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
<div *ngIf="!event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div> <div *ngIf="!event.endMany && !event.middle" class="time-start labelb">Início</div>
<div *ngIf="event.endMany && !event.middle" class="time-start">--</div> <div *ngIf="event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
<div *ngIf="!event.startMany && !event.middle" class="time-end">{{event.event.EndDate | date: 'HH:mm'}}</div> <div *ngIf="!event.startMany && !event.middle" class="time-end labelb">Fim</div>
<div *ngIf="event.startMany && !event.middle" class="time-end"> -- </div> <div *ngIf="event.startMany && !event.middle" class="time-end">{{event.event.EndDate | date: 'HH:mm'}}</div>
<div *ngIf="event.middle" class="time-start"> Todo </div> <div *ngIf="event.middle" class="time-start"> Todo </div>
<div *ngIf="event.middle" class="time-end text-center"> o dia </div> <div *ngIf="event.middle" class="time-end text-center"> o dia </div>
</div> </div>
<div class="schedule-time" *ngIf="event.event.IsAllDayEvent"> <div class="schedule-time" *ngIf="event.event.IsAllDayEvent">
<div class="time-start">Todo</div> <div class="time-start">Todo </div>
<div class="time-end">o dia</div> <div class="time-end">o dia</div>
</div> </div>
<div class="schedule-details"> <div class="schedule-details">
@@ -345,18 +345,18 @@
<div class="d-flex content-pr-{{event.event.CalendarName}} mt-10 cursor-pointer item-hover" (click)="eventClicked(event)"> <div class="d-flex content-pr-{{event.event.CalendarName}} mt-10 cursor-pointer item-hover" (click)="eventClicked(event)">
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent"> <div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
<div *ngIf="!event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div> <div *ngIf="!event.endMany && !event.middle" class="time-star labelbt">Início</div>
<div *ngIf="event.endMany && !event.middle" class="time-start">--</div> <div *ngIf="event.endMany && !event.middle" class="time-start">{{event.event.StartDate | date: 'HH:mm'}}</div>
<div *ngIf="!event.startMany && !event.middle" class="time-end">{{event.event.EndDate | date: 'HH:mm'}}</div> <div *ngIf="!event.startMany && !event.middle" class="time-end labelb">Fim</div>
<div *ngIf="event.startMany && !event.middle" class="time-end"> -- </div> <div *ngIf="event.startMany && !event.middle" class="time-end">{{event.event.EndDate | date: 'HH:mm'}} </div>
<div *ngIf="event.middle" class="time-start"> Todo </div> <div *ngIf="event.middle" class="time-start"> Todo {{ event.startMany }} </div>
<div *ngIf="event.middle" class="time-end text-center"> o dia </div> <div *ngIf="event.middle" class="time-end text-center"> o dia </div>
</div> </div>
<div class="schedule-time" *ngIf="event.event.IsAllDayEvent"> <div class="schedule-time" *ngIf="event.event.IsAllDayEvent">
<div class="time-start">Todo</div> <div class="time-start">Todo </div>
<div class="time-end">o dia</div> <div class="time-end">o dia</div>
</div> </div>
<div class="schedule-details"> <div class="schedule-details">
+8 -2
View File
@@ -486,12 +486,12 @@ td.monthview-primary-with-event {
margin-right: 10px; margin-right: 10px;
min-width: 33px; min-width: 33px;
.time-start{ .time-start{
color: #797979 !important; color: #797979 ;
font-family: Roboto; font-family: Roboto;
font-size: 13px; font-size: 13px;
} }
.time-end{ .time-end{
color: #797979 !important; color: #797979 ;
font-family: Roboto; font-family: Roboto;
font-size: 13px; font-size: 13px;
} }
@@ -914,3 +914,9 @@ $font-size: 11pt;
color: black !important; color: black !important;
border-color: #f05d5e !important; border-color: #f05d5e !important;
} }
.labelb {
font-weight: 500;
color: red !important;
}
@@ -58,7 +58,8 @@
<div class="content-details"> <div class="content-details">
<ion-label> <ion-label>
<p>{{customDate}}</p> <p>{{customDate}}</p>
<p>das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}</p> <p *ngIf="toDateString(loadedEvent.StartDate) == toDateString(loadedEvent.EndDate)">das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}</p>
<p *ngIf="toDateString(loadedEvent.StartDate) != toDateString(loadedEvent.EndDate)">{{loadedEvent.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.EndDate | date: 'dd/M/yy'}} </p>
<p *ngIf="loadedEvent.EventRecurrence"> <p *ngIf="loadedEvent.EventRecurrence">
<span *ngIf="loadedEvent.EventRecurrence.Type == 0">Diário</span> <span *ngIf="loadedEvent.EventRecurrence.Type == 0">Diário</span>
<span *ngIf="loadedEvent.EventRecurrence.Type == 1">Semanal</span> <span *ngIf="loadedEvent.EventRecurrence.Type == 1">Semanal</span>
@@ -303,6 +303,10 @@ export class ViewEventPage implements OnInit {
} }
toDateString(e) {
return new Date(e).toDateString()
}
async editEventDetail() { async editEventDetail() {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
+2 -2
View File
@@ -269,7 +269,7 @@
[selectedDate]="eventSelectedDate" [selectedDate]="eventSelectedDate"
[eventAttendees]="contacts" [eventAttendees]="contacts"
(onAddEvent)="closeNewEventComponentAndOpenChat($event)" (onAddEvent)="closeNewEventComponentAndOpenChat($event)"
(openAttendeesComponent)="closeNewEventComponentAndOpenChat($event)" (openAttendeesComponent)="openAttendeesComponent($event)"
(backToChat)="backToChat($event)" (backToChat)="backToChat($event)"
[style.display]="showNewEvent ? 'flex' : 'none'" [style.display]="showNewEvent ? 'flex' : 'none'"
class=" height-100 flex-column"> class=" height-100 flex-column">
@@ -278,7 +278,7 @@
[adding]="adding" [adding]="adding"
[taskParticipants]="taskParticipants" [taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc" [taskParticipantsCc]="taskParticipantsCc"
(closeComponent)="closeAttendeesComponent()" (closeComponent)="openNewEventPage()"
(setIntervenient)="setIntervenient($event)" (setIntervenient)="setIntervenient($event)"
(setIntervenientCC)="setIntervenientCC($event)" (setIntervenientCC)="setIntervenientCC($event)"
(setContact)="setContact($event)" (setContact)="setContact($event)"
+5 -1
View File
@@ -297,7 +297,9 @@ export class ChatPage implements OnInit {
} }
} }
openNewEventPage(data: any) { openNewEventPage(data?) {
if(data) {
this.taskParticipants = data.members.map((val) => { this.taskParticipants = data.members.map((val) => {
return { return {
Name: val.name, Name: val.name,
@@ -306,6 +308,8 @@ export class ChatPage implements OnInit {
} }
}); });
this.groupRoomId = data.roomId; this.groupRoomId = data.roomId;
}
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
@@ -313,7 +313,6 @@
<div class="my-2"><div style="width: 50%; background-color: #eeeeee; height: 10px;"></div></div> <div class="my-2"><div style="width: 50%; background-color: #eeeeee; height: 10px;"></div></div>
<div class="my-2"><div style="width: 100%; background-color: #eeeeee; height: 10px;"></div></div> <div class="my-2"><div style="width: 100%; background-color: #eeeeee; height: 10px;"></div></div>
</div> </div>
</ion-item> </ion-item>
<ion-item lines="none" <ion-item lines="none"
class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding"> class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding">
@@ -333,15 +332,10 @@
<div class="my-2"><div style="width: 50%; background-color: #eeeeee; height: 10px;"></div></div> <div class="my-2"><div style="width: 50%; background-color: #eeeeee; height: 10px;"></div></div>
<div class="my-2"><div style="width: 100%; background-color: #eeeeee; height: 10px;"></div></div> <div class="my-2"><div style="width: 100%; background-color: #eeeeee; height: 10px;"></div></div>
</div> </div>
</ion-item> </ion-item>
</ion-item-sliding> </ion-item-sliding>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
+21 -20
View File
@@ -34,8 +34,6 @@ export class ListBoxService {
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) { list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) {
//
// // filter range // // filter range
// if(selectedDate) { // if(selectedDate) {
// eventSource = eventSource.filter(data => // eventSource = eventSource.filter(data =>
@@ -67,7 +65,8 @@ export class ListBoxService {
display(list: CustomCalendarEvent[], profile, selectedDate) { display(list: CustomCalendarEvent[], profile, selectedDate) {
let days = {}; let days = {};
list.forEach( (event:CustomCalendarEvent, index)=> { list.forEach( (event:CustomCalendarEvent, index) => {
var startDate: any = new Date(event.start); var startDate: any = new Date(event.start);
@@ -76,26 +75,31 @@ export class ListBoxService {
endTime: event.end endTime: event.end
}) })
const day = this.dateService.getDay(event.start) const day = this.dateService.getDay(event.start)
event['manyDays'] = false event['manyDays'] = !this.dateService.isSameDate(event.start, event.end)
event['todayOnly'] = this.dateService.isSameDate(event.start, event.end) event['todayOnly'] = this.dateService.isSameDate(event.start, event.end)
if(!days.hasOwnProperty(day)) { if(!days.hasOwnProperty(day)) {
days[day] = [] days[day] = []
} }
const diffDays = this.dateService.deferenceBetweenDays(endDate, startDate)
if (this.dateService.notSameDate(startDate, endDate)) { if (this.dateService.notSameDate(startDate, endDate)) {
const diffDays = this.dateService.deferenceBetweenDays(endDate, startDate)
if (diffDays <= 150 && !event.event.IsAllDayEvent ) { if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
if (diffDays >= 1) { if (diffDays >= 1) {
const StartEvent = this.transForm(event, {startMany: true,endMany: false, middle: false, profile}) const StartEvent = this.transForm(event, {startMany: true, endMany: false, middle: false, profile})
if(this.push(event, selectedDate)) days[day].push(StartEvent) if(this.CanPush(event, selectedDate)) days[day].push(StartEvent)
let i = 1; let i = 1;
@@ -120,13 +124,13 @@ export class ListBoxService {
startDate.getDate() != endDate.getDate())) { startDate.getDate() != endDate.getDate())) {
// last push // last push
const EndEvent = this.transForm(event, {startMany: false,endMany: true, middle: false, profile}) const EndEvent = this.transForm(event, {startMany: false, endMany: true, middle: false, profile})
if(this.push(event, selectedDate)) days[otherDays].push(EndEvent) if(this.CanPush(event, selectedDate)) days[otherDays].push(EndEvent)
} else { } else {
const EndEvent = this.transForm(event, {startMany: false,endMany: true, middle: true, profile}) const EndEvent = this.transForm(event, {startMany: false,endMany: true, middle: true, profile})
if(this.push(event, selectedDate)) days[otherDays].push(EndEvent) if(this.CanPush(event, selectedDate)) days[otherDays].push(EndEvent)
} }
} }
@@ -134,15 +138,15 @@ export class ListBoxService {
} else { } else {
if(this.push(event, selectedDate)) days[day].push(event) if(this.CanPush(event, selectedDate)) days[day].push(event)
} }
} else { } else {
if(this.push(event, selectedDate)) days[day].push(event) if(this.CanPush(event, selectedDate)) days[day].push(event)
} }
} }
if(this.push(event, selectedDate)) days[day].push(event) // if(this.CanPush(event, selectedDate) && diffDays != 2) days[day].push(event)
}) })
@@ -159,8 +163,7 @@ export class ListBoxService {
return days return days
} }
CanPush(event: any, selectedDate: Date) {
push(event: any, selectedDate: Date) {
return new Date(event.start).getMonth() == selectedDate.getMonth() && return new Date(event.start).getMonth() == selectedDate.getMonth() &&
new Date(event.start).getFullYear() == selectedDate.getFullYear() && new Date(event.start).getFullYear() == selectedDate.getFullYear() &&
@@ -187,7 +190,6 @@ export class ListBoxService {
return events; return events;
} }
transForm(event: CustomCalendarEvent, {startMany, endMany, middle, profile}) { transForm(event: CustomCalendarEvent, {startMany, endMany, middle, profile}) {
return Object.assign({}, { return Object.assign({}, {
start: event.start, start: event.start,
@@ -204,11 +206,10 @@ export class ListBoxService {
CalendarId: event.event.CalendarId CalendarId: event.event.CalendarId
}, },
Subject: event.event.Subject, Subject: event.event.Subject,
startMany: false, startMany: startMany,
endMany: true, endMany: endMany,
middle: true middle: middle
}) })
} }
} }
@@ -55,7 +55,7 @@
<ion-label> <ion-label>
<p>{{customDate}}</p> <p>{{customDate}}</p>
<p *ngIf="toDateString(loadedEvent.StartDate) == toDateString(loadedEvent.EndDate)">das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}</p> <p *ngIf="toDateString(loadedEvent.StartDate) == toDateString(loadedEvent.EndDate)">das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}</p>
<p *ngIf="toDateString(loadedEvent.StartDate) != toDateString(loadedEvent.EndDate)">{{loadedEvent.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.StartDate | date: 'dd/M/yy'}} </p> <p *ngIf="toDateString(loadedEvent.StartDate) != toDateString(loadedEvent.EndDate)">{{loadedEvent.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.EndDate | date: 'dd/M/yy'}} </p>
<p *ngIf="loadedEvent.EventRecurrence"> <p *ngIf="loadedEvent.EventRecurrence">
<span *ngIf="loadedEvent.EventRecurrence.Type == 0">Diário</span> <span *ngIf="loadedEvent.EventRecurrence.Type == 0">Diário</span>
<span *ngIf="loadedEvent.EventRecurrence.Type == 1">Semanal</span> <span *ngIf="loadedEvent.EventRecurrence.Type == 1">Semanal</span>
+1
View File
@@ -15,4 +15,5 @@ export const environment = {
defaultuserpwd: '', //tabteste@006, defaultuserpwd: '', //tabteste@006,
chatOffline: true, chatOffline: true,
presidencia: false, presidencia: false,
version: '1.0.1'
}; };
+6 -2
View File
@@ -22,8 +22,11 @@
export const environment = { export const environment = {
production: false, production: false,
//apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/', //apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
apiURL: 'https://gd-api.oapr.gov.ao/GabineteDigital.Services/V5/api/', //apiURL: 'https://gd-api.oapr.gov.ao/GabineteDigital.Services/V5/api/',
//apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/', apiURL: 'https://gdapi-dev.dyndns.info/GabineteDigital.Services/V5/api/',
// apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
// apiChatUrl: 'http://192.168.0.29:3000/api/v1/',
// apiWsChatUrl: 'wss://192.168.0.29:3000/websocket',
apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/', apiChatUrl: 'https://gd-chat.oapr.gov.ao/api/v1/',
apiWsChatUrl: 'ws://gd-chat.oapr.gov.ao/websocket', apiWsChatUrl: 'ws://gd-chat.oapr.gov.ao/websocket',
// apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/', // apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
@@ -35,6 +38,7 @@ export const environment = {
defaultuserpwd: 'tabteste@006', //tabteste@006, defaultuserpwd: 'tabteste@006', //tabteste@006,
chatOffline: true, chatOffline: true,
presidencia: false, presidencia: false,
version: '1.0.1'
}; };
/* /*