header page footer

This commit is contained in:
Peter Maquiran
2022-04-07 15:35:48 +01:00
9 changed files with 50 additions and 76 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
<ion-tabs class="tab" *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2"> <ion-tabs class="tab" >
<ion-tab-bar class="bottoms" slot="bottom"> <ion-tab-bar *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2" class="bottoms" slot="bottom">
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'"> <ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'">
<!-- <ion-icon name="home"></ion-icon> --> <!-- <ion-icon name="home"></ion-icon> -->
+1
View File
@@ -40,6 +40,7 @@ export class UserSession {
Authorization: string; Authorization: string;
Email: string Email: string
FullName: string FullName: string
ManagerName: string
OwnerCalendars: { OwnerCalendars: {
CalendarId: string CalendarId: string
CalendarName: "Oficial" | "Pessoal"; CalendarName: "Oficial" | "Pessoal";
+24 -27
View File
@@ -41,7 +41,6 @@ import { Storage } from '@ionic/storage';
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service'; import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera'; import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
import { Plugins, Capacitor } from '@capacitor/core'; import { Plugins, Capacitor } from '@capacitor/core';
import { MultipleDocumentsPicker } from '@awesome-cordova-plugins/multiple-document-picker/ngx';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
import { StringDecoder } from 'string_decoder'; import { StringDecoder } from 'string_decoder';
import { File } from '@awesome-cordova-plugins/file/ngx'; import { File } from '@awesome-cordova-plugins/file/ngx';
@@ -135,13 +134,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private processesService: ProcessesService, private processesService: ProcessesService,
private storage: Storage, private storage: Storage,
private fileToBase64Service: FileToBase64Service, private fileToBase64Service: FileToBase64Service,
private multipleDocumentsPicker: MultipleDocumentsPicker,
private sant: DomSanitizer, private sant: DomSanitizer,
private file: File, //private fileOpener: FileOpener,
private fileOpener: FileOpener,
private sanitiser: DomSanitizer, private sanitiser: DomSanitizer,
private alertController: AlertController, private alertController: AlertController,
private document: DocumentViewer // private document: DocumentViewer
) { ) {
this.loggedUser = authService.ValidatedUserChat['data']; this.loggedUser = authService.ValidatedUserChat['data'];
this.roomId = this.navParams.get('roomId'); this.roomId = this.navParams.get('roomId');
@@ -151,7 +148,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (window.innerWidth > 701) { if (window.innerWidth > 701) {
this.modalController.dismiss(); this.modalController.dismiss();
} }
}; }
console.log(this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})); console.log(this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}));
@@ -989,27 +986,27 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
openFile(pdfString, filename, type) { openFile(pdfString, filename, type) {
const blob = this.b64toBlob(pdfString, type) // const blob = this.b64toBlob(pdfString, type)
let pathFile = '' // let pathFile = ''
const fileName = filename // const fileName = filename
const contentFile = blob // const contentFile = blob
if (this.platform.is('ios')) { // if (this.platform.is('ios')) {
pathFile = this.file.documentsDirectory // pathFile = this.file.documentsDirectory
} else { // } else {
pathFile = this.file.externalRootDirectory // pathFile = this.file.externalRootDirectory
} // }
console.log(pdfString) // console.log(pdfString)
console.log(pathFile) // console.log(pathFile)
console.log(contentFile) // console.log(contentFile)
this.file // this.file
.writeFile(pathFile, fileName, contentFile, { replace: true }) // .writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => { // .then(success => {
this.fileOpener // this.fileOpener
.open(pathFile + fileName, type) // .open(pathFile + fileName, type)
.then(() => console.log('File is opened')) // .then(() => console.log('File is opened'))
.catch(e => console.log('Error opening file', e)); // .catch(e => console.log('Error opening file', e));
}) // })
.catch(e => console.log('Error writing file', e)) // .catch(e => console.log('Error writing file', e))
} }
downloadFileFromBrowser(fileName: string, data: any): void { downloadFileFromBrowser(fileName: string, data: any): void {
-1
View File
@@ -113,7 +113,6 @@ export class LoginPage implements OnInit {
if(this.p.userPermission(this.permissionList.Chat.access)){ if(this.p.userPermission(this.permissionList.Chat.access)){
alert('RC IN')
await this.authService.loginChat(); await this.authService.loginChat();
await this.authService.loginToChatWs(); await this.authService.loginToChatWs();
} }
@@ -15,6 +15,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import {MatMenuModule} from '@angular/material/menu'; import {MatMenuModule} from '@angular/material/menu';
import { LettersAvatarModule } from "ngx-letters-avatar"; import { LettersAvatarModule } from "ngx-letters-avatar";
import { PipesModule } from 'src/app/pipes/pipes.module'; import { PipesModule } from 'src/app/pipes/pipes.module';
import { SafehtmlPipe } from 'src/app/pipes/safehtml.pipe';
@NgModule({ @NgModule({
imports: [ imports: [
@@ -33,4 +34,4 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
declarations: [GroupMessagesPage] declarations: [GroupMessagesPage]
}) })
export class GroupMessagesPageModule {} export class GroupMessagesPageModule {}
@@ -300,49 +300,25 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
} }
async checkAudioPermission() {
const permissionStatus = await navigator.permissions.query({ name: 'microphone' } as any)
console.log('permission', permissionStatus.state); // granted, denied, prompt
this.audioPermissionStatus = permissionStatus.state
permissionStatus.onchange = (data : any) => {
// console.log("Permission changed to " + data.state);
// console.log('permission', permissionStatus.state); // granted, denied, prompt
}
}
async startRecording() { async startRecording() {
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
await this.checkAudioPermission(); if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
//if(await this.hasAudioRecordingPermission()){
if(this.audioPermissionStatus == 'granted') { if (this.recording) {
if (this.recording) { return;
return;
}
this.recording = true;
VoiceRecorder.startRecording();
this.calculateDuration();
} else {
const alertPopup = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Necessita de permissão para gravar áudio',
buttons: [{
text: 'Ok',
handler: () => {
} }
}] this.recording = true;
}); VoiceRecorder.startRecording();
this.calculateDuration();
await alertPopup.present(); //}
}
else{
this.toastService._badRequest('Para gravar uma mensagem de voz, permita o acesso do Gabinete Digital ao seu microfone.');
}
}
else{
this.toastService._badRequest('Este dispositivo não tem capacidade para gravação de áudio!');
} }
} }
stopRecording() { stopRecording() {
@@ -924,7 +900,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const formData = new FormData(); const formData = new FormData();
formData.append("blobFile", blob); formData.append("blobFile", blob);
this.wsChatMethodsService.getDmRoom(roomId).send({ this.wsChatMethodsService.getGroupRoom(roomId).send({
file: { file: {
"type": file.type, "type": file.type,
"guid": '', "guid": '',
@@ -13,6 +13,7 @@ import { MatButtonModule } from '@angular/material/button';
import {MatMenuModule} from '@angular/material/menu'; import {MatMenuModule} from '@angular/material/menu';
import { LettersAvatarModule } from "ngx-letters-avatar"; import { LettersAvatarModule } from "ngx-letters-avatar";
import { PipesModule } from 'src/app/pipes/pipes.module'; import { PipesModule } from 'src/app/pipes/pipes.module';
import { SafehtmlPipe } from 'src/app/pipes/safehtml.pipe';
@NgModule({ @NgModule({
imports: [ imports: [
@@ -25,9 +26,8 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
MatMenuModule, MatMenuModule,
LettersAvatarModule, LettersAvatarModule,
PipesModule, PipesModule,
], ],
exports: [MessagesPage], exports: [MessagesPage],
declarations: [MessagesPage] declarations: [MessagesPage]
}) })
export class MessagesPageModule {} export class MessagesPageModule {}
+1 -1
View File
@@ -64,7 +64,7 @@
</div> </div>
</div> </div>
<div class="d-flex flex-1 pr-20 pl-50"> <div class="d-flex flex-1 pr-20 pl-50" *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2">
<div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')" <div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
[class.active]="locationPathname() == '/home/events'"> [class.active]="locationPathname() == '/home/events'">
+1 -1
View File
@@ -109,7 +109,7 @@ class SessionService {
get getManagerInitials() { get getManagerInitials() {
let names = this._user.FullName.split(' ') || ' ', let names = this._user.ManagerName.split(' ') || ' ',
initials = names[0].substring(0, 1).toUpperCase(); initials = names[0].substring(0, 1).toUpperCase();
if (names.length > 1) { if (names.length > 1) {
initials += names[names.length - 1].substring(0, 1).toUpperCase(); initials += names[names.length - 1].substring(0, 1).toUpperCase();