merge made

This commit is contained in:
Eudes Inácio
2022-02-18 15:30:58 +01:00
50 changed files with 436 additions and 474 deletions
+6 -13
View File
@@ -15,12 +15,11 @@
console.log(res) console.log(res)
var data= [ var data= [
{ a:{aa:10}, b:{bb:2} }, { a:{aa:10}, b:2 },
{ a:{aa:10}, b:{bb:2} }, { a:{aa:10}, b:2 },
{ a:{aa:2} , b:{bb:2} }, { a:{aa:2} , b:2 },
{ a:{aa:3} , b:{bb:3} } { a:{aa:3} , b:3}
] ]
@@ -30,19 +29,13 @@
} }
var res = alasql('SELECT a, b FROM ? WHERE b->bb = 2',[ data ]); var res = alasql('SELECT a, b FROM ? WHERE b = 2',[ data ]);
console.log(res) console.log(res)
alasql(`CREATE TABLE Persons (
ID int NOT NULL PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
jsn1 JSON(64000) CHARACTER SET LATIN
);`);
alasql("INSERT INTO Persons VALUES (100, 'maquiran', 'peter', 18)"); alasql("INSERT INTO Persons VALUES (100, 'maquiran', 'peter', 18)");
console.log(alasql("SELECT * FROM Persons ")) console.log(alasql("SELECT * FROM Persons "))
+1 -1
View File
@@ -197,7 +197,7 @@
"protractor": "~7.0.0", "protractor": "~7.0.0",
"ts-jest-puppeteer": "0.0.5", "ts-jest-puppeteer": "0.0.5",
"ts-node": "~8.3.0", "ts-node": "~8.3.0",
"tslint": "~6.1.0", "tslint": "^6.1.3",
"typescript": "^4.3.5", "typescript": "^4.3.5",
"uk.co.workingedge.cordova.plugin.sqliteporter": "^1.1.1" "uk.co.workingedge.cordova.plugin.sqliteporter": "^1.1.1"
}, },
+1 -1
View File
@@ -29,7 +29,7 @@ export class AuthGuard implements CanActivate {
this.router.navigate(['/']); this.router.navigate(['/']);
return false return false
} else { } else {
this.authService.loginChat(); //this.authService.loginChat();
return true; return true;
} }
} }
+1
View File
@@ -1,3 +1,4 @@
<ion-tabs class="tab"> <ion-tabs class="tab">
<ion-tab-bar class="bottoms" slot="bottom"> <ion-tab-bar class="bottoms" slot="bottom">
<ion-tab-button tab="events" [class.active]="pathname === '/home/events' "> <ion-tab-button tab="events" [class.active]="pathname === '/home/events' ">
+2 -2
View File
@@ -100,9 +100,9 @@ export class HomePage implements OnInit {
private processservice: ProcessesService, private processservice: ProcessesService,
private screenOrientation: ScreenOrientation, private screenOrientation: ScreenOrientation,
private sqliteservice: SqliteService, private sqliteservice: SqliteService,
private RouteService: RouteService, public RouteService: RouteService,
private WsChatService: WsChatService, private WsChatService: WsChatService,
private NativeNotificationService: NativeNotificationService) { private NativeNotificationService: NativeNotificationService,) {
/* this.webNotificationPopupService.askNotificationPermission() */ /* this.webNotificationPopupService.askNotificationPermission() */
-2
View File
@@ -8,7 +8,6 @@ import { EventPerson } from 'src/app/models/eventperson.model';
import { EventsService } from 'src/app/services/events.service'; import { EventsService } from 'src/app/services/events.service';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page'; import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
import { AlertService } from 'src/app/services/alert.service';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { SearchList } from 'src/app/models/search-document'; import { SearchList } from 'src/app/models/search-document';
@@ -51,7 +50,6 @@ export class DelegarPage implements OnInit {
private attachmentsService: AttachmentsService, private attachmentsService: AttachmentsService,
private calendarService: EventsService, private calendarService: EventsService,
public alertController: AlertController, public alertController: AlertController,
private alertService: AlertService,
private animationController: AnimationController, private animationController: AnimationController,
private toastService: ToastService, private toastService: ToastService,
public ThemeService: ThemeService public ThemeService: ThemeService
+1
View File
@@ -58,6 +58,7 @@ export class UserSession {
UserName: string UserName: string
Password: string Password: string
RochetChatUser: string RochetChatUser: string
RochetChatUserId: string
Profile: any; Profile: any;
LoginPreference: 'None' | 'Password' | 'Pin' | null; LoginPreference: 'None' | 'Password' | 'Pin' | null;
PIN: string PIN: string
-6
View File
@@ -4,7 +4,6 @@ import { AlertController, ModalController, Platform } from '@ionic/angular';
import { EventsService } from 'src/app/services/events.service'; import { EventsService } from 'src/app/services/events.service';
import { Event } from '../../models/event.model'; import { Event } from '../../models/event.model';
import { Router, NavigationEnd } from '@angular/router'; import { Router, NavigationEnd } from '@angular/router';
import { AlertService } from 'src/app/services/alert.service';
import { momentG } from 'src/plugin/momentG'; import { momentG } from 'src/plugin/momentG';
import { DomSanitizer } from "@angular/platform-browser"; import { DomSanitizer } from "@angular/platform-browser";
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
@@ -170,7 +169,6 @@ export class AgendaPage implements OnInit {
private modalCtrl: ModalController, private modalCtrl: ModalController,
private eventService: EventsService, private eventService: EventsService,
private router: Router, private router: Router,
private alertController: AlertService,
private sanitizer: DomSanitizer, private sanitizer: DomSanitizer,
authService: AuthService, authService: AuthService,
private dateAdapter: DateAdapter<any>, private dateAdapter: DateAdapter<any>,
@@ -974,10 +972,6 @@ export class AgendaPage implements OnInit {
}, 250) }, 250)
} }
showAlert() {
this.alertController.presentAlert("Funcionalidade em desenvolvimento.");
}
changeProfile() { changeProfile() {
if (this.profile == "mdgpr") { if (this.profile == "mdgpr") {
@@ -52,7 +52,7 @@
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last" [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId" > <div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last" [class.messages-list-item-wrapper-active]="msg._id == selectedMsgId" >
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' (click)="downloadFileMsg(msg)" *ngIf="msg.msg !=''"> <div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' (click)="downloadFileMsg(msg)" *ngIf="msg.msg !=''">
<div class="title"> <div class="title">
<ion-label>{{msg.u.name}}</ion-label> <ion-label (click)="hkellor()">{{msg.u.name}}</ion-label>
<span class="time">{{msg.duration}}</span> <span class="time">{{msg.duration}}</span>
</div> </div>
<div> <div>
@@ -856,6 +856,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
// dialogTitle: 'Share with buddies', // dialogTitle: 'Share with buddies',
// }); // });
// } // }
hkellor() {
// alert('cool!')
}
} }
@@ -27,8 +27,8 @@ export class EventListPage implements OnInit {
profile: string; profile: string;
segment: string; segment: string;
showLoader: boolean; showLoader: boolean;
eventsPRList: any = [] eventsPRList: any = [];
eventsMDGPRList: any = [] eventsMDGPRList: any = [];
eventPerson: EventPerson; eventPerson: EventPerson;
eventBody: EventBody; eventBody: EventBody;
categories: string[]; categories: string[];
@@ -76,7 +76,7 @@ export class EventListPage implements OnInit {
window.onresize = (event) => { window.onresize = (event) => {
// if not mobile remove all component // if not mobile remove all component
if (window.innerWidth <= 800) { if (window.innerWidth < 701) {
this.modalController.dismiss(); this.modalController.dismiss();
} }
}; };
+7 -5
View File
@@ -102,8 +102,8 @@ export class LoginPage implements OnInit {
if (attempt) { if (attempt) {
if (attempt.UserId == SessionStore.user.UserId) { if (attempt.UserId == SessionStore.user.UserId) {
await this.authService.SetSession(attempt, this.userattempt); await this.authService.SetSession(attempt, this.userattempt);
//await this.authService.loginChat(); // await this.authService.loginChat();
//await this.authService.loginToChatWs() // await this.authService.loginToChatWs()
this.getToken(); this.getToken();
SessionStore.setInativity(true); SessionStore.setInativity(true);
@@ -117,12 +117,14 @@ export class LoginPage implements OnInit {
await this.authService.SetSession(attempt, this.userattempt); await this.authService.SetSession(attempt, this.userattempt);
this.changeProfileService.run() this.changeProfileService.run()
/* await this.authService.loginChat(); // await this.authService.loginChat();
await this.authService.loginToChatWs() */ // await this.authService.loginToChatWs()
this.getToken(); this.getToken();
this.router.navigateByUrl('/pin', { replaceUrl: true }); this.router.navigateByUrl('/pin', { replaceUrl: true });
} }
}
else{
this.toastService._badRequest('Ocorreu um problema por favor valide o username e password');
} }
} }
else { else {
@@ -11,8 +11,6 @@ import { Publication } from 'src/app/models/publication';
import { ActionsOptionsPage } from 'src/app/shared/popover/actions-options/actions-options.page'; import { ActionsOptionsPage } from 'src/app/shared/popover/actions-options/actions-options.page';
import { EditActionPage } from './edit-action/edit-action.page'; import { EditActionPage } from './edit-action/edit-action.page';
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';
import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
import { SqliteService } from 'src/app/services/sqlite.service'; import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service'; import { BackgroundService } from 'src/app/services/background.service';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
@@ -39,8 +37,6 @@ export class PublicationsPage implements OnInit {
months: string[]; months: string[];
days: string[]; days: string[];
publicationEventFolderStorage = PublicationEventFolderStorage
publicationTravelFolderService = PublicationTravelFolderStore
desktopComponent: any = { desktopComponent: any = {
showViewPublication: false, showViewPublication: false,
@@ -5,9 +5,6 @@ import { Publication } from 'src/app/models/publication';
import { PublicationFolder } from 'src/app/models/publicationfolder'; import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationPipe } from 'src/app/pipes/publication.pipe'; import { PublicationPipe } from 'src/app/pipes/publication.pipe';
import { PublicationsService } from 'src/app/services/publications.service'; import { PublicationsService } from 'src/app/services/publications.service';
import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';
import { PublicationListStorage } from 'src/app/store/publication-list.service';
import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
import { NewPublicationPage } from '../new-publication/new-publication.page'; import { NewPublicationPage } from '../new-publication/new-publication.page';
import { PublicationDetailPage } from './publication-detail/publication-detail.page'; import { PublicationDetailPage } from './publication-detail/publication-detail.page';
import { SqliteService } from 'src/app/services/sqlite.service'; import { SqliteService } from 'src/app/services/sqlite.service';
@@ -32,11 +29,6 @@ export class ViewPublicationsPage implements OnInit {
id: string; id: string;
error: any; error: any;
publicationListStorage = PublicationListStorage
//
publicationEventFolderStorage = PublicationEventFolderStorage
publicationTravelFolderService = PublicationTravelFolderStore
publicationPipe = new PublicationPipe() publicationPipe = new PublicationPipe()
publicationDitails: any; publicationDitails: any;
getpublication = []; getpublication = [];
@@ -170,7 +162,6 @@ export class ViewPublicationsPage implements OnInit {
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList)); this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
console.log('PUBLICATIONS IMAGEs',this.publicationList) console.log('PUBLICATIONS IMAGEs',this.publicationList)
this.publicationListStorage.add(folderId, this.publicationList)
this.getpublication = this.publicationList; this.getpublication = this.publicationList;
this.showLoader = false; this.showLoader = false;
@@ -210,7 +201,6 @@ export class ViewPublicationsPage implements OnInit {
}); });
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList)); this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
this.publicationListStorage.add(folderId, this.publicationList)
this.getpublication = this.publicationList; this.getpublication = this.publicationList;
this.showLoader = false; this.showLoader = false;
@@ -222,7 +212,6 @@ export class ViewPublicationsPage implements OnInit {
if (error.status == '404') { if (error.status == '404') {
this.error = 'Sem publicações disponíveis!'; this.error = 'Sem publicações disponíveis!';
this.publicationList = []; this.publicationList = [];
this.publicationListStorage.add(folderId, this.publicationList)
} }
this.showLoader = false; this.showLoader = false;
}); });
-2
View File
@@ -1,6 +1,5 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { AlertController, AnimationController } from '@ionic/angular'; import { AlertController, AnimationController } from '@ionic/angular';
import { ChatService } from './chat.service';
import { WsChatMethodsService } from './chat/ws-chat-methods.service'; import { WsChatMethodsService } from './chat/ws-chat-methods.service';
import { ToastService } from './toast.service'; import { ToastService } from './toast.service';
@@ -12,7 +11,6 @@ export class AlertService {
constructor( constructor(
public alertController: AlertController, public alertController: AlertController,
private animationController: AnimationController, private animationController: AnimationController,
private chatService: ChatService,
private toastService: ToastService, private toastService: ToastService,
public wsChatMethodsService: WsChatMethodsService, public wsChatMethodsService: WsChatMethodsService,
) { } ) { }
+9 -16
View File
@@ -56,9 +56,9 @@ export class AuthService {
} }
if (localStorage.getItem("userChat") != null) { /* if (localStorage.getItem("userChat") != null) {
this.ValidatedUserChat = JSON.parse(localStorage.getItem('userChat')); this.ValidatedUserChat = JSON.parse(localStorage.getItem('userChat'));
} } */
} }
@@ -112,7 +112,7 @@ export class AuthService {
//user: UserForm //user: UserForm
async loginChat() { async loginChat() {
const expirationMinutes = 30; /* const expirationMinutes = 30;
let date = new Date().getTime(); let date = new Date().getTime();
let expirationDate = new Date(new Date().getTime() + expirationMinutes*60*1000); let expirationDate = new Date(new Date().getTime() + expirationMinutes*60*1000);
@@ -135,7 +135,7 @@ export class AuthService {
this.presentAlert('Network error'); this.presentAlert('Network error');
} }
this.autoLoginChat(expirationDate.getTime() - date); this.autoLoginChat(expirationDate.getTime() - date); */
} }
async autoLoginChat(expirationDate:number){ async autoLoginChat(expirationDate:number){
@@ -145,7 +145,7 @@ export class AuthService {
} }
loginToChatWs() { loginToChatWs() {
setTimeout(()=>{ /* setTimeout(()=>{
this.WsChatService.connect(); this.WsChatService.connect();
this.WsChatService.login().then((message) => { this.WsChatService.login().then((message) => {
@@ -189,14 +189,12 @@ export class AuthService {
console.log(e) console.log(e)
return false return false
} }
} }
} }
return false return false
} }
this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => { this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => {
console.log('FILE TYPE', message.file.type) console.log('FILE TYPE', message.file.type)
@@ -224,18 +222,13 @@ export class AuthService {
}); });
return true return true
} }
return false return false
} }
}; };
}, 1) */
}, 1)
} }
autologout(expirationDate:number){ autologout(expirationDate:number) {
setTimeout(()=>{ setTimeout(()=>{
this.logout(); this.logout();
}, expirationDate) }, expirationDate)
@@ -255,13 +248,13 @@ export class AuthService {
} }
//Get user data from RocketChat | global object //Get user data from RocketChat | global object
getUserData(){ getUserData() {
this.storageService.get(AuthConnstants.AUTH).then(res=>{ this.storageService.get(AuthConnstants.AUTH).then(res=>{
this.userData$.next(res); this.userData$.next(res);
}); });
} }
logoutChat(){ logoutChat() {
//this.storageService.clear(); //this.storageService.clear();
/* this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{ /* this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
this.userData$.next(''); this.userData$.next('');
+53 -2
View File
@@ -18,7 +18,13 @@ export class MessageService {
msg = '' msg = ''
rid = '' rid = ''
ts = {} ts = {}
u = {}
u = {
name: '',
username: '',
_id: ""
}
t = '' t = ''
_id ='' _id =''
_updatedAt _updatedAt
@@ -35,6 +41,8 @@ export class MessageService {
loadHistory = false loadHistory = false
duration = '' duration = ''
localReference = null localReference = null
viewed = []
received = []
constructor(private storage: Storage, constructor(private storage: Storage,
private NfService: NfService, private NfService: NfService,
@@ -78,6 +86,7 @@ export class MessageService {
} }
} }
this.calDateDuration() this.calDateDuration()
} }
@@ -142,7 +151,7 @@ export class MessageService {
let ChatMessage = message.result let ChatMessage = message.result
if (environment.chatOffline) { if (environment.chatOffline) {
// this.redefinedMessage(ChatMessage) this.redefinedMessage(ChatMessage)
this.offline = false this.offline = false
} }
@@ -189,5 +198,47 @@ export class MessageService {
this.duration = showDateDuration(date || this._updatedAt); this.duration = showDateDuration(date || this._updatedAt);
} }
private messageReceptor() {
return this.u.username != SessionStore.user.RochetChatUser
}
receptorReceive() {
if(this.messageReceptor()) {
let newMessage = {
rid: this._id,
msg: this.msg,
attachments: this.attachments,
file: this.file,
localReference: this.localReference,
viewed: this.viewed.push('123'),
received: this.viewed.push('123'),
}
this.WsChatService.updateMessage(newMessage).then(()=>{
console.log('newMessage', newMessage)
})
}
}
receptorView() {
if(this.messageReceptor()) {
let newMessage = {
rid: this._id,
msg: this.msg,
attachments: this.attachments,
file: this.file,
localReference: this.localReference,
viewed: this.viewed.push('123'),
received: this.viewed.push('123'),
}
this.WsChatService.updateMessage(newMessage).then(()=>{
console.log('newMessage', newMessage)
})
}
}
} }
+53 -2
View File
@@ -201,6 +201,40 @@ export class RoomService {
}) })
} }
}
async updateViewedMessage(id, userId) {
if (environment.chatOffline) {
this.storage.get('chatmsg' + this.id).then((messages: any = []) => {
if(!Array.isArray(messages)) {
messages = []
}
let index;
const find = messages.find((message, _index)=> {
if(message._id == id) {
index = _index
return true
}
return false
})
if(find) {
if(!messages[index].hasOwnProperty('viewed') || !Array.isArray(messages[index].viewed)) {
messages.viewed = []
}
messages.viewed.push(userId)
this.storage.set('chatmsg' + this.id, messages)
}
})
}
} }
/** /**
@@ -279,11 +313,16 @@ export class RoomService {
attachments, attachments,
file, file,
temporaryData, temporaryData,
localReference localReference,
viewed: [],
received: []
} }
const message: MessageService = this.prepareMessage(offlineChatMessage, environment.chatOffline) const message: MessageService = this.prepareMessage(offlineChatMessage, environment.chatOffline)
/**
* @description redefine message offline data "offlineChatMessage" with live ChatMessage
*/
message.send().then((ChatMessage) => { message.send().then((ChatMessage) => {
this.updateMessageDB(ChatMessage, localReference) this.updateMessageDB(ChatMessage, localReference)
}) })
@@ -305,6 +344,13 @@ export class RoomService {
this.message= '' this.message= ''
} }
/**
*
* @param message
* @param ChatMessage
* @description when creating message we use offline data, then we need redefined with live data
*/
redefinedMessage (message: MessageService, ChatMessage) { redefinedMessage (message: MessageService, ChatMessage) {
ChatMessage = this.fix_updatedAt(ChatMessage) ChatMessage = this.fix_updatedAt(ChatMessage)
@@ -448,7 +494,12 @@ export class RoomService {
} }
/**
* @description find or create message
* @param message
* @param save
* @returns
*/
prepareMessage(message, save = true): MessageService { prepareMessage(message, save = true): MessageService {
message = this.fix_updatedAt(message) message = this.fix_updatedAt(message)
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService) const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService)
@@ -22,8 +22,8 @@ export class WsChatMethodsService {
dm: {[key: string]: RoomService} = {} dm: {[key: string]: RoomService} = {}
group: {[key: string]: RoomService} = {} group: {[key: string]: RoomService} = {}
_dm = [] _dm: RoomService[] = []
_group = [] _group: RoomService[] = []
loadingWholeList = false loadingWholeList = false
@@ -71,7 +71,9 @@ export class WsChatMethodsService {
} }
}) })
this.changeProfileService.registerCallback(()=>{
// on change profile remove a rooms
this.changeProfileService.registerCallback(() => {
this.clearChat() this.clearChat()
this.ReLoadChat() this.ReLoadChat()
this.storage.remove('Rooms'); this.storage.remove('Rooms');
@@ -142,13 +144,6 @@ export class WsChatMethodsService {
this.users = [] this.users = []
} }
getRoomFromDb() {
this.storage.get('Rooms').then((rooms) => {
rooms.result.update.forEach((roomData: room) => {
this.prepareRoom(roomData);
});
})
}
openRoom(roomId) { openRoom(roomId) {
@@ -186,7 +181,6 @@ export class WsChatMethodsService {
async getAllRooms () { async getAllRooms () {
this.loadingWholeList = true this.loadingWholeList = true
//this.getRoomFromDb();
const rooms = await this.WsChatService.getRooms(); const rooms = await this.WsChatService.getRooms();
await this.storage.remove('Rooms'); await this.storage.remove('Rooms');
await this.storage.set('Rooms', rooms); await this.storage.set('Rooms', rooms);
@@ -266,6 +260,9 @@ export class WsChatMethodsService {
prepareRoom(roomData) { prepareRoom(roomData) {
/**
* @description data used to define or create room
*/
const setData = { const setData = {
customFields: roomData.customFields, customFields: roomData.customFields,
id: this.getRoomId(roomData), id: this.getRoomId(roomData),
@@ -277,7 +274,8 @@ export class WsChatMethodsService {
let roomId = this.getRoomId(roomData) let roomId = this.getRoomId(roomData)
if(!this.dm[roomId] && !this.group[roomId]) { // create room
if(!this.roomExist(roomId)) {
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService) let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService)
room.setData(setData) room.setData(setData)
room.receiveMessage() room.receiveMessage()
@@ -285,6 +283,8 @@ export class WsChatMethodsService {
room.receiveMessageDelete(); room.receiveMessageDelete();
room.sortRoomList = this.sortRoomList room.sortRoomList = this.sortRoomList
// create individual room
if(this.isIndividual(roomData)) { if(this.isIndividual(roomData)) {
this.dm[roomId] = room this.dm[roomId] = room
@@ -292,12 +292,16 @@ export class WsChatMethodsService {
this.dmCount++ this.dmCount++
} else { } else {
// create group room
this.group[roomId] = room this.group[roomId] = room
this._group.push(room) this._group.push(room)
this.groupCount++ this.groupCount++
} }
} else { } else {
// in this case room is already present, therefor it will only be necessary,
// to redefine
if(this.dm[roomId]) { if(this.dm[roomId]) {
this.dm[roomId].setData(setData) this.dm[roomId].setData(setData)
@@ -306,11 +310,11 @@ export class WsChatMethodsService {
} }
} }
} }
roomExist(roomId) {
return this.dm[roomId] && this.group[roomId]
}
getReceptorName(roomData) { getReceptorName(roomData) {
try { try {
@@ -326,20 +330,20 @@ export class WsChatMethodsService {
*/ */
private getUserStatus(id?:string) { private getUserStatus(id?:string) {
// this.WsChatService.getUserStatus((d) => { this.WsChatService.getUserStatus((d) => {
// const username = d.fields.args[0][1] const username = d.fields.args[0][1]
// const statusNum = d.fields.args[0][2] const statusNum = d.fields.args[0][2]
// const statusText = this.statusNumberToText(statusNum) const statusText = this.statusNumberToText(statusNum)
// const user = this.getUserByName(username) const user = this.getUserByName(username)
// if(user) { if(user) {
// user.status = statusText user.status = statusText
// } }
// }) })
} }
@@ -393,8 +397,11 @@ export class WsChatMethodsService {
} }
hidingRoom(id?) { hidingRoom(id?) {
//this.hideRoom(id);
return this.WsChatService.hidingRoom(id); return this.WsChatService.hidingRoom(id).then(()=>{
// this.hideRoom(id)
})
} }
addRoomOwner(roomid, userId){ addRoomOwner(roomid, userId){
@@ -420,7 +427,7 @@ export class WsChatMethodsService {
getRoomName(roomData: room) { getRoomName(roomData: room) {
if(this.isIndividual(roomData)) { if(this.isIndividual(roomData)) {
const names: String[] = roomData.usernames const names: String[] = roomData.usernames
const roomName = names.filter((name)=>{ const roomName = names.filter((name, index)=>{
return name != SessionStore.user.RochetChatUser return name != SessionStore.user.RochetChatUser
})[0] })[0]
+23
View File
@@ -186,6 +186,29 @@ export class WsChatService {
}); });
} }
updateMessage(messageObject) {
const requestId = uuidv4()
var message = {
msg: "method",
method: "updateMessage",
id: requestId,
params: [messageObject]
}
this.ws.send({message, requestId});
return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId ) { // same request send
resolve({message, requestId})
return true
}
}})
})
}
leaveRoom(roomId) { leaveRoom(roomId) {
const requestId = uuidv4() const requestId = uuidv4()
@@ -7,7 +7,6 @@ import { EventBody } from 'src/app/models/eventbody.model';
import { AlertController, ModalController } from '@ionic/angular'; import { AlertController, ModalController } from '@ionic/angular';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { AlertService } from 'src/app/services/alert.service';
import { Attachment } from 'src/app/models/attachment.model'; import { Attachment } from 'src/app/models/attachment.model';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { FormGroup, FormBuilder, Validators } from "@angular/forms"; import { FormGroup, FormBuilder, Validators } from "@angular/forms";
@@ -41,7 +40,6 @@ export class EditEventPage implements OnInit {
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private eventsService: EventsService, private eventsService: EventsService,
private modalCtrl: ModalController, private modalCtrl: ModalController,
private alertService: AlertService,
private attachamentsService: AttachmentsService, private attachamentsService: AttachmentsService,
private route: Router, private route: Router,
private iab: InAppBrowser) { private iab: InAppBrowser) {
@@ -184,10 +182,6 @@ export class EditEventPage implements OnInit {
} }
} }
showAlert(){
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
}
loadAttachments() loadAttachments()
{ {
/* console.log(this.pageId); */ /* console.log(this.pageId); */
@@ -6,7 +6,6 @@ import { Attachment } from 'src/app/models/attachment.model';
import { Event } from 'src/app/models/event.model'; import { Event } from 'src/app/models/event.model';
import { EventBody } from 'src/app/models/eventbody.model'; import { EventBody } from 'src/app/models/eventbody.model';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { AlertService } from 'src/app/services/alert.service';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { EventsService } from 'src/app/services/events.service'; import { EventsService } from 'src/app/services/events.service';
import { AttachmentsPage } from '../attachments/attachments.page'; import { AttachmentsPage } from '../attachments/attachments.page';
@@ -38,7 +37,6 @@ export class EventDetailModalPage implements OnInit {
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private eventsService: EventsService, private eventsService: EventsService,
private modalCtrl: ModalController, private modalCtrl: ModalController,
private alertService: AlertService,
private attachamentsService: AttachmentsService, private attachamentsService: AttachmentsService,
private route: Router,) { private route: Router,) {
this.loadedEvent = new Event(); this.loadedEvent = new Event();
@@ -180,10 +178,6 @@ export class EventDetailModalPage implements OnInit {
} }
} }
showAlert(){
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
}
loadAttachments() loadAttachments()
{ {
/* this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => { /* this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => {
@@ -7,7 +7,6 @@ import { EventBody } from 'src/app/models/eventbody.model';
import { AlertController, ModalController } from '@ionic/angular'; import { AlertController, ModalController } from '@ionic/angular';
import { EventPerson } from 'src/app/models/eventperson.model'; import { EventPerson } from 'src/app/models/eventperson.model';
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page'; import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
import { AlertService } from 'src/app/services/alert.service';
import { Attachment } from 'src/app/models/attachment.model'; import { Attachment } from 'src/app/models/attachment.model';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { FormGroup, FormBuilder, Validators } from "@angular/forms"; import { FormGroup, FormBuilder, Validators } from "@angular/forms";
@@ -42,7 +41,6 @@ export class EventDetailPage implements OnInit {
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private eventsService: EventsService, private eventsService: EventsService,
private modalCtrl: ModalController, private modalCtrl: ModalController,
private alertService: AlertService,
private attachamentsService: AttachmentsService, private attachamentsService: AttachmentsService,
private route: Router, private route: Router,
private iab: InAppBrowser) { private iab: InAppBrowser) {
@@ -182,10 +180,6 @@ export class EventDetailPage implements OnInit {
} }
} }
showAlert(){
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
}
loadAttachments() loadAttachments()
{ {
/* console.log(this.pageId); */ /* console.log(this.pageId); */
-2
View File
@@ -4,7 +4,6 @@ import { Event } from '../../models/event.model';
import { EventsService } from 'src/app/services/events.service'; import { EventsService } from 'src/app/services/events.service';
import { NavigationExtras, Router } from '@angular/router'; import { NavigationExtras, Router } from '@angular/router';
import { ActivatedRoute, NavigationEnd } from '@angular/router'; import { ActivatedRoute, NavigationEnd } from '@angular/router';
import { AlertService } from 'src/app/services/alert.service';
import { AuthService } from 'src/app/services/auth.service'; import { AuthService } from 'src/app/services/auth.service';
import { StorageService } from 'src/app/services/storage.service'; import { StorageService } from 'src/app/services/storage.service';
import { ModalController, Platform } from '@ionic/angular'; import { ModalController, Platform } from '@ionic/angular';
@@ -78,7 +77,6 @@ export class EventsPage implements OnInit {
private router: Router, private router: Router,
private storageService:StorageService, private storageService:StorageService,
public activatedRoute: ActivatedRoute, public activatedRoute: ActivatedRoute,
private alertController: AlertService,
private authService: AuthService, private authService: AuthService,
private processes:ProcessesService, private processes:ProcessesService,
/* private gabineteService: GabineteDigitalPage, */ /* private gabineteService: GabineteDigitalPage, */
+52 -13
View File
@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { NavigationEnd, Router, NavigationStart } from '@angular/router'; import { NavigationEnd, Router, NavigationStart, NavigationExtras } from '@angular/router';
import { LocalstoreService } from '../store/localstore.service';
import { Location } from '@angular/common'
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -8,11 +9,15 @@ import { NavigationEnd, Router, NavigationStart } from '@angular/router';
export class RouteService { export class RouteService {
history: any = []; history: any = [];
isGoBack = false;
constructor( constructor(
private router: Router, private router: Router,
private LocalstoreService: LocalstoreService,
private Location: Location
) { ) {
this.history = this.LocalstoreService.get('history', [])
this.router.events.forEach((event) => { this.router.events.forEach((event) => {
if (event instanceof NavigationEnd) { if (event instanceof NavigationEnd) {
@@ -20,6 +25,7 @@ export class RouteService {
if(event.url != lastRoute) { if(event.url != lastRoute) {
this.history.push(event.url) this.history.push(event.url)
this.reduceHistory()
} }
} }
@@ -30,23 +36,56 @@ export class RouteService {
} }
/** /**
* @param url [string] incase no history to go back * @param url [string] incase no history to go back */
* @param option [Object] some options to the url goBack(url = null) {
*/
goBack(url = null, option: object = {}) {
if(this.history.length >= 2) { if(this.history.length >= 2) {
console.log(this.history);
this.history.pop(); this.history.pop();
const goTo = this.history.pop(); const url = this.history.pop();
this.isGoBack = true;
this.router.navigate([goTo]); this.goTo(url)
} else if(url) { } else if(url) {
this.goTo({url}) this.goTo(url)
} }
this.reduceHistory()
} }
goTo({url}) { goTo(url) {
this.router.navigate([url]); let navigationExtras: NavigationExtras = {
queryParams: this.queryParams(url)
}
const urlObject = new URL('http://localhost:8100'+url);
this.router.navigate([urlObject.pathname], navigationExtras);
}
reduceHistory() {
if(this.history.length >= 15) {
this.history = this.history.slice(5, this.history.length)
}
this.LocalstoreService.set('history', this.history)
}
queryParams(url) {
const urlObject = new URL('http://localhost:8100'+url);
const paramsString = urlObject.search;
let searchParams: any = new URLSearchParams(paramsString);
let params = {}
for (let [key, value] of searchParams) {
params[key] = value
}
console.log('params', params)
return params
} }
} }
@@ -2,7 +2,6 @@ import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { NavigationExtras, Router } from '@angular/router'; import { NavigationExtras, Router } from '@angular/router';
import { ModalController, PopoverController } from '@ionic/angular'; import { ModalController, PopoverController } from '@ionic/angular';
import { Event } from 'src/app/models/event.model'; import { Event } from 'src/app/models/event.model';
import { AlertService } from 'src/app/services/alert.service';
import { AttachmentsService } from 'src/app/services/attachments.service'; import { AttachmentsService } from 'src/app/services/attachments.service';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page'; import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page';
@@ -47,7 +46,6 @@ export class ApproveEventPage implements OnInit {
private processes:ProcessesService, private processes:ProcessesService,
private attachmentsService: AttachmentsService, private attachmentsService: AttachmentsService,
private popoverController: PopoverController, private popoverController: PopoverController,
private alertService: AlertService,
private iab: InAppBrowser, private iab: InAppBrowser,
private toastService: ToastService, private toastService: ToastService,
public ThemeService: ThemeService public ThemeService: ThemeService
@@ -81,10 +79,6 @@ export class ApproveEventPage implements OnInit {
} */ } */
notImplemented() {
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
close() { close() {
/* this.router.navigate(['/home/gabinete-digital/event-list']); */ /* this.router.navigate(['/home/gabinete-digital/event-list']); */
this.closeEventToApprove.emit(); this.closeEventToApprove.emit();
@@ -48,11 +48,16 @@
</mat-menu> </mat-menu>
</div> </div>
<div class="title"> <div class="title">
<ion-label>{{msg.u.name}}</ion-label> <ion-label (click)="testEditMessage(msg)">{{msg.u.name}}</ion-label>
<span class="time">{{msg.duration}}</span> <span class="time">{{msg.duration}}</span>
</div> </div>
<div> <div class="d-flex justify-space-between">
<ion-label>{{msg.msg}}</ion-label> <ion-label class="flex-0">{{msg.msg}}</ion-label>
<ion-label class="float-status-all float-status" >
<ion-icon *ngIf="!msg.offline && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.offline && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.viewed.length == 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
</ion-label>
{{last ? scrollToBottom() : ''}} {{last ? scrollToBottom() : ''}}
</div> </div>
</div> </div>
@@ -75,6 +80,11 @@
<div *ngFor="let file of msg.attachments"> <div *ngFor="let file of msg.attachments">
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)" dfsdvsvs> <div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)" dfsdvsvs>
<img src={{msg.attachments[0].image_url}} alt="image"> <img src={{msg.attachments[0].image_url}} alt="image">
<ion-label class="float-status-image float-status-all">
<ion-icon *ngIf="!msg.offline && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.offline && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.viewed.length == 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
</ion-label>
</div> </div>
<div *ngIf="msg.file.type != 'application/img'"> <div *ngIf="msg.file.type != 'application/img'">
<div class="file"> <div class="file">
@@ -99,6 +109,11 @@
<span <span
*ngIf="msg.file.type != 'application/webtrix'">{{msg.displayType}}</span> *ngIf="msg.file.type != 'application/webtrix'">{{msg.displayType}}</span>
</ion-label> </ion-label>
<ion-label class="float-status-webtrix float-status-all">
<ion-icon *ngIf="!msg.offline && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.offline && msg.viewed.length == 0" src="assets/images/check-solid.svg"></ion-icon>
<ion-icon *ngIf="msg.viewed.length == 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
</ion-label>
</div> </div>
</div> </div>
</div> </div>
@@ -287,3 +287,29 @@ display: block;
padding-left: 10px; padding-left: 10px;
} }
.float-status{
position: relative !important;
float: right;
display: flex;
align-items: self-end;
}
.float-status-image{
position: relative !important;
float: right;
display: flex;
align-items: self-end;
top: -15px;
}
.float-status-webtrix {
position: relative !important;
top: 0px !important;
float: right;
display: flex;
align-items: self-end;
}
.float-status-all {
font-size: 10pt !important;
}
@@ -150,11 +150,6 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}); });
} }
notImplemented() {
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
load = () => { load = () => {
this.checktimeOut = true; this.checktimeOut = true;
this.getChatMembers(); this.getChatMembers();
@@ -774,6 +769,12 @@ console.log(msg);
} }
} }
testEditMessage(msg:MessageService) {
msg.receptorReceive()
// alert('cool!')
}
} }
@@ -3,7 +3,6 @@ import { NavigationStart, Router } from '@angular/router';
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model'; import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { DeplomasStore } from 'src/app/store/deplomas.service'; import { DeplomasStore } from 'src/app/store/deplomas.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { SortService } from 'src/app/services/functions/sort.service'; import { SortService } from 'src/app/services/functions/sort.service';
@@ -27,7 +26,6 @@ export class DiplomasAssinarPage implements OnInit {
constructor( constructor(
private processes:ProcessesService, private processes:ProcessesService,
private modalController: ModalController, private modalController: ModalController,
private alertService: AlertService,
private router: Router, private router: Router,
private sortService: SortService, private sortService: SortService,
public ThemeService: ThemeService public ThemeService: ThemeService
@@ -3,7 +3,6 @@ import { ActivatedRoute, NavigationEnd, NavigationExtras, NavigationStart, Route
import { DailyWorkTask } from '../../../models/dailyworktask.model'; import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController, NavParams } from '@ionic/angular'; import { ModalController, NavParams } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
import { DeplomasStore } from 'src/app/store/deplomas.service'; import { DeplomasStore } from 'src/app/store/deplomas.service';
@@ -32,7 +31,6 @@ customTaskPipe = new CustomTaskPipe()
constructor( constructor(
private processes:ProcessesService, private processes:ProcessesService,
private modalController: ModalController, private modalController: ModalController,
private alertService: AlertService,
private router: Router, private router: Router,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
public ThemeService: ThemeService, public ThemeService: ThemeService,
@@ -64,10 +62,6 @@ constructor(
this.router.navigate(['/home/gabinete-digital/diplomas', serialNumber, 'gabinete-digital']); this.router.navigate(['/home/gabinete-digital/diplomas', serialNumber, 'gabinete-digital']);
} }
notImplemented(){
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
async LoadList() { async LoadList() {
this.skeletonLoader = true; this.skeletonLoader = true;
@@ -18,8 +18,8 @@ import { Storage } from '@ionic/storage';
export class EventsToApprovePage implements OnInit { export class EventsToApprovePage implements OnInit {
showLoader: boolean; showLoader: boolean;
eventsPRList: any; eventsPRList: any = []
eventsMDGPRList: any; eventsMDGPRList: any = []
eventPerson: EventPerson; eventPerson: EventPerson;
eventBody: EventBody; eventBody: EventBody;
categories: string[]; categories: string[];
@@ -155,6 +155,10 @@ export class EventsToApprovePage implements OnInit {
} }
close(){ close(){
this.modalController.dismiss(null); this.modalController.dismiss(null);
// this.RouteService.goBack('/home/gabinetedigital')
} }
@@ -3,7 +3,6 @@ import { NavigationStart, Router } from '@angular/router';
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model'; import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { LoginUserRespose } from 'src/app/models/user.model'; import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service'; import { AuthService } from 'src/app/services/auth.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@@ -33,7 +32,6 @@ export class ExpedientesPrPage implements OnInit {
constructor( constructor(
private processes:ProcessesService, private processes:ProcessesService,
private modalController: ModalController, private modalController: ModalController,
private alertService: AlertService,
private authService: AuthService, private authService: AuthService,
private router: Router, private router: Router,
public ThemeService: ThemeService, public ThemeService: ThemeService,
@@ -1,7 +1,6 @@
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { NavigationStart, Router } from '@angular/router'; import { NavigationStart, Router } from '@angular/router';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { AlertService } from 'src/app/services/alert.service';
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service'; import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe'; import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
@@ -27,7 +26,6 @@ export class ExpedientsPage implements OnInit {
constructor( constructor(
private processes: ProcessesService, private processes: ProcessesService,
private alertService: AlertService,
private router: Router, private router: Router,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private sortService: SortService, private sortService: SortService,
@@ -59,10 +57,6 @@ export class ExpedientsPage implements OnInit {
this.LoadList(); this.LoadList();
} }
notImplemented() {
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
LoadList() { LoadList() {
this.skeletonLoader = true this.skeletonLoader = true
@@ -4,7 +4,6 @@ import { CalendarComponent } from 'ionic2-calendar';
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model'; import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController } from '@ionic/angular'; import { ModalController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { PedidoPage } from 'src/app/pages/gabinete-digital/pedidos/pedido/pedido.page'; import { PedidoPage } from 'src/app/pages/gabinete-digital/pedidos/pedido/pedido.page';
import { PedidosStore } from 'src/app/store/pedidos-store.service'; import { PedidosStore } from 'src/app/store/pedidos-store.service';
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
@@ -45,7 +44,6 @@ export class PedidosPage implements OnInit {
private router: Router, private router: Router,
private processes:ProcessesService, private processes:ProcessesService,
private modalController: ModalController, private modalController: ModalController,
private alertService: AlertService,
private sortService: SortService, private sortService: SortService,
public ThemeService: ThemeService public ThemeService: ThemeService
) { ) {
+1
View File
@@ -133,4 +133,5 @@
</div> </div>
</div> </div>
<div class="header-bottom-line"></div> <div class="header-bottom-line"></div>
<!-- {{ RouteService.history | json }} -->
</div> </div>
+3 -1
View File
@@ -11,6 +11,7 @@ import { environment } from 'src/environments/environment';
import { EventTrigger } from '../../services/eventTrigger.service'; import { EventTrigger } from '../../services/eventTrigger.service';
import { ThemeService } from '../../services/theme.service'; import { ThemeService } from '../../services/theme.service';
import { interval } from 'rxjs'; import { interval } from 'rxjs';
import { RouteService } from 'src/app/services/route.service';
@Component({ @Component({
selector: 'app-header', selector: 'app-header',
@@ -39,7 +40,8 @@ export class HeaderPage implements OnInit {
private platform: Platform, private platform: Platform,
//private notificationsService: NotificationsService, //private notificationsService: NotificationsService,
private eventrigger: EventTrigger, private eventrigger: EventTrigger,
public ThemeService: ThemeService public ThemeService: ThemeService,
public RouteService: RouteService
) { ) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
router.events.subscribe((val) => { router.events.subscribe((val) => {
@@ -4,7 +4,6 @@ import { EventPerson } from 'src/app/models/eventperson.model';
import { SearchList } from 'src/app/models/search-document'; import { SearchList } from 'src/app/models/search-document';
import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page'; import { NewEventPage } from 'src/app/pages/agenda/new-event/new-event.page';
import { SearchPage } from 'src/app/pages/search/search.page'; import { SearchPage } from 'src/app/pages/search/search.page';
import { AlertService } from 'src/app/services/alert.service';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
@@ -22,7 +21,6 @@ export class ChatOptionsPopoverPage implements OnInit {
constructor( constructor(
private popoverController: PopoverController, private popoverController: PopoverController,
private modalController: ModalController, private modalController: ModalController,
private alertService: AlertService,
private navParams: NavParams, private navParams: NavParams,
public ThemeService: ThemeService public ThemeService: ThemeService
) { ) {
@@ -43,10 +41,6 @@ export class ChatOptionsPopoverPage implements OnInit {
} }
notImplemented(){
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
takePicture(){ takePicture(){
if( window.innerWidth < 701){ if( window.innerWidth < 701){
this.popoverController.dismiss('take-picture'); this.popoverController.dismiss('take-picture');
@@ -97,26 +91,6 @@ export class ChatOptionsPopoverPage implements OnInit {
} }
/* getGroupContacts(room:any){
this.showLoader = true;
//If group is private call getGroupMembers
if(this.room.t === 'p'){
this.chatService.getGroupMembers(this.roomId).subscribe(res=>{
console.log(res);
this.members = res['members'];
this.showLoader = false;
});
}
//Otherwise call getChannelMembers for públic groups
else{
this.chatService.getChannelMembers(this.roomId).subscribe(res=>{
console.log(res);
this.members = res['members'];
this.showLoader = false;
});
}
} */
async getDoc(){ async getDoc(){
const modal = await this.modalController.create({ const modal = await this.modalController.create({
@@ -6,9 +6,6 @@ import { LoadingService } from 'src/app/services/loading.service';
import { PublicationsService } from 'src/app/services/publications.service'; import { PublicationsService } from 'src/app/services/publications.service';
import { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page'; import { NewPublicationPage } from 'src/app/pages/publications/new-publication/new-publication.page';
import { PublicationListStorage } from 'src/app/store/publication-list.service'
import { PublicationEventFolderStorage } from 'src/app/store/publication-event-folder.service';
import { PublicationTravelFolderStore } from 'src/app/store/publication-travel-folder.service';
import { PublicationPipe } from 'src/app/pipes/publication.pipe'; import { PublicationPipe } from 'src/app/pipes/publication.pipe';
import { ThemeService } from 'src/app/services/theme.service' import { ThemeService } from 'src/app/services/theme.service'
import { ToastService } from 'src/app/services/toast.service'; import { ToastService } from 'src/app/services/toast.service';
@@ -38,11 +35,6 @@ export class ViewPublicationsPage implements OnInit {
@Output() goBacktoPublicationDetails = new EventEmitter<any>(); @Output() goBacktoPublicationDetails = new EventEmitter<any>();
publicationListStorage = PublicationListStorage
//
publicationEventFolderStorage = PublicationEventFolderStorage
publicationTravelFolderService = PublicationTravelFolderStore
publicationPipe = new PublicationPipe() publicationPipe = new PublicationPipe()
constructor( constructor(
@@ -136,7 +128,6 @@ export class ViewPublicationsPage implements OnInit {
this.storage.set('view_publications', this.publicationList); this.storage.set('view_publications', this.publicationList);
console.log('PUBLICATIONS IMAGEs',this.publicationList) console.log('PUBLICATIONS IMAGEs',this.publicationList)
this.publicationListStorage.add(folderId, this.publicationList)
this.getpublication = this.publicationList; this.getpublication = this.publicationList;
this.showLoader = false; this.showLoader = false;
},() => { },() => {
@@ -162,7 +153,6 @@ export class ViewPublicationsPage implements OnInit {
this.publicationList.push(item); this.publicationList.push(item);
}); });
this.publicationListStorage.add(folderId, this.publicationList)
await this.storage.remove('view_publications'); await this.storage.remove('view_publications');
await this.storage.set('view_publications', this.publicationList); await this.storage.set('view_publications', this.publicationList);
//this.getFromDB(); //this.getFromDB();
@@ -172,7 +162,6 @@ export class ViewPublicationsPage implements OnInit {
if(error.status == '404') { if(error.status == '404') {
this.error = 'Sem publicações disponíveis!'; this.error = 'Sem publicações disponíveis!';
this.publicationList= []; this.publicationList= [];
this.publicationListStorage.add(folderId, this.publicationList)
} }
this.showLoader = false; this.showLoader = false;
@@ -1,45 +0,0 @@
import { Injectable } from '@angular/core';
import { localstoreService } from './localstore.service'
import { SHA1 } from 'crypto-js'
import { PublicationFolder } from '../models/publicationfolder';
@Injectable({
providedIn: 'root'
})
export class PublicationEventFolderService {
// main data
private _list: PublicationFolder[] = []
// local storage keyName
private keyName: string;
constructor() {
this.keyName = (SHA1(this.constructor.name+ 'PublicationEventFolder/local')).toString()
setTimeout(()=>{
let restore = localstoreService.get(this.keyName, [])
this._list = restore.list || []
}, 10)
}
get list() {
return this._list || []
}
reset(list: PublicationFolder[]) {
this._list = list || []
this.save()
}
private save() {
setTimeout(()=> {
localstoreService.set(this.keyName, {
list: this._list || []
})
}, 10)
}
}
export const PublicationEventFolderStorage = new PublicationEventFolderService()
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { PublicationListService } from './publication-list.service';
describe('PublicationListService', () => {
let service: PublicationListService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(PublicationListService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
-50
View File
@@ -1,50 +0,0 @@
import { Injectable } from '@angular/core'
import { localstoreService } from './localstore.service'
import { SHA1 } from 'crypto-js'
@Injectable({
providedIn: 'root'
})
export class PublicationListService {
// main data
private _document = {}
// local storage keyName
private keyName: string;
constructor() {
this.keyName = (SHA1(this.constructor.name+ 'view-publication-list/local')).toString()
setTimeout(()=>{
let restore = localstoreService.get(this.keyName, {})
this._document = restore.document || {}
}, 10)
}
get documents() {
return this._document
}
getDocument(folderId) {
return this._document[folderId]
}
add(folderId, document = []) {
this._document[folderId] = document
setTimeout(()=> {
localstoreService.set(this.keyName, {
document: this._document
})
}, 100)
}
}
export const PublicationListStorage = new PublicationListService()
@@ -1,16 +0,0 @@
import { TestBed } from '@angular/core/testing';
import { PublicationTravelFolderService } from './publication-travel-folder.service';
describe('PublicationTravelFolderService', () => {
let service: PublicationTravelFolderService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(PublicationTravelFolderService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
@@ -1,48 +0,0 @@
import { Injectable } from '@angular/core';
import { localstoreService } from './localstore.service'
import { SHA1 } from 'crypto-js'
import { Publication } from 'src/app/models/publication';
import { PublicationFolder } from '../models/publicationfolder';
@Injectable({
providedIn: 'root'
})
export class PublicationTravelFolderService {
// main data
private _list: PublicationFolder[] = []
// local storage keyName
private keyName: string;
constructor() {
this.keyName = (SHA1(this.constructor.name+ ' PublicationTravelFolder/local')).toString()
setTimeout(()=>{
let restore = localstoreService.get(this.keyName, [])
this._list = restore.list
}, 10)
}
get list() {
return this._list
}
reset(list: PublicationFolder[]) {
this._list = list
this.save(this._list)
}
private save(list: PublicationFolder[]) {
setTimeout(()=> {
localstoreService.set(this.keyName, {
list: this._list
})
}, 10)
}
}
export const PublicationTravelFolderStore = new PublicationTravelFolderService()
@@ -0,0 +1,10 @@
<svg width="78" height="87" viewBox="0 0 78 87" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_9_19)">
<path d="M31.792 41.9027C29.6156 44.0268 26.0987 44.0268 23.9223 41.9027L9.98853 28.309C7.81393 26.185 7.81393 22.7525 9.98853 20.6285C12.1649 18.5045 15.6923 18.5045 17.8634 20.6285L27.7004 30.365L51.7795 7.02967C53.9558 4.90734 57.4728 4.90734 59.6491 7.02967C61.8254 9.15369 61.8254 12.5963 59.6491 14.7203L31.792 41.9027ZM31.792 79.9652C29.6156 82.0893 26.0987 82.0893 23.9223 79.9652L1.63173 58.2152C-0.543911 56.0912 -0.543911 52.6588 1.63173 50.5348C3.80772 48.4107 7.33513 48.4107 9.51147 50.5348L27.7004 68.4276L68.4938 28.7848C70.6701 26.6607 74.1871 26.6607 76.3634 28.7848C78.5397 30.9088 78.5397 34.3412 76.3634 36.4652L31.792 79.9652Z" fill="#1EADFE"/>
</g>
<defs>
<clipPath id="clip0_9_19">
<rect width="78" height="87" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 906 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M182.6 246.6C170.1 259.1 149.9 259.1 137.4 246.6L57.37 166.6C44.88 154.1 44.88 133.9 57.37 121.4C69.87 108.9 90.13 108.9 102.6 121.4L159.1 178.7L297.4 41.37C309.9 28.88 330.1 28.88 342.6 41.37C355.1 53.87 355.1 74.13 342.6 86.63L182.6 246.6zM182.6 470.6C170.1 483.1 149.9 483.1 137.4 470.6L9.372 342.6C-3.124 330.1-3.124 309.9 9.372 297.4C21.87 284.9 42.13 284.9 54.63 297.4L159.1 402.7L393.4 169.4C405.9 156.9 426.1 156.9 438.6 169.4C451.1 181.9 451.1 202.1 438.6 214.6L182.6 470.6z"/></svg>

After

Width:  |  Height:  |  Size: 731 B

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z"/></svg>

After

Width:  |  Height:  |  Size: 496 B

+4 -4
View File
@@ -5,15 +5,15 @@
export const environment = { export const environment = {
production: false, production: false,
apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/', apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
//apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/', // apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/', apiChatUrl: 'https://gpr-dev-01.gabinetedigital.local/api/v1/',
apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket', apiWsChatUrl: 'ws://gpr-dev-01.gabinetedigital.local/websocket',
//apiChatUrl: 'https://www.tabularium.pt/api/v1/', //apiChatUrl: 'https://www.tabularium.pt/api/v1/',
/* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */ /* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */
domain: 'gabinetedigital.local', //gabinetedigital.local domain: 'gabinetedigital.local', //gabinetedigital.local
defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local
defaultuserpwd: 'tabteste@006', //tabteste@006, defaultuserpwd: 'tabteste@006', //tabteste@006,
chatOffline: false chatOffline: true
}; };
/* /*
+2 -2
View File
@@ -87,8 +87,8 @@ describe('Puppeteer tests', () => {
await page.type('input[type="password"]', environment.defaultuserpwd); await page.type('input[type="password"]', environment.defaultuserpwd);
// click and wait for navigation // click and wait for navigation
await Promise.all([ await Promise.all([
page.click('.btn-ok'), page.click('.btn-ok'),
// page.waitForNavigation({ waitUntil: 'networkidle0' }), // page.waitForNavigation({ waitUntil: 'networkidle0' }),
]); ]);
await page.waitForSelector('.circle') await page.waitForSelector('.circle')
+15
View File
@@ -0,0 +1,15 @@
{
"folders": [
{
"path": "."
},
{
"path": "..\\powercon"
}
],
"settings": {
"cSpell.words": [
"Chatmessage"
]
}
}