mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
header page footer
This commit is contained in:
@@ -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-tab-bar class="bottoms" slot="bottom">
|
||||
<ion-tabs class="tab" >
|
||||
<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-icon name="home"></ion-icon> -->
|
||||
|
||||
@@ -40,6 +40,7 @@ export class UserSession {
|
||||
Authorization: string;
|
||||
Email: string
|
||||
FullName: string
|
||||
ManagerName: string
|
||||
OwnerCalendars: {
|
||||
CalendarId: string
|
||||
CalendarName: "Oficial" | "Pessoal";
|
||||
|
||||
@@ -41,7 +41,6 @@ import { Storage } from '@ionic/storage';
|
||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||
import { Plugins, Capacitor } from '@capacitor/core';
|
||||
import { MultipleDocumentsPicker } from '@awesome-cordova-plugins/multiple-document-picker/ngx';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { StringDecoder } from 'string_decoder';
|
||||
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||
@@ -135,13 +134,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
private processesService: ProcessesService,
|
||||
private storage: Storage,
|
||||
private fileToBase64Service: FileToBase64Service,
|
||||
private multipleDocumentsPicker: MultipleDocumentsPicker,
|
||||
private sant: DomSanitizer,
|
||||
private file: File,
|
||||
private fileOpener: FileOpener,
|
||||
//private fileOpener: FileOpener,
|
||||
private sanitiser: DomSanitizer,
|
||||
private alertController: AlertController,
|
||||
private document: DocumentViewer
|
||||
// private document: DocumentViewer
|
||||
) {
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
this.roomId = this.navParams.get('roomId');
|
||||
@@ -151,7 +148,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
if (window.innerWidth > 701) {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
console.log(this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}));
|
||||
|
||||
@@ -989,27 +986,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
|
||||
}
|
||||
console.log(pdfString)
|
||||
console.log(pathFile)
|
||||
console.log(contentFile)
|
||||
this.file
|
||||
.writeFile(pathFile, fileName, contentFile, { replace: true })
|
||||
.then(success => {
|
||||
this.fileOpener
|
||||
.open(pathFile + fileName, type)
|
||||
.then(() => console.log('File is opened'))
|
||||
.catch(e => console.log('Error opening file', e));
|
||||
})
|
||||
.catch(e => console.log('Error writing file', 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
|
||||
// }
|
||||
// console.log(pdfString)
|
||||
// console.log(pathFile)
|
||||
// console.log(contentFile)
|
||||
// this.file
|
||||
// .writeFile(pathFile, fileName, contentFile, { replace: true })
|
||||
// .then(success => {
|
||||
// this.fileOpener
|
||||
// .open(pathFile + fileName, type)
|
||||
// .then(() => console.log('File is opened'))
|
||||
// .catch(e => console.log('Error opening file', e));
|
||||
// })
|
||||
// .catch(e => console.log('Error writing file', e))
|
||||
}
|
||||
|
||||
downloadFileFromBrowser(fileName: string, data: any): void {
|
||||
|
||||
@@ -113,7 +113,6 @@ export class LoginPage implements OnInit {
|
||||
|
||||
|
||||
if(this.p.userPermission(this.permissionList.Chat.access)){
|
||||
alert('RC IN')
|
||||
await this.authService.loginChat();
|
||||
await this.authService.loginToChatWs();
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||
import {MatMenuModule} from '@angular/material/menu';
|
||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
import { SafehtmlPipe } from 'src/app/pipes/safehtml.pipe';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -33,4 +34,4 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
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() {
|
||||
|
||||
await this.checkAudioPermission();
|
||||
|
||||
if(this.audioPermissionStatus == 'granted') {
|
||||
if (this.recording) {
|
||||
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: () => {
|
||||
|
||||
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;
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
await alertPopup.present();
|
||||
|
||||
this.recording = true;
|
||||
VoiceRecorder.startRecording();
|
||||
this.calculateDuration();
|
||||
//}
|
||||
}
|
||||
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() {
|
||||
@@ -924,7 +900,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
||||
const formData = new FormData();
|
||||
formData.append("blobFile", blob);
|
||||
|
||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||
this.wsChatMethodsService.getGroupRoom(roomId).send({
|
||||
file: {
|
||||
"type": file.type,
|
||||
"guid": '',
|
||||
|
||||
@@ -13,6 +13,7 @@ import { MatButtonModule } from '@angular/material/button';
|
||||
import {MatMenuModule} from '@angular/material/menu';
|
||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
import { SafehtmlPipe } from 'src/app/pipes/safehtml.pipe';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -25,9 +26,8 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||
MatMenuModule,
|
||||
LettersAvatarModule,
|
||||
PipesModule,
|
||||
|
||||
],
|
||||
exports: [MessagesPage],
|
||||
declarations: [MessagesPage]
|
||||
})
|
||||
export class MessagesPageModule {}
|
||||
export class MessagesPageModule {}
|
||||
@@ -64,7 +64,7 @@
|
||||
</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')"
|
||||
[class.active]="locationPathname() == '/home/events'">
|
||||
|
||||
@@ -109,7 +109,7 @@ class SessionService {
|
||||
|
||||
|
||||
get getManagerInitials() {
|
||||
let names = this._user.FullName.split(' ') || ' ',
|
||||
let names = this._user.ManagerName.split(' ') || ' ',
|
||||
initials = names[0].substring(0, 1).toUpperCase();
|
||||
if (names.length > 1) {
|
||||
initials += names[names.length - 1].substring(0, 1).toUpperCase();
|
||||
|
||||
Reference in New Issue
Block a user