pull made from developer

This commit is contained in:
Eudes Inácio
2021-12-23 07:43:52 +01:00
41 changed files with 1312 additions and 115 deletions
@@ -145,7 +145,6 @@
.btn-ok, .btn-cancel, .btn-delete{
height: auto !important;
font-size: 16px !important;
font-weight: 600 !important;
width: 100% !important;
margin-bottom: 10px !important;
padding: 15px !important;
@@ -25,6 +25,7 @@ import { ViewChild } from '@angular/core';
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';
const moment = _rollupMoment || _moment;
@@ -70,6 +71,7 @@ export class NewEventPage implements OnInit {
selectedRecurringType: any;
@Input() profile:string;
@Input() roomId:string;
@Input() selectedSegment: string;
@Input() selectedDate: Date;
@Input() taskParticipants: EventPerson[] = [];
@@ -120,7 +122,8 @@ export class NewEventPage implements OnInit {
private toastService: ToastService,
private userService: AuthService,
private dateAdapter: DateAdapter<any>,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private chatMethodService: ChatMethodsService,
// private translate: TranslateService
) {
this.dateAdapter.setLocale('pt');
@@ -341,7 +344,6 @@ export class NewEventPage implements OnInit {
return false
}
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
if(this.documents.length >= 0) {
@@ -353,27 +355,16 @@ export class NewEventPage implements OnInit {
}
if(this.loggeduser.Profile == 'MDGPR') {
// console.log('MD - Aqui');
// console.log(this.postEvent);
this.showLoader = true;
console.log(this.postEvent);
let loader = this.toastService.loading();
console.log(this.postEvent);
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe(
async (id) => {
loader.remove()
this.showLoader = false
const eventId: any = id;
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
@@ -386,32 +377,30 @@ export class NewEventPage implements OnInit {
SerialNumber: ''
};
});
await DocumentToSave.forEach((attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
if(DocumentToSave.length == (i+1)){
this.afterSave();
}
});
});
if(DocumentToSave.length == 0){
this.afterSave();
}
this.toastService._successMessage('Evento criado')
this.toastService._successMessage('Evento criado');
let data = {
"subject": this.postEvent.Subject,
"start": this.postEvent.StartDate,
"end": this.postEvent.EndDate,
"venue": this.postEvent.Location,
"id": id,
}
this.chatMethodService.sendMessage(this.roomId,data);
},
error => {
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
});
}
@@ -439,19 +428,15 @@ export class NewEventPage implements OnInit {
DocumentToSave.forEach((attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
if(DocumentToSave.length == (i+1)){
this.afterSave();
}
});
});
if(DocumentToSave.length == 0){
this.afterSave();
}
this.toastService.successMessage('Evento criado')
});
}
@@ -45,7 +45,7 @@
</div>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of messages; let last = last">
<div class="message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" >
<div class="message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru' && msg.msg !=''" >
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
<mat-menu #beforeMenu="matMenu" xPosition="before">
@@ -111,6 +111,15 @@
</div>
{{last ? scrollToBottom() : ''}}
</div>
<div *ngIf="msg.file" class="info-meeting">
<div *ngIf="msg.file.type == 'application/meeting'">
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
</div>
{{last ? scrollToBottom() : ''}}
</div>
</div>
</div>
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
@@ -125,6 +125,35 @@
line-height: 1.2rem;
}
}
.info-meeting{
/* width: 322px; */
width: em(422px);
background: var(--chat-alert-msg-color);
text-align: center;
font-size: 13px;
color: #262420;
padding: 10px;
margin: 10px auto;
line-height: 1.2rem;
/* margin: 15px 0px 15px 0px; */
border-radius: 8px;
.info-meeting-small{
font-size: 10px;
font-style: italic;
}
.info-meeting-medium{
font-size: 12px;
}
.info-meeting-normal{
font-weight: 700;
}
.info-meeting-normal:hover{
text-decoration: underline;
color: #0782c9;
}
}
.messages{
font-size: 13px;
font-family: Roboto;
@@ -21,6 +21,7 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
import { ThemeService } from 'src/app/services/theme.service'
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
/*
import * as pdfjsLib from 'pdfjs-dist';
@@ -143,6 +144,27 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
} catch(err) { }
}
async goToEvent(eventId: any) {
let classs;
if (window.innerWidth < 701) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: ViewEventPage,
componentProps: {
eventId: eventId,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
});
}
ngAfterViewInit() {
this.scrollChangeCallback = () => this.onContentScrolled(event);
window.addEventListener('scroll', this.scrollChangeCallback, true);
@@ -58,15 +58,15 @@
<!-- <img *ngIf="file.image_url" src="{{file.image_url}}" alt="image" (click)="imageSize(file.image_url)"> -->
<img src={{msg.image_url}} alt="image">
</div>
<div>
<div class="file">
<!-- <canvas id="pdf_canvas"></canvas> -->
<!-- <div *ngIf="msg.file.type">
<div class="file">
<div (click)="viewDocument(msg, file.title_link)" class="file-details add-ellipsis cursor-pointer" *ngIf="msg.file">
<span *ngIf="msg.file.type">
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
<ion-icon *ngIf="msg.file.type == 'application/meeting'" src="assets/icon/webtrix.svg"></ion-icon>
</span>
<ion-label class="file-title">{{file.title}}</ion-label>
</div>
@@ -77,13 +77,22 @@
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
<span *ngIf="msg.file.type != 'application/webtrix'">{{msg.file.type.replace('application/','').toUpperCase()}}</span>
</ion-label>
</div>
</div>
</div> -->
</div>
</div>
{{last ? scrollToBottom() : ''}}
</div>
</div>
<div *ngIf="msg.file" class="info-meeting">
<div *ngIf="msg.file.type == 'application/meeting'">
<ion-label class="info-meeting-small">{{msg.u.name}} criou esta reunião</ion-label><br />
<button (click)="goToEvent(msg.file.id)" class="btn-no-color info-meeting-normal"><ion-label class="info-meeting-normal">{{msg.file.subject}}</ion-label></button><br />
<ion-label class="info-meeting-medium"><ion-icon name="calendar-outline"></ion-icon> De {{showDateDuration(msg.file.start_date)}} a {{showDateDuration(msg.file.end_date)}}</ion-label><br />
<ion-label class="info-meeting-medium"><ion-icon></ion-icon><ion-icon name="location-outline"></ion-icon> {{msg.file.venue}}</ion-label><br />
</div>
{{last ? scrollToBottom() : ''}}
</div>
</div>
</div>
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
@@ -100,6 +100,34 @@
border-radius: 8px;
border: 1px solid red;
}
.info-meeting{
/* width: 322px; */
width: em(422px);
background: var(--chat-alert-msg-color);
text-align: center;
font-size: 13px;
color: #262420;
padding: 10px;
margin: 10px auto;
line-height: 1.2rem;
/* margin: 15px 0px 15px 0px; */
border-radius: 8px;
.info-meeting-small{
font-size: 10px;
font-style: italic;
}
.info-meeting-medium{
font-size: 12px;
}
.info-meeting-normal{
font-weight: 700;
}
.info-meeting-normal:hover{
text-decoration: underline;
color: #0782c9;
}
}
.messages{
font-size: 13px;
+24 -5
View File
@@ -21,6 +21,7 @@ import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { SqliteService } from 'src/app/services/sqlite.service';
import { StorageService } from 'src/app/services/storage.service';
import { Directory, Filesystem } from '@capacitor/filesystem';
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
const IMAGE_DIR = 'stored-images';
@Component({
@@ -82,7 +83,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
public ThemeService: ThemeService,
private changeDetectorRef: ChangeDetectorRef,
private sqliteservice: SqliteService,
private storageservice: StorageService
private storageservice: StorageService,
private router: Router,
) {
this.loggedUser = authService.ValidatedUserChat['data'];
@@ -208,14 +210,31 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
return this.timeService.showDateDuration(start);
}
async goToEvent(eventId: any) {
let classs;
if (window.innerWidth < 701) {
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: ViewEventPage,
componentProps: {
eventId: eventId,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then((res) => {
console.log(res);
});
}
sendMessage() {
//this.synchro.$send({})
let body = {
"message":
{
"rid": this.roomId, "msg": this.message
"rid": this.roomId, "msg": this.message,
}
}
@@ -84,7 +84,7 @@ ion-button{
.bottom-content{
//width: 360px;
margin: 0 auto;
.bottom-content h3{
font-size: 16px;
margin: 0 0 0 10px;
@@ -125,7 +125,7 @@ ion-button{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
.arrow-right-icon{
width: 37px;
float: right;
@@ -141,7 +141,6 @@ ion-button{
.btn-ok, .btn-cancel, .btn-delete{
height: auto !important;
font-size: 16px !important;
font-weight: 600 !important;
width: 100% !important;
margin-bottom: 10px !important;
padding: 15px !important;
@@ -82,7 +82,7 @@
<div class="item width-100">
<div class="exp-top-detail">
<div class="subject">
<ion-label>{{ task.Folio }} {{ task.Status }}</ion-label>
<ion-label>{{ task.Folio }}</ion-label>
</div>
<div class="exp-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-expediente-attachment.svg"></ion-icon>