mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
pull from developer-prod made
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
|
||||
|
||||
<div class="d-flex container-wrapper">
|
||||
|
||||
<div class="calendar-timeline d-flex flex-column height-100 bg-blue">
|
||||
@@ -14,7 +14,7 @@
|
||||
<!-- Toolbar -->
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
|
||||
<div class="weeksToShow">
|
||||
<div class="weeksToShow">
|
||||
<!-- Calendar is here -->
|
||||
|
||||
<div class="calendar-segment-{{profile}}" [class.calendar-segment-pr-force]="SessionStore.user.Profile =='PR'">
|
||||
@@ -55,13 +55,13 @@
|
||||
class="select-calendar">
|
||||
<mat-form-field class="select-calendar" appearance="none" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||
<mat-select [(value)]="CalendarName" (selectionChange)="reloadCalendar()">
|
||||
|
||||
|
||||
<mat-option *ngFor="let calendars of eventService.calendarNamesAry" value="{{calendars.Fullname || calendars}}">
|
||||
|
||||
|
||||
<div *ngIf="environment.presidential">
|
||||
<div *ngIf="calendars.Role == 'Presidente da República'"> PR </div>
|
||||
<div *ngIf="calendars.Role == 'Ministro e Director do Gabinete do PR'"> MDGPR </div>
|
||||
<div *ngIf="calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República' && calendars.Fullname"> Agenda do {{calendars.Fullname}} </div>
|
||||
<div *ngIf="calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars.Role != 'Presidente da República' && calendars.Fullname"> Agenda do {{calendars.Fullname}} </div>
|
||||
<div *ngIf="calendars.Role != 'Presidente da República' && calendars.Role != 'Ministro e Director do Gabinete do PR' && calendars == 'Meu calendario' ">
|
||||
<!-- <span *ngIf="SessionStore.user.Profile == 'PR' ">PR</span>
|
||||
<span *ngIf="SessionStore.user.Profile == 'MDGPR' ">MDGPR</span>
|
||||
@@ -69,7 +69,7 @@
|
||||
Minha agenda
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="!environment.presidential">
|
||||
<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>
|
||||
@@ -82,14 +82,14 @@
|
||||
<mat-option value="PR+MDGPR" *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) && environment.presidential">
|
||||
PR+MDGPR
|
||||
</mat-option>
|
||||
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="float-button">
|
||||
|
||||
<div class="float-button">
|
||||
|
||||
<button title="Visualizar a lista de Eventos para aprovação" class="cursor-pointer resize pr-20-rem" (click)="viewEventsToApprove()" *ngIf="p.userPermission([p.permissionList.Gabinete.aprove_event])">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="right-icons" src="assets/images/icons-received-event.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && !mobileComponent.showEventList" class="right-icons" src="assets/images/theme/gov/icons-received-event.svg"></ion-icon>
|
||||
@@ -105,7 +105,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</ion-row>
|
||||
<ion-row class="ion-align-items-center calendar-options">
|
||||
|
||||
@@ -215,24 +215,30 @@
|
||||
</div>
|
||||
<div class="timeline-wrapper flex-grow-1 height-100" >
|
||||
<div class="height-100">
|
||||
<div class="timeline-container height-100 d-flex pt-10 pl-20 filter-{{segment}}" >
|
||||
<div class="timeline-container height-100 d-flex pt-10 pl-20 filter-{{segment}} flex-column" >
|
||||
|
||||
|
||||
<div class="timeline-date align-center" *ngIf="isSelectedDayHasEvent && hasEventToday">
|
||||
<span >Hoje, </span> {{ timelineDate }}
|
||||
</div>
|
||||
|
||||
<div class="ss-timeline timeline-mobile flex-grow-1 pr-10 text-black height-100 width-100 overflow-y-auto" >
|
||||
<div class="timeline-date align-center" *ngIf="isSelectedDayHasEvent && hasEventToday">
|
||||
<span >Hoje, </span> {{ timelineDate }}
|
||||
</div>
|
||||
|
||||
<div *ngFor="let events of TimelineMDList | keyvalue; " >
|
||||
<div *ngFor="let year of TimelineMDList " >
|
||||
<!-- {{year.yearInfo.yearName}} -->
|
||||
<div *ngFor="let month of year.months " class="header-day" >
|
||||
<!-- {{ month.monthInfo.monthName | json }} -->
|
||||
<!-- <hr> -->
|
||||
|
||||
<div class="EventListBox-container" >
|
||||
<div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
|
||||
{{ TimelineDay(events.key)}} <div style="text-transform: capitalize; display: inline;">{{ viewTitle }}</div>
|
||||
</div>
|
||||
<div *ngFor="let day of month.days " class="EventListBox-container" >
|
||||
|
||||
<div *ngFor="let event of events.value" class="EventListBox mb-10" >
|
||||
<div class="day " [class.dayShow]="isSelectedDayHasEvent && hasEventToday" >
|
||||
{{ day.daysInfo.dayName }} <div style="text-transform: capitalize; display: inline;">{{month.monthInfo.monthName}}</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
|
||||
*ngIf="viewEventMonth <= dateMonth(event) ">
|
||||
<div *ngFor="let event of day.events " class="EventListBox mb-10" >
|
||||
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
|
||||
>
|
||||
|
||||
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
|
||||
|
||||
@@ -258,10 +264,11 @@
|
||||
<div class="font-13 calendar-owner"*ngIf="eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId) == 'Meu calendario'">{{SessionStore.user.FullName}} </div>
|
||||
<ng-template #other_content>{{eventService.getCalendarOwnNameByCalendarId(event.event.CalendarId)}}</ng-template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -875,13 +875,12 @@ $font-size: rem(15);
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.ss-timeline > :nth-child(2) .dayShow {
|
||||
display: none;
|
||||
.header-day .dayShow:nth-child(1) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.ss-timeline > :nth-child(1) .dayShow {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.calendar-options {
|
||||
position: relative;
|
||||
|
||||
+157
-105
@@ -105,7 +105,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
selectedEvent: Event;
|
||||
selectedEventId: string | number;
|
||||
selectedEventCalendarId : string | number;
|
||||
selectedEventCalendarId: string | number;
|
||||
postEvent: any;
|
||||
|
||||
// temporary data
|
||||
@@ -213,14 +213,14 @@ export class AgendaPage implements OnInit {
|
||||
} else if (this.loggeduser.Profile == 'PR') {
|
||||
this.profile = "pr";
|
||||
} else {
|
||||
if(this.eventService.usersCalendarIds.length >= 2) {
|
||||
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.calendarHeight = ["height-356"];
|
||||
@@ -253,7 +253,7 @@ export class AgendaPage implements OnInit {
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
@@ -270,18 +270,29 @@ export class AgendaPage implements OnInit {
|
||||
this.segment = "Combinado";
|
||||
}
|
||||
if (realoadCounter != 0) {
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
this.updateEventListBox()
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.calendar.currentDate = new Date();
|
||||
|
||||
try {
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.onDropDownScrollWeal()
|
||||
} catch (e) { }
|
||||
|
||||
this.updateEventListBox()
|
||||
|
||||
realoadCounter++;
|
||||
this.weekToShow()
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.backgroundservice.registerBackService('Online', () => {
|
||||
//this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
});
|
||||
|
||||
|
||||
window.onresize = (event) => {
|
||||
// if not table remove all component
|
||||
if (window.innerWidth <= 1024) {
|
||||
@@ -296,31 +307,31 @@ export class AgendaPage implements OnInit {
|
||||
setTimeout(() => {
|
||||
try {
|
||||
let weekNum = 0;
|
||||
|
||||
|
||||
function Week(a) {
|
||||
for(let b of a.querySelectorAll('td')) {
|
||||
if(!b.className.includes('text-muted')) {
|
||||
for (let b of a.querySelectorAll('td')) {
|
||||
if (!b.className.includes('text-muted')) {
|
||||
weekNum++;
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const dayBoxHeight = document.querySelector('.monthview-container .swiper-container .swiper-slide-active table tbody tr td').clientHeight
|
||||
const weeks = document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr');
|
||||
|
||||
for (let week of weeks as any ){
|
||||
|
||||
for (let week of weeks as any) {
|
||||
Week(week)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.showCalendar = true
|
||||
this.listBoxService.height = (weekNum * dayBoxHeight) +'px'
|
||||
|
||||
if(dayBoxHeight == 0) {
|
||||
this.listBoxService.height = (weekNum * dayBoxHeight) + 'px'
|
||||
|
||||
if (dayBoxHeight == 0) {
|
||||
this.weekToShow()
|
||||
}
|
||||
} catch (e) {
|
||||
setTimeout(()=> {
|
||||
setTimeout(() => {
|
||||
this.weekToShow()
|
||||
}, 100)
|
||||
}
|
||||
@@ -328,8 +339,8 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
setCalendarByDefault() {
|
||||
if(!this.CalendarName) {
|
||||
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||
if (!this.CalendarName) {
|
||||
if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||
this.CalendarName = 'Meu calendario';
|
||||
} else {
|
||||
this.CalendarName = this.eventService.calendarNamesAry[0]
|
||||
@@ -410,13 +421,16 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
onDropDownScrollWeal() {
|
||||
|
||||
setTimeout(() => {
|
||||
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
try {
|
||||
setTimeout(() => {
|
||||
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[1].scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}, 300)
|
||||
}, 10)
|
||||
|
||||
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
setTimeout(() => {
|
||||
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[1].scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}, 300)
|
||||
}, 10)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -424,10 +438,23 @@ export class AgendaPage implements OnInit {
|
||||
this.eventSelectedDate2 = ev.selectedTime;
|
||||
}
|
||||
|
||||
|
||||
currentMoth = {
|
||||
rangeStartDate: null,
|
||||
rangeEndDate: null
|
||||
}
|
||||
|
||||
onRangeChanged(ev: { startTime: Date, endTime: Date }) {
|
||||
this.rangeStartDate = ev.startTime;
|
||||
this.rangeEndDate = ev.endTime;
|
||||
|
||||
if (this.currentMoth.rangeEndDate == null) {
|
||||
this.currentMoth = {
|
||||
rangeStartDate: ev.startTime,
|
||||
rangeEndDate: ev.endTime
|
||||
}
|
||||
}
|
||||
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
|
||||
|
||||
@@ -554,8 +581,8 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
loadRangeEvents(startTime: Date, endTime: Date) {
|
||||
this.weekToShow()
|
||||
|
||||
if(!this.eventService.hasAnyCalendar) {
|
||||
|
||||
if (!this.eventService.hasAnyCalendar) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -565,9 +592,9 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = true;
|
||||
|
||||
const index = `${startTime}${endTime}`
|
||||
if(!this.loadRequest[index]) {
|
||||
this.loadRequest[index] = {startTime, endTime}
|
||||
this.loadRequestHistory[index] = {lastTimeUpdate: new Date()}
|
||||
if (!this.loadRequest[index]) {
|
||||
this.loadRequest[index] = { startTime, endTime }
|
||||
this.loadRequestHistory[index] = { lastTimeUpdate: new Date() }
|
||||
|
||||
this.loadRangeEventRun(startTime, endTime)
|
||||
} else {
|
||||
@@ -582,7 +609,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
loadRangeEventRun(startTime: Date, endTime: Date) {
|
||||
|
||||
if(SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
|
||||
if (SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -602,18 +629,18 @@ export class AgendaPage implements OnInit {
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
let load = 0;
|
||||
|
||||
for ( const selectedCalendar of selectedCalendarIds) {
|
||||
let load = 0;
|
||||
|
||||
for (const selectedCalendar of selectedCalendarIds) {
|
||||
this.eventService.getEventsByCalendarId(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59'), selectedCalendar.CalendarId).then((response: any) => {
|
||||
|
||||
let label;
|
||||
|
||||
if(SessionStore.user.Profile == 'PR') {
|
||||
if (SessionStore.user.Profile == 'PR') {
|
||||
label = "pr"
|
||||
} else if(SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
|
||||
} else if (SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
|
||||
label = 'md'
|
||||
} else {
|
||||
label = "pr"
|
||||
@@ -622,7 +649,7 @@ export class AgendaPage implements OnInit {
|
||||
let eventsList = response;
|
||||
this.CalendarStore.removeRangeForCalendar(startTime, endTime, label, selectedCalendar.CalendarId)
|
||||
this.CalendarStore.pushEvent(eventsList, label);
|
||||
|
||||
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
this.updateEventListBox()
|
||||
|
||||
@@ -632,10 +659,10 @@ export class AgendaPage implements OnInit {
|
||||
this.deleteLoadRangeEvent(startTime, endTime);
|
||||
|
||||
load++
|
||||
if(load == selectedCalendarIds.length) {
|
||||
if (load == selectedCalendarIds.length) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
this.updateEventListBox()
|
||||
@@ -645,9 +672,9 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
selectedAgenda = {}
|
||||
|
||||
getSelectedAgendaCalendars () {
|
||||
getSelectedAgendaCalendars() {
|
||||
|
||||
if(this.CalendarName == 'PR+MDGPR') {
|
||||
if (this.CalendarName == 'PR+MDGPR') {
|
||||
|
||||
let result = this.SessionStore.user.OwnerCalendars
|
||||
|
||||
@@ -657,50 +684,50 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
return result.concat(join)
|
||||
} else {
|
||||
|
||||
const calendar = this.eventService.calendarNamesType[this.CalendarName];
|
||||
let Oficial = calendar?.['OficialId']
|
||||
let Pessoal = calendar?.['PessoalId']
|
||||
|
||||
if(Oficial && Pessoal) {
|
||||
|
||||
return [
|
||||
{
|
||||
CalendarId : Oficial,
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarName: calendar.CalendarName
|
||||
},
|
||||
{
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarId : Pessoal,
|
||||
CalendarName: calendar.CalendarName
|
||||
const calendar = this.eventService.calendarNamesType[this.CalendarName];
|
||||
let Oficial = calendar?.['OficialId']
|
||||
let Pessoal = calendar?.['PessoalId']
|
||||
|
||||
if (Oficial && Pessoal) {
|
||||
|
||||
return [
|
||||
{
|
||||
CalendarId: Oficial,
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarName: calendar.CalendarName
|
||||
},
|
||||
{
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarId: Pessoal,
|
||||
CalendarName: calendar.CalendarName
|
||||
}
|
||||
]
|
||||
|
||||
} else if (Oficial) {
|
||||
try {
|
||||
return [{
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarId: Oficial,
|
||||
CalendarName: calendar.CalendarName
|
||||
}]
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return [{
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarId: Pessoal,
|
||||
CalendarName: calendar.CalendarName
|
||||
}]
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
]
|
||||
|
||||
} else if (Oficial) {
|
||||
try {
|
||||
return [{
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarId : Oficial,
|
||||
CalendarName: calendar.CalendarName
|
||||
}]
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return [{
|
||||
OwnerId: calendar.OwnerId,
|
||||
CalendarId : Pessoal,
|
||||
CalendarName: calendar.CalendarName
|
||||
}]
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -710,11 +737,26 @@ export class AgendaPage implements OnInit {
|
||||
const selectedCalendarIds = this.getSelectedAgendaCalendars();
|
||||
this.listToPresent = this.CalendarStore.getEventsByCalendarIds(selectedCalendarIds)
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
const year = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||
this.TimelineMDList = year
|
||||
|
||||
const selectedDay = momentG(this.eventSelectedDate, 'dd', 'pt');
|
||||
if(this.TimelineMDList[selectedDay]) {
|
||||
this.hasEventToday = true
|
||||
const yearName = momentG(new Date(this.eventSelectedDate), 'yyyy')
|
||||
const monthName = momentG(new Date(this.eventSelectedDate), 'MMMM')
|
||||
const dayName = momentG(new Date(this.eventSelectedDate), 'dd')
|
||||
|
||||
let YearIndex = year.findIndex( x => x.yearInfo.yearName == yearName)
|
||||
if(YearIndex == 0) {
|
||||
let MonthNameIndex = year[YearIndex].months.findIndex( x => x.monthInfo.monthName == monthName)
|
||||
if(MonthNameIndex == 0) {
|
||||
let DayNameIndex = year[YearIndex].months[MonthNameIndex].days.findIndex( x => x.daysInfo.dayName == dayName)
|
||||
if(DayNameIndex == 0) {
|
||||
this.hasEventToday = true
|
||||
} else {
|
||||
this.hasEventToday = false
|
||||
}
|
||||
} else {
|
||||
this.hasEventToday = false
|
||||
}
|
||||
} else {
|
||||
this.hasEventToday = false
|
||||
}
|
||||
@@ -742,16 +784,13 @@ export class AgendaPage implements OnInit {
|
||||
} catch (e) { }
|
||||
|
||||
this.updateEventListBox()
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
} else { }
|
||||
|
||||
}
|
||||
|
||||
changeMonth = (month) => {
|
||||
const a = this.calendar.currentDate;
|
||||
|
||||
|
||||
|
||||
const isInvalidDate = (dateString) => JSON.stringify(new Date(dateString)) === 'null';
|
||||
|
||||
@@ -768,7 +807,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.updateEventListBox()
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -796,7 +835,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
changeProfile() {
|
||||
|
||||
|
||||
if (this.profile == "mdgpr") {
|
||||
this.profile = "pr";
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
@@ -839,7 +878,7 @@ export class AgendaPage implements OnInit {
|
||||
cssClass: 'modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data) {
|
||||
|
||||
@@ -870,7 +909,7 @@ export class AgendaPage implements OnInit {
|
||||
openAddEventDismiss(data) {
|
||||
|
||||
try {
|
||||
|
||||
|
||||
let postEvent: Event = data;
|
||||
if (postEvent.Subject != null) {
|
||||
// this.eventSource.push({
|
||||
@@ -884,7 +923,7 @@ export class AgendaPage implements OnInit {
|
||||
this.myCal.loadEvents();
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
@@ -899,8 +938,8 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
let navigationExtras: NavigationExtras = { queryParams: { CalendarId } }
|
||||
|
||||
this.router.navigate(['/home/agenda/',eventId,'agenda'], navigationExtras);
|
||||
|
||||
this.router.navigate(['/home/agenda/', eventId, 'agenda'], navigationExtras);
|
||||
|
||||
}
|
||||
|
||||
// open component
|
||||
@@ -914,16 +953,16 @@ export class AgendaPage implements OnInit {
|
||||
this.postEvent = data.event;
|
||||
|
||||
this.mobileComponent.showEditEvent = true;
|
||||
} else if(data.type == 'delete') {
|
||||
} else if (data.type == 'delete') {
|
||||
|
||||
}
|
||||
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
this.onCurrentChanged(this.eventSelectedDate)
|
||||
}, 500)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1083,7 +1122,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
reloadCalendar() {
|
||||
//
|
||||
//
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
}
|
||||
|
||||
@@ -1129,10 +1168,8 @@ export class AgendaPage implements OnInit {
|
||||
// THIS LINE
|
||||
this.updateEventListBox();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
shoeEventDay(events: any[]) {
|
||||
|
||||
if (this.segment == 'Combinado') {
|
||||
@@ -1150,3 +1187,18 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function endOfMonth(myDate) {
|
||||
let date = new Date(myDate);
|
||||
date.setDate(1); // Avoids edge cases on the 31st day of some months
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
date.setDate(0);
|
||||
date.setHours(23);
|
||||
date.setMinutes(59);
|
||||
date.setSeconds(59);
|
||||
return date;
|
||||
}
|
||||
|
||||
const addDays = 5;
|
||||
const endDateRange = endOfMonth(new Date(5))
|
||||
endDateRange.setDate(endDateRange.getDate() + addDays)
|
||||
|
||||
@@ -18,6 +18,7 @@ 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 { ContactsService } from 'src/app/services/contacts.service';
|
||||
import { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -98,7 +99,8 @@ export class EditEventPage implements OnInit {
|
||||
private router: Router,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private contactsService: ContactsService
|
||||
private contactsService: ContactsService,
|
||||
private domSanitazerService: DomSanitizerService
|
||||
) {
|
||||
|
||||
/* this.postEvent = new Event(); */
|
||||
@@ -363,6 +365,9 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
|
||||
this.postEvent.Subject = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Subject/* ) */;
|
||||
this.postEvent.Location = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Location/* ) */;
|
||||
this.postEvent.Body.Text = /* this.domSanitazerService.sanitizeInput( */this.postEvent.Body.Text/* ) */;
|
||||
|
||||
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ 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 { DomSanitizerService } from 'src/app/services/DomSanitizer.service';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -93,6 +95,9 @@ export class NewEventPage implements OnInit {
|
||||
roomId: string;
|
||||
globalEnd = new Date('1999')
|
||||
environment = environment
|
||||
eventPersons: EventPerson[];
|
||||
contacts: EventPerson[];
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -105,7 +110,9 @@ export class NewEventPage implements OnInit {
|
||||
private chatMethodService: ChatMethodsService,
|
||||
private hhtpErrorHandle: HttpErrorHandle,
|
||||
private processeService: ProcessesService,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private contactsService: ContactsService,
|
||||
private domSanitazerService: DomSanitizerService
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.postEvent = new Event();
|
||||
@@ -196,6 +203,7 @@ export class NewEventPage implements OnInit {
|
||||
this.checkRoleInArray()
|
||||
this.changeAgenda()
|
||||
|
||||
this.fetchContacts("")
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -407,6 +415,9 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
this.postEvent.Subject = this.domSanitazerService.sanitizeInput(this.postEvent.Subject);
|
||||
this.postEvent.Location = this.domSanitazerService.sanitizeInput(this.postEvent.Location);
|
||||
this.postEvent.Body.Text = this.domSanitazerService.sanitizeInput(this.postEvent.Body.Text);
|
||||
|
||||
let eventId: any;
|
||||
|
||||
@@ -831,4 +842,33 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
return toAproveObject;
|
||||
}
|
||||
|
||||
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()
|
||||
});
|
||||
|
||||
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)
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="title-content d-flex justify-between width-100 mb-10">
|
||||
<div class="left d-flex">
|
||||
<button class="btn-no-color d-flex align-center" (click)="goBack()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-calendar-arrow-left.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="end" src='assets/images/theme/{{ThemeService.currentTheme}}/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</button>
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
<i class="far fa-clock font-15"></i>
|
||||
<ion-label class="font-15 pl-10" color="warning">{{roomCountDownDate}}</ion-label>
|
||||
</div>
|
||||
{{ RouteService.history }}
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
@@ -341,4 +340,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ion-footer>
|
||||
</ion-footer>
|
||||
|
||||
@@ -32,6 +32,10 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
import { sanitize } from "sanitize-filename-ts";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
templateUrl: './group-messages.page.html',
|
||||
@@ -104,6 +108,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private file: File,
|
||||
private fileOpener: FileOpener,
|
||||
public RouteService: RouteService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
this.ChatSystemService.getUser()
|
||||
|
||||
@@ -507,7 +512,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"mimeType": audioFile.value.mimeType,
|
||||
},
|
||||
attachments: [{
|
||||
"title": fileName,
|
||||
"title": sanitize(fileName),
|
||||
"title_link_download": true,
|
||||
"type": "audio"
|
||||
}],
|
||||
@@ -828,37 +833,45 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
const file: any = await this.fileService.getFileFromDevice(types);
|
||||
|
||||
|
||||
const fileName = file.name
|
||||
|
||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||
const validation = this.FileValidatorService.fileNameValidation(fileName)
|
||||
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
if(validation.isOk) {
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
|
||||
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": file.type,
|
||||
"guid": '',
|
||||
},
|
||||
attachments: [{
|
||||
"title": file.name,
|
||||
"name": file.name,
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: encodedData
|
||||
}
|
||||
});
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": file.type,
|
||||
"guid": '',
|
||||
},
|
||||
attachments: [{
|
||||
"title": sanitize(fileName),
|
||||
"name": sanitize(fileName),
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: encodedData
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest("Ficheiro inválido")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div hidden class="right">
|
||||
<button class="btn-no-color" (click)="openMessagesOptions()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg">
|
||||
</ion-icon>
|
||||
</button>
|
||||
|
||||
@@ -33,6 +33,10 @@ import { Filesystem, Directory } from '@capacitor/filesystem';
|
||||
import { NewEventPage } from '../../agenda/new-event/new-event.page';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
import { sanitize } from "sanitize-filename-ts";
|
||||
|
||||
|
||||
|
||||
const IMAGE_DIR = 'stored-images';
|
||||
|
||||
@@ -117,6 +121,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private fileOpener: FileOpener,
|
||||
private router: Router,
|
||||
public RochetChatConnectorService: RochetChatConnectorService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
|
||||
try {
|
||||
@@ -413,12 +418,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Converting base64 to blob
|
||||
const encodedData = btoa(this.audioRecorded);
|
||||
const blob = this.fileService.base64toBlob(encodedData, recordData.value.mimeType)
|
||||
|
||||
|
||||
const validation = await this.FileValidatorService.validateAudioFromBlob(blob)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
@@ -429,7 +435,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
"mimeType": audioFile.value.mimeType,
|
||||
},
|
||||
attachments: [{
|
||||
"title": fileName,
|
||||
"title": sanitize(fileName),
|
||||
"title_link_download": true,
|
||||
"type": "audio"
|
||||
}],
|
||||
@@ -759,7 +765,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
async addFileToChatMobile(types: typeof FileType[]) {
|
||||
console.log('add image from gallery')
|
||||
const roomId = this.roomId
|
||||
|
||||
const file = await Camera.getPhoto({
|
||||
@@ -852,43 +857,41 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
formData.append('blobFile', blob);
|
||||
console.log('add file', fileBase64) */
|
||||
|
||||
const fileName = file.name
|
||||
|
||||
const validation = this.FileValidatorService.fileNameValidation(fileName)
|
||||
|
||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||
console.log('TYPE', file.type)
|
||||
if(validation.isOk) {
|
||||
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
console.log(encodedData)
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
console.log('BLOB BLOB', blob)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
/* console.log('add file', fileBase64) */
|
||||
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": file.type,
|
||||
"guid": '',
|
||||
},
|
||||
attachments: [{
|
||||
"title": file.name,
|
||||
"name": file.name,
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: encodedData,
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('file not supported')
|
||||
}
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
console.log(encodedData)
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
/* console.log('add file', fileBase64) */
|
||||
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
file: {
|
||||
"type": file.type,
|
||||
"guid": '',
|
||||
},
|
||||
attachments: [{
|
||||
"title": sanitize(fileName),
|
||||
"name": sanitize(fileName),
|
||||
// "text": "description",
|
||||
"title_link_download": false,
|
||||
}],
|
||||
temporaryData: formData,
|
||||
attachmentsModelData: {
|
||||
fileBase64: encodedData,
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.toastService._badRequest("Ficheiro inválido")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,27 +21,27 @@ export class AttendeesPageModal implements OnInit {
|
||||
eventPersons: EventPerson[];
|
||||
adding: "intervenient" | "CC";
|
||||
currentPath = window.location.pathname;
|
||||
|
||||
|
||||
taskParticipants:EventPerson[] = [];
|
||||
taskParticipantsCc:EventPerson[] = [];
|
||||
loggeduser: LoginUserRespose;
|
||||
@Input() loggedAttendSon: boolean;
|
||||
taskType: any;
|
||||
|
||||
|
||||
|
||||
constructor(
|
||||
private modalCtrl: ModalController,
|
||||
private modalCtrl: ModalController,
|
||||
private contactsService: ContactsService,
|
||||
private navParams: NavParams,
|
||||
private modalController: ModalController,
|
||||
public ThemeService: ThemeService,
|
||||
private router: Router,) {
|
||||
|
||||
|
||||
this.adding = this.navParams.get('adding');
|
||||
this.taskParticipants = this.navParams.get('taskParticipants');
|
||||
this.taskParticipantsCc = this.navParams.get('taskParticipantsCc');
|
||||
this.taskType = this.navParams.get('taskType');
|
||||
|
||||
|
||||
this.loggeduser = SessionStore.user;
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ export class AttendeesPageModal implements OnInit {
|
||||
ngOnInit() {
|
||||
console.log('Pesquisa de contactos current path1',this.router.url)
|
||||
this.fetchContacts("");
|
||||
|
||||
|
||||
if(this.taskParticipants == null || this.taskParticipants == undefined){
|
||||
this.taskParticipants = [];
|
||||
}
|
||||
@@ -57,9 +57,9 @@ export class AttendeesPageModal implements OnInit {
|
||||
if(this.taskParticipantsCc == null || this.taskParticipantsCc == undefined){
|
||||
this.taskParticipantsCc = [];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
ngOnChanges(event) {}
|
||||
|
||||
save(){
|
||||
@@ -81,16 +81,16 @@ export class AttendeesPageModal implements OnInit {
|
||||
filterSearchList(itm: EventPerson): boolean {
|
||||
|
||||
const result = this.taskParticipants.concat( this.taskParticipantsCc).find((contact, index)=>{
|
||||
|
||||
|
||||
if(contact.Name.toLocaleLowerCase() == itm.Name.toLocaleLowerCase() && contact.EmailAddress.toLocaleLowerCase() == itm.EmailAddress.toLocaleLowerCase()){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
return undefined == result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
remove(itm: EventPerson) {
|
||||
@@ -103,7 +103,7 @@ export class AttendeesPageModal implements OnInit {
|
||||
return contact;
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
});
|
||||
|
||||
} else if (this.adding == "CC") {
|
||||
@@ -114,7 +114,7 @@ export class AttendeesPageModal implements OnInit {
|
||||
return contact;
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ export class AttendeesPageModal implements OnInit {
|
||||
if(this.adding == "intervenient"){
|
||||
itm.IsRequired = true;
|
||||
this.taskParticipants.push(itm);
|
||||
|
||||
|
||||
} else if (this.adding == "CC") {
|
||||
itm.IsRequired = false;
|
||||
this.taskParticipantsCc.push(itm);
|
||||
@@ -142,7 +142,7 @@ export class AttendeesPageModal implements OnInit {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
|
||||
});
|
||||
|
||||
|
||||
result.splice(index, 1);
|
||||
|
||||
});
|
||||
@@ -153,16 +153,16 @@ export class AttendeesPageModal implements OnInit {
|
||||
this.showLoader = false;
|
||||
} else {
|
||||
this.contacts = result;
|
||||
console.log('Attendes Email',this.loggeduser.Email)
|
||||
// console.log('Attendes Email',this.loggeduser.Email)
|
||||
let filterLoggedUserEmail = this.contacts.filter(item => item.EmailAddress.toLocaleLowerCase() != this.loggeduser.Email.toLocaleLowerCase())
|
||||
if(this.taskType == 0 || this.taskType == 1){
|
||||
filterLoggedUserEmail = this.contacts.filter(item => item.IsPR == false)
|
||||
}
|
||||
console.log('Attendes Email', filterLoggedUserEmail)
|
||||
// console.log('Attendes Email', filterLoggedUserEmail)
|
||||
let filterEmptyEmail = filterLoggedUserEmail.filter(item => item.EmailAddress.toLocaleLowerCase() != "")
|
||||
|
||||
|
||||
this.contacts = filterEmptyEmail;
|
||||
console.log('Attendes Email', this.contacts)
|
||||
//console.log('Attendes Email', this.contacts)
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
@@ -183,4 +183,4 @@ export class AttendeesPageModal implements OnInit {
|
||||
}).reverse()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,8 @@ label {
|
||||
.time {
|
||||
font-family: Roboto;
|
||||
text-align: center;
|
||||
color: var(--header-tab-text-white);
|
||||
/* color: var(--header-tab-text-white); */
|
||||
color: black;
|
||||
line-height: unset;
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="title">{{ task.Folio}}</div>
|
||||
</div>
|
||||
<div class="div-icon" (click)="openOptions()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-25 cursor-pointer" src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-25 cursor-pointer" src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-25 cursor-pointer" src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-25 cursor-pointer" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
@@ -97,7 +97,7 @@
|
||||
</div>
|
||||
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
|
||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
|
||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecutar')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
|
||||
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
|
||||
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
|
||||
</div>
|
||||
|
||||
@@ -328,7 +328,7 @@ export class DespachoPrPage implements OnInit {
|
||||
async reexecutar(note: string, documents: any) {
|
||||
let body = {
|
||||
"serialNumber": this.serialNumber,
|
||||
"action": "Reexecução",
|
||||
"action": "Reexecutar",
|
||||
"ActionTypeId": 100000010,
|
||||
"dataFields": {
|
||||
"ReviewUserComment": note,
|
||||
@@ -416,7 +416,7 @@ export class DespachoPrPage implements OnInit {
|
||||
// console.log('actionName', actionName)
|
||||
await this.concluir(res.data.note, docs);
|
||||
}
|
||||
else if (actionName == 'Reexecução') {
|
||||
else if (actionName == 'Reexecutar') {
|
||||
await this.reexecutar(res.data.note, docs);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<ion-label class="title">{{ task.Folio }}</ion-label>
|
||||
</div>
|
||||
<div class="div-icon" (click)="openOptions()" *ngIf="p.userPermission([p.permissionList.Agenda.access])">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
<div class="solid"></div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button class="btn-cancel" shape="round" >Arquivar</button>
|
||||
<button class="btn-cancel" shape="round" (click)="openAddNoteModal('Arquivo')">Arquivar</button>
|
||||
<!-- <div class="solid"></div> -->
|
||||
</div>
|
||||
<div class="buttons">
|
||||
|
||||
+2
-2
@@ -504,7 +504,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
});
|
||||
|
||||
await Promise.all(draftPromises);
|
||||
if(this.draftArray.length == 0 ) {
|
||||
if (this.draftArray.length == 0) {
|
||||
console.log('No draft found.');
|
||||
this.asDraft = false
|
||||
}
|
||||
@@ -512,7 +512,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
if (this.DraftNames) {
|
||||
this.DraftNames = this.DraftNames.slice(0, -1);
|
||||
this.DraftIds = this.DraftIds.slice(0, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<div class="menu-ptions">
|
||||
<button class="btn-no-color" (click)="openOptions(loadedEvent)">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
</button>
|
||||
|
||||
+11
-11
@@ -17,7 +17,7 @@
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Subject').invalid " class="input-errror-message">
|
||||
<div *ngIf="Form.get('Subject').errors?.required">
|
||||
|
||||
|
||||
</div>
|
||||
<div *ngIf="Form.get('Subject').errors?.minlength">
|
||||
O campo deve ter pelo menos 4 caracteres.
|
||||
@@ -34,12 +34,12 @@
|
||||
|
||||
<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>
|
||||
@@ -47,7 +47,7 @@
|
||||
<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>
|
||||
</mat-option>
|
||||
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
@@ -72,16 +72,16 @@
|
||||
<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)]="postData.CalendarName" >
|
||||
<mat-option *ngFor="let calendars of CalendarNamesOptions" value="{{calendars}}">
|
||||
Agenda {{ calendars }}
|
||||
</mat-option>
|
||||
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -195,7 +195,7 @@
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi"
|
||||
|
||||
|
||||
>
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
@@ -232,7 +232,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div class="ion-input-class-no-height cursor-pointer" (click)="addParticipantsCc()">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
@@ -241,7 +241,7 @@
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
</div>
|
||||
<div class="add-people" (click)="addParticipantsCc()">
|
||||
<div class="add-people" >
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="start" src="assets/images/theme/gov/icons-arrow-forward.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-arrow-forward.svg"></ion-icon>
|
||||
@@ -294,7 +294,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="sessionStore.user.Profile != 'PR'" class="aside-righ flex-grow-1">
|
||||
<div class="aside-righ flex-grow-1">
|
||||
<app-empty-container
|
||||
[texto]="emptyTextDescription"
|
||||
*ngIf="!showAttendees"
|
||||
|
||||
+43
-7
@@ -23,6 +23,7 @@ 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';
|
||||
|
||||
const moment = _rollupMoment || _moment;
|
||||
|
||||
@@ -114,6 +115,9 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
sessionStore = SessionStore;
|
||||
environment = environment
|
||||
loggeduser: LoginUserRespose;
|
||||
eventPersons: EventPerson[];
|
||||
contacts: EventPerson[];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -125,7 +129,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
public eventService: EventsService,
|
||||
public RoleIdService: RoleIdService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private contactsService: ContactsService,
|
||||
|
||||
|
||||
) {
|
||||
@@ -136,7 +141,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
console.log('fulltask', this.fulltask)
|
||||
|
||||
if(this.fulltask?.Documents) {
|
||||
if (this.fulltask?.Documents) {
|
||||
this.documents = this.fulltask.Documents
|
||||
}
|
||||
|
||||
@@ -174,6 +179,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
}
|
||||
|
||||
this.changeAgenda();
|
||||
this.loggeduser = SessionStore.user;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -182,6 +188,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
this.getAttachments();
|
||||
this.setDefaultTime()
|
||||
this.getRecurrenceTypes();
|
||||
this.fetchContacts("")
|
||||
|
||||
}
|
||||
|
||||
@@ -191,8 +198,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
}
|
||||
|
||||
myInterval = setInterval(() => {
|
||||
document.querySelectorAll('.ngx-mat-timepicker input').forEach((e :any) => {
|
||||
if(e) {
|
||||
document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => {
|
||||
if (e) {
|
||||
e.disabled = true;
|
||||
}
|
||||
})
|
||||
@@ -327,8 +334,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType || e.ApplicationId,
|
||||
Source: 1,
|
||||
SourceId: e.Id || e.DocId || e.SourceId,
|
||||
SourceName:e.Assunto,
|
||||
SourceId: e.Id || e.DocId || e.SourceId,
|
||||
SourceName: e.Assunto,
|
||||
Description: e.Assunto,
|
||||
Stakeholders: e.EntidadeOrganicaNome
|
||||
}
|
||||
@@ -417,7 +424,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
|
||||
console.log('attenes return', data)
|
||||
if (data) {
|
||||
data = data['data'];
|
||||
|
||||
@@ -587,4 +594,33 @@ export class BookMeetingModalPage implements OnInit {
|
||||
this.postData.EndDate = this.postData.StartDate;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
});
|
||||
}
|
||||
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)
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -97,7 +97,7 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom ">
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom || validateField ">
|
||||
<!-- <ion-item
|
||||
class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none">
|
||||
<ion-select
|
||||
@@ -112,7 +112,7 @@
|
||||
appearance="fill"
|
||||
class="width-100 d-block"
|
||||
appearance="none">
|
||||
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de assunto*">
|
||||
<mat-select [multiple]="false" [(ngModel)]="selectedTypes" placeholder="{{placeholderSubject}}">
|
||||
<mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
+43
-38
@@ -69,7 +69,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
loadedAttachments:any;
|
||||
documents:SearchList[] = [];
|
||||
|
||||
subjectTypes:any[] = [];
|
||||
subjectTypes:any;
|
||||
selectedTypes: string[]=[];
|
||||
SearchFolder: any = []
|
||||
|
||||
@@ -96,6 +96,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
validateFrom = false;
|
||||
validateField = false;
|
||||
document: any
|
||||
placeholderSubject: string;
|
||||
|
||||
get toppingsValues() {
|
||||
return this.toppings.value;
|
||||
@@ -124,40 +125,38 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
this.SearchFolder = this.navParams.get('SearchFolder');
|
||||
this.aplicationId = this.navParams.get('aplicationId')
|
||||
// this.document = this.navParams.get('document')
|
||||
this.document = this.navParams.get('document')
|
||||
|
||||
this.taskType = this.navParams.get('taskAction');
|
||||
|
||||
|
||||
// if(this.document) {
|
||||
// const doc: any = this.document
|
||||
|
||||
// this.documents.push({
|
||||
// ApplicationId: (doc.ApplicationType || doc.ApplicationId),
|
||||
// ApplicationType: (doc.ApplicationType || doc.ApplicationId),
|
||||
// SourceId: (doc.Id || doc.DocId || doc.SourceId),
|
||||
// Id: (doc.Id || doc.DocId || doc.SourceId),
|
||||
// EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
|
||||
// Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
|
||||
// Data: (doc.DocDate || doc.Data),
|
||||
// DocDate: (doc.DocDate || doc.Data),
|
||||
// Assunto: doc.Assunto,
|
||||
// } as any)
|
||||
// try {
|
||||
// if(this.document) {
|
||||
// const doc: any = this.document
|
||||
// this.documents.push({
|
||||
// ApplicationId: (doc.ApplicationType || doc.ApplicationId),
|
||||
// ApplicationType: (doc.ApplicationType || doc.ApplicationId),
|
||||
// SourceId: (doc.Id || doc.DocId || doc.SourceId),
|
||||
// Id: (doc.Id || doc.DocId || doc.SourceId),
|
||||
// EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
|
||||
// Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
|
||||
// Data: (doc.DocDate || doc.Data),
|
||||
// DocDate: (doc.DocDate || doc.Data),
|
||||
// Assunto: doc.Assunto,
|
||||
// } as any)
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.log(error)
|
||||
// }
|
||||
|
||||
|
||||
const DocumentToSave = this.documents.map((e) => {
|
||||
return {
|
||||
ApplicationId: e.ApplicationType,
|
||||
SourceId: e.Id
|
||||
}
|
||||
});
|
||||
// console.log('this.document', this.document)
|
||||
|
||||
|
||||
console.log('this.document', this.document)
|
||||
|
||||
|
||||
this.selectedTypes = ['99999850'];
|
||||
if(this.loggeduser.Profile == 'PR') {
|
||||
this.selectedTypes = ['99999850'];
|
||||
this.placeholderSubject = 'Indefinido'
|
||||
} else {
|
||||
this.placeholderSubject = 'Selecione o tipo de assunto*'
|
||||
}
|
||||
|
||||
this.postData = new Despacho();
|
||||
this.participants = this.participants = new Array();
|
||||
@@ -461,16 +460,22 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
/* if(this.postData.DispatchFolder.Message){ */
|
||||
try {
|
||||
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho')
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
//loader.remove()
|
||||
}
|
||||
/* if(this.postData.DispatchFolder.Message){
|
||||
if(this.selectedTypes.length > 0) { */
|
||||
try {
|
||||
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
|
||||
await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho')
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
//loader.remove()
|
||||
}
|
||||
/* } else {
|
||||
this.validateField = true;
|
||||
this.toastService._badRequest('Por favor selecione um assunto');
|
||||
} */
|
||||
|
||||
/* }
|
||||
else{
|
||||
this.validateField = true;
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
</div>
|
||||
<div class="menu-ptions">
|
||||
<button class="btn-no-color d-flex" (click)="openOptions()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
</button>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="menu-ptions">
|
||||
<button class="btn-no-color" (click)="openOptions()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div class="div-icon d-flex">
|
||||
<div autoHide="false" class="d-flex" (click)="openOptions()">
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-30-rem cursor-pointer" src="assets/images/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-30-rem cursor-pointer" src="assets/images/theme/blue/icons-menu.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-30-rem cursor-pointer" src="assets/images/theme/gov/icons-menu.svg"></ion-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,15 +7,16 @@
|
||||
<div class="bg-4 d-flex justify-center align-center">
|
||||
<div class="div-logo">
|
||||
|
||||
<img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/fullLogo-no-g.png' alt='logo'>
|
||||
<img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/donit.jpg' alt='logo'>
|
||||
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
|
||||
<img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A.png' alt='logo'>
|
||||
<img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/doneit.jpg' alt='logo'>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <h3 class="center text-white">doneIT</h3> -->
|
||||
<h3 class="center text-white">Gabinete Digital</h3>
|
||||
<form class="form">
|
||||
<p class="form-label">Email</p>
|
||||
|
||||
@@ -112,8 +112,15 @@ export class LoginPage implements OnInit {
|
||||
if (this.validateUsername()) {
|
||||
if (this.validatePassword()) {
|
||||
|
||||
let newUserName = ""
|
||||
if (this.usernameAsDomain(environment.domain, this.username.trim())) {
|
||||
newUserName = this.username.trim();
|
||||
} else {
|
||||
newUserName = this.username.trim() + "@" + environment.domain;
|
||||
}
|
||||
|
||||
this.userattempt = {
|
||||
username: this.username.trim(),
|
||||
username: newUserName.trim(),
|
||||
password: this.password.trim(),
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
@@ -233,4 +240,8 @@ export class LoginPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
usernameAsDomain(substring, mainString) {
|
||||
return mainString.includes(substring);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ import { Capacitor } from '@capacitor/core';
|
||||
import { File } from '@ionic-native/file/ngx';
|
||||
import { Media } from '@ionic-native/media/ngx';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
import { FileValidatorService } from "src/app/services/file/file-validator.service"
|
||||
const config = {
|
||||
quality: 0.5,
|
||||
maxWidth: 800,
|
||||
@@ -130,7 +131,8 @@ export class NewPublicationPage implements OnInit {
|
||||
private RouteService: RouteService,
|
||||
public FileService: FileService,
|
||||
private mediaCapture: MediaCapture,
|
||||
public checkFileType: checkFileTypeService
|
||||
public checkFileType: checkFileTypeService,
|
||||
private FileValidatorService: FileValidatorService
|
||||
) {
|
||||
|
||||
this.publicationType = this.navParams.get('publicationType');
|
||||
@@ -695,3 +697,4 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
<div class="title-content width-100 d-flex justify-space-between">
|
||||
<div class="div-title flex-grow-1">
|
||||
<ion-label class="title font-25-em">Acções</ion-label>
|
||||
<!-- <div>
|
||||
<input type="file" (change)="onFileSelect($event)" />
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div *ngIf="!intent" class="div-icon">
|
||||
|
||||
@@ -15,6 +15,10 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { NewPublicationPage } from './new-publication/new-publication.page';
|
||||
import { ChunkService } from 'src/app/services/stream/chunk.service'
|
||||
import { StreamService } from 'src/app/services/stream/stream.service'
|
||||
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
|
||||
|
||||
// import { ActionModel } from 'src/app/models/beast-orm';
|
||||
|
||||
|
||||
@@ -70,6 +74,9 @@ export class PublicationsPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
public p: PermissionService,
|
||||
private storage: Storage,
|
||||
private ChunkService: ChunkService,
|
||||
private StreamService:StreamService,
|
||||
private http: HttpClient,
|
||||
|
||||
) {
|
||||
this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
@@ -153,11 +160,11 @@ export class PublicationsPage implements OnInit {
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
this.showLoader = false;
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
|
||||
|
||||
|
||||
this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento')
|
||||
|
||||
await this.storage.set('actionsEvents', this.publicationsEventFolderList);
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
// (async ()=> {
|
||||
@@ -199,35 +206,79 @@ export class PublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
async getFromDB() {
|
||||
|
||||
|
||||
//const folders: PublicationFolder[] = await ActionModel.all()
|
||||
//this.showLoader = false;
|
||||
// this.publicationsEventFolderList = folders
|
||||
|
||||
|
||||
this.storage.get('actionsEvents').then((events = []) => {
|
||||
|
||||
|
||||
if(Array.isArray(events)) {
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(events)
|
||||
|
||||
this.showLoader = false;
|
||||
this.publicationsEventFolderList = folders
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
this.storage.get('actionsViagens').then((viagens = []) => {
|
||||
|
||||
|
||||
if(Array.isArray(viagens)) {
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(viagens)
|
||||
|
||||
this.publicationsTravelFolderList = folders
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
async onFileSelect(event: any) {
|
||||
|
||||
const file:File = event.target.files[0];
|
||||
|
||||
|
||||
const chunkSize = 1024 * 1024; // Adjust the chunk size as needed
|
||||
const chunks = [];
|
||||
let offset = 0;
|
||||
let i = 0;
|
||||
let j = 0;
|
||||
|
||||
function count () {
|
||||
j++
|
||||
return j
|
||||
}
|
||||
|
||||
while (offset < file.size) {
|
||||
const chunk = file.slice(offset, offset + chunkSize);
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onload = async () => {
|
||||
|
||||
const headers = new HttpHeaders()
|
||||
.append('X-File-Name', "fileName")
|
||||
.append('X-File-Extension', "mp4")
|
||||
.append('X-File-Content-Length', i.toString())
|
||||
.append('X-File-Index', count().toString());
|
||||
|
||||
const a = new Uint8Array(reader.result as ArrayBuffer)
|
||||
await this.http.post('http://localhost:3001/upload', a.buffer, { headers, responseType: 'blob' }).toPromise();
|
||||
|
||||
|
||||
};
|
||||
reader.readAsArrayBuffer(chunk);
|
||||
offset += chunkSize;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
async editAction(folderId?: string) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EditActionPage,
|
||||
@@ -254,7 +305,7 @@ export class PublicationsPage implements OnInit {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
}
|
||||
@@ -262,7 +313,7 @@ export class PublicationsPage implements OnInit {
|
||||
loader.remove()
|
||||
this.refreshing()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async AddPublicationFolder(item?: any) {
|
||||
@@ -280,7 +331,7 @@ export class PublicationsPage implements OnInit {
|
||||
cssClass: 'new-action modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.getActions();
|
||||
});
|
||||
@@ -368,7 +419,7 @@ export class PublicationsPage implements OnInit {
|
||||
cssClass: 'new-action modal modal-desktop',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss();
|
||||
await modal.present();
|
||||
|
||||
@@ -502,7 +553,7 @@ export class PublicationsPage implements OnInit {
|
||||
},
|
||||
//translucent: true
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
if (res['data'] == 'edit') {
|
||||
this.closeDesktopComponent();
|
||||
|
||||
Reference in New Issue
Block a user