merge with develop

This commit is contained in:
Eudes Inácio
2022-07-08 09:17:02 +01:00
11 changed files with 293 additions and 257 deletions
+1 -1
View File
@@ -123,7 +123,7 @@
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
</button>
<button title="Visualizar a lista de Eventos para aprovação" class="btn-no-color cursor-pointer resize" (click)="viewEventsToApprove()" *ngIf="loggeduser.Profile != 'PR'">
<button title="Visualizar a lista de Eventos para aprovação" class="btn-no-color cursor-pointer resize" (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>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' && mobileComponent.showEventList" class="right-icons" src="assets/images/theme/gov/icons-received-event-selected.svg"></ion-icon>
+3 -1
View File
@@ -33,6 +33,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
import { PermissionService } from 'src/app/services/permission.service';
@Component({
@@ -183,7 +184,8 @@ export class AgendaPage implements OnInit {
private platform: Platform,
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
private storage:Storage
private storage:Storage,
public p: PermissionService
) {
this.dateAdapter.setLocale('es');
@@ -1055,7 +1055,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
return blob;
}
openFile(pdfString, filename) {
openFile(pdfString, filename, type) {
const blob = this.b64toBlob(pdfString, 'application/pdf')
let pathFile = ''
const fileName = filename
@@ -1106,7 +1106,6 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log(msg)
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
@@ -1120,11 +1119,25 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
modal.present();
} else {
this.downloadFileFromBrowser("file", str)
this.downloadFileFromBrowser(msg.attachments[0].name, str)
}
} else {
this.openFile(str, msg.attachments[0].name);
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
cssClass: 'modal modal-desktop',
componentProps: {
image: msg.attachments[0].image_url,
type: msg.file.type,
username: msg.u.name,
_updatedAt: msg._updatedAt
}
});
modal.present();
} else {
this.openFile(str, msg.attachments[0].name, msg.file.type);
}
}
}
}
+68 -66
View File
@@ -19,7 +19,7 @@ import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
import { environment } from 'src/environments/environment';
import { ThemeService } from 'src/app/services/theme.service'
import { VoiceRecorder, RecordingData, GenericResponse} from 'capacitor-voice-recorder';
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
import { Haptics, ImpactStyle } from '@capacitor/haptics';
import { SqliteService } from 'src/app/services/sqlite.service';
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
@@ -37,7 +37,9 @@ import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
import { DomSanitizer } from '@angular/platform-browser';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorResponse } from '@angular/common/http';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
const IMAGE_DIR = 'stored-images';
@@ -101,7 +103,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
downloadProgess: number;
downloadLoader: boolean;
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
audioPermissionStatus: 'granted' | 'denied' | 'prompt' | null = null
sessionStore = SessionStore
constructor(
@@ -133,10 +135,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private sanitiser: DomSanitizer,
private alertController: AlertController,
// private document: DocumentViewer
private file: File,
private fileOpener: FileOpener,
) {
this.loggedUser = authService.ValidatedUserChat['data'];
this.roomId = this.navParams.get('roomId');
window.onresize = (event) => {
if (window.innerWidth > 701) {
@@ -144,7 +148,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
}
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
@@ -161,9 +165,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.wsChatMethodsService.getAllRooms();
this.chatService.refreshtoken();
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
})
this.getChatMembers();
}
@@ -213,11 +217,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
try {
this.storage.get('recordData').then((recordData) => {
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
}
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
else if (recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
}
});
@@ -228,22 +232,22 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async startRecording() {
VoiceRecorder.requestAudioRecordingPermission();
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
if (await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) => { return result.value })) {
if (await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => { return result.value })) {
//if(await this.hasAudioRecordingPermission()){
if (this.recording) {
return;
}
this.recording = true;
VoiceRecorder.startRecording();
this.calculateDuration();
if (this.recording) {
return;
}
this.recording = true;
VoiceRecorder.startRecording();
this.calculateDuration();
//}
}
else{
else {
this.toastService._badRequest('Para gravar uma mensagem de voz, permita o acesso do Gabinete Digital ao seu microfone.');
}
}
else{
else {
this.toastService._badRequest('Este dispositivo não tem capacidade para gravação de áudio!');
}
}
@@ -251,13 +255,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
stopRecording() {
this.deleteRecording();
this.allowTyping = false;
if (!this.recording) {
return;
}
this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
@@ -266,7 +270,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Save file
this.storage.set('fileName', fileName);
this.storage.set('recordData', result).then(() => {
})
}
})
@@ -351,7 +355,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await modal.present();
modal.onDidDismiss().then((res) => {
});
}
@@ -415,16 +419,16 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = recordData?.value?.recordDataBase64;
}
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
else if (recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
}
//Converting base64 to blob
const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
const formData = new FormData();
formData.append("blobFile", blob);
@@ -447,7 +451,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
viewDocument(file: any, url?: string) {
if (file.type == "application/webtrix") {
this.openViewDocumentModal(file);
}
@@ -598,7 +602,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
IsRequired: "true",
}
});
this.popoverController.dismiss();
if (window.innerWidth <= 1024) {
const modal = await this.modalController.create({
@@ -632,7 +636,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const blob = await base64.blob();
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
@@ -712,7 +716,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
resultType: CameraResultType.Base64,
source: CameraSource.Photos
});
//const imageData = await this.fileToBase64Service.convert(file)
//
@@ -749,17 +753,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const file: any = await this.fileService.getFileFromDevice(types);
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)));
const blob = this.base64toBlob(encodedData, file.type)
const formData = new FormData();
formData.append('blobFile', blob);
this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
@@ -775,7 +779,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
temporaryData: formData
});
} else {
}
@@ -790,7 +794,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
resolve(reader.result)
};
reader.onerror = function (error) {
};
});
@@ -798,7 +802,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async openChatOptions(ev?: any) {
const roomId = this.roomId
const popover = await this.popoverController.create({
component: ChatOptionsPopoverPage,
@@ -813,7 +817,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
await popover.present();
popover.onDidDismiss().then(async (res) => {
if (res['data'] == 'meeting') {
this.bookMeeting();
}
@@ -840,11 +844,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
let chatmsgArray = [];
let array = []
msg.forEach(element => {
let msgChat = {
_id: element.Id,
@@ -864,7 +868,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
})
}
}
@@ -946,27 +950,27 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
openFile(pdfString, filename, type) {
// const blob = this.b64toBlob(pdfString, type)
// let pathFile = ''
// const fileName = filename
// const contentFile = blob
// if (this.platform.is('ios')) {
// pathFile = this.file.documentsDirectory
// } else {
// pathFile = this.file.externalRootDirectory
// }
//
//
//
// this.file
// .writeFile(pathFile, fileName, contentFile, { replace: true })
// .then(success => {
// this.fileOpener
// .open(pathFile + fileName, type)
// .then(() =>
// .catch(e =>
// })
// .catch(e =>
const blob = this.b64toBlob(pdfString, type)
let pathFile = ''
const fileName = filename
const contentFile = blob
if (this.platform.is('ios')) {
pathFile = this.file.documentsDirectory
} else {
pathFile = this.file.externalRootDirectory
}
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
this.fileOpener
.open(pathFile + fileName, type)
.then(() => console.log())
.catch(e => console.error(e))
})
.catch(e => console.error(e))
}
downloadFileFromBrowser(fileName: string, data: any): void {
@@ -979,9 +983,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async openPreview(msg) {
if(msg.file.type === "application/webtrix") {
if (msg.file.type === "application/webtrix") {
this.viewDocument(msg.file, msg.attachments.image_url)
} else {
@@ -995,7 +999,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log(msg)
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
@@ -1009,7 +1012,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
});
modal.present();
} else {
this.downloadFileFromBrowser("file", str)
this.downloadFileFromBrowser(msg.attachments[0].name, str)
}
} else {
@@ -1028,7 +1031,6 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} else {
this.openFile(str, msg.attachments[0].name, msg.file.type);
}
}
}
@@ -1037,7 +1039,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async audioPreview(msg) {
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg)
} else { }
+110 -108
View File
@@ -2,7 +2,8 @@
<app-header></app-header>
</ion-header>
<ion-header class="ion-no-border init-event-header">
<!-- <ion-header class="ion-no-border init-event-header"> -->
<ion-header class="ion-no-border">
<ion-label>
<p class="time ion-text-center">{{customDate}}</p>
</ion-label>
@@ -17,132 +18,133 @@
</ion-header>
<ion-content class="main " ng-controller="AppController">
<!-- <ion-content class="main " ng-controller="AppController"> -->
<ion-content ng-controller="AppController">
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="schedule height-100">
<div class="schedule-header">
<div class="title">
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
<div class="text">A sua Agenda</div>
</div>
<button title="Ir para a sua Agenda" class="btn-no-color" [routerLink]="['/home/agenda']">
<ion-icon
*ngIf="ThemeService.currentTheme == 'default' "
class="icon-next"
slot="end"
src="assets/images/icons-arrow-circle-arrow-right.svg"
></ion-icon>
<ion-icon
*ngIf="ThemeService.currentTheme == 'gov' "
class="icon-next"
slot="end"
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
></ion-icon>
<ion-icon
*ngIf="ThemeService.currentTheme == 'tribunal' "
class="icon-next"
slot="end"
src="assets/images/theme/tribunal/icons-arrow-circle-arrow-right.svg"
></ion-icon>
</button>
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="schedule height-100">
<div class="schedule-header">
<div class="title">
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
<div class="text">A sua Agenda</div>
</div>
<div class="content overflow-y-auto flex-grow-1 height-100">
<button title="Ir para a sua Agenda" class="btn-no-color" [routerLink]="['/home/agenda']">
<ion-icon
*ngIf="ThemeService.currentTheme == 'default' "
class="icon-next"
slot="end"
src="assets/images/icons-arrow-circle-arrow-right.svg"
></ion-icon>
<ion-list>
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of listToPresent"
(click)="goToEvent(event.EventId)"
>
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
<ion-icon
*ngIf="ThemeService.currentTheme == 'gov' "
class="icon-next"
slot="end"
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
></ion-icon>
<div class="schedule-time">
<div *ngIf="!event.IsAllDayEvent" class="time-start">{{event.StartDate | date: 'HH:mm'}}</div>
<div *ngIf="!event.IsAllDayEvent" class="time-end">{{event.EndDate | date: 'HH:mm'}}</div>
<ion-icon
*ngIf="ThemeService.currentTheme == 'tribunal' "
class="icon-next"
slot="end"
src="assets/images/theme/tribunal/icons-arrow-circle-arrow-right.svg"
></ion-icon>
<div *ngIf="event.IsAllDayEvent" class="time-start"> Todo </div>
<div *ngIf="event.IsAllDayEvent" class="time-end text-center"> o dia </div>
<div></div>
</div>
<div class="schedule-details">
<div class="location">{{event.Location}}</div>
<div class="description">
<p>{{event.Subject}}</p>
</div>
</div>
</div>
</ion-item>
</ion-list>
<!--
<div class="resume">
<div class="title">
Resumo para Amnahã
</div>
<div class="event-num">4 eventos ageandados para amanhã</div>
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
</div>
-->
</div>
</button>
</div>
<div class="content overflow-y-auto flex-grow-1 height-100">
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="schedule height-100">
<div class="schedule-header">
<div class="title">
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
<div class="text">Correspondência por ler</div>
</div>
<button title="Ir para o Gabinete Digital" (click)="viewExpedientListPage()" class="btn-no-color cursor-pointer">
<ion-icon
*ngIf="ThemeService.currentTheme == 'default' "
class="icon-next"
slot="end"
src="assets/images/icons-arrow-circle-arrow-right.svg"
></ion-icon>
<ion-list>
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of listToPresent"
(click)="goToEvent(event.EventId)"
>
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
<ion-icon
*ngIf="ThemeService.currentTheme == 'gov' "
class="icon-next"
slot="end"
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
></ion-icon>
<div class="schedule-time">
<div *ngIf="!event.IsAllDayEvent" class="time-start">{{event.StartDate | date: 'HH:mm'}}</div>
<div *ngIf="!event.IsAllDayEvent" class="time-end">{{event.EndDate | date: 'HH:mm'}}</div>
<ion-icon
*ngIf="ThemeService.currentTheme == 'tribunal' "
class="icon-next"
slot="end"
src="assets/images/theme/tribunal/icons-arrow-circle-arrow-right.svg"
></ion-icon>
</button>
</div>
<div class="content overflow-y-auto flex-grow-1 height-100">
<ion-list>
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of listToPresentexpediente"
(click)="goToExpediente(task.SerialNumber)">
<div class="item-exp d-flex">
<div class="schedule-date">
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yyyy'}}</div>
<div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div>
</div>
<div class="schedule-details pointer">
<div class="description">{{ task.Subject }}</div>
<div class="location">{{ task.Senders }}</div>
<div *ngIf="event.IsAllDayEvent" class="time-start"> Todo </div>
<div *ngIf="event.IsAllDayEvent" class="time-end text-center"> o dia </div>
<div></div>
</div>
<div class="schedule-details">
<div class="location">{{event.Location}}</div>
<div class="description">
<p>{{event.Subject}}</p>
</div>
</div>
</ion-item>
</div>
</ion-item>
</ion-list>
</ion-list>
<!--
<div class="resume">
<div class="title">
Resumo para Amnahã
</div>
<div class="event-num">4 eventos ageandados para amanhã</div>
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
</div>
-->
</div>
</div>
<!-- <iframe id="home-iframe" style="width: 100%;" src="/assets/www/pdfjs/web/viewer.html?file=/assets/www/pdfjs/web/compressed.tracemonkey-pldi-09.pdf.pdf"></iframe> -->
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="schedule height-100">
<div class="schedule-header">
<div class="title">
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
<div class="text">Correspondência por ler</div>
</div>
<button title="Ir para o Gabinete Digital" (click)="viewExpedientListPage()" class="btn-no-color cursor-pointer">
<ion-icon
*ngIf="ThemeService.currentTheme == 'default' "
class="icon-next"
slot="end"
src="assets/images/icons-arrow-circle-arrow-right.svg"
></ion-icon>
<ion-icon
*ngIf="ThemeService.currentTheme == 'gov' "
class="icon-next"
slot="end"
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
></ion-icon>
<ion-icon
*ngIf="ThemeService.currentTheme == 'tribunal' "
class="icon-next"
slot="end"
src="assets/images/theme/tribunal/icons-arrow-circle-arrow-right.svg"
></ion-icon>
</button>
</div>
<div class="content overflow-y-auto flex-grow-1 height-100">
<ion-list>
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of listToPresentexpediente"
(click)="goToExpediente(task.SerialNumber)">
<div class="item-exp d-flex">
<div class="schedule-date">
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yyyy'}}</div>
<div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div>
</div>
<div class="schedule-details pointer">
<div class="description">{{ task.Subject }}</div>
<div class="location">{{ task.Senders }}</div>
</div>
</div>
</ion-item>
</ion-list>
</div>
</div>
</div>
<!-- <iframe id="home-iframe" style="width: 100%;" src="/assets/www/pdfjs/web/viewer.html?file=/assets/www/pdfjs/web/compressed.tracemonkey-pldi-09.pdf.pdf"></iframe> -->
</ion-content>
@@ -109,16 +109,17 @@ export class EditEventPage implements OnInit {
}
}
const result = this.participantsPipe.transform(this.postEvent.Attendees)
this.taskParticipants = result.taskParticipants
this.taskParticipantsCc = result.taskParticipantsCc
if (this.postEvent.Attendees != null) {
const result = this.participantsPipe.transform(this.postEvent.Attendees)
this.taskParticipants = result.taskParticipants
this.taskParticipantsCc = result.taskParticipantsCc
this.taskParticipants = removeDuplicate(this.taskParticipants);
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
this.setIntervenient.emit(this.taskParticipants);
this.setIntervenientCC.emit(this.taskParticipantsCc);
this.taskParticipants = removeDuplicate(this.taskParticipants);
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
this.setIntervenient.emit(this.taskParticipants);
this.setIntervenientCC.emit(this.taskParticipantsCc);
}
}
this.initCalendarName = this.postEvent.CalendarName;
@@ -127,14 +128,10 @@ export class EditEventPage implements OnInit {
this.getRecurrenceTypes();
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
// this.postEvent.EventRecurrence.LastOccurrence = this.currentDate;
setTimeout(() => {
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
}, 1000);
}, 500);
}
@@ -1103,20 +1103,21 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
async openPreview(msg) {
if (msg.file.type === "application/webtrix") {
this.viewDocument(msg.file, msg.attachments.image_url)
} else {
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
this.downloadFileMsg(msg)
//this.testDownlod(msg)
} else {
var str = msg.attachments[0].image_url;
str = str.substring(1, ((str.length) - 1));
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log(msg)
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
@@ -1130,23 +1131,27 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
modal.present();
} else {
this.downloadFileFromBrowser("file", str)
this.downloadFileFromBrowser(msg.attachments[0].name, str)
}
} else {
this.openFile(str, msg.attachments[0].name, msg.file.type);
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
cssClass: 'modal modal-desktop',
componentProps: {
image: msg.attachments[0].image_url,
type: msg.file.type,
username: msg.u.name,
_updatedAt: msg._updatedAt
}
});
modal.present();
} else {
this.openFile(str, msg.attachments[0].name, msg.file.type);
}
}
/* const modal = await this.modalController.create({
component: ViewMediaPage,
cssClass: 'modal modal-desktop',
componentProps: {
image: str,
type: msg.file.type,
username: msg.u.name,
_updatedAt: msg._updatedAt
}
});
modal.present(); */
}
}
+47 -36
View File
@@ -97,9 +97,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
isPlaying = false;
audioProgress = 0;
audioDuration = 0;
audioTimer: any;
@ViewChild('range', { static: false }) range: IonRange;
userName = "";
audioTimer:any;
@ViewChild('range', {static: false}) range: IonRange;
room: any = new Array();
roomName: any;
isAdmin = false;
roomCountDownDate: string;
constructor(
public popoverController: PopoverController,
@@ -129,6 +132,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
ngOnChanges(changes: SimpleChanges): void {
this.wsChatMethodsService.getAllRooms();
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
@@ -164,12 +168,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
async ngOnInit() {
ngOnInit() {
this.wsChatMethodsService.getAllRooms();
alert(this.wsChatMethodsService.getDmRoom(this.roomId).name)
this.chatService.refreshtoken();
this.scrollToBottom();
this.getChatMembers();
this.deleteRecording();
@@ -1027,35 +1029,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
if (!msg.attachments[0].image_url || msg.attachments[0].image_url === null || msg.attachments[0].image_url === '') {
this.downloadFileMsg(msg)
//this.testDownlod(msg)
/* } else if (msg.file.type === "application/pdf") {
const win = window.open("", "_blank");
let html = '';
html += '<html>';
html += '<body style="margin:0!important">';
html += '<iframe width="100%" height="100%" src="' + str + '" type="application/pdf" />';
html += '</body>';
html += '</html>';
setTimeout(() => {
win.document.write(html);
}, 0); */
//this.viewDocument(msg, msg.attachments.image_url)
} else {
var str = msg.attachments[0].image_url;
str = str.substring(1, ((str.length) - 1));
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log(msg)
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
@@ -1069,19 +1050,28 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
});
modal.present();
} else {
this.downloadFileFromBrowser("file", str)
this.downloadFileFromBrowser(msg.attachments[0].name, str)
}
} else {
this.openFile(str, msg.attachments[0].name, msg.file.type);
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
cssClass: 'modal modal-desktop',
componentProps: {
image: msg.attachments[0].image_url,
type: msg.file.type,
username: msg.u.name,
_updatedAt: msg._updatedAt
}
});
modal.present();
} else {
this.openFile(str, msg.attachments[0].name, msg.file.type);
}
}
}
}
}
@@ -1138,6 +1128,27 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}, 1000)
}
async getRoomInfo() {
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
// console.log('ROOM',room)
this.room = room['room'];
if (this.room.name) {
this.roomName = this.room.name.split('-').join(' ');
}
if(SessionStore.user.ChatData.data.userId == this.room.u._id){
this.isAdmin = true
} else {
this.isAdmin = false
}
if (this.room.customFields.countDownDate) {
this.roomCountDownDate = this.room.customFields.countDownDate;
}
}
}
+8 -4
View File
@@ -56,9 +56,13 @@
<img *ngIf="ThemeService.currentTheme == 'tribunal' " src='assets/images/theme/tribunal/tribunal-constitucional.png' alt='logo'>
</div>
<div class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content">
<!-- <p class="logo-description-text">Presidente da República</p> -->
<p class="logo-description-text">GABINETE DIGITAL</p>
<div *ngIf="ThemeService.currentTheme == 'default' " class="logo-description-content">
<!-- <p class="logo-description-text color-white">Presidente da República</p> -->
<div class="add-line color-white" style="border-bottom-color: white;"></div>
<p class="logo-description-text color-white">GABINETE DIGITAL</p>
</div>
<div *ngIf="ThemeService.currentTheme == 'gov' " class="logo-description-content">
<p class="logo-description-text">Presidente da República</p>
<div class="add-line"></div>
</div>
</div>
@@ -171,6 +175,6 @@
</div>
</div>
<div class="header-bottom-line"></div>
<div [class.header-bottom-line] = "ThemeService.currentTheme == 'gov'" style="height: 5px;"></div>
<!-- {{ RouteService.history | json }} -->
</div>
+7 -7
View File
@@ -15,11 +15,11 @@
color: black;
overflow: auto;
.logo-icon{
.logo-icon {
width: 25.33%;
overflow: auto;
img{
img {
width: 100%;
margin: 0px auto;
}
@@ -72,12 +72,12 @@
}
}
.header-btns{
.header-btns {
justify-content: center;
align-items: center;
}
.div-profile{
.div-profile {
height: fit-content;
font-size: 45px;
justify-content: flex-end;
@@ -103,7 +103,7 @@
position: absolute; /* changed */
top: 5px; /* changed */
right: 27px; /* changed */
}
}
.profile-text{
font-size: 20px;
@@ -113,11 +113,11 @@
color: var(--profile-text-color);
}
}
.main-tab{
.main-tab {
//border: 1px solid red;
}
.desktop{
.desktop {
display: none;
}
+2 -2
View File
@@ -798,7 +798,7 @@ ion-content {
@media only screen and (min-width: 1224px) {
app-header .header-container{
background: var(--header-container-background) !important;
// background: var(--header-container-background) !important;
color: var(--headercolor);
}
app-events .init-event-header,
@@ -822,7 +822,7 @@ ion-content {
}
@media only screen and (min-width : 321px) {
@media only screen and (min-width : 1364px) {
app-header .header-container{
background: var(--header-container-background) !important;
color: var(--headercolor);