resolve conflit

This commit is contained in:
Hirondino Van-Dunem
2022-12-15 18:04:49 +01:00
416 changed files with 37702 additions and 2316 deletions
@@ -6,7 +6,6 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="right-icons font-28" src="assets/images/icons-received-event.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov'" class="right-icons font-28" src="assets/images/theme/gov/icons-received-event.svg"></ion-icon>
<!-- <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="right-icons" src="assets/images/theme/gov/icons-received-event-selected.svg"></ion-icon> -->
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="right-icons font-28" src="assets/images/theme/tribunal/icons-received-event.svg"></ion-icon>
<div style="color: white;">
Evento Pendente de Aprovação
</div>
@@ -19,6 +18,7 @@
<div class="header-content width-100 d-flex justify-space-between">
<div (click)="close()" class="header-icon-left cursor-pointer">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-calendar-arrow-left.svg"></ion-icon>
</div>
<div class="header-title flex-grow-1 cursor-pointer">
@@ -92,7 +92,7 @@
<div *ngIf="loadedEvent.workflowInstanceDataFields.Body">
<h5>Detalhes</h5>
<ion-item lines="none" class="ion-no-margin ion-no-padding">
<p [innerHTML]="loadedEvent.workflowInstanceDataFields.Body"></p>
<p class="text" [innerHTML]="loadedEvent.workflowInstanceDataFields.Body"></p>
</ion-item>
<div class="line"></div>
</div>
@@ -51,7 +51,7 @@
.event-type-Oficial{
font-family: Roboto;
border-radius: 20px;
background: #ffb703;
background: var(--label-bg-color);
float: right !important;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
@@ -220,3 +220,8 @@
background: #d30606;
border-radius: 20px;
}
.text {
text-transform: initial !important
}
@@ -289,6 +289,7 @@
<div class="add-people cursor-pointer" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="start" src="assets/images/theme/gov/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
@@ -311,6 +312,7 @@
<div class="add-people cursor-pointer" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="start" src="assets/images/theme/gov/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
@@ -332,6 +334,7 @@
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-attach-doc.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-attach-doc.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-attach-doc.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Adicionar documentos</ion-label>
@@ -131,7 +131,6 @@ export class EditEventToApprovePage implements OnInit {
private processes:ProcessesService,
private toastService: ToastService,
public ThemeService: ThemeService,
private router: Router,
) {
this.isEventEdited = false;
}
@@ -281,6 +281,7 @@
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "src="assets/images/icons-attach-doc.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-attach-doc.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-attach-doc.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Adicionar documentos</ion-label>
@@ -11,10 +11,10 @@
<ion-toolbar>
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<ion-segment-button value="MDGPR">
Calendário do MDGPR
Meu Calendário
</ion-segment-button>
<ion-segment-button value="PR">
Presidente da República
Calendário Partilhado
</ion-segment-button>
</ion-segment>
</ion-toolbar>
@@ -48,7 +48,7 @@
}
.event-mdgpr-Oficial{
border-radius: 5px;
border-right: 5px solid #ffb703;
border-right: 5px solid var(--label-bg-color);
overflow: auto;
}
.event-mdgpr-Pessoal{
@@ -3,9 +3,9 @@ import { EventBody } from 'src/app/models/eventbody.model';
import { EventPerson } from 'src/app/models/eventperson.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { NavigationEnd, Router } from '@angular/router';
import { AuthService } from 'src/app/services/auth.service';
import { LoginUserRespose } from 'src/app/models/user.model';
import { SortService } from 'src/app/services/functions/sort.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-event-list',
@@ -34,10 +34,9 @@ export class EventListPage implements OnInit {
constructor(
private processes:ProcessesService,
private router: Router,
private userAuth: AuthService,
private sortService: SortService,
) {
this.loggeduser = userAuth.ValidatedUser;
this.loggeduser = SessionStore.user;
}
ngOnInit() {
@@ -248,6 +248,7 @@
<div class="add-people cursor-pointer" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="start" src="assets/images/theme/gov/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
@@ -272,6 +273,7 @@
<div class="add-people cursor-pointer" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="start" src="assets/images/theme/gov/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
@@ -295,6 +297,7 @@
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-attach-doc.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-attach-doc.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-attach-doc.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Adicionar documentos</ion-label>
@@ -12,7 +12,6 @@ import { EventAttachment } from 'src/app/models/attachment.model';
import { ToastService } from 'src/app/services/toast.service';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import {DateAdapter} from '@angular/material/core';
import * as _moment from 'moment';
@@ -26,6 +25,7 @@ import { FormGroup, Validators } from '@angular/forms';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { ThemeService } from 'src/app/services/theme.service'
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
import { SessionStore } from 'src/app/store/session.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -84,6 +84,7 @@ export class NewEventPage implements OnInit {
@Output() clearContact = new EventEmitter<any>();
@Output() GoBackEditOrAdd = new EventEmitter<any>();
@Output() cloneAllmobileComponent = new EventEmitter<any>();
@Output() backToChat = new EventEmitter<any>();
documents:SearchList[] = [];
@@ -123,15 +124,14 @@ export class NewEventPage implements OnInit {
public eventService: EventsService,
private attachmentsService: AttachmentsService,
private toastService: ToastService,
private userService: AuthService,
private dateAdapter: DateAdapter<any>,
public ThemeService: ThemeService,
private chatMethodService: ChatMethodsService,
// private translate: TranslateService
) {
this.dateAdapter.setLocale('pt');
this.loggeduser = userService.ValidatedUser;
this.postEvent = new Event();
this.loggeduser = SessionStore.user;
this.postEvent = new Event();
}
@@ -373,10 +373,10 @@ export class NewEventPage implements OnInit {
close() {
this.deleteTemporaryData();
this.cloneAllmobileComponent.emit({roomId:this.roomId});
this.clearContact.emit();
this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]);
this.backToChat.emit({roomId:this.roomId})
}
getRecurrenceTypes() {
@@ -6,6 +6,7 @@
<button class="btn-no-color" (click)="close()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-calendar-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="end" src='assets/images/theme/{{ThemeService.currentTheme}}/icons-calendar-arrow-left.svg'></ion-icon>
</button>
</div>
<div class="middle" (click)="openOptions()">
@@ -16,6 +17,7 @@
<button class="btn-no-color" (click)="editEvent()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="edit" slot="end" src="assets/images/icons-edit.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="edit" slot="end" src="assets/images/theme/gov/icons-edit.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="edit" slot="end" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-edit.svg" ></ion-icon>
</button>
<button class="btn-no-color" (click)="deleteEvent()">
<ion-icon class="delete" name="trash-sharp"></ion-icon>
@@ -80,7 +82,7 @@
<div *ngIf="loadedEvent.Body.Text">
<h5>Detalhes</h5>
<ion-item lines="none" class="ion-no-margin ion-no-padding">
<div [innerHTML]="loadedEvent.Body.Text"></div>
<div class="text"> {{ loadedEvent.Body.Text }} </div>
</ion-item>
<div class="line"></div>
</div>
@@ -112,7 +112,7 @@ ion-content{
.label{
width: fit-content;
border-radius: 20px;
background: #ffb703;
background: var(--label-bg-color);
float: right !important;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
@@ -209,4 +209,8 @@ ion-content{
width: 35px;
height: 41px;
align-items: center;
}
.text {
text-transform: initial !important
}
@@ -12,8 +12,7 @@ import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTas
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
import { CalendarService } from 'src/app/store/calendar.service';
import { ThemeService } from 'src/app/services/theme.service';
import { SessionStore } from 'src/app/store/session.service';
@@ -59,7 +58,6 @@ export class ViewEventPage implements OnInit {
public popoverController: PopoverController,
private toastService: ToastService,
public ThemeService: ThemeService,
private CalendarService: CalendarService
) {
this.isEventEdited = false;
this.loadedEvent = new Event();
@@ -1,6 +1,8 @@
<div class="btn-modal-dismiss">
<button class="btn-no-color" (click)="close()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="end" src='assets/images/theme/{{ThemeService.currentTheme}}/icons-calendar-arrow-left.svg'></ion-icon>
</button>
</div>
@@ -5,6 +5,7 @@
<div class="left">
<button class="btn-no-color" (click)="close()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/iassets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
</button>
</div>
@@ -1,9 +1,9 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ModalController, PickerController } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-edit-group',
@@ -27,14 +27,13 @@ export class EditGroupPage implements OnInit {
private modalController: ModalController,
private pickerController: PickerController,
private chatService: ChatService,
private authService: AuthService,
public ThemeService: ThemeService
) {
this.loggedUser = authService.ValidatedUserChat['data'];
this.loggedUser = SessionStore.user.ChatData['data'];
}
ngOnInit() {
this.chatService.refreshtoken();
// this.chatService.refreshtoken();
this.getRoomInfo();
}
@@ -42,7 +41,12 @@ export class EditGroupPage implements OnInit {
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room'];
this.groupName = this.room.name.split('-').join(' ');
try {
this.groupName = this.room.name.split('-').join(' ');
} catch (error) {
this.groupName = this.room.name;
}
});
}
@@ -5,6 +5,7 @@
<div class="back-icon cursor-pointer">
<button title="Retroceder" class="btn-no-color" (click)="openGroupMessagesPage()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
</button>
</div>
@@ -48,7 +49,7 @@
</ion-list>
</div>
<ion-virtual-scroll [items]="users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
<ion-virtual-scroll [items]="ChatSystemService.users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
<div class="item-divider" *virtualHeader="let header">
<ion-label>{{header}}</ion-label>
@@ -1,13 +1,13 @@
import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { HttpHeaders } from '@angular/common/http';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';
import { ModalController } from '@ionic/angular';
import * as _ from 'lodash';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { NewGroupPage } from '../../new-group/new-group.page';
import { GroupMessagesPage } from '../group-messages.page';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
@Component({
selector: 'app-group-contacts',
@@ -21,7 +21,6 @@ export class GroupContactsPage implements OnInit {
contact: string[] = [" Ana M.", "Andre F.", "Bruno G.", "Catarina T", "Tiago"];
headers: HttpHeaders;
options:any;
listContacts: any[];
contacts: any;
@@ -39,25 +38,19 @@ export class GroupContactsPage implements OnInit {
constructor(
private modalController: ModalController,
private http: HttpClient,
private chatService: ChatService,
private authService: AuthService,
public ThemeService: ThemeService
//private navParams: NavParams,
public ThemeService: ThemeService,
public ChatSystemService: ChatSystemService
)
{
this.loggedUser = authService.ValidatedUserChat['data'];
this.loggedUser = SessionStore.user.ChatData['data'];
this.textSearch="";
this.dm=null;
this.room=null;
/* this.isGroupCreated = this.navParams.get('isCreated');
this.groupName = this.navParams.get('name');
this.room = this.navParams.get('room');
this.members = this.navParams.get('members'); */
}
ngOnInit() {
this.chatService.refreshtoken();
// this.chatService.refreshtoken();
//this.getRoomInfo();
this.loadUsers();
@@ -147,10 +140,8 @@ export class GroupContactsPage implements OnInit {
this.showLoader = false;
}
loadUsers1(members:any){
this.options = {
headers: this.headers,
};
loadUsers1(members:any) {
this.chatService.getAllUsers().subscribe((res:any)=>{
@@ -178,9 +169,7 @@ export class GroupContactsPage implements OnInit {
}
loadUsers(){
this.options = {
headers: this.headers,
};
this.chatService.getAllUsers().subscribe((res:any)=>{
@@ -276,24 +265,6 @@ export class GroupContactsPage implements OnInit {
});
}
/* createGroup(){
if(!this.isGroupCreated){
let body = { "name":this.groupName, }
this.chatService.addGroup(body).subscribe(res=>{
this.addContacts(res['group']);
this.openGroupMessages(res['group']);
});
}
else{
this.addContacts(this.room);
this.close();
}
} */
async newGroup(){
this.close();
@@ -41,7 +41,7 @@
<ion-label>A conversa original mantêm-se como chat individual</ion-label>
</div>
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getGroupRoom(roomId).messages; let last = last">
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of ChatSystemService.getGroupRoom(roomId).messages; let last = last">
<div class="message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45" *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" >
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
@@ -240,14 +240,14 @@
<ion-footer>
<div class="typing" *ngIf="wsChatMethodsService.getGroupRoom(roomId).otherUserType == true">
<div class="typing" *ngIf="ChatSystemService.getGroupRoom(roomId).otherUserType == true">
<ngx-letters-avatar *ngIf="showAvatar"
[avatarName]= "wsChatMethodsService.getGroupRoom(roomId).name"
[avatarName]= "ChatSystemService.getGroupRoom(roomId).name"
[width]="30"
[circular]="true"
fontFamily="Roboto"></ngx-letters-avatar>
{{ wsChatMethodsService.getGroupRoom(roomId).userThatIsTyping }} está a escrever...
{{ ChatSystemService.getGroupRoom(roomId).userThatIsTyping }} está a escrever...
</div>
<div class="width-100 pl-20 pr-20">
@@ -286,7 +286,7 @@
<div class="width-100">
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getGroupRoom(roomId).message" (ionChange)="wsChatMethodsService.getGroupRoom(roomId).sendTyping()"></ion-textarea>
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="ChatSystemService.getGroupRoom(roomId).message" (ionChange)="ChatSystemService.getGroupRoom(roomId).sendTyping()"></ion-textarea>
</div>
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
@@ -296,15 +296,15 @@
</div>
<div class="btn-send">
<button #recordbtn *ngIf="!wsChatMethodsService.getGroupRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
<button #recordbtn *ngIf="!ChatSystemService.getGroupRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
</button>
<button *ngIf="wsChatMethodsService.getGroupRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
<button *ngIf="ChatSystemService.getGroupRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
</button>
<button *ngIf="!wsChatMethodsService.getGroupRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
<button *ngIf="!ChatSystemService.getGroupRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
</button>
@@ -1,27 +1,21 @@
import { Component, OnChanges, OnInit, Input, SimpleChanges, ChangeDetectorRef, Output, EventEmitter, ViewChild, ElementRef, AfterViewInit, OnDestroy } from '@angular/core';
import { Component, OnChanges, OnInit, Input, SimpleChanges, Output, EventEmitter, ViewChild, ElementRef, AfterViewInit, OnDestroy } from '@angular/core';
import { AnimationController, ModalController, PopoverController, Platform } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { ChatPopoverPage } from 'src/app/shared/popover/chat-popover/chat-popover.page';
import { GroupContactsPage } from './group-contacts/group-contacts.page';
import { Router } from '@angular/router'
import { ChatOptionsPopoverPage } from '../../popover/chat-options-popover/chat-options-popover.page';
import { ChatOptionsFeaturesPage } from 'src/app/modals/chat-options-features/chat-options-features.page';
import { TimeService } from 'src/app/services/functions/time.service';
import { FileLoaderService } from 'src/app/services/file/file-loader.service';
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
import { SearchPage } from 'src/app/pages/search/search.page';
import { SearchList } from 'src/app/models/search-document';
import { ProcessesService } from 'src/app/services/processes.service';
import { FileService } from 'src/app/services/functions/file.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service'
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
import { Storage } from '@ionic/storage';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
import { MessageService } from 'src/app/services/chat/message.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { CameraService } from 'src/app/services/camera.service';
import { FileType } from 'src/app/models/fileType';
@@ -30,22 +24,11 @@ import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
import { Filesystem, Directory } from '@capacitor/filesystem';
import { DomSanitizer } from '@angular/platform-browser';
import { AlertController } from '@ionic/angular';
import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorResponse } from '@angular/common/http';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
/*
import * as pdfjsLib from 'pdfjs-dist';
if( pdfjsLib !== undefined ){
pdfjsLib.GlobalWorkerOptions.workerSrc = "https://npmcdn.com/pdfjs-dist@2.4.456/build/pdf.worker.js";
}
*/
@Component({
selector: 'app-group-messages',
templateUrl: './group-messages.page.html',
@@ -60,7 +43,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
allUsers: any[] = [];
documents: SearchList[] = [];
room: any = new Array();
roomName: any;
members: any;
@@ -88,7 +70,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
@ViewChild('scrollMe') private myScrollContainer: ElementRef;
pdfurl = "http://www.africau.edu/images/default/sample.pdf";
downloadFile: any;
showAvatar = false;
@@ -106,54 +87,38 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
groupNameFormart = "";
constructor(
public wsChatMethodsService: WsChatMethodsService,
public ChatSystemService: ChatSystemService,
private modalController: ModalController,
public popoverController: PopoverController,
private chatService: ChatService,
private authService: AuthService,
private animationController: AnimationController,
private alertService: AlertService,
private route: Router,
private timeService: TimeService,
private fileLoaderService: FileLoaderService,
private fileToBase64Service: FileToBase64Service,
private processesService: ProcessesService,
private fileService: FileService,
public ThemeService: ThemeService,
private changeDetectorRef: ChangeDetectorRef,
private storage: Storage,
private AttachmentsService: AttachmentsService,
private CameraService: CameraService,
private toastService: ToastService,
private sanitiser: DomSanitizer,
private alertController: AlertController,
private file: File,
private platform: Platform,
private fileOpener: FileOpener,
) {
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.loggedUserChat = SessionStore.user.ChatData['data'];
this.isGroupCreated = true;
this.roomCountDownDate = "";
this.roomCountDownTime = "";
}
ngOnChanges(changes: SimpleChanges): void {
this.getRoomInfo();
//this.scrollToBottom();
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
//
this.wsChatMethodsService.openRoom(this.roomId)
this.wsChatMethodsService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked
this.groupNameFormart = this.wsChatMethodsService.getGroupRoom(this.roomId).name.split('-').join(' ')
this.ChatSystemService.openRoom(this.roomId)
this.ChatSystemService.getGroupRoom(this.roomId).scrollDown = this.scrollToBottomClicked
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
this.showAvatar = false
@@ -167,14 +132,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
ngOnInit() {
this.chatService.refreshtoken();
// console.log(this.roomId)
this.loggedUser = this.loggedUserChat;
//setTimeout(() => {
this.getRoomInfo()
//}, 1000);
this.getChatMembers();
//this.getMessageDB();
this.deleteRecording();
this.loadFiles();
@@ -185,7 +148,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
countDownDate() {
//this.roomCountDownTime = this.timeService.countDownDateTimer(this.roomCountDownDate, this.room._id);
return this.timeService.countDownDateTimer(this.roomCountDownDate, this.roomId);
}
@@ -407,12 +369,21 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
async getRoomInfo() {
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
if(this.ChatSystemService.getGroupRoom(this.roomId)) {
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
}
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
// console.log('ROOM',room)
this.room = room['room'];
if (this.room.name) {
this.roomName = this.room.name.split('-').join(' ');
try {
this.roomName = this.room.name.split('-').join(' ');
} catch (error) {
this.roomName = this.room.name;
}
}
@@ -430,27 +401,29 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
getGroupContacts(room: any) {
this.showLoader = true;
//If group is private call getGroupMembers
if (room.t === 'p') {
this.chatService.getGroupMembers(this.roomId).subscribe(res => {
//
this.members = res['members'];
this.showLoader = false;
});
}
//Otherwise call getChannelMembers for públic groups
else {
this.chatService.getChannelMembers(this.roomId).subscribe(res => {
// this.showLoader = true;
// //If group is private call getGroupMembers
// if (room.t === 'p') {
// this.chatService.getGroupMembers(this.roomId).subscribe(res => {
// //
// this.members = res['members'];
// this.showLoader = false;
// });
// }
// //Otherwise call getChannelMembers for públic groups
// else {
// this.chatService.getChannelMembers(this.roomId).subscribe(res => {
this.members = res['members'];
this.showLoader = false;
});
}
// this.members = res['members'];
// this.showLoader = false;
// });
// }
this.members = this.ChatSystemService.getGroupRoom(this.roomId).members
}
sendMessage() {
this.wsChatMethodsService.getGroupRoom(this.roomId).send({})
this.ChatSystemService.getGroupRoom(this.roomId).send({})
}
base64toBlob(base64Data, contentType) {
@@ -495,7 +468,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getGroupRoom(roomId).send({
this.ChatSystemService.getGroupRoom(roomId).send({
file: {
"type": "application/audio",
"msDuration": audioFile.value.msDuration,
@@ -514,7 +487,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
deleteMessage(msgId: string) {
const room = this.wsChatMethodsService.getGroupRoom(this.roomId)
const room = this.ChatSystemService.getGroupRoom(this.roomId)
this.alertService.confirmDeleteMessage(msgId, room);
}
@@ -542,26 +515,11 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
return enterAnimation(baseEl).direction('reverse');
}
/* const popover = await this.popoverController.create({
component: MessagesOptionsPage,
componentProps: {
roomId: this.dm._id,
},
cssClass: 'messages-options',
event: ev,
translucent: true,
});
return await popover.present(); */
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
component: ChatPopoverPage,
cssClass: 'model profile-modal search-submodal',
cssClass: 'model profile-modal search-submodal chat-aside',
componentProps: {
roomId: this.roomId,
members: this.members,
@@ -575,7 +533,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
this.getRoomInfo();
this.closeAllDesktopComponents.emit();
this.showEmptyContainer.emit();
this.wsChatMethodsService.hidingRoom(this.roomId);
this.ChatSystemService.hidingRoom(this.roomId);
}
else if (res.data == 'delete') {
this.closeAllDesktopComponents.emit();
@@ -590,7 +548,17 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
this.openEditGroupPage.emit(this.roomId);
}
else {
this.roomName = res.data.name.split('-').join(' ');
if(res?.data?.name) {
try {
this.roomName = res.data.name.split('-').join(' ');
} catch (error) {
console.log(error);
console.log(res.data)
this.roomName = res.data.name
}
}
};
@@ -768,7 +736,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getGroupRoom(roomId).send({
this.ChatSystemService.getGroupRoom(roomId).send({
file: {
"type": "application/img",
"guid": '',
@@ -797,7 +765,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getGroupRoom(roomId).send({
this.ChatSystemService.getGroupRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
@@ -838,7 +806,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
if (data.selected) {
this.wsChatMethodsService.getGroupRoom(roomId).send({
this.ChatSystemService.getGroupRoom(roomId).send({
file: {
"name": res.data.selected.Assunto,
"type": "application/webtrix",
@@ -884,7 +852,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getGroupRoom(roomId).send({
this.ChatSystemService.getGroupRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
@@ -917,7 +885,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getGroupRoom(roomId).send({
this.ChatSystemService.getGroupRoom(roomId).send({
file: {
"type": file.type,
"guid": '',
@@ -1119,23 +1087,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
cssClass: 'modal modal-desktop',
componentProps: {
image: msg.attachments[0].image_url,
type: msg.file.type,
username: msg.u.name,
_updatedAt: msg._updatedAt
}
});
modal.present();
} else {
this.downloadFileFromBrowser(msg.attachments[0].name, str)
}
console.log(msg)
} else {
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
@@ -1149,8 +1102,10 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
});
modal.present();
} else {
this.openFile(str, msg.attachments[0].name, msg.file.type);
this.downloadFileFromBrowser("file", str)
}
} else {
this.openFile(str, msg.attachments[0].name, msg.file.type);
}
}
@@ -4,10 +4,12 @@
<div class="title-content">
<div class="back-icon cursor-pointer" (click)="close()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
</div>
<div class="div-title">
<ion-label class="title">Nova Conversa</ion-label>
<!-- Desktop -->
<ion-label class="title">Nova Conversas</ion-label>
</div>
</div>
</div>
@@ -22,14 +24,14 @@
<ion-content>
<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> -->
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<div class="main-content">
<ion-virtual-scroll [items]="WsChatMethodsService.users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
<ion-virtual-scroll [items]="ChatSystemService.users | filter:textSearch: 'name'" approxItemHeight="70px" [headerFn]="separateLetter">
<div class="item-divider" *virtualHeader="let header">
<ion-label>{{header}}</ion-label>
@@ -1,11 +1,10 @@
import { HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { HttpHeaders } from '@angular/common/http';
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { MessagesPage } from '../messages.page';
import { ThemeService } from 'src/app/services/theme.service'
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service'
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
import { SessionStore } from 'src/app/store/session.service';
@Component({
@@ -14,29 +13,28 @@ import { SessionStore } from 'src/app/store/session.service';
styleUrls: ['./contacts.page.scss'],
})
export class ContactsPage implements OnInit {
showLoader: boolean;
loggedUser: any;
users = [];
headers: HttpHeaders;
options:any;
contacts:any;
textSearch:string;
room:any;
dm:any;
sessionStore = SessionStore
@Input() roomId: string;
@Output() openMessage:EventEmitter<any> = new EventEmitter<any>();
@Output() emptyTextDescriptionOpen:EventEmitter<any> = new EventEmitter<any>();
@Output() emptyTextDescriptionOpen:EventEmitter<any> = new EventEmitter<any>();
@Output() backToChat:EventEmitter<any> = new EventEmitter<any>();
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
constructor(
private modalController: ModalController,
private chatService: ChatService,
private authService: AuthService,
public ThemeService: ThemeService,
public WsChatMethodsService: WsChatMethodsService
public ChatSystemService: ChatSystemService
) {
this.loggedUser = authService.ValidatedUserChat['data'];
this.loggedUser = SessionStore.user.ChatData['data'];
this.textSearch="";
this.dm=null;
this.room=null;
@@ -45,16 +43,13 @@ export class ContactsPage implements OnInit {
async ngOnInit() {
this.loadUsers();
await this.chatService.refreshtoken();
this.loadUsers();
}
onChange(event){
onChange(event) {
this.textSearch = event.detail.value;
}
openMessagesPage(username:string){
openMessagesPage(username:string) {
if( window.innerWidth < 701){
this.createRoom(username);
}
@@ -71,28 +66,11 @@ export class ContactsPage implements OnInit {
}
loadUsers() {
this.options = {
headers: this.headers,
};
this.chatService.getAllUsers().subscribe((res:any)=> {
//this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){
return -1;
}
if(a.name > b.name){
return 1;
}
return 0;
});
this.showLoader = false;
});
this.ChatSystemService.getUser()
}
separateLetter(record, recordIndex, records){
if(recordIndex == 0){
separateLetter(record, recordIndex, records) {
if(recordIndex == 0) {
return record.name[0];
}
@@ -109,7 +87,12 @@ export class ContactsPage implements OnInit {
}
close() {
this.emptyTextDescriptionOpen.emit();
if(this.roomId) {
this.backToChat.emit({roomId: this.roomId});
} else {
this.closeAllDesktopComponents.emit();
}
}
clicked() {
@@ -124,7 +107,7 @@ export class ContactsPage implements OnInit {
this.room = res['room'];
this.openMessagesModal(this.room._id);
this.WsChatMethodsService.getAllRooms()
this.ChatSystemService.getAllRooms()
});
}
@@ -148,22 +131,8 @@ export class ContactsPage implements OnInit {
let dm:any;
//Create new room
this.createRoom(username);
//Get direct messages (dm)
/* this.getDirectMessage(this.room._id); */
this.createRoom(username);
/* const modal = await this.modalController.create({
component: MessagesPage,
cssClass: 'group-messages',
backdropDismiss: false,
componentProps: {
dm: dm,
},
});
await modal.present();
modal.onDidDismiss(); */
}
}
+11 -10
View File
@@ -3,8 +3,9 @@
<div class="main-header">
<div class="header-top">
<div class="middle">
<ion-label class="title">{{ wsChatMethodsService.getDmRoom(roomId).name }}</ion-label>
<!-- <span><ion-icon class="{{users.status}}" name="ellipse"></ion-icon></span> -->
<ion-label class="title">{{ ChatSystemService.getDmRoom(this.roomId).name }}</ion-label>
<!-- <button (click)="ChatMessageDebuggingPage()">Dev</button> -->
<span><ion-icon class="{{ ChatSystemService.getDmRoom(this.roomId).online }}" name="ellipse"></ion-icon></span>
</div>
<div hidden class="right">
<button title="Menu" class="btn-no-color" (click)="_openMessagesOptions()">
@@ -37,7 +38,7 @@
<ion-list>
<div class="messages-list-item-wrapper container-width-100"
*ngFor="let msg of wsChatMethodsService.getDmRoom(roomId).messages; index as i; let last = last">
*ngFor="let msg of ChatSystemService.getDmRoom(roomId).messages; index as i; let last = last">
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45' *ngIf="msg.msg !=''">
<div class="message-item-options d-flex justify-content-end">
@@ -217,11 +218,11 @@
</ion-content>
<ion-footer (click)="wsChatMethodsService.getDmRoom(roomId).sendReadMessage()">
<ion-footer (click)="ChatSystemService.getDmRoom(roomId).sendReadMessage()">
<div class="typing" *ngIf="wsChatMethodsService.getDmRoom(roomId).otherUserType == true" >
<div class="typing" *ngIf="ChatSystemService.getDmRoom(roomId).otherUserType == true" >
<ngx-letters-avatar *ngIf="showAvatar"
[avatarName]= "wsChatMethodsService.getDmRoom(roomId).name"
[avatarName]= "ChatSystemService.getDmRoom(roomId).name"
[width]="30"
[circular]="true"
fontFamily="Roboto"></ngx-letters-avatar>
@@ -267,7 +268,7 @@
<div class="width-100">
<div *ngIf="!recording && !lastAudioRecorded" class="type-message">
<ion-textarea *ngIf="allowTyping" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="wsChatMethodsService.getDmRoom(roomId).message" (ionChange)="wsChatMethodsService.getDmRoom(roomId).sendTyping()"></ion-textarea>
<ion-textarea *ngIf="allowTyping" (keyup.enter)="sendMessage()" clearOnEdit="true" placeholder="Escrever uma mensagem" class="message-input" rows="1" [(ngModel)]="ChatSystemService.getDmRoom(roomId).message" (ionChange)="ChatSystemService.getDmRoom(roomId).sendTyping()"></ion-textarea>
</div>
<div *ngIf="recording" class="d-flex align-items-center justify-content-center">
<button (click)="stopRecording()" class="btn-no-color d-flex align-items-center justify-content-center">
@@ -277,16 +278,16 @@
</div>
<div>
<button #recordbtn *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
<button #recordbtn *ngIf="!ChatSystemService.getDmRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
<!-- <ion-icon *ngIf="audioPermissionStatus != 'granted' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio-disable.svg"></ion-icon> -->
</button>
<button *ngIf="wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
<button *ngIf="ChatSystemService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
</button>
<button *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
<button *ngIf="!ChatSystemService.getDmRoom(roomId).message && lastAudioRecorded" class="btn-no-color" (click)="sendAudio(lastAudioRecorded)">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
</button>
+134 -114
View File
@@ -15,8 +15,8 @@ import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.pag
import { ThemeService } from 'src/app/services/theme.service'
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
import { Storage } from '@ionic/storage';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service'
import { WsChatService } from 'src/app/services/chat/ws-chat.service'
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'
import { MessageService } from 'src/app/services/chat/message.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { CameraService } from 'src/app/services/camera.service';
@@ -32,7 +32,9 @@ import { File } from '@awesome-cordova-plugins/file/ngx';
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { SessionStore } from 'src/app/store/session.service';
import { Howl } from 'howler';
import { runInThisContext } from 'vm';
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
const IMAGE_DIR = 'stored-images';
@@ -87,14 +89,15 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
durationDisplay = '';
duration = 0;
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
audioPermissionStatus: 'granted' | 'denied' | 'prompt' | null = null
sessionStore = SessionStore
audioPlay: Howl = null;
isPlaying = false;
audioProgress = 0;
audioDuration = 0;
audioTimer:any;
@ViewChild('range', {static: false}) range: IonRange;
audioTimer: any;
@ViewChild('range', { static: false }) range: IonRange;
userName = "";
room: any = new Array();
roomName: any;
isAdmin = false;
@@ -105,7 +108,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
private modalController: ModalController,
/* private navParams: NavParams, */
private chatService: ChatService,
private authService: AuthService,
private animationController: AnimationController,
private toastService: ToastService,
private timeService: TimeService,
@@ -113,30 +115,26 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
private gestureController: GestureController,
public ThemeService: ThemeService,
private storage: Storage,
public wsChatMethodsService: WsChatMethodsService,
public WsChatService: WsChatService,
private AttachmentsService: AttachmentsService,
public ChatSystemService: ChatSystemService,
public RochetChatConnectorService: RochetChatConnectorService,
private CameraService: CameraService,
private sanitiser: DomSanitizer,
private file: File,
private platform: Platform,
private fileOpener: FileOpener,
) {
// update
this.checkAudioPermission()
}
ngOnChanges(changes: SimpleChanges): void {
this.wsChatMethodsService.getAllRooms();
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
this.ChatSystemService.getAllRooms();
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
this.wsChatMethodsService.openRoom(this.roomId)
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
this.wsChatMethodsService.getDmRoom(this.roomId).uploadAttachment = async (formData) => {
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
}
this.ChatSystemService.openRoom(this.roomId)
this.showAvatar = false
@@ -149,14 +147,26 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
async ChatMessageDebuggingPage() {
const modal = await this.modalController.create({
component: ChatMessageDebuggingPage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
roomId: this.roomId,
}
});
return await modal.present();
}
async checkAudioPermission() {
const permissionStatus = await navigator.permissions.query({ name: 'microphone' } as any)
this.audioPermissionStatus = permissionStatus.state
permissionStatus.onchange = (data : any) => {
permissionStatus.onchange = (data: any) => {
//
//
}
@@ -164,11 +174,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
ngOnInit() {
this.wsChatMethodsService.getAllRooms();
this.chatService.refreshtoken();
this.ChatSystemService.getAllRooms();
// this.chatService.refreshtoken();
this.scrollToBottom();
this.getChatMembers();
this.deleteRecording();
this.loadFiles();
}
@@ -180,11 +190,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
gestureName: 'long-press',
onStart: ev => {
this.longPressActive = true;
},
onEnd: ev => {
this.longPressActive = false;
}
});
}
@@ -275,11 +285,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
})
this.storage.get('recordData').then((recordData) => {
if (recordData?.value?.recordDataBase64.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData?.value?.recordDataBase64);
}
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
else if (recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`);
}
});
@@ -287,11 +297,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.storage.get('recordData').then((recordData) => {
if (recordData?.value?.recordDataBase64?.includes('data:audio')) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(recordData.value.recordDataBase64);
}
else if(recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
else if (recordData?.value?.mimeType && recordData?.value?.recordDataBase64) {
this.audioRecorded = this.sanitiser.bypassSecurityTrustResourceUrl(`data:${recordData.value.mimeType};base64,${recordData.value.recordDataBase64}`);
}
});
@@ -299,15 +309,15 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
async startRecording() {
VoiceRecorder.requestAudioRecordingPermission();
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
if (await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) => { return result.value })) {
if (await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => { return result.value })) {
//if(await this.hasAudioRecordingPermission()){
if (this.recording) {
return;
}
this.recording = true;
VoiceRecorder.startRecording();
this.calculateDuration();
if (this.recording) {
return;
}
this.recording = true;
VoiceRecorder.startRecording();
this.calculateDuration();
//}
}
else {
@@ -322,13 +332,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
stopRecording() {
this.deleteRecording();
this.allowTyping = false;
if (!this.recording) {
return;
}
this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
this.recording = false;
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
@@ -337,7 +347,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
//Save file
this.storage.set('fileName', fileName);
this.storage.set('recordData', result).then(() => {
})
}
})
@@ -389,12 +399,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
});
await modal.present();
modal.onDidDismiss().then((res) => {
});
}
sendMessage() {
this.wsChatMethodsService.getDmRoom(this.roomId).send({})
this.ChatSystemService.getDmRoom(this.roomId).send({})
}
@@ -402,7 +412,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const roomId = this.roomId
let audioFile;
this.storage.get('recordData').then((recordData) => {
audioFile = recordData;
if (recordData?.value?.recordDataBase64?.includes('data:audio')) {
@@ -414,11 +424,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
//Converting base64 to blob
const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getDmRoom(roomId).send({
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/audio",
"msDuration": audioFile.value.msDuration,
@@ -438,23 +448,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
deleteMessage(msgId: string, msg: MessageService) {
this.wsChatMethodsService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
if (msg?.file?.type == "application/webtrix") {
// this.openViewDocumentModal(msg.file);
}
else {
// var str = msg.attachments[0].image_url;
// str = str.substring(1, ((str.length) - 1));
// const encodedData = btoa(str);
// let file = this.base64toBlob(encodedData, 'application/pdf')
// let fileURL = URL.createObjectURL(file)
// window.open(fileURL);
}
this.ChatSystemService.getDmRoom(this.roomId).sendDeleteRequest(msgId)
}
base64toBlob(base64Data, contentType) {
@@ -531,12 +525,15 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
getChatMembers() {
//
//this.showLoader = true;
this.chatService.getMembers(this.roomId).subscribe(res => {
this.members = res['members'];
this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.UserName)
this.showLoader = false;
});
// this.showLoader = true;
// this.chatService.getMembers(this.roomId).subscribe(res => {
// this.members = res['members'];
// this.dmUsers = res['members'].filter(data => data.username != this.sessionStore.user.UserName)
// this.showLoader = false;
// });
this.members = this.ChatSystemService.getDmRoom(this.roomId).members
this.dmUsers = this.ChatSystemService.getDmRoom(this.roomId).membersExcludeMe
}
async openMessagesOptions(ev: any) {
@@ -567,11 +564,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
openSendMessageOptions(ev?: any) {
if (window.innerWidth < 701) {
this.openChatOptions(ev);
}
else {
this._openChatOptions();
}
}
@@ -627,8 +624,34 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
dataURItoBlob(dataURI) {
// convert base64 to raw binary data held in a string
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
var byteString = atob(dataURI.split(',')[1]);
// separate out the mime component
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
// write the bytes of the string to an ArrayBuffer
var ab = new ArrayBuffer(byteString.length);
// create a view into the buffer
var ia = new Uint8Array(ab);
// set the bytes of the buffer to the correct values
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
// write the ArrayBuffer to a blob, and you're done
var blob = new Blob([ab], {type: mimeString});
return blob;
}
async takePictureMobile() {
const roomId = this.roomId
const file = await Camera.getPhoto({
@@ -638,13 +661,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
source: CameraSource.Camera
});
const response = await fetch('data:image/jpeg;base64,' + file.base64String!);
const blob = await response.blob();
const blob = this.dataURItoBlob('data:image/jpeg;base64,' + file.base64String)
console.log('data:image/jpeg;base64,' + file.base64String)
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getDmRoom(roomId).send({
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": '',
@@ -662,6 +685,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
async takePicture() {
const roomId = this.roomId
const image = await this.CameraService.takePicture();
@@ -669,14 +693,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const lastphoto: any = await this.fileService.loadFiles();
const { capturedImage, capturedImageTitle } = await this.fileService.loadFileData(lastphoto);
const base64 = await fetch(capturedImage);
const blob = await base64.blob();
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getDmRoom(roomId).send({
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
@@ -712,13 +736,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
});
await modal.present();
modal.onDidDismiss().then(async res => {
const data = res.data;
const roomId = this.roomId
if (data.selected) {
this.wsChatMethodsService.getDmRoom(roomId).send({
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"name": res.data.selected.Assunto,
"type": "application/webtrix",
@@ -751,7 +775,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
resultType: CameraResultType.Base64,
source: CameraSource.Photos
});
//const imageData = await this.fileToBase64Service.convert(file)
//
@@ -761,7 +785,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getDmRoom(roomId).send({
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
@@ -784,18 +808,18 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
const roomId = this.roomId
const file: any = await this.fileService.getFileFromDevice(types);
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
const blob = this.base64toBlob(encodedData, file.type)
const formData = new FormData();
formData.append("blobFile", blob);
this.wsChatMethodsService.getDmRoom(roomId).send({
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": file.type,
"guid": '',
@@ -811,7 +835,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
})
} else {
}
@@ -831,7 +855,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
resolve(reader.result)
};
reader.onerror = function (error) {
};
});
@@ -890,7 +914,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
});
await modal.present();
modal.onDidDismiss().then(async (res) => {
if (res['data'] == 'meeting') {
@@ -941,7 +965,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
async audioPreview(msg) {
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg)
} else { }
@@ -973,6 +997,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
downloadFileFromBrowser(fileName: string, data: any): void {
console.log(fileName + data)
const linkSource = data;
const downloadLink = document.createElement("a");
downloadLink.href = linkSource;
@@ -981,7 +1006,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
viewDocument(file: any, url?: string) {
if (file.type == "application/webtrix") {
this.openViewDocumentModal(file);
}
@@ -1001,15 +1026,15 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
} else {
pathFile = this.file.externalRootDirectory
}
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
this.fileOpener
.open(pathFile + fileName, type)
.then(() => {})
.then(() => { })
.catch(e => console.error(e))
})
.catch(e => console.error(e))
@@ -1031,6 +1056,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log(msg)
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
@@ -1044,34 +1070,23 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
});
modal.present();
} else {
this.downloadFileFromBrowser(msg.attachments[0].name, str)
this.downloadFileFromBrowser("file", str)
}
} else {
if (msg.file.type == "application/img") {
const modal = await this.modalController.create({
component: ViewMediaPage,
cssClass: 'modal modal-desktop',
componentProps: {
image: msg.attachments[0].image_url,
type: msg.file.type,
username: msg.u.name,
_updatedAt: msg._updatedAt
}
});
modal.present();
} else {
this.openFile(str, msg.attachments[0].name, msg.file.type);
}
this.openFile(str, msg.attachments[0].name, msg.file.type);
}
}
}
}
start(track) {
if(this.audioPlay){
if (this.audioPlay) {
this.audioPlay.stop();
}
this.audioPlay = new Howl({
@@ -1086,7 +1101,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.isPlaying = false;
clearTimeout(this.audioTimer)
this.audioProgress = 0
},
})
this.audioPlay.play();
@@ -1094,12 +1109,12 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
togglePlayer(pause) {
this.isPlaying = !pause;
if(pause) {
if (pause) {
this.audioPlay.pause();
} else {
this.audioPlay.play();
}
}
}
seek() {
let newValue = +this.range.value;
@@ -1113,16 +1128,21 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
console.log(this.audioDuration)
this.audioTimer = setTimeout(() => {
this.updateProgress()
},1000)
}, 1000)
}
async getRoomInfo() {
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
// this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
// console.log('ROOM',room)
this.room = room['room'];
if (this.room.name) {
this.roomName = this.room.name.split('-').join(' ');
try {
this.roomName = this.room.name.split('-').join(' ');
} catch(error) {
this.roomName = this.room.name;
}
}
@@ -24,7 +24,7 @@
<ion-content>
<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> -->
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
@@ -36,7 +36,7 @@
</ion-item>
</ion-list> -->
<ion-virtual-scroll [items]="users" approxItemHeight="70px" [headerFn]="separateLetter">
<ion-virtual-scroll [items]="ChatSystemService.users" approxItemHeight="70px" [headerFn]="separateLetter">
<div class="item-divider" *virtualHeader="let header">
<ion-label>{{header}}</ion-label>
@@ -1,8 +1,8 @@
import { HttpHeaders } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { GroupMessagesPage } from '../../group-messages/group-messages.page';
import { ThemeService } from 'src/app/services/theme.service'
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
@Component({
selector: 'app-contacts',
@@ -10,58 +10,15 @@ import { ThemeService } from 'src/app/services/theme.service'
styleUrls: ['./contacts.page.scss'],
})
export class ContactsPage implements OnInit {
showLoader: boolean;
users = [];
contact: string[] = [" Ana M.", "Andre F.", "Bruno G.", "Catarina T", "Tiago"];
headers: HttpHeaders;
options:any;
contacts = [
{
first: 'Ana',
last: 'Manuel',
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
},
{
first: 'Abdullah',
last: 'Hill',
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
},
{
first: 'Batur',
last: 'Oymen',
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
},
{
first: 'Bianca',
last: 'Costa',
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
},
{
first: 'Zaya',
last: 'Mary',
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
},
{
first: 'Tiago',
last: 'Kayaya',
url: 'https://randomuser.me/api/portraits/med/women/54.jpg',
}
];
constructor(
private modalController: ModalController,
public ThemeService: ThemeService
public ThemeService: ThemeService,
public ChatSystemService: ChatSystemService
)
{
this.headers = new HttpHeaders();
this.headers = this.headers.set('Access-Control-Allow-Origin' , '*');
this.headers = this.headers.set('Access-Control-Allow-Methods', 'POST, GET, OPTIONS, PUT');
this.headers = this.headers.set('Accept','application/json');
this.headers = this.headers.set('content-type','application/json');
}
ngOnInit() {
@@ -70,46 +27,11 @@ export class ContactsPage implements OnInit {
}
loadUsers(){
this.options = {
headers: this.headers,
};
/* this.http.get('https://randomuser.me/api/?results=100', this.options)
.subscribe(res => {
this.users = res['results'].sort((a,b) => {
if(a.name.first < b.name.first){
return -1;
}
if(a.name.first > b.name.first){
return 1;
}
return 0;
});
}); */
this.users = this.contacts.sort((a,b) => {
if(a.first < b.first){
return -1;
}
if(a.first > b.first){
return 1;
}
return 0;
});
this.ChatSystemService.getUser()
}
separateLetter(record, recordIndex, records){
/* if(recordIndex == 0){
return record.name.first[0];
}
let first_prev = records[recordIndex - 1].name.first[0];
let first_current = record.name.first[0];
if(first_prev != first_current){
return first_current;
}
return null; */
if(recordIndex == 0){
return record.first[0];
}
@@ -2,6 +2,12 @@
<ion-toolbar class="header-toolbar">
<div class="main-header">
<div class="title-content">
<div class="left">
<button class="btn-no-color" (click)="close()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
</button>
</div>
<div class="middle">
<ion-label class="title">Novo Grupo</ion-label>
</div>
+71 -56
View File
@@ -1,14 +1,15 @@
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
import { ModalController, PickerController, PopoverController } from '@ionic/angular';
import { AuthService } from 'src/app/services/auth.service';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
import { DataService } from 'src/app/services/data.service';
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
import { SessionStore } from 'src/app/store/session.service';
import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';
import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service';
import { RouteService } from 'src/app/services/route.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-new-group',
templateUrl: './new-group.page.html',
@@ -24,12 +25,15 @@ export class NewGroupPage implements OnInit{
selectedDuration = ['','',''];
countDownTime:any;
task:any;
link = ''
documents: any;
loggedUserChat: any;
@Input() roomId: string;
@Input() groupName:string;
@Output() addGroupMessage:EventEmitter<any> = new EventEmitter<any>();
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
@Output() backToChat:EventEmitter<any> = new EventEmitter<any>();
constructor(
@@ -38,47 +42,53 @@ export class NewGroupPage implements OnInit{
private modalController: ModalController,
private dataService:DataService,
private router: Router,
public wsChatMethodsService: WsChatMethodsService,
public ChatSystemService: ChatSystemService,
private authService: AuthService,
private toastService: ToastService,
public ThemeService: ThemeService,
private RouteService: RouteService,
)
{
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.loggedUserChat = SessionStore.user.ChatData['data'];
this.isGroupCreated = false;
}
ngOnInit() {
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith('/home/chat')) {
if (this.dataService.get("newGroup")) {
this.task = this.dataService.get("task");
this.groupName = this.task.Folio;
this.documents = this.dataService.get("documents");
}
}
else{
this.dataService.set("newGroup", false);
}
});
this.task = this.dataService.get("task");
if(this.task) {
this.link = this.dataService.get("link");
this.groupName = this.task.Folio;
this.documents = this.dataService.get("documents");
this.dataService.set("newGroup", false);
this.dataService.set("link", false);
}
}
_ionChange(event){
_ionChange(event) {
this.showDuration = event.detail.checked;
if(event.detail.checked){
if(event.detail.checked) {
this.thedate = new Date();
}
else{
else {
this.thedate = '';
}
}
close() {
this.addGroupMessage.emit();
if(this.link) {
this.RouteService.goBack();
this.dataService.set("link", false);
} else {
if(this.roomId) {
this.backToChat.emit({roomId: this.roomId});
} else {
this.closeAllDesktopComponents.emit();
}
}
}
async createGroup() {
@@ -97,10 +107,10 @@ export class NewGroupPage implements OnInit{
let customFields = {
"countDownDate":this.thedate
}
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
}
else {
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
}
@@ -111,9 +121,9 @@ export class NewGroupPage implements OnInit{
if(res?.result?.rid) {
this.addGroupMessage.emit(res.result.rid);
await this.wsChatMethodsService.getAllRooms();
await this.ChatSystemService.getAllRooms();
if(!this.wsChatMethodsService.getGroupRoom(res.result.rid)) {
if(!this.ChatSystemService.getGroupRoom(res.result.rid)) {
this.createGroupWithAttachmentsCath(res)
} else {
setTimeout(()=> {
@@ -134,7 +144,7 @@ export class NewGroupPage implements OnInit{
}
createGroupWithAttachmentsCath(res: any) {
if(!this.wsChatMethodsService.getGroupRoom(res.result.rid)) {
if(!this.ChatSystemService.getGroupRoom(res.result.rid)) {
setTimeout(()=>{
this.createGroupWithAttachmentsCath(res)
}, 1500)
@@ -144,35 +154,40 @@ export class NewGroupPage implements OnInit{
}
createGroupWithAttachments(res: any) {
this.wsChatMethodsService.getGroupRoom(res.result.rid).hasLoadHistory = true;
this.ChatSystemService.getGroupRoom(res.result.rid).hasLoadHistory = true;
this.documents.forEach(element => {
this.wsChatMethodsService.getGroupRoom(res.result.rid).send({
file: {
"name": element.Assunto,
"type": "application/webtrix",
"ApplicationId": element.ApplicationId,
"DocId": element.DocId,
"Assunto": element.Assunto,
},
temporaryData: {
data: {
selected: {
Id: element.DocId,
ApplicationType: element.ApplicationId
if(this.documents) {
this.documents.forEach(element => {
this.ChatSystemService.getGroupRoom(res.result.rid).send({
file: {
"name": element.Assunto,
"type": "application/webtrix",
"ApplicationId": element.ApplicationId,
"DocId": element.DocId,
"Assunto": element.Assunto,
},
temporaryData: {
data: {
selected: {
Id: element.DocId,
ApplicationType: element.ApplicationId
}
}
}
},
attachments: [{
"title": element.Assunto,
"description": element.Assunto,
"title_link_download": true,
"type": "webtrix",
"text": element.Assunto,
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
}],
})
});
},
attachments: [{
"title": element.Assunto,
"description": element.Assunto,
"title_link_download": true,
"type": "webtrix",
"text": element.Assunto,
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
}],
})
});
}
this.ChatSystemService.getAllRooms();
setTimeout(() => {
this.groupName = ""
@@ -16,6 +16,7 @@
<div class="pr-10">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-35" src="assets/images/icons-default-profile.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-35" src="assets/images/theme/gov/icons-profile.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-35" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-profile.svg"></ion-icon>
</div>
<ion-label>
<h3>{{ attendee.Name }}</h3>
@@ -24,6 +25,7 @@
<div>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-35" src="assets/images/icons-add-25.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-35" src="assets/images/theme/gov/icons-add-25.svg" ></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-35" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-add-25.svg" ></ion-icon>
</div>
</ion-item>
</div>
@@ -39,6 +41,7 @@
<div class="pr-10">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-35" src="assets/images/icons-default-profile.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-35" src="assets/images/theme/gov/icons-profile.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-35" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-profile.svg"></ion-icon>
</div>
<ion-label>
<h3>{{ attendee.Name }}</h3>
@@ -58,6 +61,7 @@
<div class="pr-10">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-35" src="assets/images/icons-default-profile.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-35" src="assets/images/theme/gov/icons-profile.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-35" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-profile.svg"></ion-icon>
</div>
<ion-label>
<h3>{{ attendee.Name }}</h3>
@@ -1,10 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js';
import { SortService } from 'src/app/services/functions/sort.service';
import { ThemeService } from 'src/app/services/theme.service'
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { DeplomasStore } from 'src/app/store/deplomas.service';
@@ -40,13 +36,10 @@ export class AllProcessesPage implements OnInit {
constructor(
private processesService: ProcessesService,
private router: Router,
private authService: AuthService,
private sortService: SortService,
public ThemeService: ThemeService
) {
this.loggeduser = authService.ValidatedUser;
this.loggeduser = SessionStore.user;
}
ngOnInit() {
@@ -176,7 +176,7 @@ ion-item{
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -7,6 +7,7 @@ import { NavigationStart, Router } from '@angular/router';
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { SortService } from 'src/app/services/functions/sort.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-despachos-pr',
@@ -28,7 +29,7 @@ constructor (
private sortService: SortService,
) {
this.loggeduser = authService.ValidatedUser;
this.loggeduser = SessionStore.user;
}
ngOnInit() {
@@ -157,7 +157,7 @@ ion-item{
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -177,7 +177,7 @@ ion-item{
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -177,7 +177,7 @@ ion-item{
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ExpedientsPage } from './expedients.page';
const routes: Routes = [
{
path: '',
component: ExpedientsPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ExpedientsPageRoutingModule {}
@@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { ExpedientsPageRoutingModule } from './expedients-routing.module';
import { ExpedientsPage } from './expedients.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ExpedientsPageRoutingModule
],
exports: [ExpedientsPage],
declarations: [ExpedientsPage]
})
export class ExpedientsPageModule {}
@@ -0,0 +1,95 @@
<ion-header class="ion-no-border">
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
<div class="title">
<div class="thetitle"><ion-label >Expediente</ion-label></div>
<div class="theicon">
<button title="Atualizar" class="btn-no-color" (click)="doRefresh()">
<ion-icon slot="end" class="title-icon font-awesome" name="reload-circle"></ion-icon>
</button>
</div>
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<div class="content width-100 overflow-y-auto height-100" >
<div >
<ion-list *ngIf="expedientegbstore.list.length >=0">
<div
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
*ngFor = "let task of expedientegbstore.list"
(click)="goToExpediente(task.SerialNumber)"
>
<div class="item width-100">
<div class="exp-top-detail">
<div class="subject">
<ion-label>{{ task.Subject }}</ion-label>
</div>
<div class="exp-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-expediente-attachment.svg"></ion-icon>
<label *ngIf="task.DocumentsQty != 0">{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
</div>
<div class="exp-middle-detail">
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
</div>
</div>
</div>
</div>
</ion-list>
</div>
<div
*ngIf="!skeletonLoader && taskslist.length == 0 && taskslist.length == 0"
class="empty-list d-flex height-100 align-center justify-content-center"
>
<span>Lista vazia</span>
</div>
<div *ngIf="skeletonLoader && taskslist.length == 0">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,161 @@
@import '~src/function.scss';
//CONTENT
:host{
margin: 0;
}
.title{
font-family: Roboto;
font-size: 25px;
color:#000;
overflow: auto;
padding: 30px 20px 0 20px !important;
.thetitle{
width: fit-content;
float: left;
}
.theicon{
width: fit-content;
float: right;
}
}
//DIV
ion-item{
--background: none;
}
.item {
//border-radius: 15px;
//box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
//Sborder: solid 1px #e9e9e9;
//background-color: var(--white);
margin: 0 auto;
//padding: 10px;
overflow: auto;
}
/* New CSS */
.content{
padding: 0px 20px 0 20px !important;
}
.expediente{
border-radius: 15px;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
border:1px solid #e9e9e9 !important;
//background-color: transparent;
margin-bottom: 10px !important;
padding: 15px;
}
.exp-list-item{
//width: 368px;
overflow: auto;
//border-bottom: 1px solid gray;
margin: 10px auto;
}
.exp-top-detail{
width: 100%;
float: left;
font-family: Roboto;
font-size: 12pt;
font-weight: 700;
color: var(--title-text-color);
padding-left: 3px;
.subject{
width: 84%;
float: left;
}
.exp-icon{
width: fit-content;
float: right;
//font-size: 13px;
margin: 0 !important;
padding: 0 !important;
ion-icon{
font-size: 12pt;
color: #42b9fe;
float: left;
}
label{
font-size: 10pt;
}
}
}
.exp-middle-detail, .exp-bottom-detail{
margin-bottom: 5px;
}
.exp-middle-detail{
font-size: 12pt;
width: 100%;
overflow: auto;
.exp-workflow{
float: left;
margin: 0 !important;
.label{
border-radius: 15px;
background: var(--label-bg-color);
//font-size: 12px;
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
color: #fff;
}
}
.exp-date{
width: auto;
font-family: Roboto;
font-size: 10pt;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #797979;
float: right;
}
}
.exp-bottom-detail{
font-size: 8pt;
width: 100%;
overflow: auto;
padding-left: 3px;
.exp-remetente{
//width: 200px;
font-family: Roboto;
//font-size: 13px;
font-weight: normal;
color: #000000;
float: left;
//border: 1px solid red;
}
}
.div-top-header{
width: 400px;
margin: 6px auto;
background-color: #0782c9;
overflow: auto;
}
.div-search{
font-size: 45px;
float: left;
margin: 0 0 0 10px
}
.div-logo{
background: transparent;
width: 150px;
margin: 2.5px 0 2.5px 71px;
float: left;
}
.div-logo img{
width: 100%;
}
.div-profile{
font-size: 45px;
float: right;
margin-right: 10px;
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ExpedientsPage } from './expedients.page';
describe('ExpedientsPage', () => {
let component: ExpedientsPage;
let fixture: ComponentFixture<ExpedientsPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ExpedientsPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ExpedientsPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,109 @@
import { Component, Input, OnInit } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { ProcessesService } from 'src/app/services/processes.service';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SortService } from 'src/app/services/functions/sort.service';
import { Storage } from '@ionic/storage';
@Component({
selector: 'app-expedients',
templateUrl: './expedients.page.html',
styleUrls: ['./expedients.page.scss'],
})
export class ExpedientsPage implements OnInit {
segment: string;
taskslist = [];
serialNumber: string;
@Input() profile: string;
skeletonLoader = true
expedientegbstore = ExpedienteGdStore
expedienteTaskPipe = new ExpedienteTaskPipe()
constructor(
private processes: ProcessesService,
private router: Router,
public ThemeService: ThemeService,
private sortService: SortService,
private storage: Storage
) {
this.profile = 'mdgpr';
}
ngOnInit() {
//Inicializar segment
this.segment = "expedientes";
this.LoadList()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart &&
event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.doRefresh()
} else {
this.LoadList()
}
}
});
}
segmentChanged() {
this.LoadList();
}
LoadList() {
this.skeletonLoader = true
this.processes.GetTaskListExpediente(false).subscribe(result => {
this.taskslist = [];
this.skeletonLoader = false
let res = result.filter(data => data.workflowInstanceDataFields.Status == "Active");
res.forEach(element => {
let task = this.expedienteTaskPipe.transform(element)
this.taskslist.push(task);
});
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
this.addProcessTODb(this.taskslist);
this.taskslist = this.taskslist.filter(function(item) {
return item.activityInstanceName != 'Retificar Expediente'
})
this.expedientegbstore.reset(this.taskslist);
}, (error) => {
this.getEventsFromLocalDb();
});
}
addProcessTODb(task) {
this.storage.set('gabinete-expediente', task).then(() => {
})
}
getEventsFromLocalDb() {
this.storage.get('gabinete-expediente').then((expediente) => {
this.taskslist = expediente
})
}
doRefresh() {
setTimeout(() => {
this.LoadList();
}, 1000)
}
goToExpediente(serialNumber: any) {
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
}
}
@@ -166,7 +166,7 @@ ion-item{
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { ActivatedRoute, NavigationStart, Router } from '@angular/router';
import { NavigationStart, Router } from '@angular/router';
import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@@ -30,7 +30,6 @@ export class DiplomasPage implements OnInit {
constructor(
private processes:ProcessesService,
private router: Router,
private activatedRoute: ActivatedRoute,
public ThemeService: ThemeService,
private sortService: SortService,
public p: PermissionService,
@@ -232,6 +232,7 @@
<div class="add-people cursor-pointer">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="start" src="assets/images/theme/gov/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
@@ -254,6 +255,7 @@
<div class="add-people cursor-pointer" >
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="start" src="assets/images/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="start" src="assets/images/theme/gov/icons-arrow-forward.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="start" src="assets/images/theme/{{ThemeService.currentTheme}}/icons-arrow-forward.svg"></ion-icon>
</div>
</div>
</div>
@@ -275,6 +277,7 @@
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " src="assets/images/icons-attach-doc.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " src="assets/images/theme/gov/icons-attach-doc.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/{{ThemeService.currentTheme}}/icons-attach-doc.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Adicionar documentos</ion-label>
@@ -10,10 +10,10 @@
<ion-toolbar>
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<ion-segment-button value="MDGPR">
Calendário do MDGPR
Meu Calendário
</ion-segment-button>
<ion-segment-button value="PR">
Presidente da República
Calendário Partilhado
</ion-segment-button>
</ion-segment>
</ion-toolbar>
@@ -42,7 +42,7 @@
}
.event-mdgpr-Oficial{
border-radius: 5px;
border-right: 5px solid #ffb703;
border-right: 5px solid var(--label-bg-color);
overflow: auto;
}
.event-mdgpr-Pessoal{
@@ -161,7 +161,7 @@
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -9,6 +9,7 @@ import { AuthService } from 'src/app/services/auth.service';
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
import { SortService } from 'src/app/services/functions/sort.service';
import { Storage } from '@ionic/storage';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-events-to-approve',
@@ -37,7 +38,7 @@ export class EventsToApprovePage implements OnInit {
private storage: Storage
)
{
this.loggeduser = userAuth.ValidatedUser;
this.loggeduser = SessionStore.user;
}
ngOnInit() {
@@ -98,7 +98,7 @@ ion-item{
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
//font-size: 12px;
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -1,14 +1,13 @@
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SortService } from 'src/app/services/functions/sort.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
@@ -30,13 +29,11 @@ export class ExpedientesPrPage implements OnInit {
constructor(
private processes:ProcessesService,
private modalController: ModalController,
private authService: AuthService,
private router: Router,
public ThemeService: ThemeService,
private sortService: SortService,
) {
this.loggeduser = authService.ValidatedUser;
this.loggeduser = SessionStore.user;
}
ngOnInit() {
@@ -98,7 +98,7 @@ ion-item{
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
//font-size: 12px;
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -60,7 +60,7 @@ ion-button{
.label{
border-radius: 20px;
background: #ffb703;
background: var(--label-bg-color);
float: right;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
@@ -61,7 +61,7 @@
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -165,7 +165,7 @@ ion-item{
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -160,7 +160,7 @@ ion-item{
.label{
border-radius: 15px;
background: #ffb703;
background: var(--label-bg-color);
/* font-size: 12px; */
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
@@ -3,12 +3,12 @@ import { NavigationStart, Router } from '@angular/router';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { customTask} from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { AuthService } from 'src/app/services/auth.service';
import { PendentesStore } from 'src/app/store/pendestes-store.service';
import { LoginUserRespose } from 'src/app/models/user.model';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { SortService } from 'src/app/services/functions/sort.service';
import { Storage } from '@ionic/storage';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-pendentes',
@@ -29,12 +29,11 @@ export class PendentesPage implements OnInit {
constructor(
private processes:ProcessesService,
private authService: AuthService,
private router: Router,
private sortService: SortService,
private storage: Storage
) {
this.loggeduser = authService.ValidatedUser;
this.loggeduser = SessionStore.user;
}
ngOnInit() {
+2 -1
View File
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-header-pr',
@@ -13,7 +14,7 @@ export class HeaderPrPage implements OnInit {
constructor(authService: AuthService) {
this.loggeduser = authService.ValidatedUser;
this.loggeduser = SessionStore.user;
}
ngOnInit() {
+37 -55
View File
@@ -1,49 +1,41 @@
<div class="header-container">
<div class="main-tab pb-10 ion-toolbar header-color">
<div class="mobile pt-20 d-flex div-top-header justify-space-between">
<div title="Pesquisa" *ngIf="!hideSearchBtn" class="div-search">
<div (click)="openSearch()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-45" src='assets/images/icons-search.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-45" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon *ngIf=" ThemeService.currentTheme == 'default' " class="font-45" src='assets/images/icons-search.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-45" src='assets/images/theme/gov/icons-search.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="font-45" src='assets/images/theme/tribunal/icons-search.svg'></ion-icon>
</div>
</div>
<!-- <div class="div-logo align-center justify-center">
<img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-no-bg.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/gabinetedigital_logo.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'tribunal' " src='assets/images/theme/tribunal/tribunal-constitucional.png' alt='logo'>
</div> -->
<div class="div-logo align-center justify-center">
<div class="logo-icon">
<img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-no-bg.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'tribunal' " src='assets/images/theme/tribunal/tribunal-constitucional.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'doneIt'" src="assets/images/theme/doneIt/governoangola_A1.png" alt='logo'/>
</div>
<div *ngIf="ThemeService.currentTheme == 'gov'" class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content">
<p class="logo-description-text">Presidente da República</p>
<p class="logo-description-text tp-5" >GABINETE DIGITAL</p>
<div class="add-line"></div>
<p class="logo-description-text tp-5">GABINETE DIGITAL</p>
</div>
</div>
<div *ngIf="ThemeService.currentTheme == 'default'" class="logo-description d-flex align-center justify-content-center">
<div *ngIf="ThemeService.currentTheme == 'default' " class="logo-description d-flex align-center justify-content-center">
<div class="logo-description-content">
<p class="logo-description-text color-white">Presidente da República</p>
<p class="logo-description-text tp-5 color-white" >GABINETE DIGITAL</p>
<div class="add-line-white"></div>
<p class="logo-description-text tp-5 color-white">GABINETE DIGITAL</p>
</div>
</div>
</div>
<div title="Perfil" class="div-profile cursor-pointer" (click)="openProfile()">
<div *ngIf="this.notificationLength > 0" class="icon-badge">{{notificationLength}}</div>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="icon" src='assets/images/theme/doneIt/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="icon" src='assets/images/theme/tribunal/icons-profile.svg'></ion-icon>
<!-- <ion-label class="profile-text">{{loggeduser.Profile}}</ion-label> -->
</div>
</div>
@@ -51,20 +43,26 @@
<div class="d-flex justify-space-between align-center">
<div tab="events" class="div-logo height-fit-content">
<div class="logo-icon">
<img *ngIf="ThemeService.currentTheme == 'default' " src='assets/images/logo-no-bg.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'default'" src='assets/images/logo-no-bg.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'gov' " src='assets/images/theme/gov/governoangola_A.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'tribunal' " src='assets/images/theme/tribunal/tribunal-constitucional.png' alt='logo'>
<img *ngIf="ThemeService.currentTheme == 'doneIt' " src='assets/images/theme/{{ThemeService.currentTheme}}/governoangola_A1.png' alt='logo'>
</div>
<div class="logo-description d-flex align-center justify-content-center">
<div *ngIf="ThemeService.currentTheme == 'default' " class="logo-description-content">
<p class="logo-description-text color-white">Presidente da República</p>
<div class="add-line color-white" style="border-bottom-color: white;"></div>
<p class="logo-description-text color-white">GABINETE DIGITAL</p>
</div>
<div *ngIf="ThemeService.currentTheme == 'gov' " class="logo-description-content">
<p class="logo-description-text">Presidente da República</p>
<div class="add-line"></div>
<p class="logo-description-text">GABINETE DIGITAL</p>
<div class="logo-description-content">
<div *ngIf="ThemeService.currentTheme == 'gov' " class="logo-description-content">
<p *ngIf="environment.presidencia" class="logo-description-text">Calendário Partilhado</p>
<p *ngIf="!environment.presidencia" class="logo-description-text" >GABINETE DIGITAL</p>
<div class="add-line"></div>
</div>
<div *ngIf="ThemeService.currentTheme == 'default' " class="logo-description-content">
<p *ngIf="environment.presidencia" class="logo-description-text">Calendário Partilhado</p>
<p *ngIf="!environment.presidencia" class="logo-description-text" style="color: white;">GABINETE DIGITAL</p>
<div class="add-line" style="border-bottom: 1px solid white;"></div>
</div>
</div>
</div>
</div>
@@ -74,68 +72,53 @@
<div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
[class.active]="locationPathname() == '/home/events'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-active-black.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-home-active-black.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-home-active-black.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="font-40" src='assets/images/theme/gov/icons-nav-home-active-black.svg'></ion-icon>
<span>Início</span>
</div>
<!-- *ngIf="p.userPermission([permissionList.Agenda])" -->
<div *ngIf="p.userPermission([permissionList.Agenda.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/agenda')"
[class.active]="locationPathname() == '/home/agenda'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-agenda-inactive.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-agenda-inactive.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-agenda-inactive.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="font-40" src='assets/images/theme/gov/icons-nav-agenda-inactive.svg'></ion-icon>
<span>Agenda</span>
</div>
<!-- *ngIf="p.userPermission([permissionList.Gabinete])" -->
<div *ngIf="p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/gabinete-digital')"
[class.active]="locationPathname() == '/home/gabinete-digital'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-home-dk.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-home-dk.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-home-dk.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="font-40" src='assets/images/theme/gov/icons-nav-home-dk.svg'></ion-icon>
<span>Gabinete</span>
</div>
<!-- *ngIf="p.userPermission([permissionList.Actions])" -->
<div *ngIf="p.userPermission([permissionList.Actions.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/publications')"
[class.active]="locationPathname() == '/home/publications'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-a-es-inactive.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-a-es-inactive.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-a-es-inactive.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="font-40" src='assets/images/theme/gov/icons-nav-a-es-inactive.svg'></ion-icon>
<span>Acções</span>
</div>
<!-- *ngIf="p.userPermission([permissionList.Chat])" -->
<div *ngIf="p.userPermission([permissionList.Chat.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/chat')"
[class.active]="locationPathname() == '/home/chat'">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" src='assets/images/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" src='assets/images/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" src='assets/images/theme/gov/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="font-40" src='assets/images/theme/gov/icons-nav-grupos-inactive-dk-white.svg'></ion-icon>
<span>Chat</span>
</div>
</div>
<div class="header-btns d-flex">
<div title="Pesquisa" *ngIf="!hideSearchBtn" class="mr-20 d-flex align-center cursor-pointer">
<div style="padding-top: 5px;" (click)="openSearch();showSearch=true" *ngIf="!showSearch">
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'doneIt' " class="font-45" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'default' " class="font-45" src='assets/images/icons-search.svg'></ion-icon>
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'gov' " class="font-45" src='assets/images/theme/gov/icons-search.svg'></ion-icon>
<ion-icon title="Perfil" *ngIf="ThemeService.currentTheme == 'tribunal' " class="font-45" src='assets/images/theme/tribunal/icons-search.svg'></ion-icon>
</div>
<button title="Fechar" class="btn-no-color" (click)="closeSearch();showSearch=false;searchSubject=''" *ngIf="showSearch">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="font-40" name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' || ThemeService.currentTheme == 'doneIt' " class="font-40" name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="font-40" name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="font-40" name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</button>
<div *ngIf="showSearch">
@@ -147,23 +130,23 @@
<ion-input (keyup.enter)="basicSearch()" [(ngModel)]='searchSubject' (ngModelChange)="dynamicSearch()"
class="search-input text-black" type="search" placeholder="Pesquisar"></ion-input>
</div>
<div class="icon" (click)="clearSearchInput()">
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'default' "name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'doneIt' "name="restaurant-outline" src="assets/images/theme/doneIt/icons-search.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'gov' " name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
<ion-icon title="Limpar" *ngIf="ThemeService.currentTheme == 'tribunal' " name="restaurant-outline" src="assets/images/theme/gov/icons-search-close.svg"></ion-icon>
</div>
</div>
</div>
</div>
<div title="Perfil" class="div-profile d-flex cursor-pointer" (click)="openProfile()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " class="icon" src='assets/images/theme/doneIt/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="icon" src='assets/images/theme/tribunal/icons-profile.svg'></ion-icon>
<div class="profile-text">
<!-- <ion-label>{{profileLabel(loggeduser.Profile)}}</ion-label> -->
<div *ngIf="this.notificationLength > 0 && !production" class="icon-badge"
style="right: -18px;top: -9px;">
{{notificationLength}}</div>
@@ -177,5 +160,4 @@
</div>
<div [class.header-bottom-line] = "ThemeService.currentTheme == 'gov'" style="height: 5px;"></div>
<!-- {{ RouteService.history | json }} -->
</div>
+69 -67
View File
@@ -7,7 +7,6 @@ import { ProfilePage } from 'src/app/modals/profile/profile.page';
import { StorageService } from '../../services/storage.service';
import { SessionStore } from 'src/app/store/session.service';
import { environment } from 'src/environments/environment';
import { EventTrigger } from '../../services/eventTrigger.service';
import { ThemeService } from '../../services/theme.service';
import { RouteService } from 'src/app/services/route.service';
import { PermissionList } from 'src/app/models/permission/permissionList';
@@ -29,9 +28,13 @@ export class HeaderPage implements OnInit {
notificationLength: 0;
SessionStore = SessionStore
check: boolean;
permissionList = new PermissionList();
production = environment.production
environment = environment
canOpenSearch = false
showProfileModal = false
permissionList = new PermissionList();
constructor(
private router: Router,
@@ -39,8 +42,6 @@ export class HeaderPage implements OnInit {
private animationController: AnimationController,
private storageservice: StorageService,
public platform: Platform,
//private notificationsService: NotificationsService,
private eventrigger: EventTrigger,
public ThemeService: ThemeService,
public RouteService: RouteService,
public p: PermissionService,
@@ -48,42 +49,25 @@ export class HeaderPage implements OnInit {
this.loggeduser = SessionStore.user;
router.events.subscribe((val) => {
this.showSearch = false;
//this.modalController.dismiss();
this.canOpenSearch = true;
this.showProfileModal = false
});
}
ngOnInit() {
async ngOnInit() {
this.hideSearch();
this.update()
/* this.notificationLengthData();
this.eventrigger.getObservable().subscribe(async (data) => {
if (data.notification === "delete" || "recive") {
await this.notificationLengthData();
}
}) */
this.update();
}
update() {
/* setInterval(() => {
this.notificationLengthData();
}, 5000) */
}
/* UpdateNotificationCount() {
this.notificationsService.registerCallback(
'any',
() => {
setTimeout(()=>{
this.notificationLengthData();
}, 100)
}
)
} */
async notificationLengthData() {
await this.storageservice.get("Notifications").then((value) => {
@@ -135,8 +119,6 @@ export class HeaderPage implements OnInit {
showSearchInput = false
}
if (window.location.pathname.startsWith('/home/agenda')) {
type = "Agenda"
} else if (window.location.pathname.startsWith('/home/gabinete-digital')) {
@@ -146,16 +128,28 @@ export class HeaderPage implements OnInit {
type = "AccoesPresidenciais"
}
const modal = await this.modalController.create({
component: SearchPage,
cssClass: classs,
componentProps: {
type: type,
showSearchInput: showSearchInput,
select: false
}
});
return await modal.present();
if(this.canOpenSearch) {
this.canOpenSearch = false
const modal = await this.modalController.create({
component: SearchPage,
cssClass: classs,
componentProps: {
type: type,
showSearchInput: showSearchInput,
select: false
}
});
await modal.present();
modal.onDidDismiss().then(() => {
this.canOpenSearch = true;
});
}
}
changeRoute(path) {
@@ -188,24 +182,33 @@ export class HeaderPage implements OnInit {
return enterAnimation(baseEl).direction('reverse');
}
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
component: ProfilePage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
}
});
await modal.present();
modal.onDidDismiss().then(() => {
this.notificationLengthData()
})
if(!this.showProfileModal) {
this.showProfileModal = true
const modal = await this.modalController.create({
component: ProfilePage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
}
});
await modal.present();
modal.onDidDismiss().then(() => {
this.notificationLengthData()
this.showProfileModal = false
})
}
}
async dynamicSearch() {
window['dynamicSearch'](this.searchSubject)
if(window['dynamicSearch']) {
window['dynamicSearch']()
} else {
setTimeout(()=>{
this.dynamicSearch()
}, 100)
}
}
@@ -222,16 +225,15 @@ export class HeaderPage implements OnInit {
}
async basicSearch() {
window['searchTriger']()
if(window['searchTriger']) {
window['searchTriger']()
} else {
setTimeout(()=>{
this.basicSearch()
}, 100)
}
}
profileLabel(text) {
if (text == 'MDGPR') {
return 'MD'
} else if (text == 'PR') {
return text
} else {
return 'UN'
}
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ChatDebuggingPage } from './chat-debugging.page';
const routes: Routes = [
{
path: '',
component: ChatDebuggingPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ChatDebuggingPageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { ChatDebuggingPageRoutingModule } from './chat-debugging-routing.module';
import { ChatDebuggingPage } from './chat-debugging.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ChatDebuggingPageRoutingModule
],
declarations: [ChatDebuggingPage]
})
export class ChatDebuggingPageModule {}
@@ -0,0 +1,9 @@
<ion-content>
<ul>
<li>Chat login</li>
<li>Chat user list {{ ChatSystemService.users | json }}</li>
</ul>
<ul>
<li *ngFor="let room of ChatSystemService._dm">chat Name: {{room.name}}; subcribe: {{room.status.receive.message}}; </li>
</ul>
</ion-content>
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ChatDebuggingPage } from './chat-debugging.page';
describe('ChatDebuggingPage', () => {
let component: ChatDebuggingPage;
let fixture: ComponentFixture<ChatDebuggingPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ChatDebuggingPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ChatDebuggingPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,17 @@
import { Component, OnInit } from '@angular/core';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
@Component({
selector: 'app-chat-debugging',
templateUrl: './chat-debugging.page.html',
styleUrls: ['./chat-debugging.page.scss'],
})
export class ChatDebuggingPage implements OnInit {
constructor(
public ChatSystemService: ChatSystemService
) { }
ngOnInit() {}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ChatMessageDebuggingPage } from './chat-message-debugging.page';
const routes: Routes = [
{
path: '',
component: ChatMessageDebuggingPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ChatMessageDebuggingPageRoutingModule {}
@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { ChatMessageDebuggingPageRoutingModule } from './chat-message-debugging-routing.module';
import { ChatMessageDebuggingPage } from './chat-message-debugging.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ChatMessageDebuggingPageRoutingModule
],
declarations: [ChatMessageDebuggingPage]
})
export class ChatMessageDebuggingPageModule {}
@@ -0,0 +1,10 @@
<ion-header>
<ion-toolbar>
<ion-title>chatMessageDebugging</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<button (click)="loadHistory()">Load History</button>
</ion-content>
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ChatMessageDebuggingPage } from './chat-message-debugging.page';
describe('ChatMessageDebuggingPage', () => {
let component: ChatMessageDebuggingPage;
let fixture: ComponentFixture<ChatMessageDebuggingPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ ChatMessageDebuggingPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ChatMessageDebuggingPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,29 @@
import { Component, OnInit } from '@angular/core';
import { NavParams } from '@ionic/angular';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
@Component({
selector: 'app-chat-message-debugging',
templateUrl: './chat-message-debugging.page.html',
styleUrls: ['./chat-message-debugging.page.scss'],
})
export class ChatMessageDebuggingPage implements OnInit {
roomId: string
constructor(
public ChatSystemService: ChatSystemService,
private navParams: NavParams
) { }
ngOnInit() {
this.roomId = this.navParams.get('roomId')
}
loadHistory() {
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({});
}
}
@@ -4,7 +4,7 @@ import { ChatService } from 'src/app/services/chat.service';
import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'
import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service';
import { HttpErrorResponse } from '@angular/common/http';
import { SessionStore } from 'src/app/store/session.service';
@@ -27,7 +27,7 @@ export class ChatPopoverPage implements OnInit {
private chatService: ChatService,
private toastService: ToastService,
public ThemeService: ThemeService,
public wsChatMethodsService: WsChatMethodsService,
public ChatSystemService: ChatSystemService,
) {
this.roomId = this.navParams.get('roomId');
this.members = this.navParams.get('members');
@@ -35,7 +35,7 @@ export class ChatPopoverPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
// this.chatService.refreshtoken();
}
close(action:any){
@@ -73,7 +73,7 @@ export class ChatPopoverPage implements OnInit {
modal.onDidDismiss().then((res)=>{
if(res.data == 'success'){
this.leaveGroup();
//this.wsChatMethodsService.hidingRoom(this.roomId);
//this.ChatSystemService.hidingRoom(this.roomId);
}
});
}
@@ -82,8 +82,8 @@ export class ChatPopoverPage implements OnInit {
let body = { "roomId":this.roomId, }
let res:any = await this.wsChatMethodsService.leaveRoom(this.roomId);
this.wsChatMethodsService.deleteRoom(this.roomId)
let res:any = await this.ChatSystemService.leaveRoom(this.roomId);
if(res.error){
if(res.error.error = "error-you-are-last-owner"){
@@ -98,12 +98,11 @@ export class ChatPopoverPage implements OnInit {
this.toastService._badRequest("Não foi possível sair do grupo");
}
}
else{
else {
this.ChatSystemService.deleteRoom(this.roomId)
this.close('leave');
}
this.close('leave');
}
//Delete
@@ -112,14 +111,14 @@ export class ChatPopoverPage implements OnInit {
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room'];
if(this.room.t === 'p'){
if(this.room.t === 'p') {
this.chatService.deleteGroup(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.roomId)
this.ChatSystemService.deleteRoom(this.roomId)
});
}
else{
else {
this.chatService.deleteChannel(body).subscribe(res=>{
this.wsChatMethodsService.deleteRoom(this.roomId)
this.ChatSystemService.deleteRoom(this.roomId)
});
}
});
@@ -1,9 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { DeplomaService } from 'src/app/Rules/deploma.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service';
import { RouteService } from 'src/app/services/route.service';
@@ -26,12 +24,9 @@ export class DeplomaOptionsPage implements OnInit {
constructor(
public popoverController: PopoverController,
private modalController: ModalController,
private activatedRoute: ActivatedRoute,
private processes: ProcessesService,
private navParams: NavParams,
private toastService: ToastService,
private router: Router,
private deplomaService: DeplomaService,
private RouteService: RouteService,
public p: PermissionService,) {
this.serialNumber = this.navParams.get('serialNumber');
@@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ProcessesService } from 'src/app/services/processes.service';
import { ActivatedRoute, Router } from '@angular/router';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
@@ -24,9 +23,8 @@ export class DespachosOptionsPage implements OnInit {
fulltask: fullTask;
serialNumber: string;
constructor(private activateRoute: ActivatedRoute,
constructor(
private processes: ProcessesService,
private router: Router,
private modalController: ModalController,
public popoverController: PopoverController,
private navParams: NavParams,
@@ -1,10 +1,9 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service';
import { ActivatedRoute, Router } from '@angular/router';
import { Router } from '@angular/router';
import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { DespachoService } from 'src/app/Rules/despacho.service'
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
@@ -26,9 +25,7 @@ export class DiplomasGerarOptionsPage implements OnInit {
private processes: ProcessesService,
public popoverController: PopoverController,
private modalController: ModalController,
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
private RouteService: RouteService,
public ThemeService: ThemeService,
private despachoService: DespachoService,
private navParams: NavParams,
@@ -1,4 +1,3 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service';
@@ -25,7 +24,7 @@ export class MessagesOptionsPage implements OnInit {
}
ngOnInit() {
this.chatService.refreshtoken();
// this.chatService.refreshtoken();
}
close(){
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { SearchList } from 'src/app/models/search-document';
import { LoginUserRespose } from 'src/app/models/user.model';
@@ -8,12 +8,12 @@ import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { SearchPage } from 'src/app/pages/search/search.page';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { AuthService } from 'src/app/services/auth.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'
import { RouteService } from 'src/app/services/route.service';
import { PermissionService } from 'src/app/services/permission.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-opts-expediente-pr',
@@ -45,7 +45,6 @@ export class OptsExpedientePrPage implements OnInit {
private modalController: ModalController,
private processes: ProcessesService,
private attachmentsService: AttachmentsService,
private userAuth: AuthService,
private navParams: NavParams,
private toastService: ToastService,
private RouteService: RouteService,
@@ -57,7 +56,7 @@ export class OptsExpedientePrPage implements OnInit {
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
this.loggeduser = userAuth.ValidatedUser;
this.loggeduser = SessionStore.user;
if(this.task.Status != 'Pending'){
this.showEnviarPendentes = true;
}
@@ -18,7 +18,7 @@ import { ThemeService } from 'src/app/services/theme.service'
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
import { RouteService } from 'src/app/services/route.service';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-opts-expediente',
@@ -49,10 +49,9 @@ export class OptsExpedientePage implements OnInit {
private attachmentsService: AttachmentsService,
private RouteService: RouteService,
private expedienteService: ExpedienteService,
public ThemeService: ThemeService,
private userAuth: AuthService,
public ThemeService: ThemeService
) {
this.loggeduser = userAuth.ValidatedUser
this.loggeduser = SessionStore.user
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ActivatedRoute } from '@angular/router';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
@@ -10,7 +10,6 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { ToastService } from 'src/app/services/toast.service';
import { PedidoService } from 'src/app/Rules/pedido.service';
import { PermissionService } from 'src/app/services/permission.service';
import { DataService } from 'src/app/services/data.service';
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
@@ -34,10 +33,8 @@ export class RequestOptionsPage implements OnInit {
private processes: ProcessesService,
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
private router: Router,
public p: PermissionService,
private pedidoService: PedidoService,
private dataService: DataService,
) {
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
@@ -97,12 +97,12 @@
</div>
</div>
<div class="container-div">
<div class="container-div" >
<div class="ion-item-class-2 d-flex">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div>
<div class="ion-textarea-class flex-grow-1">
<div class="ion-textarea-class flex-grow-1" [class.input-error]="Form?.get('Detail')?.invalid && validateFrom ">
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="folder.Detail" rows="12" cols="20" placeholder="Descrição da acção..."></ion-textarea>
</div>
</div>
@@ -44,12 +44,6 @@ export class NewActionPage implements OnInit {
) {
this.folder = new PublicationFolder();
/* this.folder = Object.assign(this.folder, {
DateBegin: new Date().toISOString(),
DateEnd: (new Date(new Date().getTime() + 15 * 60000)).toISOString(),
}) */
}
get dateStart () {
@@ -85,16 +79,17 @@ export class NewActionPage implements OnInit {
injectValidation() {
this.Form = new FormGroup({
Subject: new FormControl(this.folder.Description, [
Validators.required,
// Validators.minLength(4)
//Validators.minLength(1)
]),
Date: new FormControl(this.dateValid, [
Validators.required
]),
Detail: new FormControl(this.folder.Detail, [
Validators.required
])
})
}
@@ -3,6 +3,7 @@
<div class="back-icon cursor-pointer" (click)="goBack()">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " slot="end" src='assets/images/theme/{{ThemeService.currentTheme}}/icons-calendar-arrow-left.svg'></ion-icon>
</div>
<div class="div-title">
<ion-label class="title"> {{publication.Title}}</ion-label>