mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Merge branch 'developer-prod' of bitbucket.org:equilibriumito/gabinete-digital-fo into chat/labels3
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="right-icons font-28" src="assets/images/icons-received-event.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov'" class="right-icons font-28" src="assets/images/theme/gov/icons-received-event.svg"></ion-icon>
|
||||
<!-- <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="right-icons" src="assets/images/theme/gov/icons-received-event-selected.svg"></ion-icon> -->
|
||||
<div style="color: white;">
|
||||
<div style="color: black;">
|
||||
Evento Pendente de Aprovação
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -108,7 +108,7 @@ export class ApproveEventPage implements OnInit {
|
||||
|
||||
async rejectTask(serialNumber:string) {
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Descartar" }
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
@@ -397,7 +397,7 @@ export class EditEventPage implements OnInit {
|
||||
this.clearPostEvent.emit();
|
||||
this.deleteTemporaryData();
|
||||
|
||||
await this.saveDocument()
|
||||
/* await this.saveDocument() */
|
||||
|
||||
this.close();
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ import { ModalController } from '@ionic/angular';
|
||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchList } from "src/app/models/search-document";
|
||||
import { EventAttachment } from 'src/app/models/attachment.model';
|
||||
import { EventAttachment } from 'src/app/models/attachment.model';
|
||||
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
|
||||
import {DateAdapter} from '@angular/material/core';
|
||||
import { DateAdapter } from '@angular/material/core';
|
||||
import * as _moment from 'moment';
|
||||
import * as _rollupMoment from 'moment';
|
||||
import { FormControl } from '@angular/forms';
|
||||
@@ -21,7 +21,7 @@ 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 { 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 { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
|
||||
@@ -29,6 +29,10 @@ import { ServerConnectionService } from 'src/app/services/server-connection.serv
|
||||
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 { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -55,7 +59,7 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
export class NewEventPage implements OnInit {
|
||||
|
||||
eventBody: EventBody;
|
||||
segment:string = "true";
|
||||
segment: string = "true";
|
||||
|
||||
public date: any;
|
||||
public disabled = false;
|
||||
@@ -74,8 +78,8 @@ export class NewEventPage implements OnInit {
|
||||
mostrarModal = false;
|
||||
|
||||
@Input() attendees: []
|
||||
@Input() profile:string;
|
||||
@Input() roomId:string;
|
||||
@Input() profile: string;
|
||||
@Input() roomId: string;
|
||||
@Input() selectedSegment: string;
|
||||
@Input() selectedDate: Date;
|
||||
@Input() CalendarDate: Date;
|
||||
@@ -86,14 +90,15 @@ 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>();
|
||||
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
||||
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
||||
@Output() cloneAllmobileComponent = new EventEmitter<any>();
|
||||
@Output() backToChat = new EventEmitter<any>();
|
||||
|
||||
documents:SearchList[] = [];
|
||||
documents: SearchList[] = [];
|
||||
|
||||
// minDate: string;
|
||||
|
||||
@@ -107,7 +112,7 @@ export class NewEventPage implements OnInit {
|
||||
Form: FormGroup;
|
||||
validateFrom = false;
|
||||
autoStartTime;
|
||||
autoEndTime;
|
||||
autoEndTime;
|
||||
|
||||
public options = [
|
||||
{ value: true, label: 'True' },
|
||||
@@ -136,6 +141,7 @@ export class NewEventPage implements OnInit {
|
||||
public ThemeService: ThemeService,
|
||||
private chatMethodService: ChatMethodsService,
|
||||
private hhtpErrorHandle: HttpErrorHandle,
|
||||
private processeService: ProcessesService,
|
||||
public TaskService: TaskService
|
||||
) {
|
||||
this.dateAdapter.setLocale('pt');
|
||||
@@ -146,8 +152,8 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
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]
|
||||
@@ -155,12 +161,12 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
this.getRecurrenceTypes();
|
||||
if(!this.restoreTemporaryData()) {
|
||||
if (!this.restoreTemporaryData()) {
|
||||
// clear
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.eventBody = { BodyType: "1", Text: "" };
|
||||
this.postEvent.Body = this.eventBody;
|
||||
|
||||
if(this.selectedSegment != "Combinada") {
|
||||
if (this.selectedSegment != "Combinada") {
|
||||
this.postEvent = {
|
||||
EventId: '',
|
||||
Subject: '',
|
||||
@@ -179,10 +185,10 @@ export class NewEventPage implements OnInit {
|
||||
Organizer: '',
|
||||
Category: 'Reunião',
|
||||
HasAttachments: false,
|
||||
EventRecurrence: { Type:'-1', LastOccurrence: this.autoEndTime },
|
||||
EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime },
|
||||
};
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.postEvent = {
|
||||
EventId: '',
|
||||
Subject: '',
|
||||
@@ -201,13 +207,13 @@ export class NewEventPage implements OnInit {
|
||||
Organizer: '',
|
||||
Category: 'Reunião',
|
||||
HasAttachments: false,
|
||||
EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime},
|
||||
EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime },
|
||||
}
|
||||
}
|
||||
|
||||
if(this.postEvent.Attendees != null) {
|
||||
if (this.postEvent.Attendees != null) {
|
||||
this.postEvent.Attendees.forEach(e => {
|
||||
if(e.IsRequired) {
|
||||
if (e.IsRequired) {
|
||||
this.taskParticipants.push(e);
|
||||
} else {
|
||||
this.taskParticipantsCc.push(e);
|
||||
@@ -223,8 +229,8 @@ export class NewEventPage implements OnInit {
|
||||
this.setDefaultTime();
|
||||
}
|
||||
|
||||
|
||||
this.date = new Date(2021,9,4,5,6,7);
|
||||
|
||||
this.date = new Date(2021, 9, 4, 5, 6, 7);
|
||||
|
||||
this.injectValidation();
|
||||
this.changeAgenda()
|
||||
@@ -237,14 +243,14 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
roundTimeQuarterHour(timeToReturn = new Date()): Date {
|
||||
|
||||
|
||||
let date = new Date(timeToReturn) || new Date();
|
||||
|
||||
const minutes = date.getMinutes();
|
||||
date.setSeconds(0);
|
||||
|
||||
if(minutes % 15 != 0) {
|
||||
|
||||
if (minutes % 15 != 0) {
|
||||
|
||||
if (minutes > 45) {
|
||||
date.setMinutes(60)
|
||||
} else if (minutes > 30) {
|
||||
@@ -254,26 +260,26 @@ export class NewEventPage implements OnInit {
|
||||
} else if (minutes > 0) {
|
||||
date.setMinutes(15)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return date
|
||||
}
|
||||
|
||||
roundTimeQuarterHourPlus15(date:Date) {
|
||||
roundTimeQuarterHourPlus15(date: Date) {
|
||||
const _date = new Date(date);
|
||||
const minutes = _date .getMinutes();
|
||||
_date .setMinutes(minutes + 15)
|
||||
return _date
|
||||
const minutes = _date.getMinutes();
|
||||
_date.setMinutes(minutes + 15)
|
||||
return _date
|
||||
}
|
||||
|
||||
|
||||
roundTimeQuarterHour1 (timeToReturn) {
|
||||
roundTimeQuarterHour1(timeToReturn) {
|
||||
let date: any = new Date(timeToReturn) || new Date();
|
||||
const minutes = date.getMinutes();
|
||||
date.setSeconds(0);
|
||||
|
||||
if((minutes % 15) != 0 ) {
|
||||
if ((minutes % 15) != 0) {
|
||||
let a = (Math.floor(minutes / 15) + 1) * 15
|
||||
date.setMinutes(a)
|
||||
}
|
||||
@@ -281,24 +287,24 @@ export class NewEventPage implements OnInit {
|
||||
return date
|
||||
}
|
||||
|
||||
setStartDate(){
|
||||
setStartDate() {
|
||||
// this.postEvent.StartDate = this.roundTimeQuarterHour();
|
||||
}
|
||||
|
||||
setEndDate(){
|
||||
setEndDate() {
|
||||
// this.postEvent.EndDate = this.postEvent.StartDate;
|
||||
}
|
||||
|
||||
runValidation() {
|
||||
this.validateFrom = true;
|
||||
if(new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()){
|
||||
this.validateFrom = true;
|
||||
if (new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()) {
|
||||
this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento")
|
||||
}
|
||||
}
|
||||
|
||||
injectValidation() {
|
||||
|
||||
if (typeof(this.postEvent.EventRecurrence.Type) == 'number') {
|
||||
if (typeof (this.postEvent.EventRecurrence.Type) == 'number') {
|
||||
const str: any = this.postEvent.EventRecurrence.Type.toString()
|
||||
this.postEvent.EventRecurrence.Type = str
|
||||
}
|
||||
@@ -321,13 +327,13 @@ export class NewEventPage implements OnInit {
|
||||
dateEnd: new FormControl(this.postEvent.EndDate, [
|
||||
Validators.required
|
||||
]),
|
||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok': null, [
|
||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [
|
||||
Validators.required
|
||||
]),
|
||||
participantes: new FormControl(this.taskParticipants, [
|
||||
// Validators.required
|
||||
]),
|
||||
Date: new FormControl( new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok': null,[
|
||||
Date: new FormControl(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [
|
||||
Validators.required
|
||||
]),
|
||||
})
|
||||
@@ -337,15 +343,15 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
openInicio() {
|
||||
let input: any = document.querySelector('#new-inicio')
|
||||
if(input) {
|
||||
|
||||
if (input) {
|
||||
|
||||
input.click()
|
||||
}
|
||||
}
|
||||
|
||||
openFim() {
|
||||
let input: any = document.querySelector('#new-fim')
|
||||
if(input) {
|
||||
if (input) {
|
||||
input.click()
|
||||
}
|
||||
}
|
||||
@@ -354,32 +360,36 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
this.CalendarNameShow = false
|
||||
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
|
||||
this.CalendarNameShow = true
|
||||
|
||||
if(this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
|
||||
|
||||
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
|
||||
|
||||
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
|
||||
console.log(this.postEvent.CalendarName)
|
||||
|
||||
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) {
|
||||
this.CalendarNamesOptions = ['Oficial']
|
||||
this.postEvent.CalendarName = 'Oficial'
|
||||
|
||||
console.log(this.postEvent.CalendarName)
|
||||
|
||||
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
|
||||
this.CalendarNamesOptions = ['Pessoal']
|
||||
this.postEvent.CalendarName = 'Pessoal'
|
||||
|
||||
console.log(this.postEvent.CalendarName)
|
||||
|
||||
} else {
|
||||
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
console.log(this.postEvent.CalendarName)
|
||||
}
|
||||
}, 50)
|
||||
|
||||
}
|
||||
|
||||
|
||||
openLastOccurrence() {
|
||||
let input: any = document.querySelector('#last-occurrence')
|
||||
if(input) {
|
||||
if (input) {
|
||||
input.click()
|
||||
}
|
||||
}
|
||||
@@ -396,7 +406,7 @@ export class NewEventPage implements OnInit {
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
if(res){
|
||||
if (res) {
|
||||
const data = res.data;
|
||||
this.documents.push(data.selected);
|
||||
}
|
||||
@@ -412,45 +422,45 @@ export class NewEventPage implements OnInit {
|
||||
this.setIntervenient.emit([]);
|
||||
this.setIntervenientCC.emit([]);
|
||||
// chat exit
|
||||
this.backToChat.emit({roomId:this.roomId})
|
||||
this.backToChat.emit({ roomId: this.roomId })
|
||||
// agenda exit
|
||||
this.cloneAllmobileComponent.emit({})
|
||||
}
|
||||
|
||||
getRecurrenceTypes() {
|
||||
this.eventService.getRecurrenceTypes().subscribe(res=>{
|
||||
|
||||
this.eventService.getRecurrenceTypes().subscribe(res => {
|
||||
|
||||
this.recurringTypes = res;
|
||||
});
|
||||
}
|
||||
|
||||
onSelectedRecurringChanged(ev:any){
|
||||
|
||||
onSelectedRecurringChanged(ev: any) {
|
||||
|
||||
this.calculetedLastOccurrence(ev);
|
||||
|
||||
if(ev.length > 1){
|
||||
|
||||
|
||||
if (ev.length > 1) {
|
||||
|
||||
this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
|
||||
}
|
||||
if(ev.length == 0){
|
||||
if (ev.length == 0) {
|
||||
this.postEvent.EventRecurrence.Type = "-1";
|
||||
}
|
||||
}
|
||||
|
||||
calculetedLastOccurrence(type:number){
|
||||
calculetedLastOccurrence(type: number) {
|
||||
|
||||
var valor;
|
||||
var valor;
|
||||
var opcao: boolean;
|
||||
if (type == 0) {
|
||||
valor = 7;
|
||||
opcao = true;
|
||||
} else if(type == 1){
|
||||
} else if (type == 1) {
|
||||
valor = 30;
|
||||
opcao = true;
|
||||
} else if(type == 2){
|
||||
} else if (type == 2) {
|
||||
valor = 1;
|
||||
opcao = false;
|
||||
}else if(type == 3){
|
||||
} else if (type == 3) {
|
||||
valor = 5;
|
||||
opcao = false;
|
||||
}
|
||||
@@ -458,22 +468,22 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
defineLastOccurrence(valor:number, opcao:boolean){
|
||||
defineLastOccurrence(valor: number, opcao: boolean) {
|
||||
var time = new Date(this.postEvent.EndDate);
|
||||
if (opcao == true) {
|
||||
time.setDate(time.getDate() + valor);
|
||||
this.postEvent.EventRecurrence.LastOccurrence = time;
|
||||
} else {
|
||||
time = new Date(
|
||||
time.getFullYear() + valor,
|
||||
time.getMonth(),
|
||||
time.getDate(),
|
||||
time.getHours(),
|
||||
time.getFullYear() + valor,
|
||||
time.getMonth(),
|
||||
time.getDate(),
|
||||
time.getHours(),
|
||||
time.getMinutes()
|
||||
);
|
||||
this.postEvent.EventRecurrence.LastOccurrence = time;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
async save() {
|
||||
@@ -481,30 +491,30 @@ export class NewEventPage implements OnInit {
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
if(this.Form.invalid) {
|
||||
|
||||
if (this.Form.invalid) {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
|
||||
if(this.documents.length >= 0) {
|
||||
|
||||
if (this.documents.length > 0) {
|
||||
this.postEvent.HasAttachments = true;
|
||||
}
|
||||
|
||||
if(this.postEvent.EventRecurrence.Type == undefined) {
|
||||
if (this.postEvent.EventRecurrence.Type == undefined) {
|
||||
this.postEvent.EventRecurrence.Type = '-1'
|
||||
}
|
||||
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
const CalendarId = this.selectedCalendarId()
|
||||
this.showLoader = true;
|
||||
this.postEvent.CalendarId = CalendarId
|
||||
|
||||
|
||||
let loader = this.toastService.loading();
|
||||
|
||||
|
||||
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||
async (id) => {
|
||||
loader.remove()
|
||||
@@ -523,13 +533,13 @@ export class NewEventPage implements OnInit {
|
||||
};
|
||||
});
|
||||
await DocumentToSave.forEach((attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
||||
if(DocumentToSave.length == (i+1)) {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||
if (DocumentToSave.length == (i + 1)) {
|
||||
this.afterSave();
|
||||
}
|
||||
});
|
||||
});
|
||||
if(DocumentToSave.length == 0) {
|
||||
if (DocumentToSave.length == 0) {
|
||||
this.afterSave();
|
||||
}
|
||||
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||
@@ -542,30 +552,30 @@ export class NewEventPage implements OnInit {
|
||||
"calendarId": CalendarId
|
||||
}
|
||||
|
||||
if(this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId,data);
|
||||
if (this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId, data);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error => {
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
|
||||
else if (this.loggeduser.Profile == 'PR') {
|
||||
|
||||
const CalendarId = this.selectedCalendarId()
|
||||
let loader = this.toastService.loading();
|
||||
this.postEvent.CalendarId = CalendarId
|
||||
|
||||
|
||||
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||
(id) => {
|
||||
|
||||
|
||||
loader.remove()
|
||||
|
||||
const eventId: any = id;
|
||||
const eventId: any = id;
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
return {
|
||||
@@ -581,14 +591,14 @@ export class NewEventPage implements OnInit {
|
||||
});
|
||||
|
||||
DocumentToSave.forEach((attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
||||
if(DocumentToSave.length == (i+1)){
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||
if (DocumentToSave.length == (i + 1)) {
|
||||
this.afterSave();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if(DocumentToSave.length == 0){
|
||||
if (DocumentToSave.length == 0) {
|
||||
this.afterSave();
|
||||
}
|
||||
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||
@@ -600,10 +610,10 @@ export class NewEventPage implements OnInit {
|
||||
"id": id,
|
||||
"calendarId": CalendarId
|
||||
}
|
||||
if(this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId,data);
|
||||
if (this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId, data);
|
||||
}
|
||||
},(error) => {
|
||||
}, (error) => {
|
||||
|
||||
//const connectionToServer = this.ServerConnectionService.BaseAPI()
|
||||
|
||||
@@ -611,22 +621,201 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
|
||||
|
||||
});
|
||||
|
||||
} else if (this.loggeduser.Profile == 'SGGPR') {
|
||||
|
||||
console.log(this.postEventToAprove)
|
||||
console.log(this.postEvent)
|
||||
console.log(this.postEvent.CalendarName)
|
||||
console.log(this.CalendarName)
|
||||
console.log(this.eventService.calendarNamesAry)
|
||||
const CalendarId = this.selectedCalendarId()
|
||||
|
||||
let selectedCalendar
|
||||
try {
|
||||
selectedCalendar = this.eventService.calendarNamesAry.find(calendar => calendar.Fullname === this.CalendarName)
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
console.log('selectedCalendar', selectedCalendar)
|
||||
|
||||
if (selectedCalendar) {
|
||||
if (selectedCalendar.Role = 'Presidente da República') {
|
||||
let loader = this.toastService.loading();
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
return {
|
||||
SourceTitle: e.Assunto,
|
||||
ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
|
||||
Source: '1',
|
||||
SourceId: e.Id,
|
||||
ApplicationId: e.ApplicationType.toString(),
|
||||
Id: '',
|
||||
Link: '',
|
||||
SerialNumber: ''
|
||||
};
|
||||
});
|
||||
|
||||
let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
|
||||
await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'pr', body).subscribe((id) => {
|
||||
loader.remove()
|
||||
this.afterSave();
|
||||
this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
|
||||
|
||||
|
||||
|
||||
|
||||
/* DocumentToSave.forEach((attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||
if (DocumentToSave.length == (i + 1)) {
|
||||
this.afterSave();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (DocumentToSave.length == 0) {
|
||||
this.afterSave();
|
||||
} */
|
||||
|
||||
}, (error) => {
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
|
||||
|
||||
|
||||
} else if (selectedCalendar.Role = 'Ministro e Director do Gabinete do PR') {
|
||||
let loader = this.toastService.loading();
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
return {
|
||||
SourceTitle: e.Assunto,
|
||||
ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
|
||||
Source: '1',
|
||||
SourceId: e.Id,
|
||||
ApplicationId: e.ApplicationType.toString(),
|
||||
Id: '',
|
||||
Link: '',
|
||||
SerialNumber: ''
|
||||
};
|
||||
});
|
||||
|
||||
let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
|
||||
await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'md', body).subscribe((id) => {
|
||||
loader.remove()
|
||||
this.afterSave();
|
||||
this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
|
||||
|
||||
|
||||
|
||||
/* DocumentToSave.forEach((attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||
if (DocumentToSave.length == (i + 1)) {
|
||||
this.afterSave();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (DocumentToSave.length == 0) {
|
||||
this.afterSave();
|
||||
} */
|
||||
|
||||
}, (error) => {
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!selectedCalendar && this.CalendarName == "Meu calendario") {
|
||||
console.log('SG generic')
|
||||
this.postEvent.CalendarName
|
||||
|
||||
const CalendarId = this.selectedCalendarId()
|
||||
let loader = this.toastService.loading();
|
||||
|
||||
this.postEvent.CalendarId = CalendarId
|
||||
|
||||
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||
(id) => {
|
||||
loader.remove();
|
||||
|
||||
const eventId: any = id;
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
return {
|
||||
SourceTitle: e.Assunto,
|
||||
ParentId: eventId,
|
||||
Source: '1',
|
||||
SourceId: e.Id,
|
||||
ApplicationId: e.ApplicationType.toString(),
|
||||
Id: '',
|
||||
Link: '',
|
||||
SerialNumber: ''
|
||||
};
|
||||
});
|
||||
|
||||
DocumentToSave.forEach((attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||
if (DocumentToSave.length == (i + 1)) {
|
||||
this.afterSave();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (DocumentToSave.length == 0) {
|
||||
this.afterSave();
|
||||
}
|
||||
|
||||
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||
let data = {
|
||||
"subject": this.postEvent.Subject,
|
||||
"start": this.postEvent.StartDate,
|
||||
"end": this.postEvent.EndDate,
|
||||
"venue": this.postEvent.Location,
|
||||
"id": id,
|
||||
"calendarId": CalendarId
|
||||
}
|
||||
if (this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId, data);
|
||||
}
|
||||
}, (error) => {
|
||||
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
this.postEvent.CalendarName
|
||||
|
||||
const CalendarId = this.selectedCalendarId()
|
||||
let loader = this.toastService.loading();
|
||||
|
||||
this.postEvent.CalendarId = CalendarId
|
||||
|
||||
|
||||
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||
(id) => {
|
||||
loader.remove();
|
||||
|
||||
const eventId: any = id;
|
||||
const eventId: any = id;
|
||||
|
||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||
return {
|
||||
@@ -642,14 +831,14 @@ export class NewEventPage implements OnInit {
|
||||
});
|
||||
|
||||
DocumentToSave.forEach((attachments, i) => {
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
||||
if(DocumentToSave.length == (i+1)){
|
||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||
if (DocumentToSave.length == (i + 1)) {
|
||||
this.afterSave();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if(DocumentToSave.length == 0){
|
||||
if (DocumentToSave.length == 0) {
|
||||
this.afterSave();
|
||||
}
|
||||
|
||||
@@ -662,20 +851,20 @@ export class NewEventPage implements OnInit {
|
||||
"id": id,
|
||||
"calendarId": CalendarId
|
||||
}
|
||||
if(this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId,data);
|
||||
if (this.roomId) {
|
||||
this.chatMethodService.sendMessage(this.roomId, data);
|
||||
}
|
||||
},(error)=>{
|
||||
}, (error) => {
|
||||
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
loader.remove()
|
||||
this.showLoader = false
|
||||
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
selectedCalendarId () {
|
||||
selectedCalendarId() {
|
||||
|
||||
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
|
||||
|
||||
@@ -705,12 +894,12 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
removeAttachment(index: number) {
|
||||
this.documents = this.documents.filter( (e, i) => index != i);
|
||||
this.documents = this.documents.filter((e, i) => index != i);
|
||||
|
||||
}
|
||||
|
||||
async addParticipants() {
|
||||
|
||||
|
||||
|
||||
this.saveTemporaryData();
|
||||
|
||||
@@ -750,9 +939,9 @@ export class NewEventPage implements OnInit {
|
||||
*/
|
||||
restoreTemporaryData(): boolean {
|
||||
|
||||
const restoredData = window['temp.path:/home/agenda/new-event.component.ts']
|
||||
const restoredData = window['temp.path:/home/agenda/new-event.component.ts']
|
||||
|
||||
if(JSON.stringify(restoredData) != "{}" && undefined != restoredData) {
|
||||
if (JSON.stringify(restoredData) != "{}" && undefined != restoredData) {
|
||||
this.postEvent = restoredData.postEvent
|
||||
this.eventBody = restoredData.eventBody
|
||||
this.segment = restoredData.segment
|
||||
@@ -764,7 +953,7 @@ export class NewEventPage implements OnInit {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,5 +961,31 @@ export class NewEventPage implements OnInit {
|
||||
window['temp.path:/home/agenda/new-event.component.ts'] = {}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -174,9 +174,8 @@ export class EditGroupPage implements OnInit {
|
||||
{
|
||||
name: 'minutes',
|
||||
prefix: 'Minutos',
|
||||
selectedIndex: 3,
|
||||
selectedIndex: 0,
|
||||
options: [
|
||||
{ text: '0', value: 0 },
|
||||
{ text: '5', value: 5 },
|
||||
{ text: '10', value: 10 },
|
||||
{ text: '15', value: 15 },
|
||||
|
||||
@@ -275,9 +275,9 @@
|
||||
<!-- <ion-fab-button *ngIf="p.userPermission([p.permissionList.Agenda.access])" title="Nova Reunião" (click)="bookMeeting()" color="light">
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
</ion-fab-button> -->
|
||||
<!-- <ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-icon name="document"></ion-icon>
|
||||
</ion-fab-button> -->
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
||||
<ion-icon name="image"></ion-icon>
|
||||
</ion-fab-button>
|
||||
|
||||
@@ -907,13 +907,26 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
let blob;
|
||||
let formData
|
||||
let fileBase64
|
||||
if (this.platform.is("tablet")) {
|
||||
|
||||
const fileBase64 = await this._getBase64(file)
|
||||
blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
console.log('BLOB BLOB', blob)
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
/* console.log('add file', fileBase64) */
|
||||
|
||||
} else {
|
||||
blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
fileBase64 = await this._getBase64(file)
|
||||
|
||||
formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
}
|
||||
|
||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class="messages-list-item-wrapper container-width-100"
|
||||
*ngFor="let msg of ChatSystemService.getDmRoom(roomId).messages; index as i; let last = last" >
|
||||
|
||||
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45' *ngIf="msg.msg !=''" [class.dateLabel]="msg.dateLabel">
|
||||
<div [class.dateLabel]="msg.dateLabel" class='message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45' *ngIf="msg.msg !=''" >
|
||||
<div class="message-item-options d-flex justify-content-end" *ngIf="!msg.dateLabel">
|
||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
|
||||
</fa-icon>
|
||||
@@ -253,9 +253,9 @@
|
||||
<!-- <ion-fab-button *ngIf="p.userPermission([p.permissionList.Agenda.access])" title="Nova Reunião" (click)="bookMeeting()" color="light">
|
||||
<ion-icon name="calendar"></ion-icon>
|
||||
</ion-fab-button> -->
|
||||
<!-- <ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-fab-button title="Adicionar Documento" (click)="addFile()" color="light">
|
||||
<ion-icon name="document"></ion-icon>
|
||||
</ion-fab-button> -->
|
||||
</ion-fab-button>
|
||||
<ion-fab-button title="Anexar Fotografia" (click)="addImage()" color="light">
|
||||
<ion-icon name="image"></ion-icon>
|
||||
</ion-fab-button>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '~src/function.scss';
|
||||
@import "~src/function.scss";
|
||||
|
||||
.header-toolbar {
|
||||
--background: transparent;
|
||||
@@ -29,7 +29,6 @@
|
||||
margin: 2px 0 0 5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
|
||||
.right {
|
||||
@@ -45,13 +44,11 @@
|
||||
width: 95%;
|
||||
overflow: auto;
|
||||
|
||||
|
||||
.header-bottom-icon {
|
||||
width: rem(30);
|
||||
font-size: rem(25);
|
||||
float: left;
|
||||
padding: 2px;
|
||||
|
||||
}
|
||||
|
||||
.header-bottom-contacts {
|
||||
@@ -164,7 +161,6 @@ ion-content {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
|
||||
.incoming-true,
|
||||
.incoming-false {
|
||||
padding: 15px 20px;
|
||||
@@ -267,7 +263,6 @@ ion-footer {
|
||||
align-self: center;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.text-color-blue {
|
||||
@@ -357,7 +352,6 @@ ion-footer {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.typing ngx-letters-avatar {
|
||||
padding-right: 5px;
|
||||
}
|
||||
@@ -390,24 +384,23 @@ ion-footer {
|
||||
right: 50%;
|
||||
}
|
||||
|
||||
|
||||
.try {
|
||||
color: red;
|
||||
background: #f3414159;
|
||||
padding: 6px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
background: #f3414159;
|
||||
padding: 6px;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.red-top {
|
||||
border-top: 1px solid red !important;
|
||||
}
|
||||
.red {
|
||||
color: red !important;
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
|
||||
.lido, .enviado {
|
||||
.lido,
|
||||
.enviado {
|
||||
font-size: rem(11);
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
roomName: any;
|
||||
isAdmin = false;
|
||||
roomCountDownDate: string;
|
||||
|
||||
|
||||
constructor(
|
||||
public popoverController: PopoverController,
|
||||
@@ -137,6 +138,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
this.showAvatar = false
|
||||
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
this.scrollToBottomClicked()
|
||||
this.showAvatar = true
|
||||
@@ -144,13 +148,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
this.deleteRecording()
|
||||
|
||||
|
||||
// this.ChatSystemService.getDmRoom(this.roomId).deleteAll()
|
||||
|
||||
}
|
||||
|
||||
async ChatMessageDebuggingPage() {
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ChatMessageDebuggingPage,
|
||||
cssClass: 'model profile-modal search-submodal',
|
||||
@@ -183,6 +186,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
this.deleteRecording();
|
||||
this.loadFiles();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -612,25 +616,25 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
// convert base64 to raw binary data held in a string
|
||||
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
|
||||
var byteString = atob(dataURI.split(',')[1]);
|
||||
|
||||
|
||||
// separate out the mime component
|
||||
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
|
||||
|
||||
|
||||
// write the bytes of the string to an ArrayBuffer
|
||||
var ab = new ArrayBuffer(byteString.length);
|
||||
|
||||
|
||||
// create a view into the buffer
|
||||
var ia = new Uint8Array(ab);
|
||||
|
||||
|
||||
// set the bytes of the buffer to the correct values
|
||||
for (var i = 0; i < byteString.length; i++) {
|
||||
ia[i] = byteString.charCodeAt(i);
|
||||
ia[i] = byteString.charCodeAt(i);
|
||||
}
|
||||
|
||||
|
||||
// write the ArrayBuffer to a blob, and you're done
|
||||
var blob = new Blob([ab], {type: mimeString});
|
||||
var blob = new Blob([ab], { type: mimeString });
|
||||
return blob;
|
||||
|
||||
|
||||
}
|
||||
|
||||
async takePictureMobile() {
|
||||
@@ -645,7 +649,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
source: CameraSource.Camera
|
||||
});
|
||||
|
||||
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||
const compressedImage = await this.compressImageBase64(
|
||||
base64,
|
||||
800, // maxWidth
|
||||
@@ -785,7 +789,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
//const imageData = await this.fileToBase64Service.convert(file)
|
||||
//
|
||||
|
||||
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||
const compressedImage = await this.compressImageBase64(
|
||||
base64,
|
||||
800, // maxWidth
|
||||
@@ -795,7 +799,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
console.log('Selected: ', picture)
|
||||
base64 = picture
|
||||
});
|
||||
|
||||
|
||||
const response = await fetch(base64);
|
||||
const blob = await response.blob();
|
||||
|
||||
@@ -827,23 +831,42 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
async addFileToChat(types: typeof FileType[]) {
|
||||
|
||||
|
||||
const roomId = this.roomId
|
||||
|
||||
const file: any = await this.fileService.getFileFromDevice(types);
|
||||
console.log(file.type)
|
||||
|
||||
|
||||
|
||||
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) => {
|
||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
|
||||
console.error(error);
|
||||
})));
|
||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
const fileBase64 = await this._getBase64(file)
|
||||
let blob;
|
||||
let formData
|
||||
let fileBase64
|
||||
if (this.platform.is("tablet")) {
|
||||
|
||||
blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
console.log('BLOB BLOB', blob)
|
||||
|
||||
formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
/* console.log('add file', fileBase64) */
|
||||
|
||||
} else {
|
||||
blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||
|
||||
fileBase64 = await this._getBase64(file)
|
||||
|
||||
formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
}
|
||||
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('blobFile', blob);
|
||||
|
||||
|
||||
this.ChatSystemService.getDmRoom(roomId).send({
|
||||
@@ -872,7 +895,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
_getBase64(file) {
|
||||
return new Promise((resolve, reject)=>{
|
||||
return new Promise((resolve, reject) => {
|
||||
var reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = function () {
|
||||
@@ -882,7 +905,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
console.log('Error: ', error);
|
||||
};
|
||||
})
|
||||
}
|
||||
}
|
||||
getFileReader(): FileReader {
|
||||
const fileReader = new FileReader();
|
||||
const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"];
|
||||
@@ -991,7 +1014,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1094,7 +1117,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.downloadFileMsg(msg)
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
var str = msg.attachments[0].image_url
|
||||
str = str.substring(1, ((str.length) - 1));
|
||||
|
||||
@@ -1176,14 +1199,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
if (this.room.name) {
|
||||
try {
|
||||
this.roomName = this.room.name.split('-').join(' ');
|
||||
} catch(error) {
|
||||
} catch (error) {
|
||||
this.roomName = this.room.name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(SessionStore.user.ChatData.data.userId == this.room.u._id){
|
||||
}
|
||||
|
||||
|
||||
if (SessionStore.user.ChatData.data.userId == this.room.u._id) {
|
||||
this.isAdmin = true
|
||||
} else {
|
||||
this.isAdmin = false
|
||||
@@ -1199,32 +1222,32 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
return new Promise((resolve, reject) => {
|
||||
const image = new (window as any).Image();
|
||||
image.src = base64String;
|
||||
|
||||
|
||||
image.onload = async () => {
|
||||
const canvas = document.createElement('canvas');
|
||||
let newWidth = image.width;
|
||||
let newHeight = image.height;
|
||||
|
||||
|
||||
if (newWidth > maxWidth) {
|
||||
newHeight *= maxWidth / newWidth;
|
||||
newWidth = maxWidth;
|
||||
}
|
||||
|
||||
|
||||
if (newHeight > maxHeight) {
|
||||
newWidth *= maxHeight / newHeight;
|
||||
newHeight = maxHeight;
|
||||
}
|
||||
|
||||
|
||||
canvas.width = newWidth;
|
||||
canvas.height = newHeight;
|
||||
|
||||
|
||||
const context = canvas.getContext('2d');
|
||||
context?.drawImage(image, 0, 0, newWidth, newHeight);
|
||||
|
||||
|
||||
const compressedBase64 = canvas.toDataURL('image/jpeg', quality);
|
||||
resolve(compressedBase64);
|
||||
};
|
||||
|
||||
|
||||
image.onerror = (error) => {
|
||||
reject(error);
|
||||
};
|
||||
|
||||
@@ -335,9 +335,8 @@ export class NewGroupPage implements OnInit{
|
||||
{
|
||||
name: 'minutes',
|
||||
prefix: 'Minutos',
|
||||
selectedIndex: 3,
|
||||
selectedIndex: 0,
|
||||
options: [
|
||||
{ text: '0', value: 0 },
|
||||
{ text: '5', value: 5 },
|
||||
{ text: '10', value: 10 },
|
||||
{ text: '15', value: 15 },
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
|
||||
|
||||
<div *ngIf="profilePicture != ''" class="profile-image">
|
||||
<img class="profile-image" src={{profilePicture}}>
|
||||
<img class="profile-image font-45-em" src={{profilePicture}}>
|
||||
</div>
|
||||
|
||||
<div class="profile-text">
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
@import '~src/function.scss';
|
||||
@import "~src/function.scss";
|
||||
|
||||
.div-top-header{
|
||||
.div-top-header {
|
||||
margin: 0 em(20);
|
||||
// background-color: #0782c9;
|
||||
//padding-top: em(15px);
|
||||
border: 0!important;
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
.profile-image {
|
||||
vertical-align: middle;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
display: block; /* Torna a imagem um elemento de bloco */
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
|
||||
.profile-image {
|
||||
border-radius: 80%; /* Tornar a imagem circular */
|
||||
width: 100%;
|
||||
height: 25.33%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.div-logo{
|
||||
.div-logo {
|
||||
background: transparent;
|
||||
width: em(140);
|
||||
justify-content: center;
|
||||
@@ -34,17 +34,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
.logo-description{
|
||||
.logo-description {
|
||||
width: 74.67%;
|
||||
margin: 0 auto;
|
||||
overflow: auto;
|
||||
font-size: 8.5px;
|
||||
font-family: Bahnschrift;
|
||||
|
||||
.logo-description-content{
|
||||
.logo-description-content {
|
||||
width: 100%;
|
||||
|
||||
.logo-description-text{
|
||||
.logo-description-text {
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
@@ -52,32 +52,31 @@
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.add-line{
|
||||
.add-line {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #000;
|
||||
margin-bottom: 2.5px !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.add-line-white{
|
||||
.add-line-white {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #fff;
|
||||
margin-bottom: 2.5px !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
}
|
||||
.color-white{
|
||||
.color-white {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.add-botton-border{
|
||||
.add-botton-border {
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
|
||||
.add-botton-border-white{
|
||||
.add-botton-border-white {
|
||||
border-bottom: 1px solid #fff;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,15 +86,15 @@
|
||||
}
|
||||
|
||||
.div-profile {
|
||||
height: fit-content;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
background-color: transparent;
|
||||
overflow: auto;
|
||||
display: flex !important;
|
||||
justify-content: end;
|
||||
max-width: 45px;
|
||||
justify-content:space-around;
|
||||
border-radius: 50px;
|
||||
|
||||
.icon{
|
||||
.icon {
|
||||
position: relative;
|
||||
border: none !important;
|
||||
}
|
||||
@@ -105,15 +104,15 @@
|
||||
font-size: rem(12);
|
||||
color: white;
|
||||
text-align: center;
|
||||
width:20px;
|
||||
height:20px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 35%;
|
||||
position: absolute; /* changed */
|
||||
top: 5px; /* changed */
|
||||
right: 27px; /* changed */
|
||||
}
|
||||
|
||||
.profile-text{
|
||||
.profile-text {
|
||||
font-size: rem(20);
|
||||
font-weight: 300;
|
||||
width: fit-content;
|
||||
@@ -125,43 +124,40 @@
|
||||
//border: 1px solid red;
|
||||
}
|
||||
|
||||
.desktop {
|
||||
.desktop {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1366px) {
|
||||
|
||||
.mobile{
|
||||
.mobile {
|
||||
display: none !important;
|
||||
}
|
||||
.desktop{
|
||||
.desktop {
|
||||
display: block;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.tab{
|
||||
.tab {
|
||||
height: 65px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.tab:hover{
|
||||
.tab:hover {
|
||||
border-top: 7px solid var(--header-tab-text-white);
|
||||
}
|
||||
.active{
|
||||
.active {
|
||||
border-top: 7px solid var(--header-tab-text-white);
|
||||
span{
|
||||
span {
|
||||
font-weight: 650;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.search-input-container{
|
||||
.search-input-container {
|
||||
background-color: white;
|
||||
border-radius: 27.5px;
|
||||
border: solid 1px #ebebeb;
|
||||
.icon{
|
||||
.icon {
|
||||
color: #797979;
|
||||
width: rem(45);
|
||||
height: rem(45);
|
||||
@@ -170,15 +166,14 @@
|
||||
font-size: rem(25);
|
||||
align-items: center;
|
||||
}
|
||||
.input-text{
|
||||
.input-text {
|
||||
width: 100%;
|
||||
}
|
||||
.icon-z{
|
||||
.icon-z {
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.tab {
|
||||
color: var(--header-tab-text-white);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ export class HeaderPage implements OnInit {
|
||||
this.eventTriger.getObservable().subscribe((event) => {
|
||||
if (event.notification == "recive") {
|
||||
console.log('header', event.notification)
|
||||
this.notificationLength++
|
||||
this.notificationLengthData()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -105,21 +105,24 @@ export class HeaderPage implements OnInit {
|
||||
this.eventTriger.getObservable().subscribe((event) => {
|
||||
if (event.notification == "deleted") {
|
||||
console.log('header', event.notification)
|
||||
this.notificationLength--
|
||||
this.notificationLengthData()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async notificationLengthData() {
|
||||
console.log('Call notification data')
|
||||
await this.storageservice.get("Notifications").then((value) => {
|
||||
|
||||
|
||||
console.log('Get notification data', )
|
||||
|
||||
this.notificationLength = value.length;
|
||||
console.log('Call notification data',this.notificationLength)
|
||||
|
||||
}).catch((error) => {
|
||||
if (!error) {
|
||||
console.error('header storage get notification', error)
|
||||
this.notificationLength = 0;
|
||||
} else {
|
||||
console.error('header storage get notification', error)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
|
||||
<!-- <button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button> -->
|
||||
<button (click)="addFile()" class="btn-ok" shape="round" >Anexar Documento</button>
|
||||
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
|
||||
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Gestão Documental</button>
|
||||
<div class="solid"></div>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="buttons width-100">
|
||||
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||
</div>
|
||||
<div class="buttons width-100" *ngIf="task.activityInstanceName != 'Revisar Diploma'">
|
||||
<div class="buttons width-100" *ngIf="task.activityInstanceName != 'Assinar Diploma'">
|
||||
<button (click)="openExpedientActionsModal('0',task)" class="btn-cancel" shape="round" >Efetuar despacho</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -53,6 +53,7 @@ export class DiplomaOptionsPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.task.activityInstanceName)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user