mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -96,7 +96,7 @@ ion-content{
|
|||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
.item-title{
|
.item-title{
|
||||||
width: calc(100% - 80px);
|
width: calc(100% - 90px);
|
||||||
float: left;
|
float: left;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
color: var(--title-text-color);
|
color: var(--title-text-color);
|
||||||
@@ -105,7 +105,7 @@ ion-content{
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.item-date{
|
.item-date{
|
||||||
width: 80px;
|
width: 90px;
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #797979;
|
color: #797979;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import { environment } from 'src/environments/environment';
|
|||||||
import { NotificationsService } from 'src/app/services/notifications.service';
|
import { NotificationsService } from 'src/app/services/notifications.service';
|
||||||
import { TimeService } from 'src/app/services/functions/time.service';
|
import { TimeService } from 'src/app/services/functions/time.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { DataService } from 'src/app/services/data.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -115,7 +116,9 @@ export class ChatPage implements OnInit {
|
|||||||
private resolver: ComponentFactoryResolver,
|
private resolver: ComponentFactoryResolver,
|
||||||
private route: Router,
|
private route: Router,
|
||||||
private timeService: TimeService,
|
private timeService: TimeService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
|
private dataService:DataService,
|
||||||
|
private router: Router,
|
||||||
){
|
){
|
||||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
@@ -150,6 +153,21 @@ export class ChatPage implements OnInit {
|
|||||||
console.log(t);
|
console.log(t);
|
||||||
|
|
||||||
this.setStatus('away');
|
this.setStatus('away');
|
||||||
|
if(this.dataService.get("newGroup")){
|
||||||
|
this.openNewGroupPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
|
if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
|
||||||
|
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/chat')) {
|
||||||
|
alert('OIII')
|
||||||
|
} else {
|
||||||
|
if(this.dataService.get("newGroup")){
|
||||||
|
this.openNewGroupPage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(){
|
ngOnDestroy(){
|
||||||
@@ -397,7 +415,7 @@ hideRefreshButton(){
|
|||||||
//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, 1000));
|
||||||
await this.getDirectMessages();
|
await this.getDirectMessages();
|
||||||
//console.log('Timer contactos list running')
|
//console.log('Timer contactos list running')
|
||||||
}
|
}
|
||||||
@@ -453,7 +471,7 @@ hideRefreshButton(){
|
|||||||
else {
|
else {
|
||||||
//Check if modal is opened
|
//Check if modal is opened
|
||||||
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, 1000));
|
||||||
await this.getGroups();
|
await this.getGroups();
|
||||||
//console.log('Timer groups list running')
|
//console.log('Timer groups list running')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
this.scrollChangeCallback = () => this.onContentScrolled(event);
|
||||||
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
window.addEventListener('scroll', this.scrollChangeCallback, true);
|
||||||
|
this.roomCountDownDate = this.timeService.countDownDate(this.room.customFields.countDownDate, this.room._id);
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePress(id?:string){
|
handlePress(id?:string){
|
||||||
@@ -184,7 +185,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.room = room['room'];
|
this.room = room['room'];
|
||||||
this.roomName = this.room.name.split('-').join(' ');
|
this.roomName = this.room.name.split('-').join(' ');
|
||||||
if(this.room.customFields.countDownDate){
|
if(this.room.customFields.countDownDate){
|
||||||
this.roomCountDownDate = this.timeService.countDownDate(this.room.customFields.countDownDate, this.room._id);
|
this.roomCountDownDate = this.timeService.countDownDateTimer(this.room.customFields.countDownDate, this.room._id);
|
||||||
}
|
}
|
||||||
this.getGroupContacts(this.room);
|
this.getGroupContacts(this.room);
|
||||||
this.loadGroupMessages(this.room);
|
this.loadGroupMessages(this.room);
|
||||||
@@ -260,7 +261,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
return this.timeService.showDateDuration(start);
|
return this.timeService.showDateDuration(start);
|
||||||
}
|
}
|
||||||
countDownDate(date:any, roomId:string){
|
countDownDate(date:any, roomId:string){
|
||||||
return this.timeService.countDownDate(date, roomId);
|
this.roomCountDownDate = this.timeService.countDownDate(date, roomId);
|
||||||
|
return this.timeService.countDownDateTimer(date, roomId);
|
||||||
}
|
}
|
||||||
|
|
||||||
addZero(i) {
|
addZero(i) {
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="showDuration" class="container-div">
|
<div *ngIf="showDuration" class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2 width-100">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-duration.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-duration.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ ion-content{
|
|||||||
.middle{
|
.middle{
|
||||||
padding: 0!important;
|
padding: 0!important;
|
||||||
float: left;
|
float: left;
|
||||||
width: 221px;
|
width:fit-content;
|
||||||
margin: 2.5px 0 0 5px;
|
margin: 2.5px 0 0 5px;
|
||||||
}
|
}
|
||||||
.btn-criar{
|
.btn-criar{
|
||||||
@@ -115,7 +115,6 @@ ion-content{
|
|||||||
|
|
||||||
.item-container-no-border{
|
.item-container-no-border{
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 360px;
|
|
||||||
margin: 25px auto;
|
margin: 25px auto;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -133,8 +132,8 @@ ion-content{
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.ion-item-class-2{
|
.ion-item-class-2{
|
||||||
width: 360px;
|
|
||||||
margin: 0px auto;
|
margin: 0px auto;
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
.ion-icon-class{
|
.ion-icon-class{
|
||||||
width: 45px;
|
width: 45px;
|
||||||
@@ -145,7 +144,7 @@ ion-content{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ion-input-class{
|
.ion-input-class{
|
||||||
width: 315px;
|
width: calc(100% - 45px) !important;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
border: 1px solid #ebebeb;
|
border: 1px solid #ebebeb;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ export class NewGroupPage implements OnInit {
|
|||||||
|
|
||||||
createGroup(){
|
createGroup(){
|
||||||
let name = this.groupName.split(' ').join('-');
|
let name = this.groupName.split(' ').join('-');
|
||||||
|
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
||||||
let body = { "name":name, }
|
let body = { "name":name, }
|
||||||
this.chatService.addGroup(body).subscribe(res=>{
|
this.chatService.addGroup(body).subscribe(res=>{
|
||||||
console.log('group created');
|
console.log('group created');
|
||||||
|
|||||||
+1
@@ -104,6 +104,7 @@
|
|||||||
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
<button *ngIf="!p.userRole(['PR'])" (click)="attachDocument()" class="btn-cancel" shape="round" >Anexar Documentos</button>
|
||||||
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Descartar</button>
|
||||||
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
|
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" full class="btn-cancel" shape="round" >Enviar para pendentes</button>
|
||||||
|
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Inicair Conversa</button>
|
||||||
<div class="solid"></div>
|
<div class="solid"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+30
-1
@@ -30,6 +30,8 @@ import { ThemeService } from 'src/app/services/theme.service'
|
|||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { Platform } from '@ionic/angular';
|
import { Platform } from '@ionic/angular';
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
||||||
|
import { DataService } from 'src/app/services/data.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-expediente-detail',
|
selector: 'app-expediente-detail',
|
||||||
@@ -77,7 +79,8 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
public platform: Platform,
|
public platform: Platform,
|
||||||
private sqliteservice: SqliteService,
|
private sqliteservice: SqliteService,
|
||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
|
private dataService: DataService,
|
||||||
) {
|
) {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
if (params["params"].SerialNumber) {
|
if (params["params"].SerialNumber) {
|
||||||
@@ -612,4 +615,30 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
return await popover.present();
|
return await popover.present();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openNewGroupPage(){
|
||||||
|
this.router.navigate(['/home/chat']);
|
||||||
|
this.dataService.set("newGroup", true);
|
||||||
|
|
||||||
|
if( window.innerWidth < 801){
|
||||||
|
this.newGroup();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.dataService.set("newGroup", true);
|
||||||
|
/* this.closeAllDesktopComponents();
|
||||||
|
this.showNewGroup=true; */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async newGroup(){
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: NewGroupPage,
|
||||||
|
cssClass: 'modal modal-desktop',
|
||||||
|
componentProps: {
|
||||||
|
name: this.task.Folio,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export class TimeService {
|
|||||||
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
|
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
|
||||||
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
|
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
|
||||||
|
|
||||||
this.countDownTime = c_day + " : " + c_hours + " : " + c_minutes + " : " + c_seconds ;
|
this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
|
||||||
|
|
||||||
if(difference < 0){
|
if(difference < 0){
|
||||||
//clearInterval(timer);
|
//clearInterval(timer);
|
||||||
@@ -74,6 +74,39 @@ export class TimeService {
|
|||||||
return this.countDownTime;
|
return this.countDownTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
countDownDateTimer(date:any, roomId:string){
|
||||||
|
let timer = setInterval(() =>{
|
||||||
|
let difference = new Date(date).getTime() - new Date().getTime();
|
||||||
|
let c_day = Math.floor(difference/(1000*60*60*24));
|
||||||
|
let c_hours = Math.floor((difference % (1000*60*60*24)) / (1000*60*60));
|
||||||
|
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
|
||||||
|
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
|
||||||
|
|
||||||
|
this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
|
||||||
|
|
||||||
|
if(difference < 0){
|
||||||
|
clearInterval(timer);
|
||||||
|
this.countDownTime = "Expired";
|
||||||
|
let body = { "roomId":roomId, }
|
||||||
|
this.chatService.getRoomInfo(roomId).subscribe(room=>{
|
||||||
|
this.room = room['room'];
|
||||||
|
|
||||||
|
if(this.room.t === 'p'){
|
||||||
|
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||||
|
console.log(res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||||
|
console.log(res);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return this.countDownTime;
|
||||||
|
}
|
||||||
|
|
||||||
addZero(i) {
|
addZero(i) {
|
||||||
if (i < 10) {
|
if (i < 10) {
|
||||||
i = "0" + i;
|
i = "0" + i;
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
</ion-label>
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="roomCountDownDate" class="d-flex align-items-center yellow-orange pl-10">
|
<div *ngIf="room.customFields.countDownDate" class="d-flex align-items-center yellow-orange pl-10">
|
||||||
<i class="far fa-clock font-15" ></i>
|
<i class="far fa-clock font-15" ></i>
|
||||||
<ion-label class="font-15 pl-10" color="warning">{{roomCountDownDate}}</ion-label>
|
<ion-label class="font-15 pl-10" color="warning">{{countDownDate()}}</ion-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
currentPosition: any;
|
currentPosition: any;
|
||||||
startPosition: number;
|
startPosition: number;
|
||||||
scrollToBottomBtn = false;
|
scrollToBottomBtn = false;
|
||||||
roomCountDownDate:any;
|
roomCountDownDate:string;
|
||||||
|
roomCountDownTime:string;
|
||||||
|
|
||||||
@Input() roomId:string;
|
@Input() roomId:string;
|
||||||
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
|
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
|
||||||
@@ -89,6 +90,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
) {
|
) {
|
||||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||||
this.isGroupCreated = true;
|
this.isGroupCreated = true;
|
||||||
|
this.roomCountDownDate = "";
|
||||||
|
this.roomCountDownTime = "";
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
@@ -100,49 +103,18 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
this.loggedUser=this.loggedUserChat;
|
this.loggedUser=this.loggedUserChat;
|
||||||
this.getRoomInfo();
|
this.getRoomInfo();
|
||||||
this.serverLongPull();
|
this.serverLongPull();
|
||||||
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() {
|
showDateDuration(start:any){
|
||||||
const loadingTask = pdfjsLib.getDocument( this.pdfurl );
|
return this.timeService.showDateDuration(start);
|
||||||
loadingTask.promise.then((pdf) => {
|
}
|
||||||
console.log( "pdf: ", pdf );
|
|
||||||
console.log('PDF loaded');
|
|
||||||
|
|
||||||
// Fetch the first page
|
countDownDate(){
|
||||||
var pageNumber = 1;
|
//this.roomCountDownTime = this.timeService.countDownDateTimer(this.roomCountDownDate, this.room._id);
|
||||||
pdf.getPage(pageNumber).then(function(page) {
|
return this.timeService.countDownDateTimer(this.roomCountDownDate, this.roomId);
|
||||||
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 = {
|
||||||
@@ -235,30 +207,19 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
console.log('here watching');
|
console.log('here watching');
|
||||||
return this.roomId;
|
return this.roomId;
|
||||||
}
|
}
|
||||||
showDateDuration(start:any){
|
|
||||||
return this.timeService.showDateDuration(start);
|
|
||||||
}
|
|
||||||
|
|
||||||
countDownDate(date:any, roomId:string){
|
async getRoomInfo(){
|
||||||
return this.timeService.countDownDate(date, roomId);
|
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
|
||||||
}
|
this.room=room['room'];
|
||||||
|
|
||||||
getRoomInfo(){
|
|
||||||
this.showLoader = true;
|
|
||||||
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
|
|
||||||
console.log(room);
|
|
||||||
|
|
||||||
this.room = room['room'];
|
|
||||||
if(this.room.name){
|
if(this.room.name){
|
||||||
this.roomName = this.room.name.split('-').join(' ');
|
this.roomName = this.room.name.split('-').join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.room.customFields.countDownDate){
|
if(this.room.customFields.countDownDate){
|
||||||
this.roomCountDownDate = this.timeService.countDownDate(this.room.customFields.countDownDate, this.room._id);
|
this.roomCountDownDate = this.room.customFields.countDownDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getGroupContacts(this.room);
|
this.getGroupContacts(this.room);
|
||||||
//this.loadGroupMessages(this.room);
|
|
||||||
this.showLoader = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getGroupContacts(room:any){
|
getGroupContacts(room:any){
|
||||||
|
|||||||
Reference in New Issue
Block a user