mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Fix merge
This commit is contained in:
Generated
+74
-8
@@ -6732,10 +6732,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@pdftron/pdfjs-express": {
|
"@rkusa/linebreak": {
|
||||||
"version": "8.0.1",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@pdftron/pdfjs-express/-/pdfjs-express-8.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@rkusa/linebreak/-/linebreak-1.0.0.tgz",
|
||||||
"integrity": "sha512-zSX8i2CwouW3bjrRHm7i1oeYPYWKQpUs3sprGm0qYcvMytpGJ2F2nKJ3iQLlUxyfgUJB3akolAmjlQuPjEwk2g=="
|
"integrity": "sha512-yCSm87XA1aYMgfcABSxcIkk3JtCw3AihNceHY+DnZGLvVP/g2z3UWZbi0xIoYpZWAJEVPr5Zt3QE37Q80wF1pA==",
|
||||||
|
"requires": {
|
||||||
|
"unicode-trie": "^0.3.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"@scarf/scarf": {
|
"@scarf/scarf": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
@@ -22262,6 +22265,15 @@
|
|||||||
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
|
||||||
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A=="
|
"integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A=="
|
||||||
},
|
},
|
||||||
|
"opentype.js": {
|
||||||
|
"version": "1.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/opentype.js/-/opentype.js-1.3.3.tgz",
|
||||||
|
"integrity": "sha512-/qIY/+WnKGlPIIPhbeNjynfD2PO15G9lA/xqlX2bDH+4lc3Xz5GCQ68mqxj3DdUv6AJqCeaPvuAoH8mVL0zcuA==",
|
||||||
|
"requires": {
|
||||||
|
"string.prototype.codepointat": "^0.2.1",
|
||||||
|
"tiny-inflate": "^1.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"openurl": {
|
"openurl": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz",
|
||||||
@@ -22638,6 +22650,41 @@
|
|||||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||||
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
|
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
|
||||||
},
|
},
|
||||||
|
"pdfjs": {
|
||||||
|
"version": "2.4.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/pdfjs/-/pdfjs-2.4.6.tgz",
|
||||||
|
"integrity": "sha512-bVANz4AmxgNdKd9kjAuJj/KgINaV7ZMDsRjDe6VgwQMpu9lcQMh6QjyaajSx0IGlAwAD59K8kbJA3wuVHNicwQ==",
|
||||||
|
"requires": {
|
||||||
|
"@rkusa/linebreak": "^1.0.0",
|
||||||
|
"opentype.js": "^1.3.3",
|
||||||
|
"pako": "^2.0.3",
|
||||||
|
"readable-stream": "^3.6.0",
|
||||||
|
"unorm": "^1.6.0",
|
||||||
|
"uuid": "^8.3.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"pako": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg=="
|
||||||
|
},
|
||||||
|
"readable-stream": {
|
||||||
|
"version": "3.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||||
|
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||||
|
"requires": {
|
||||||
|
"inherits": "^2.0.3",
|
||||||
|
"string_decoder": "^1.1.1",
|
||||||
|
"util-deprecate": "^1.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"pdfjs-dist": {
|
"pdfjs-dist": {
|
||||||
"version": "2.9.359",
|
"version": "2.9.359",
|
||||||
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.9.359.tgz",
|
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.9.359.tgz",
|
||||||
@@ -27058,8 +27105,7 @@
|
|||||||
"string.prototype.codepointat": {
|
"string.prototype.codepointat": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz",
|
||||||
"integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==",
|
"integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"string.prototype.trimend": {
|
"string.prototype.trimend": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
@@ -27603,6 +27649,11 @@
|
|||||||
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
|
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"tiny-inflate": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw=="
|
||||||
|
},
|
||||||
"tmp": {
|
"tmp": {
|
||||||
"version": "0.0.33",
|
"version": "0.0.33",
|
||||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
|
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
|
||||||
@@ -29068,6 +29119,22 @@
|
|||||||
"integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==",
|
"integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"unicode-trie": {
|
||||||
|
"version": "0.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-0.3.1.tgz",
|
||||||
|
"integrity": "sha1-1nHd3YkQGgi6w3tqUWEBBgIFIIU=",
|
||||||
|
"requires": {
|
||||||
|
"pako": "^0.2.5",
|
||||||
|
"tiny-inflate": "^1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"pako": {
|
||||||
|
"version": "0.2.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
|
||||||
|
"integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"union": {
|
"union": {
|
||||||
"version": "0.5.0",
|
"version": "0.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz",
|
||||||
@@ -29132,8 +29199,7 @@
|
|||||||
"unorm": {
|
"unorm": {
|
||||||
"version": "1.6.0",
|
"version": "1.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz",
|
||||||
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==",
|
"integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"unpipe": {
|
"unpipe": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
|||||||
+1
-1
@@ -96,7 +96,7 @@
|
|||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"ng2-pdf-viewer": "^7.0.1",
|
"ng2-pdf-viewer": "^7.0.1",
|
||||||
"ngx-socket-io": "^3.2.0",
|
"ngx-socket-io": "^3.2.0",
|
||||||
"pdfjs-dist": "^2.9.359",
|
"pdfjs": "^2.4.6",
|
||||||
"puppeteer": "^10.1.0",
|
"puppeteer": "^10.1.0",
|
||||||
"rxjs": "~6.6.3",
|
"rxjs": "~6.6.3",
|
||||||
"rxjs-compat": "^6.6.7",
|
"rxjs-compat": "^6.6.7",
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ import { PdfViewerModule } from 'ng2-pdf-viewer';
|
|||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
MatDialogModule,
|
MatDialogModule,
|
||||||
//
|
//
|
||||||
PdfViewerModule
|
PdfViewerModule,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: MAT_DATE_LOCALE, useValue: 'pt' },
|
{ provide: MAT_DATE_LOCALE, useValue: 'pt' },
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button hidden (click)="notImplemented()" full class="btn-cancel" shape="round" >Tirar Fotografia</button>
|
<button (click)="takePicture()" full class="btn-cancel hide-desktop" shape="round" >Tirar Fotografia</button>
|
||||||
<button hidden (click)="notImplemented()" class="btn-cancel" shape="round" >Digitalizar Documento</button>
|
<button (click)="addPicture()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
|
||||||
<button (click)="anexarFoto()" full class="btn-cancel" shape="round" >Anexar Fotografia</button>
|
<button hidden (click)="addDocument()" class="btn-cancel" shape="round" >Documento</button>
|
||||||
<button (click)="addDocGestaoDocumental()" class="btn-cancel" shape="round" >Anexar Documento (G.D.)</button>
|
<button (click)="addDocGestaoDocumental()" class="btn-cancel" shape="round" >Anexar Documento (G.D.)</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="bookMeeting()" class="btn-cancel" shape="round" >Marcar reunião</button>
|
<button (click)="bookMeeting()" class="btn-cancel" shape="round" >Novo Evento</button>
|
||||||
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
|
<button (click)="close()" full class="btn-cancel mobile-only" shape="round" >Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -68,8 +68,21 @@ export class ChatOptionsFeaturesPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
anexarFoto(){
|
addDocument(){
|
||||||
this.modalController.dismiss('picture');
|
this.modalController.dismiss('add-document');
|
||||||
|
}
|
||||||
|
|
||||||
|
takePicture(){
|
||||||
|
if( window.innerWidth < 701){
|
||||||
|
this.popoverController.dismiss('take-picture');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.modalController.dismiss('take-picture');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addPicture(){
|
||||||
|
this.modalController.dismiss('add-picture');
|
||||||
}
|
}
|
||||||
|
|
||||||
addDocGestaoDocumental(){
|
addDocGestaoDocumental(){
|
||||||
|
|||||||
@@ -8,4 +8,7 @@ export let FileType:
|
|||||||
"image/svg+xml" |
|
"image/svg+xml" |
|
||||||
"image/tiff" |
|
"image/tiff" |
|
||||||
"image/webp" |
|
"image/webp" |
|
||||||
"image/x-icon"
|
"image/x-icon" |
|
||||||
|
".doc" |
|
||||||
|
".docx" |
|
||||||
|
".pdf"
|
||||||
|
|||||||
@@ -28,13 +28,14 @@ import { EmptyChatPageModule } from 'src/app/shared/chat/empty-chat/empty-chat.m
|
|||||||
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
import { HeaderPageModule } from 'src/app/shared/header/header.module';
|
||||||
import { NewEventPageModule } from 'src/app/shared/agenda/new-event/new-event.module';
|
import { NewEventPageModule } from 'src/app/shared/agenda/new-event/new-event.module';
|
||||||
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
|
import { AttendeeModalPageModule } from 'src/app/shared/event/attendee-modal/attendee-modal.module';
|
||||||
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
IonicModule,
|
IonicModule,
|
||||||
|
FontAwesomeModule,
|
||||||
PipesModule,
|
PipesModule,
|
||||||
ChatPageRoutingModule,
|
ChatPageRoutingModule,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
|
|||||||
@@ -67,6 +67,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item-description" [class.item-description-active]="dm._id == idSelected">
|
<div class="item-description" [class.item-description-active]="dm._id == idSelected">
|
||||||
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
|
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
|
||||||
|
<ion-label *ngIf="dm.lastMessage.file">
|
||||||
|
<fa-icon icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="dm._id == idSelected"></fa-icon>
|
||||||
|
<span> {{dm.lastMessage.file.name}}</span>
|
||||||
|
</ion-label>
|
||||||
|
<ion-label *ngIf="dm.lastMessage.attachments">
|
||||||
|
<div *ngIf="dm.lastMessage.attachments[0].image_url">
|
||||||
|
<fa-icon icon="image" class="file-icon" [class.set-active-item-font-to-white]="dm._id == idSelected"></fa-icon>
|
||||||
|
<span> Fotografia</span>
|
||||||
|
</div>
|
||||||
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -88,8 +98,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="item-date" [class.item-date-active]="group._id ==idSelected" *ngIf="group.lastMessage">{{showDateDuration(group._updatedAt)}}</div>
|
<div class="item-date" [class.item-date-active]="group._id ==idSelected" *ngIf="group.lastMessage">{{showDateDuration(group._updatedAt)}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-description" [class.item-description-active]="group._id ==idSelected" *ngIf="group.lastMessage">
|
<div class="item-description d-flex align-items-center" [class.item-description-active]="group._id ==idSelected" *ngIf="group.lastMessage">
|
||||||
<ion-label>{{group.lastMessage.u.name}}: {{group.lastMessage.msg}}</ion-label>
|
<div class="item-message">{{group.lastMessage.u.name}}: {{group.lastMessage.msg}} </div>
|
||||||
|
<div class="item-files" *ngIf="group.lastMessage.file">
|
||||||
|
<fa-icon icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group._id == idSelected"></fa-icon>
|
||||||
|
<span> {{group.lastMessage.file.name}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="item-files" *ngIf="group.lastMessage.attachments">
|
||||||
|
<div *ngIf="group.lastMessage.attachments[0].image_url">
|
||||||
|
<fa-icon icon="image" class="file-icon" [class.set-active-item-font-to-white]="group._id == idSelected"></fa-icon>
|
||||||
|
<span> Fotografia</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ ion-content{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item-content{
|
.item-content{
|
||||||
width: 317px;
|
//width: 317px;
|
||||||
float:right;
|
float:right;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ ion-content{
|
|||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.item-title{
|
.item-title{
|
||||||
width: 80%;
|
width: calc(100% - 75px);
|
||||||
float: left;
|
float: left;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
color: #0d89d1;
|
color: #0d89d1;
|
||||||
@@ -105,7 +105,7 @@ ion-content{
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.item-date{
|
.item-date{
|
||||||
width: 20%;
|
width: 75px;
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #797979;
|
color: #797979;
|
||||||
@@ -114,9 +114,19 @@ ion-content{
|
|||||||
.item-date-active{
|
.item-date-active{
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-description{
|
.item-description{
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.item-message{
|
||||||
|
float: left;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
.item-files{
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.item-description-active{
|
.item-description-active{
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@@ -130,7 +140,6 @@ ion-content{
|
|||||||
@media only screen and (min-width: 701px) {
|
@media only screen and (min-width: 701px) {
|
||||||
.main-content{
|
.main-content{
|
||||||
|
|
||||||
|
|
||||||
.aside-wrapper{
|
.aside-wrapper{
|
||||||
width: 35%;
|
width: 35%;
|
||||||
border-right: 1px solid #d8d8d8;
|
border-right: 1px solid #d8d8d8;
|
||||||
|
|||||||
@@ -280,8 +280,6 @@ hideRefreshButton(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
openGroupMessagesPage(rid) {
|
openGroupMessagesPage(rid) {
|
||||||
console.log(rid);
|
|
||||||
|
|
||||||
if( window.innerWidth < 701){
|
if( window.innerWidth < 701){
|
||||||
this.openGroupMessagesModal(rid);
|
this.openGroupMessagesModal(rid);
|
||||||
}
|
}
|
||||||
@@ -392,21 +390,21 @@ hideRefreshButton(){
|
|||||||
var dateB = new Date(b._updatedAt).getTime();
|
var dateB = new Date(b._updatedAt).getTime();
|
||||||
return dateB - dateA;
|
return dateB - dateA;
|
||||||
});
|
});
|
||||||
console.log(this.userDirectMessages);
|
//console.log(this.userDirectMessages);
|
||||||
|
|
||||||
if(this.route.url != "/home/chat"){
|
if(this.route.url != "/home/chat"){
|
||||||
console.log("Timer message stop")
|
//console.log("Timer message stop")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log('TIMER');
|
//console.log('TIMER');
|
||||||
//Check if modal is opened
|
//Check if modal is opened
|
||||||
if(this.segment == "Contactos" && this.showMessages != true){
|
if(this.segment == "Contactos" && this.showMessages != true){
|
||||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
await this.getDirectMessages();
|
await this.getDirectMessages();
|
||||||
console.log('Timer contactos list running')
|
//console.log('Timer contactos list running')
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log('No timer!');
|
//console.log('No timer!');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -445,7 +443,7 @@ hideRefreshButton(){
|
|||||||
var dateB = new Date(b._updatedAt).getTime();
|
var dateB = new Date(b._updatedAt).getTime();
|
||||||
return dateB - dateA;
|
return dateB - dateA;
|
||||||
});
|
});
|
||||||
console.log(this.allGroups);
|
//console.log(this.allGroups);
|
||||||
/* }); */
|
/* }); */
|
||||||
if(this.route.url != "/home/chat"){
|
if(this.route.url != "/home/chat"){
|
||||||
console.log("Timer message stop")
|
console.log("Timer message stop")
|
||||||
@@ -455,7 +453,7 @@ hideRefreshButton(){
|
|||||||
if(this.segment == "Grupos" && this.showGroupMessages != true){
|
if(this.segment == "Grupos" && this.showGroupMessages != true){
|
||||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||||
await this.getGroups();
|
await this.getGroups();
|
||||||
console.log('Timer groups list running')
|
//console.log('Timer groups list running')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
FontAwesomeModule,
|
FontAwesomeModule,
|
||||||
IonicModule,
|
IonicModule,
|
||||||
|
|
||||||
GroupMessagesPageRoutingModule,
|
GroupMessagesPageRoutingModule,
|
||||||
ChatPopoverPageModule,
|
ChatPopoverPageModule,
|
||||||
BtnModalDismissPageModule,
|
BtnModalDismissPageModule,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<ion-icon src="assets/icon/icons-user.svg"></ion-icon>
|
<ion-icon src="assets/icon/icons-user.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-bottom-contacts">
|
<div class="header-bottom-contacts">
|
||||||
<ion-label *ngFor="let member of members" >
|
<ion-label class="contacts-list" *ngFor="let member of members" >
|
||||||
{{member.name}},
|
{{member.name}},
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,16 +50,27 @@
|
|||||||
<div *ngIf="msg.attachments" class="message-attachments">
|
<div *ngIf="msg.attachments" class="message-attachments">
|
||||||
<div *ngFor="let file of msg.attachments">
|
<div *ngFor="let file of msg.attachments">
|
||||||
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
||||||
<div *ngIf="file.thumb_url">
|
<div>
|
||||||
<div class="file d-flex">
|
<div>
|
||||||
<ion-thumbnail slot="start">
|
<div class="file">
|
||||||
<img src="{{file.thumb_url}}" alt="image">
|
<!-- <canvas id="pdf_canvas"></canvas> -->
|
||||||
</ion-thumbnail>
|
<ion-label class="file-details" *ngIf="msg.file">
|
||||||
<ion-label class="file-details">
|
<span (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">
|
||||||
<h3 (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">{{file.title}}</h3>
|
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||||
<p *ngIf="file.text">{{file.text}}</p>
|
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
||||||
|
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
||||||
|
{{file.title}}
|
||||||
|
</span>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="file-details-optional">
|
||||||
|
<ion-label *ngIf="msg.file">
|
||||||
|
<span *ngIf="file.description">{{file.description}}</span>
|
||||||
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -88,6 +99,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||||
|
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||||
|
<ion-icon name="chevron-down"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
</ion-fab>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
.header-bottom-contacts{
|
.header-bottom-contacts{
|
||||||
width: 275px;
|
width: calc(100% - 40px);
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
color: #797979;
|
color: #797979;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -55,6 +55,12 @@
|
|||||||
float: left;
|
float: left;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin: 1px;
|
margin: 1px;
|
||||||
|
|
||||||
|
.contacts-list{
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden !important;
|
||||||
|
text-overflow: ellipsis !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import { FileLoaderService } from 'src/app/services/file/file-loader.service';
|
|||||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||||
import { FileService } from 'src/app/services/functions/file.service';
|
import { FileService } from 'src/app/services/functions/file.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { NewEventPage } from '../../agenda/new-event/new-event.page';
|
||||||
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
@@ -45,6 +48,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
capturedImage:any;
|
capturedImage:any;
|
||||||
capturedImageTitle:any;
|
capturedImageTitle:any;
|
||||||
|
attendees: EventPerson[] = [];
|
||||||
|
scrollToBottomBtn = false;
|
||||||
|
|
||||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||||
|
|
||||||
@@ -102,14 +107,21 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
onContentScrolled(e) {
|
onContentScrolled(e) {
|
||||||
this.startPosition = e.srcElement.scrollTop;
|
this.startPosition = e.srcElement.scrollTop;
|
||||||
let scroll = e.srcElement.scrollTop;
|
let scroll = e.srcElement.scrollTop;
|
||||||
|
let windowHeight = e.srcElement.scrollHeight;
|
||||||
|
let containerHeight = windowHeight - e.srcElement.clientHeight;
|
||||||
|
|
||||||
if (scroll > this.currentPosition) {
|
if (scroll > this.currentPosition) {
|
||||||
//this.showButton = false;
|
|
||||||
//alert('BOTTOM');
|
//alert('BOTTOM');
|
||||||
} else {
|
} else {
|
||||||
//this.showButton = true;
|
|
||||||
//alert('UP');
|
//alert('UP');
|
||||||
this.scrollingOnce = false;
|
this.scrollingOnce = false;
|
||||||
}
|
}
|
||||||
|
if((containerHeight - 100) > scroll){
|
||||||
|
this.scrollToBottomBtn = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.scrollToBottomBtn = false;
|
||||||
|
}
|
||||||
this.currentPosition = scroll;
|
this.currentPosition = scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +138,12 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
} catch(err) { }
|
} catch(err) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scrollToBottomClicked(): void {
|
||||||
|
try {
|
||||||
|
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||||
|
} catch(err) { }
|
||||||
|
}
|
||||||
|
|
||||||
getRoomInfo(){
|
getRoomInfo(){
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
||||||
@@ -320,6 +338,34 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.fileService.viewDocumentByUrl(url);
|
this.fileService.viewDocumentByUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async bookMeeting() {
|
||||||
|
this.attendees = this.members.map((val)=>{
|
||||||
|
return {
|
||||||
|
Name: val.name,
|
||||||
|
EmailAddress: val.username+"@"+environment.domain,
|
||||||
|
IsRequired: "true",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(this.attendees);
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
if( window.innerWidth <= 1024){
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: NewEventPage,
|
||||||
|
componentProps:{
|
||||||
|
attendees: this.attendees,
|
||||||
|
},
|
||||||
|
cssClass: 'modal modal-desktop',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then((data) => {
|
||||||
|
if(data){
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async openChatOptions(ev?: any) {
|
async openChatOptions(ev?: any) {
|
||||||
console.log(this.members);
|
console.log(this.members);
|
||||||
|
|
||||||
@@ -336,34 +382,28 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
await popover.present();
|
await popover.present();
|
||||||
await popover.onDidDismiss().then((res)=>{
|
await popover.onDidDismiss().then((res)=>{
|
||||||
if(res['data'] == "loadPicture"){
|
console.log(res['data']);
|
||||||
this.loadPicture();
|
if(res['data'] == 'meeting'){
|
||||||
|
this.bookMeeting();
|
||||||
}
|
}
|
||||||
else if(res['data'] == "takePicture"){
|
else if(res['data'] == 'take-picture'){
|
||||||
let data = this.fileService.takePicture();
|
this.fileService.addCameraPictureToChat(this.roomId);
|
||||||
if(data.name != null){
|
//this.loadPicture();
|
||||||
let body = {
|
|
||||||
"message":
|
|
||||||
{
|
|
||||||
"rid": this.roomId,
|
|
||||||
"msg": "",
|
|
||||||
"attachments": [{
|
|
||||||
"title": data.name,
|
|
||||||
"title_link_download": false,
|
|
||||||
"image_url": data.image,
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
|
else if(res['data'] == 'add-picture'){
|
||||||
|
this.fileService.addPictureToChat(this.roomId);
|
||||||
|
//this.loadPicture();
|
||||||
}
|
}
|
||||||
this.chatService.sendMessage(body).subscribe(res=> {
|
else if(res['data'] == 'add-document'){
|
||||||
console.log(res);
|
this.fileService.addDocumentToChat(this.roomId);
|
||||||
},(error) => {
|
//this.loadDocument();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'documentoGestaoDocumental'){
|
||||||
|
|
||||||
});
|
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
|
||||||
}
|
//this.addDocGestaoDocumental();
|
||||||
else{
|
|
||||||
this.toastService.badRequest("Não foi possível adicionar a fotografia!");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
this.loadGroupMessages(this.roomId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -400,7 +440,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then((res)=>{
|
modal.onDidDismiss().then((res)=>{
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
this.modalController.dismiss(res.data);
|
this.getRoomInfo();
|
||||||
|
//this.modalController.dismiss(res.data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { MessagesPageRoutingModule } from './messages-routing.module';
|
|||||||
import { MessagesPage } from './messages.page';
|
import { MessagesPage } from './messages.page';
|
||||||
import { SharedModule } from 'src/app/shared/shared.module';
|
import { SharedModule } from 'src/app/shared/shared.module';
|
||||||
import { BtnModalDismissPage } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.page';
|
import { BtnModalDismissPage } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.page';
|
||||||
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
@@ -16,7 +17,7 @@ import { BtnModalDismissPage } from 'src/app/shared/btn-modal-dismiss/btn-modal-
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
IonicModule,
|
IonicModule,
|
||||||
|
FontAwesomeModule,
|
||||||
MessagesPageRoutingModule
|
MessagesPageRoutingModule
|
||||||
],
|
],
|
||||||
declarations: [MessagesPage]
|
declarations: [MessagesPage]
|
||||||
|
|||||||
@@ -43,10 +43,42 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ion-label>{{msg.msg}}</ion-label>
|
<ion-label>{{msg.msg}}</ion-label>
|
||||||
|
<div *ngIf="msg.attachments" class="message-attachments">
|
||||||
|
<div *ngFor="let file of msg.attachments">
|
||||||
|
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<div class="file">
|
||||||
|
<!-- <canvas id="pdf_canvas"></canvas> -->
|
||||||
|
<ion-label class="file-details" *ngIf="msg.file">
|
||||||
|
<span (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">
|
||||||
|
<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>
|
||||||
|
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
||||||
|
{{file.title}}
|
||||||
|
</span>
|
||||||
|
</ion-label>
|
||||||
|
</div>
|
||||||
|
<div class="file-details-optional">
|
||||||
|
<ion-label *ngIf="msg.file">
|
||||||
|
<span *ngIf="file.description">{{file.description}}</span>
|
||||||
|
<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() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||||
|
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||||
|
<ion-icon name="chevron-down"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
</ion-fab>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,20 @@ import { AfterViewChecked, AfterViewInit, Component, ElementRef, OnDestroy, OnIn
|
|||||||
import {ActivatedRoute, Router} from '@angular/router'
|
import {ActivatedRoute, Router} from '@angular/router'
|
||||||
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||||
import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page';
|
import { ContactsPage } from 'src/app/pages/chat/messages/contacts/contacts.page';
|
||||||
import { AlertService } from 'src/app/services/alert.service';
|
import { AlertService } from 'src/app/services/alert.service';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
import { ChatService } from 'src/app/services/chat.service';
|
import { ChatService } from 'src/app/services/chat.service';
|
||||||
|
import { FileService } from 'src/app/services/functions/file.service';
|
||||||
import { synchro } from 'src/app/services/socket/synchro.service';
|
import { synchro } from 'src/app/services/socket/synchro.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { NewEventPage } from 'src/app/shared/agenda/new-event/new-event.page';
|
||||||
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
|
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
|
||||||
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
|
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
|
||||||
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
||||||
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-messages',
|
selector: 'app-messages',
|
||||||
@@ -41,6 +45,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private scrollChangeCallback: () => void;
|
private scrollChangeCallback: () => void;
|
||||||
currentPosition: any;
|
currentPosition: any;
|
||||||
startPosition: number;
|
startPosition: number;
|
||||||
|
scrollToBottomBtn = false;
|
||||||
|
attendees: EventPerson[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public popoverController: PopoverController,
|
public popoverController: PopoverController,
|
||||||
@@ -52,6 +58,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private route: Router,
|
private route: Router,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private fileService: FileService,
|
||||||
) {
|
) {
|
||||||
/* this.activatedRoute.paramMap.subscribe(params => {
|
/* this.activatedRoute.paramMap.subscribe(params => {
|
||||||
if(params["params"].SerialNumber) {
|
if(params["params"].SerialNumber) {
|
||||||
@@ -116,6 +123,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
} catch(err) { }
|
} catch(err) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scrollToBottomClicked(): void {
|
||||||
|
try {
|
||||||
|
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||||
|
} catch(err) { }
|
||||||
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
||||||
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
||||||
@@ -124,15 +137,23 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
onContentScrolled(e) {
|
onContentScrolled(e) {
|
||||||
this.startPosition = e.srcElement.scrollTop;
|
this.startPosition = e.srcElement.scrollTop;
|
||||||
let scroll = e.srcElement.scrollTop;
|
let scroll = e.srcElement.scrollTop;
|
||||||
|
let windowHeight = e.srcElement.scrollHeight;
|
||||||
|
let containerHeight = windowHeight - e.srcElement.clientHeight;
|
||||||
|
|
||||||
if (scroll > this.currentPosition) {
|
if (scroll > this.currentPosition) {
|
||||||
//this.showButton = false;
|
|
||||||
//alert('BOTTOM');
|
//alert('BOTTOM');
|
||||||
} else {
|
} else {
|
||||||
//this.showButton = true;
|
|
||||||
//alert('UP');
|
//alert('UP');
|
||||||
this.scrollingOnce = false;
|
this.scrollingOnce = false;
|
||||||
}
|
}
|
||||||
|
if((containerHeight - 100) > scroll){
|
||||||
|
this.scrollToBottomBtn = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.scrollToBottomBtn = false;
|
||||||
|
}
|
||||||
this.currentPosition = scroll;
|
this.currentPosition = scroll;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
@@ -157,7 +178,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
loadMessages() {
|
loadMessages() {
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId;
|
||||||
|
|
||||||
this.chatService.getRoomMessages(this.roomId).subscribe(res => {
|
this.chatService.getRoomMessages(this.roomId).subscribe(res => {
|
||||||
/* console.log(res); */
|
/* console.log(res); */
|
||||||
@@ -167,6 +188,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewDocument(url:string){
|
||||||
|
this.fileService.viewDocumentByUrl(url);
|
||||||
|
}
|
||||||
|
|
||||||
getChatMembers() {
|
getChatMembers() {
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
this.chatService.getMembers(this.roomId).subscribe(res=> {
|
this.chatService.getMembers(this.roomId).subscribe(res=> {
|
||||||
@@ -241,6 +267,34 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
modal.onDidDismiss();
|
modal.onDidDismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async bookMeeting() {
|
||||||
|
this.attendees = this.members.map((val)=>{
|
||||||
|
return {
|
||||||
|
Name: val.name,
|
||||||
|
EmailAddress: val.username+"@"+environment.domain,
|
||||||
|
IsRequired: "true",
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(this.attendees);
|
||||||
|
this.popoverController.dismiss();
|
||||||
|
if( window.innerWidth <= 1024){
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: NewEventPage,
|
||||||
|
componentProps:{
|
||||||
|
attendees: this.attendees,
|
||||||
|
},
|
||||||
|
cssClass: 'modal modal-desktop',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then((data) => {
|
||||||
|
if(data){
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async openChatOptions(ev?: any) {
|
async openChatOptions(ev?: any) {
|
||||||
console.log(this.members);
|
console.log(this.members);
|
||||||
|
|
||||||
@@ -255,7 +309,32 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
},
|
},
|
||||||
translucent: true
|
translucent: true
|
||||||
});
|
});
|
||||||
return await popover.present();
|
await popover.present();
|
||||||
|
popover.onDidDismiss().then((res)=>{
|
||||||
|
console.log(res['data']);
|
||||||
|
if(res['data'] == 'meeting'){
|
||||||
|
this.bookMeeting();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'take-picture'){
|
||||||
|
this.fileService.addCameraPictureToChat(this.roomId);
|
||||||
|
//this.loadPicture();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'add-picture'){
|
||||||
|
this.fileService.addPictureToChat(this.roomId);
|
||||||
|
//this.loadPicture();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'add-document'){
|
||||||
|
this.fileService.addDocumentToChat(this.roomId);
|
||||||
|
//this.loadDocument();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'documentoGestaoDocumental'){
|
||||||
|
|
||||||
|
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
|
||||||
|
//this.addDocGestaoDocumental();
|
||||||
|
}
|
||||||
|
this.loadMessages();
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async serverLongPull() {
|
async serverLongPull() {
|
||||||
@@ -276,7 +355,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
// happens when the synchro was pending for too long
|
// happens when the synchro was pending for too long
|
||||||
// let's reconnect
|
// let's reconnect
|
||||||
await this.serverLongPull();
|
await this.serverLongPull();
|
||||||
} else if (res != 200) {
|
}
|
||||||
|
else if (res != 200) {
|
||||||
// Show Error
|
// Show Error
|
||||||
//showMessage(response.statusText);
|
//showMessage(response.statusText);
|
||||||
//this.loadMessages()
|
//this.loadMessages()
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ import { FileToBase64Service } from '../file/file-to-base64.service';
|
|||||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||||
//Cordova
|
//Cordova
|
||||||
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
|
||||||
|
import { ChatService } from '../chat.service';
|
||||||
|
import { ModalController } from '@ionic/angular';
|
||||||
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
|
import { SearchList } from 'src/app/models/search-document';
|
||||||
|
import { ProcessesService } from '../processes.service';
|
||||||
|
import { ToastService } from '../toast.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -12,12 +18,18 @@ export class FileService {
|
|||||||
|
|
||||||
capturedImage:any;
|
capturedImage:any;
|
||||||
capturedImageTitle:any;
|
capturedImageTitle:any;
|
||||||
|
documents:SearchList[] = [];
|
||||||
|
showLoader: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private camera: Camera,
|
private camera: Camera,
|
||||||
private fileLoaderService: FileLoaderService,
|
private fileLoaderService: FileLoaderService,
|
||||||
private fileToBase64Service: FileToBase64Service,
|
private fileToBase64Service: FileToBase64Service,
|
||||||
private iab: InAppBrowser,
|
private iab: InAppBrowser,
|
||||||
|
private chatService: ChatService,
|
||||||
|
private modalController: ModalController,
|
||||||
|
private processesService: ProcessesService,
|
||||||
|
private toastService: ToastService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
takePicture() {
|
takePicture() {
|
||||||
@@ -71,6 +83,174 @@ export class FileService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addCameraPictureToChat(roomId){
|
||||||
|
let data = this.takePicture();
|
||||||
|
if(data.name != null){
|
||||||
|
let body = {
|
||||||
|
"message":
|
||||||
|
{
|
||||||
|
"rid": roomId,
|
||||||
|
"msg": "",
|
||||||
|
"attachments": [{
|
||||||
|
"title": data.name,
|
||||||
|
"title_link_download": false,
|
||||||
|
"image_url": data.image,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
console.log(res);
|
||||||
|
},(error) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.toastService.badRequest("Não foi possível adicionar a fotografia!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addPictureToChat(roomId:string) {
|
||||||
|
const input = this.fileLoaderService.createInput({
|
||||||
|
accept: ['image/apng', 'image/jpeg', 'image/png']
|
||||||
|
})
|
||||||
|
|
||||||
|
input.onchange = async () => {
|
||||||
|
|
||||||
|
const file = this.fileLoaderService.getFirstFile(input)
|
||||||
|
|
||||||
|
console.log(file);
|
||||||
|
const loader = this.toastService.loading();
|
||||||
|
|
||||||
|
const imageData = await this.fileToBase64Service.convert(file)
|
||||||
|
this.capturedImage = imageData;
|
||||||
|
this.capturedImageTitle = file.name;
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"message":
|
||||||
|
{
|
||||||
|
"rid": roomId,
|
||||||
|
"msg": "",
|
||||||
|
"attachments": [{
|
||||||
|
//"title": this.capturedImageTitle ,
|
||||||
|
//"text": "description",
|
||||||
|
"title_link_download": false,
|
||||||
|
"image_url": this.capturedImage,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
loader.remove();
|
||||||
|
//console.log(res);
|
||||||
|
},(error) => {
|
||||||
|
loader.remove();
|
||||||
|
});
|
||||||
|
//console.log(this.capturedImage)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
addDocumentToChat(roomId:string) {
|
||||||
|
const input = this.fileLoaderService.createInput({
|
||||||
|
accept: ['.doc', '.docx', '.pdf']
|
||||||
|
})
|
||||||
|
|
||||||
|
input.onchange = async () => {
|
||||||
|
const loader = this.toastService.loading();
|
||||||
|
const file = this.fileLoaderService.getFirstFile(input)
|
||||||
|
|
||||||
|
console.log(file);
|
||||||
|
|
||||||
|
const imageData = await this.fileToBase64Service.convert(file)
|
||||||
|
this.capturedImage = imageData;
|
||||||
|
this.capturedImageTitle = file.name;
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"message":
|
||||||
|
{
|
||||||
|
"rid": roomId,
|
||||||
|
"msg": "",
|
||||||
|
"attachments": [{
|
||||||
|
"title": this.capturedImageTitle,
|
||||||
|
"text": "",
|
||||||
|
"title_link": this.capturedImage,
|
||||||
|
"title_link_download": true,
|
||||||
|
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
|
||||||
|
"message_link": this.capturedImage,
|
||||||
|
}],
|
||||||
|
"file":{
|
||||||
|
"name": this.capturedImageTitle,
|
||||||
|
"type": "application/pdf",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
loader.remove();
|
||||||
|
//console.log(res);
|
||||||
|
},(error) => {
|
||||||
|
loader.remove();
|
||||||
|
});
|
||||||
|
//console.log(this.capturedImage)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async addDocGestaoDocumentalToChat(roomId:string){
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: SearchPage,
|
||||||
|
cssClass: 'group-messages modal-desktop search-modal search-modal-to-desktop',
|
||||||
|
componentProps: {
|
||||||
|
type: 'AccoesPresidenciais & ArquivoDespachoElect',
|
||||||
|
select: true,
|
||||||
|
showSearchInput: true,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss().then(async res=>{
|
||||||
|
const data = res.data;
|
||||||
|
|
||||||
|
if(data.selected){
|
||||||
|
const loader = this.toastService.loading();
|
||||||
|
|
||||||
|
this.documents.push(data.selected);
|
||||||
|
console.log(res.data.selected);
|
||||||
|
console.log(res.data.selected.Id);
|
||||||
|
console.log(res.data.selected.ApplicationType);
|
||||||
|
|
||||||
|
let url = await this.processesService.GetDocumentUrl(res.data.selected.Id, res.data.selected.ApplicationType).toPromise();
|
||||||
|
let url_no_options: string = url.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||||
|
console.log(url_no_options);
|
||||||
|
console.log('Oie');
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"message":
|
||||||
|
{
|
||||||
|
"rid": roomId,
|
||||||
|
"msg": "",
|
||||||
|
"attachments": [{
|
||||||
|
"title": res.data.selected.Assunto,
|
||||||
|
"description": res.data.selected.DocTypeDesc,
|
||||||
|
"title_link": url_no_options,
|
||||||
|
"title_link_download": true,
|
||||||
|
//"thumb_url": "assets/images/webtrix-logo.png",
|
||||||
|
"message_link": url_no_options,
|
||||||
|
}],
|
||||||
|
"file":{
|
||||||
|
"name": res.data.selected.Assunto,
|
||||||
|
"type": "application/webtrix"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
loader.remove();
|
||||||
|
console.log(res);
|
||||||
|
},(error) => {
|
||||||
|
loader.remove();
|
||||||
|
});
|
||||||
|
loader.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
viewDocumentByUrl(url) {
|
viewDocumentByUrl(url) {
|
||||||
const browser = this.iab.create(url,"_blank");
|
const browser = this.iab.create(url,"_blank");
|
||||||
browser.show();
|
browser.show();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
@@ -12,18 +12,21 @@ import { SharedModule } from 'src/app/shared/shared.module';
|
|||||||
import { ChatPopoverPageModule } from '../../popover/chat-popover/chat-popover.module';
|
import { ChatPopoverPageModule } from '../../popover/chat-popover/chat-popover.module';
|
||||||
import { NewEventPageModule } from '../../agenda/new-event/new-event.module';
|
import { NewEventPageModule } from '../../agenda/new-event/new-event.module';
|
||||||
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
import { PdfViewerModule } from 'ng2-pdf-viewer';
|
||||||
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
IonicModule,
|
IonicModule,
|
||||||
|
FontAwesomeModule,
|
||||||
|
PdfViewerModule,
|
||||||
ChatPopoverPageModule,
|
ChatPopoverPageModule,
|
||||||
GroupMessagesPageRoutingModule,
|
GroupMessagesPageRoutingModule,
|
||||||
//
|
//
|
||||||
PdfViewerModule
|
|
||||||
],
|
],
|
||||||
exports: [GroupMessagesPage],
|
exports: [GroupMessagesPage],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
declarations: [GroupMessagesPage]
|
declarations: [GroupMessagesPage]
|
||||||
})
|
})
|
||||||
export class GroupMessagesPageModule {}
|
export class GroupMessagesPageModule {}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<ion-icon src="assets/icon/icons-user.svg"></ion-icon>
|
<ion-icon src="assets/icon/icons-user.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-bottom-contacts">
|
<div class="header-bottom-contacts">
|
||||||
<ion-label *ngFor="let member of members" >
|
<ion-label class="contacts-list" *ngFor="let member of members" >
|
||||||
{{member.name}},
|
{{member.name}},
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
@@ -25,7 +25,6 @@
|
|||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
@@ -38,6 +37,7 @@
|
|||||||
<ion-label> Esta conversa passou a grupo</ion-label><br />
|
<ion-label> Esta conversa passou a grupo</ion-label><br />
|
||||||
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-width-100" *ngFor="let msg of messages; let last = last" #scrollMe>
|
<div class="container-width-100" *ngFor="let msg of messages; let last = last" #scrollMe>
|
||||||
<div *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
<div *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru'" class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
@@ -49,16 +49,27 @@
|
|||||||
<div *ngIf="msg.attachments" class="message-attachments">
|
<div *ngIf="msg.attachments" class="message-attachments">
|
||||||
<div *ngFor="let file of msg.attachments">
|
<div *ngFor="let file of msg.attachments">
|
||||||
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
||||||
<div *ngIf="file.thumb_url">
|
<div>
|
||||||
<div class="file d-flex">
|
<div>
|
||||||
<ion-thumbnail slot="start">
|
<div class="file">
|
||||||
<img src="{{file.thumb_url}}" alt="image">
|
<!-- <canvas id="pdf_canvas"></canvas> -->
|
||||||
</ion-thumbnail>
|
<ion-label class="file-details" *ngIf="msg.file">
|
||||||
<ion-label class="file-details">
|
<span (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">
|
||||||
<h3 (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">{{file.title}}</h3>
|
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||||
<p *ngIf="file.text">{{file.text}}</p>
|
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
||||||
|
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
||||||
|
{{file.title}}
|
||||||
|
</span>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="file-details-optional">
|
||||||
|
<ion-label *ngIf="msg.file">
|
||||||
|
<span *ngIf="file.description">{{file.description}}</span>
|
||||||
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,6 +98,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||||
|
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||||
|
<ion-icon name="chevron-down"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
<!-- <ion-fab-list side="start">
|
||||||
|
<ion-fab-button color="light">
|
||||||
|
<ion-icon name="chevron-down"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
<ion-fab-button color="light">
|
||||||
|
<ion-icon name="logo-twitter"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
<ion-fab-button color="light">
|
||||||
|
<ion-icon name="logo-vimeo"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
</ion-fab-list> -->
|
||||||
|
</ion-fab>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
@import '~src/function.scss';
|
@import '~src/function.scss';
|
||||||
|
div{
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
.header-toolbar{
|
.header-toolbar{
|
||||||
--background:transparent;
|
--background:transparent;
|
||||||
--opacity: 1;
|
--opacity: 1;
|
||||||
@@ -31,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.header-bottom{
|
.header-bottom{
|
||||||
width: 95%;
|
width: 98%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.header-bottom-icon{
|
.header-bottom-icon{
|
||||||
@@ -42,6 +45,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
.header-bottom-contacts{
|
.header-bottom-contacts{
|
||||||
|
width: calc(100% - 40px);
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
color: #797979;
|
color: #797979;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -50,6 +54,12 @@
|
|||||||
float: left;
|
float: left;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin: 1px;
|
margin: 1px;
|
||||||
|
|
||||||
|
.contacts-list{
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden !important;
|
||||||
|
text-overflow: ellipsis !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,15 @@ import { SearchList } from 'src/app/models/search-document';
|
|||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
import { FileService } from 'src/app/services/functions/file.service';
|
import { FileService } from 'src/app/services/functions/file.service';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
import * as pdfjsLib from 'pdfjs-dist';
|
||||||
|
if( pdfjsLib !== undefined ){
|
||||||
|
console.log( "set worker...");
|
||||||
|
pdfjsLib.GlobalWorkerOptions.workerSrc = "https://npmcdn.com/pdfjs-dist@2.4.456/build/pdf.worker.js";
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-group-messages',
|
selector: 'app-group-messages',
|
||||||
templateUrl: './group-messages.page.html',
|
templateUrl: './group-messages.page.html',
|
||||||
@@ -45,6 +54,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
private scrollChangeCallback: () => void;
|
private scrollChangeCallback: () => void;
|
||||||
currentPosition: any;
|
currentPosition: any;
|
||||||
startPosition: number;
|
startPosition: number;
|
||||||
|
scrollToBottomBtn = false;
|
||||||
|
|
||||||
@Input() roomId:string;
|
@Input() roomId:string;
|
||||||
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
|
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
|
||||||
@@ -56,6 +66,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
|
|
||||||
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
|
||||||
|
|
||||||
|
pdfurl = "http://www.africau.edu/images/default/sample.pdf";
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private menu: MenuController,
|
private menu: MenuController,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
@@ -74,6 +86,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
) {
|
) {
|
||||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||||
this.isGroupCreated = true;
|
this.isGroupCreated = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
//this.getRoomInfo();
|
//this.getRoomInfo();
|
||||||
@@ -87,15 +100,54 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
console.log(this.roomId);
|
console.log(this.roomId);
|
||||||
this.setStatus('online');
|
this.setStatus('online');
|
||||||
this.getChatMembers();
|
this.getChatMembers();
|
||||||
|
|
||||||
|
/* pdfjs.Lib.getDocument('sample.pdf').promise.then((doc)=>{
|
||||||
|
console.log(doc);
|
||||||
|
|
||||||
|
}) */
|
||||||
|
//this.loadPDF();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* loadPDF() {
|
||||||
|
const loadingTask = pdfjsLib.getDocument( this.pdfurl );
|
||||||
|
loadingTask.promise.then((pdf) => {
|
||||||
|
console.log( "pdf: ", pdf );
|
||||||
|
console.log('PDF loaded');
|
||||||
|
|
||||||
|
// Fetch the first page
|
||||||
|
var pageNumber = 1;
|
||||||
|
pdf.getPage(pageNumber).then(function(page) {
|
||||||
|
console.log('Page loaded');
|
||||||
|
|
||||||
|
var scale = 1.5;
|
||||||
|
var viewport = page.getViewport({scale: scale});
|
||||||
|
|
||||||
|
// Prepare canvas using PDF page dimensions
|
||||||
|
var canvas: any = document.getElementById('pdf_canvas');
|
||||||
|
var context = canvas.getContext('2d');
|
||||||
|
canvas.height = viewport.height;
|
||||||
|
canvas.width = viewport.width;
|
||||||
|
|
||||||
|
// Render PDF page into canvas context
|
||||||
|
var renderContext = {
|
||||||
|
canvasContext: context,
|
||||||
|
viewport: viewport
|
||||||
|
};
|
||||||
|
var renderTask = page.render(renderContext);
|
||||||
|
renderTask.promise.then(function () {
|
||||||
|
console.log('Page rendered');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} */
|
||||||
|
|
||||||
setStatus(status:string){
|
setStatus(status:string){
|
||||||
let body = {
|
let body = {
|
||||||
message: '',
|
message: '',
|
||||||
status: status,
|
status: status,
|
||||||
}
|
}
|
||||||
this.chatService.setUserStatus(body).subscribe(res => {
|
this.chatService.setUserStatus(body).subscribe(res => {
|
||||||
console.log(res);
|
//console.log(res);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +159,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
} catch(err) { }
|
} catch(err) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scrollToBottomClicked(): void {
|
||||||
|
try {
|
||||||
|
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||||
|
} catch(err) { }
|
||||||
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
||||||
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
||||||
@@ -115,12 +173,21 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
onContentScrolled(e) {
|
onContentScrolled(e) {
|
||||||
this.startPosition = e.srcElement.scrollTop;
|
this.startPosition = e.srcElement.scrollTop;
|
||||||
let scroll = e.srcElement.scrollTop;
|
let scroll = e.srcElement.scrollTop;
|
||||||
|
let windowHeight = e.srcElement.scrollHeight;
|
||||||
|
let containerHeight = windowHeight - e.srcElement.clientHeight;
|
||||||
|
|
||||||
if (scroll > this.currentPosition) {
|
if (scroll > this.currentPosition) {
|
||||||
//this.showButton = false;
|
//alert('BOTTOM');
|
||||||
} else {
|
} else {
|
||||||
//this.showButton = true;
|
//alert('UP');
|
||||||
this.scrollingOnce = false;
|
this.scrollingOnce = false;
|
||||||
}
|
}
|
||||||
|
if((containerHeight - 100) > scroll){
|
||||||
|
this.scrollToBottomBtn = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.scrollToBottomBtn = false;
|
||||||
|
}
|
||||||
this.currentPosition = scroll;
|
this.currentPosition = scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,10 +199,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
async getChatMembers(){
|
async getChatMembers(){
|
||||||
//return await this.chatService.getMembers(roomId).toPromise();
|
//return await this.chatService.getMembers(roomId).toPromise();
|
||||||
this.chatService.getAllUsers().subscribe(res=> {
|
this.chatService.getAllUsers().subscribe(res=> {
|
||||||
console.log(res);
|
//console.log(res);
|
||||||
|
|
||||||
this.allUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
|
this.allUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
|
||||||
console.log(this.allUsers);
|
//console.log(this.allUsers);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +254,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
//If group is private call getGroupMembers
|
//If group is private call getGroupMembers
|
||||||
if(room.t === 'p'){
|
if(room.t === 'p'){
|
||||||
this.chatService.getGroupMembers(this.roomId).subscribe(res=>{
|
this.chatService.getGroupMembers(this.roomId).subscribe(res=>{
|
||||||
console.log(res);
|
//console.log(res);
|
||||||
this.members = res['members'];
|
this.members = res['members'];
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
});
|
});
|
||||||
@@ -214,7 +281,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
console.log(res);
|
console.log(res);
|
||||||
let msgOnly = res['messages'].filter(data => data.t != 'au');
|
let msgOnly = res['messages'].filter(data => data.t != 'au');
|
||||||
this.messages = msgOnly.reverse();
|
this.messages = msgOnly.reverse();
|
||||||
console.log(res);
|
//console.log(res);
|
||||||
|
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
});
|
});
|
||||||
@@ -438,6 +505,49 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loadDocument() {
|
||||||
|
const input = this.fileLoaderService.createInput({
|
||||||
|
accept: ['.doc', '.docx', '.pdf']
|
||||||
|
})
|
||||||
|
|
||||||
|
input.onchange = async () => {
|
||||||
|
const file = this.fileLoaderService.getFirstFile(input)
|
||||||
|
|
||||||
|
console.log(file);
|
||||||
|
|
||||||
|
const imageData = await this.fileToBase64Service.convert(file)
|
||||||
|
this.capturedImage = imageData;
|
||||||
|
this.capturedImageTitle = file.name;
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"message":
|
||||||
|
{
|
||||||
|
"rid": this.roomId,
|
||||||
|
"msg": "",
|
||||||
|
"attachments": [{
|
||||||
|
"title": this.capturedImageTitle,
|
||||||
|
"text": "",
|
||||||
|
"title_link": this.capturedImage,
|
||||||
|
"title_link_download": true,
|
||||||
|
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
|
||||||
|
"message_link": this.capturedImage,
|
||||||
|
}],
|
||||||
|
"file":{
|
||||||
|
"name": this.capturedImageTitle,
|
||||||
|
"type": "application/pdf",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chatService.sendMessage(body).subscribe(res=> {
|
||||||
|
//console.log(res);
|
||||||
|
},(error) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
//console.log(this.capturedImage)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
async addDocGestaoDocumental(){
|
async addDocGestaoDocumental(){
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: SearchPage,
|
component: SearchPage,
|
||||||
@@ -529,7 +639,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
modal.onDidDismiss().then((res)=>{
|
modal.onDidDismiss().then((res)=>{
|
||||||
console.log(res['data']);
|
//console.log(res['data']);
|
||||||
if(res['data'] == 'meeting'){
|
if(res['data'] == 'meeting'){
|
||||||
//this.closeAllDesktopComponents.emit();
|
//this.closeAllDesktopComponents.emit();
|
||||||
let data = {
|
let data = {
|
||||||
@@ -538,25 +648,37 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
}
|
}
|
||||||
this.openNewEventPage.emit(data);
|
this.openNewEventPage.emit(data);
|
||||||
}
|
}
|
||||||
else if(res['data'] == 'picture'){
|
else if(res['data'] == 'take-picture'){
|
||||||
this.loadPicture();
|
this.fileService.addCameraPictureToChat(this.roomId);
|
||||||
|
//this.loadPicture();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'add-picture'){
|
||||||
|
this.fileService.addPictureToChat(this.roomId);
|
||||||
|
//this.loadPicture();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'add-document'){
|
||||||
|
this.loadDocument();
|
||||||
}
|
}
|
||||||
else if(res['data'] == 'documentoGestaoDocumental'){
|
else if(res['data'] == 'documentoGestaoDocumental'){
|
||||||
this.addDocGestaoDocumental();
|
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
|
||||||
|
//this.addDocGestaoDocumental();
|
||||||
}
|
}
|
||||||
|
this.loadGroupMessages(this.roomId);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async serverLongPull(){
|
async serverLongPull(){
|
||||||
this.chatService.getPrivateGroupMessages(this.roomId).subscribe(async res => {
|
|
||||||
|
|
||||||
if (res == 502) {
|
if(this.route.url != "/home/chat" && document.querySelector('app-group-messages')){
|
||||||
// Connection timeout
|
console.log("Timer message stop")
|
||||||
// happens when the connection was pending for too long
|
}
|
||||||
// let's reconnect
|
else
|
||||||
await this.serverLongPull();
|
{
|
||||||
} else if (res != 200) {
|
|
||||||
|
this.chatService.getPrivateGroupMessages(this.roomId).subscribe(async res =>
|
||||||
|
{
|
||||||
|
if(res['success'] == true) {
|
||||||
// Show Error
|
// Show Error
|
||||||
//showMessage(response.statusText);
|
//showMessage(response.statusText);
|
||||||
//this.loadMessages()
|
//this.loadMessages()
|
||||||
@@ -564,28 +686,30 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
this.messages = msgOnly.reverse();
|
this.messages = msgOnly.reverse();
|
||||||
console.log(this.messages);
|
console.log(this.messages);
|
||||||
// Reconnect in one second
|
// Reconnect in one second
|
||||||
if(this.route.url != "/home/chat"){
|
|
||||||
console.log("Timer message stop")
|
|
||||||
} else {
|
|
||||||
if(document.querySelector('app-group-messages')){
|
if(document.querySelector('app-group-messages')){
|
||||||
await new Promise(resolve => setTimeout(resolve,3000));
|
await new Promise(resolve => setTimeout(resolve,5000));
|
||||||
await this.serverLongPull();
|
|
||||||
this.getGroups.emit();
|
this.getGroups.emit();
|
||||||
console.log('Timer message running')
|
console.log('Timer message running')
|
||||||
|
await this.serverLongPull();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
alert('HEY2')
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// Got message
|
// Got message
|
||||||
//let message = await response.text();
|
//let message = await response.text();
|
||||||
//this.loadMessages()
|
//this.loadMessages()
|
||||||
await this.serverLongPull();
|
await this.serverLongPull();
|
||||||
}
|
}
|
||||||
|
}, (error)=>{
|
||||||
|
console.log(error);
|
||||||
|
this.serverLongPull();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,14 @@ import { MessagesPageRoutingModule } from './messages-routing.module';
|
|||||||
|
|
||||||
import { MessagesPage } from './messages.page';
|
import { MessagesPage } from './messages.page';
|
||||||
import { SharedModule } from 'src/app/shared/shared.module';
|
import { SharedModule } from 'src/app/shared/shared.module';
|
||||||
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
IonicModule,
|
IonicModule,
|
||||||
|
FontAwesomeModule,
|
||||||
MessagesPageRoutingModule
|
MessagesPageRoutingModule
|
||||||
],
|
],
|
||||||
exports: [MessagesPage],
|
exports: [MessagesPage],
|
||||||
|
|||||||
@@ -31,19 +31,70 @@
|
|||||||
</ion-refresher-content>
|
</ion-refresher-content>
|
||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
<div class="messages" #scrollMe>
|
<div class="messages" #scrollMe>
|
||||||
<div class="container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last">
|
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of chatMessageStore.message[roomId]; let last = last">
|
||||||
<div class='incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45'>
|
||||||
|
<div class="message-item-options d-flex justify-content-end">
|
||||||
|
<fa-icon (click)="mesageItemDropdownOptions=true" icon="chevron-down" class="message-options-icon"></fa-icon>
|
||||||
|
<!-- <div class="mesage-item-dropdown-options" *ngIf="mesageItemDropdownOptions">
|
||||||
|
<ion-label>Apagar mensagem</ion-label>
|
||||||
|
</div> -->
|
||||||
|
<ion-select hidden class="message-options-icon" interface="popover">
|
||||||
|
<ion-select-option value="nes">Apagar mensagem</ion-select-option>
|
||||||
|
</ion-select>
|
||||||
|
|
||||||
|
</div>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<ion-label>{{msg.u.name}}</ion-label>
|
<ion-label>{{msg.u.name}}</ion-label>
|
||||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ion-label>{{msg.msg}}</ion-label>
|
<ion-label>{{msg.msg}}</ion-label>
|
||||||
|
<div *ngIf="msg.attachments" class="message-attachments">
|
||||||
|
<div *ngFor="let file of msg.attachments">
|
||||||
|
<img *ngIf="file.image_url" src="{{file.image_url}}" alt="image">
|
||||||
|
<div>
|
||||||
|
<div class="file">
|
||||||
|
<!-- <canvas id="pdf_canvas"></canvas> -->
|
||||||
|
<ion-label class="file-details" *ngIf="msg.file">
|
||||||
|
<span (click)="viewDocument(file.title_link)" class="file-title cursor-pointer">
|
||||||
|
<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>
|
||||||
|
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
||||||
|
{{file.title}}
|
||||||
|
</span>
|
||||||
|
</ion-label>
|
||||||
|
</div>
|
||||||
|
<div class="file-details-optional">
|
||||||
|
<ion-label *ngIf="msg.file">
|
||||||
|
<span *ngIf="file.description">{{file.description}}</span>
|
||||||
|
<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>
|
||||||
{{last ? scrollToBottom() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ion-fab horizontal="end" vertical="bottom" slot="fixed">
|
||||||
|
<ion-fab-button *ngIf="scrollToBottomBtn" (click)="scrollToBottomClicked()" color="light" size="small">
|
||||||
|
<ion-icon name="chevron-down"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
<!-- <ion-fab-list side="start">
|
||||||
|
<ion-fab-button color="light">
|
||||||
|
<ion-icon name="chevron-down"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
<ion-fab-button color="light">
|
||||||
|
<ion-icon name="logo-twitter"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
<ion-fab-button color="light">
|
||||||
|
<ion-icon name="logo-vimeo"></ion-icon>
|
||||||
|
</ion-fab-button>
|
||||||
|
</ion-fab-list> -->
|
||||||
|
</ion-fab>
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,28 @@
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.message{
|
||||||
|
.message-attachments{
|
||||||
|
.file{
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.file-details{
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.file-title{
|
||||||
|
color: #000;
|
||||||
|
text-decoration: underline;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden !important;
|
||||||
|
text-overflow: ellipsis !important;
|
||||||
|
}
|
||||||
|
.file-title:hover{
|
||||||
|
color: #0782c9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ion-footer{
|
ion-footer{
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/ch
|
|||||||
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
||||||
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
||||||
import { TimeService } from 'src/app/services/functions/time.service';
|
import { TimeService } from 'src/app/services/functions/time.service';
|
||||||
|
import { FileService } from 'src/app/services/functions/file.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-messages',
|
selector: 'app-messages',
|
||||||
@@ -49,6 +50,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
private scrollChangeCallback: () => void;
|
private scrollChangeCallback: () => void;
|
||||||
currentPosition: any;
|
currentPosition: any;
|
||||||
startPosition: number;
|
startPosition: number;
|
||||||
|
mesageItemDropdownOptions: boolean = false;
|
||||||
|
scrollToBottomBtn = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public popoverController: PopoverController,
|
public popoverController: PopoverController,
|
||||||
@@ -61,6 +64,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private route: Router,
|
private route: Router,
|
||||||
private timeService: TimeService,
|
private timeService: TimeService,
|
||||||
|
private fileService: FileService,
|
||||||
) {
|
) {
|
||||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||||
|
|
||||||
@@ -120,6 +124,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
} catch(err) { }
|
} catch(err) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scrollToBottomClicked(): void {
|
||||||
|
try {
|
||||||
|
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
|
||||||
|
//this.scrollingOnce = false;
|
||||||
|
} catch(err) { }
|
||||||
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
||||||
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
||||||
@@ -128,14 +139,21 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
onContentScrolled(e) {
|
onContentScrolled(e) {
|
||||||
this.startPosition = e.srcElement.scrollTop;
|
this.startPosition = e.srcElement.scrollTop;
|
||||||
let scroll = e.srcElement.scrollTop;
|
let scroll = e.srcElement.scrollTop;
|
||||||
|
let windowHeight = e.srcElement.scrollHeight;
|
||||||
|
let containerHeight = windowHeight - e.srcElement.clientHeight;
|
||||||
|
|
||||||
if (scroll > this.currentPosition) {
|
if (scroll > this.currentPosition) {
|
||||||
//this.showButton = false;
|
|
||||||
//alert('BOTTOM');
|
//alert('BOTTOM');
|
||||||
} else {
|
} else {
|
||||||
//this.showButton = true;
|
|
||||||
//alert('UP');
|
//alert('UP');
|
||||||
this.scrollingOnce = false;
|
this.scrollingOnce = false;
|
||||||
}
|
}
|
||||||
|
if((containerHeight - 100) > scroll){
|
||||||
|
this.scrollToBottomBtn = true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.scrollToBottomBtn = false;
|
||||||
|
}
|
||||||
this.currentPosition = scroll;
|
this.currentPosition = scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,6 +209,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
viewDocument(url:string){
|
||||||
|
this.fileService.viewDocumentByUrl(url);
|
||||||
|
}
|
||||||
|
|
||||||
getChatMembers() {
|
getChatMembers() {
|
||||||
console.log(this.roomId);
|
console.log(this.roomId);
|
||||||
|
|
||||||
@@ -350,31 +372,50 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
this.openNewEventPage.emit(data);
|
this.openNewEventPage.emit(data);
|
||||||
}
|
}
|
||||||
|
else if(res['data'] == 'take-picture'){
|
||||||
|
this.fileService.addCameraPictureToChat(this.roomId);
|
||||||
|
//this.loadPicture();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'add-picture'){
|
||||||
|
this.fileService.addPictureToChat(this.roomId);
|
||||||
|
//this.loadPicture();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'add-document'){
|
||||||
|
this.fileService.addDocumentToChat(this.roomId);
|
||||||
|
//this.loadDocument();
|
||||||
|
}
|
||||||
|
else if(res['data'] == 'documentoGestaoDocumental'){
|
||||||
|
|
||||||
|
this.fileService.addDocGestaoDocumentalToChat(this.roomId);
|
||||||
|
this.showLoader = false;
|
||||||
|
//this.addDocGestaoDocumental();
|
||||||
|
}
|
||||||
|
this.loadMessages();
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async serverLongPull() {
|
async serverLongPull() {
|
||||||
|
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId;
|
||||||
this.chatService.getRoomMessages(this.roomId).subscribe(async res => {
|
|
||||||
|
|
||||||
if (res == 502) {
|
this.chatService.getRoomMessages(this.roomId).subscribe(async res => {
|
||||||
// Connection timeout
|
console.log(res['success']);
|
||||||
// happens when the connection was pending for too long
|
|
||||||
// let's reconnect
|
|
||||||
await this.serverLongPull();
|
if (res['success'] == true) {
|
||||||
} else if (res != 200) {
|
|
||||||
// Show Error
|
// Show Error
|
||||||
//showMessage(response.statusText);
|
//showMessage(response.statusText);
|
||||||
//this.loadMessages()
|
//this.loadMessages()
|
||||||
this.messages = res['messages'].reverse();
|
this.messages = res['messages'].reverse();
|
||||||
this.chatMessageStore.add(roomId, this.messages)
|
this.chatMessageStore.add(roomId, this.messages)
|
||||||
|
|
||||||
console.log(this.messages);
|
console.log(this.messages);
|
||||||
// Reconnect in one second
|
// Reconnect in one second
|
||||||
if(this.route.url != "/home/chat"){
|
if(this.route.url != "/home/chat"){
|
||||||
console.log("Timer message stop")
|
console.log("Timer message stop")
|
||||||
} else {
|
}
|
||||||
|
else{
|
||||||
if(document.querySelector('app-messages')){
|
if(document.querySelector('app-messages')){
|
||||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||||
await this.serverLongPull();
|
await this.serverLongPull();
|
||||||
@@ -382,12 +423,16 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
console.log('Timer message running')
|
console.log('Timer message running')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} /* else {
|
||||||
// Got message
|
// Got message
|
||||||
//let message = await response.text();
|
//let message = await response.text();
|
||||||
//this.loadMessages()
|
//this.loadMessages()
|
||||||
await this.serverLongPull();
|
await this.serverLongPull();
|
||||||
}
|
} */
|
||||||
|
}, (error)=>{
|
||||||
|
console.log(error);
|
||||||
|
this.serverLongPull();
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
|
<button (click)="takePicture()" full class="btn-ok" shape="round" >Tirar Fotografia</button>
|
||||||
<button hidden (click)="notImplemented()" class="btn-ok" shape="round" >Digitalizar Documento</button>
|
<button hidden (click)="notImplemented()" class="btn-ok" shape="round" >Digitalizar Documento</button>
|
||||||
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
|
<button (click)="anexarFoto()" full class="btn-ok" shape="round" >Anexar Fotografia</button>
|
||||||
<button hidden (click)="getDoc()" class="btn-ok" shape="round" >Anexar Documento</button>
|
<button (click)="addDocGestaoDocumental()" class="btn-ok" shape="round" >Anexar Documento (G.D.)</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
<button (click)="bookMeeting()" class="btn-ok" shape="round" >Marcar reunião</button>
|
<button (click)="bookMeeting()" class="btn-ok" shape="round" >Novo Evento</button>
|
||||||
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -47,19 +47,28 @@ export class ChatOptionsPopoverPage implements OnInit {
|
|||||||
|
|
||||||
takePicture(){
|
takePicture(){
|
||||||
if( window.innerWidth < 701){
|
if( window.innerWidth < 701){
|
||||||
this.popoverController.dismiss('takePicture');
|
this.popoverController.dismiss('take-picture');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.modalController.dismiss('takePicture');
|
this.modalController.dismiss('take-picture');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
anexarFoto(){
|
anexarFoto(){
|
||||||
if( window.innerWidth < 701){
|
if( window.innerWidth < 701){
|
||||||
this.popoverController.dismiss('loadPicture');
|
this.popoverController.dismiss('add-picture');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.modalController.dismiss('loadPicture');
|
this.modalController.dismiss('add-picture');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addDocGestaoDocumental(){
|
||||||
|
if( window.innerWidth < 701){
|
||||||
|
this.popoverController.dismiss('documentoGestaoDocumental');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.modalController.dismiss('documentoGestaoDocumental');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,6 +106,7 @@ export class ChatOptionsPopoverPage implements OnInit {
|
|||||||
}
|
}
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
|
||||||
async getDoc(){
|
async getDoc(){
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: SearchPage,
|
component: SearchPage,
|
||||||
|
|||||||
@@ -111,8 +111,12 @@ export class ChatPopoverPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openChangeGroupName(){
|
async openChangeGroupName(){
|
||||||
|
if( window.innerWidth < 701){
|
||||||
this.popoverController.dismiss('edit');
|
this.popoverController.dismiss('edit');
|
||||||
|
}
|
||||||
|
else{
|
||||||
this.modalController.dismiss('edit');
|
this.modalController.dismiss('edit');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 7.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
@@ -1072,6 +1072,95 @@ ngx-mat-datetime-content{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.messages{
|
||||||
|
.messages-list-item-wrapper{
|
||||||
|
.message-item{
|
||||||
|
.message-item-options{
|
||||||
|
.message-options-icon{
|
||||||
|
display: none;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 0px;
|
||||||
|
position: absolute;
|
||||||
|
//background-color: red;
|
||||||
|
|
||||||
|
//box-shadow: rgba(0, 30, 0, 0.15) 1.95px 1.95px 2.6px;
|
||||||
|
}
|
||||||
|
.mesage-item-dropdown-options{
|
||||||
|
display: none;
|
||||||
|
margin-top: 15px;
|
||||||
|
position: absolute;
|
||||||
|
border: 1px solid red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title{
|
||||||
|
//border: 1px solid blue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.incoming-true:hover{
|
||||||
|
.message-options-icon{
|
||||||
|
display: block;
|
||||||
|
background-color: #ebebeb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.incoming-false:hover{
|
||||||
|
.message-options-icon{
|
||||||
|
display: block;
|
||||||
|
background-color: #e4f4fe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.message-attachments{
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #42b9fe13;
|
||||||
|
padding: 1px;
|
||||||
|
.file{
|
||||||
|
ion-thumbnail{
|
||||||
|
--size: 20px;
|
||||||
|
}
|
||||||
|
.file-details{
|
||||||
|
max-width: calc(100% - 20px);
|
||||||
|
padding-left: 5px;
|
||||||
|
|
||||||
|
.file-title:hover{
|
||||||
|
color: #0782c9;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
span{
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden !important;
|
||||||
|
text-overflow: ellipsis !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.file-details-optional{
|
||||||
|
font-size: xx-small;
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-icon{
|
||||||
|
color: #b2b2b2;
|
||||||
|
}
|
||||||
|
.set-active-item-font-to-white{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.pdf-icon{
|
||||||
|
color: #a40404;
|
||||||
|
}
|
||||||
|
.word-icon{
|
||||||
|
color: #295497;
|
||||||
|
}
|
||||||
|
.excel-icon{
|
||||||
|
color: #1f7244;
|
||||||
|
}
|
||||||
|
.powerpoint-icon{
|
||||||
|
color: #d24726;
|
||||||
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: 665px) {
|
@media only screen and (min-width: 665px) {
|
||||||
.loading-blocker {
|
.loading-blocker {
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript" src="node_modules/ibm-mfp-web-sdk/ibmmfpfanalytics.js"></script>
|
<script type="text/javascript" src="node_modules/ibm-mfp-web-sdk/ibmmfpfanalytics.js"></script>
|
||||||
<script type="text/javascript" src="node_modules/ibm-mfp-web-sdk/ibmmfpf.js"></script>
|
<script type="text/javascript" src="node_modules/ibm-mfp-web-sdk/ibmmfpf.js"></script>
|
||||||
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.9.359/pdf.min.js" integrity="sha512-U5C477Z8VvmbYAoV4HDq17tf4wG6HXPC6/KM9+0/wEXQQ13gmKY2Zb0Z2vu0VNUWch4GlJ+Tl/dfoLOH4i2msw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<!-- <script src="assets/js/index.js"></script> -->
|
<!-- <script src="assets/js/index.js"></script> -->
|
||||||
<script src="assets/js/wldirectudpate.js"></script>
|
<script src="assets/js/wldirectudpate.js"></script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user