From 7b1153be77e2621523872b5888416e32ea495f21 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 28 Mar 2022 16:39:15 +0100 Subject: [PATCH 01/15] save --- src/app/services/permission.service.ts | 2 -- src/app/shared/header/header.page.html | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/app/services/permission.service.ts b/src/app/services/permission.service.ts index 9ff448f36..9d350366e 100644 --- a/src/app/services/permission.service.ts +++ b/src/app/services/permission.service.ts @@ -20,7 +20,6 @@ export class PermissionService { } userPermission(args) { - if(!Array.isArray(args)) { args = [args] } @@ -30,7 +29,6 @@ export class PermissionService { } } return false; - } role(args: any) { diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index d0db46512..01a982036 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -76,7 +76,9 @@ Início -
+ +
@@ -85,7 +87,9 @@ Agenda
-
+ +
@@ -94,7 +98,9 @@ Gabinete
-
+ +
@@ -102,7 +108,9 @@ Acções
-
+ +
From 37ec193f22e2afb76d8dc01c13e8a2e206dabb26 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 29 Mar 2022 16:48:24 +0100 Subject: [PATCH 02/15] message --- package-lock.json | 6 +- package.json | 2 +- src/app/services/chat/chat-methods.service.ts | 5 -- src/app/services/chat/message.service.ts | 43 +++++++----- src/app/services/chat/room.service.ts | 70 +++++++------------ .../services/chat/ws-chat-methods.service.ts | 6 +- .../services/network-service.service.spec.ts | 16 +++++ src/app/services/network-service.service.ts | 62 ++++++++++++++++ src/app/services/permission.service.ts | 6 +- 9 files changed, 140 insertions(+), 76 deletions(-) create mode 100644 src/app/services/network-service.service.spec.ts create mode 100644 src/app/services/network-service.service.ts diff --git a/package-lock.json b/package-lock.json index 80c0d2804..cc410f1a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3175,9 +3175,9 @@ } }, "@ionic-native/network": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@ionic-native/network/-/network-5.36.0.tgz", - "integrity": "sha512-gpa7cJqodEK+zmmViYJCqEpXoKSXcaYLaaRKdv5gn5M++bpmiw2pKM9JH8VoqYWaYDcUwD3S0yYeBBkG5DE0Kg==", + "version": "5.22.0-beta-1", + "resolved": "https://registry.npmjs.org/@ionic-native/network/-/network-5.22.0-beta-1.tgz", + "integrity": "sha512-reOgFhHkyzCujqoGc1x8U9AZ40SBzdYT4HCFA6L2RwQT1NMyv+sDsp5er64p419Rfxg1k2QVTaDlEh+xPwhEqQ==", "requires": { "@types/cordova": "^0.0.34" }, diff --git a/package.json b/package.json index 39938b7c9..b208ddaa9 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@ionic-native/local-notifications": "^4.20.0", "@ionic-native/media": "^5.36.0", "@ionic-native/media-capture": "^5.36.0", - "@ionic-native/network": "^5.36.0", + "@ionic-native/network": "^5.22.0-beta-1", "@ionic-native/photo-viewer": "^5.36.0", "@ionic-native/screen-orientation": "^5.35.0", "@ionic-native/social-sharing": "^5.36.0", diff --git a/src/app/services/chat/chat-methods.service.ts b/src/app/services/chat/chat-methods.service.ts index 61e446163..379d048b5 100644 --- a/src/app/services/chat/chat-methods.service.ts +++ b/src/app/services/chat/chat-methods.service.ts @@ -47,13 +47,8 @@ export class ChatMethodsService { return this.chatService.sendMessage(body) } - deleteMessage(body) { return this.chatService.deleteMessage(body) } - - - - } \ No newline at end of file diff --git a/src/app/services/chat/message.service.ts b/src/app/services/chat/message.service.ts index fb7f144b2..68108025a 100644 --- a/src/app/services/chat/message.service.ts +++ b/src/app/services/chat/message.service.ts @@ -12,6 +12,7 @@ import { MessageModel, DeleteMessageModel } from '../../models/beast-orm' import { AESEncrypt } from '../aesencrypt.service' import { HttpClient, HttpEventType } from '@angular/common/http'; import { AttachmentsService } from 'src/app/services/attachments.service'; +import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service'; @Injectable({ providedIn: 'root' @@ -62,7 +63,8 @@ export class MessageService { private ChatStorageService: ChatStorageService, private ChatMethodsService: ChatMethodsService, private AESEncrypt: AESEncrypt, - private AttachmentsService: AttachmentsService,) { + private AttachmentsService: AttachmentsService, + private NetworkServiceService: NetworkServiceService) { } setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference , viewed = [], received = [], delate = false, delateRequest =false, }:Message) { @@ -184,24 +186,29 @@ export class MessageService { delete params?.attachments?.image_url } - this.ChatMethodsService.send(params).subscribe( - (response: any) => { - const ChatMessage = response.message - this.messageSend = true - this.redefinedMessage(ChatMessage) - }, - (error) => { - this.WsChatService.registerCallback({ - type: 'reConnect', - funx: async ()=> { - - this.send() - return true - } - }) - } - ) + if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) { + + this.WsChatService.send(params).then( + (ChatMessage: any) => { + ChatMessage = ChatMessage.message.result + + this.messageSend = true + this.redefinedMessage(ChatMessage) + } + ) + + } else { + this.WsChatService.registerCallback({ + type: 'reConnect', + funx: async ()=> { + + this.send() + return true + } + }) + } + } async redefinedMessage(ChatMessage , update = true) { diff --git a/src/app/services/chat/room.service.ts b/src/app/services/chat/room.service.ts index b5099f4fe..80fcab564 100644 --- a/src/app/services/chat/room.service.ts +++ b/src/app/services/chat/room.service.ts @@ -22,6 +22,7 @@ import { DeleteMessageModel, MessageModel } from '../../models/beast-orm' import { AESEncrypt } from '../aesencrypt.service' import { IncomingChatMessage, ChatMessageInterface, falseTypingMethod } from 'src/app/models/message.model'; import { AttachmentsService } from 'src/app/services/attachments.service'; +import { ConnectionStatus, NetworkServiceService} from 'src/app/services/network-service.service'; @Injectable({ providedIn: 'root' @@ -77,18 +78,16 @@ export class RoomService { private ChatStorageService: ChatStorageService, private ChatMethodsService: ChatMethodsService, private AESEncrypt: AESEncrypt, - private AttachmentsService: AttachmentsService + private AttachmentsService: AttachmentsService, + private NetworkServiceService: NetworkServiceService ) { this.NativeNotificationService.askForPermission() - // this.restoreMessageFromDB() - this.WsChatService.getUserStatus((d) => { const userId = d.fields.args[0][0] const statusNum = d.fields.args[0][2] const statusText = this.statusNumberToText(statusNum) - // if(this.members?.map) { const membersIds = this.members.map((user)=> user._id) @@ -145,7 +144,7 @@ export class RoomService { } } - setData({members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService), _updatedAt }) { + setData({members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), _updatedAt }) { this.customFields = customFields this.id = id this.name = name @@ -343,7 +342,6 @@ export class RoomService { } - async receiveMessageDelete() { this.WsChatService.updateRoomEventss( @@ -372,14 +370,6 @@ export class RoomService { if(this.messages[i]?._id == id ) { - - //Get previous last message from room - const previousLastMessage = this.messages.slice(-1)[0]; - this.lastMessage = previousLastMessage; - - this.calDateDuration(previousLastMessage._updatedAt) - this.sortRoomList() - if (SessionStore.user.RochetChatUser == this.messages[i]?.u?.username) { const allMemberThatIsOffline = this.getAllMemberThatIsOffline() @@ -393,10 +383,14 @@ export class RoomService { } this.messages[i]?.delateDB() - - // console.log(_id,'==',this.messages[i]?._id, true) this.messages.splice(i, 1) + //Get previous last message from room + const previousLastMessage = this.messages.slice(-1)[0]; + this.lastMessage = previousLastMessage; + this.calDateDuration(previousLastMessage._updatedAt) + this.sortRoomList() + return true } else { @@ -429,40 +423,28 @@ export class RoomService { const message = this.messages.find((e)=>e._id == msgId) await message.delateStatusFalse() - this.ChatMethodsService.deleteMessage({_id:msgId, msgId:msgId, roomId:message.rid}).subscribe( - async (response: any) => { - + if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) { + + this.WsChatService.deleteMessage(msgId).then(async() => { message.delateRequest = true await message.save() this.deleteMessage(msgId) + }) - }, - async (response) => { - - if (response?.error?.error.startsWith('No message found with the id of')) { + } else { + this.WsChatService.registerCallback({ + type: 'reConnect', + funx: async ()=> { - this.deleteMessage(msgId) - message.delateRequest = true - await message.save() - - } else { - this.WsChatService.registerCallback({ - type: 'reConnect', - funx: async ()=> { - - this.sendDeleteRequest(msgId) - return true - } - }) + this.sendDeleteRequest(msgId) + return true } - - } - ) + }) + } } - /** * @description sen text message */ @@ -629,7 +611,7 @@ export class RoomService { await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => { - console.log('load chatHistory', JSON.stringify(chatHistory)) + // console.log('load chatHistory', JSON.stringify(chatHistory)) const messagesId = this.messages.map((message)=> message._id) @@ -685,7 +667,7 @@ export class RoomService { message = this.fix_updatedAt(message) - const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService) + const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService) wewMessage.setData(message) wewMessage.loadHistory = this.hasLoadHistory @@ -742,7 +724,7 @@ export class RoomService { async prepareCreate({message, save = true}): Promise { message = this.fix_updatedAt(message) - const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService) + const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService) wewMessage.setData(message) wewMessage.loadHistory = this.hasLoadHistory @@ -754,7 +736,7 @@ export class RoomService { simplePrepareMessage(message) { message = this.fix_updatedAt(message) - const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService) + const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService) wewMessage.setData(message) wewMessage.loadHistory = this.hasLoadHistory diff --git a/src/app/services/chat/ws-chat-methods.service.ts b/src/app/services/chat/ws-chat-methods.service.ts index db3e320d7..82dae5b98 100644 --- a/src/app/services/chat/ws-chat-methods.service.ts +++ b/src/app/services/chat/ws-chat-methods.service.ts @@ -20,6 +20,7 @@ import { ChatStorageService } from './chat-storage.service' import { ChatMethodsService } from './chat-methods.service' import { AESEncrypt } from '../aesencrypt.service' import { AttachmentsService } from 'src/app/services/attachments.service'; +import { NetworkServiceService} from 'src/app/services/network-service.service'; @Injectable({ providedIn: 'root' @@ -57,7 +58,8 @@ export class WsChatMethodsService { private ChatStorageService: ChatStorageService, private ChatMethodsService:ChatMethodsService, private AESEncrypt: AESEncrypt, - private AttachmentsService:AttachmentsService + private AttachmentsService:AttachmentsService, + private NetworkServiceService: NetworkServiceService ) { this.loggedUser = authService.ValidatedUserChat['data']; @@ -314,7 +316,7 @@ export class WsChatMethodsService { // create room if(!this.roomExist(roomId)) { - let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService) + let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService) room.setData(setData) room.receiveMessage() room.getAllUsers = this.getUsers diff --git a/src/app/services/network-service.service.spec.ts b/src/app/services/network-service.service.spec.ts new file mode 100644 index 000000000..987fc15ec --- /dev/null +++ b/src/app/services/network-service.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { NetworkServiceService } from './network-service.service'; + +describe('NetworkServiceService', () => { + let service: NetworkServiceService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(NetworkServiceService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/network-service.service.ts b/src/app/services/network-service.service.ts new file mode 100644 index 000000000..8e5e32d36 --- /dev/null +++ b/src/app/services/network-service.service.ts @@ -0,0 +1,62 @@ +import { Injectable } from '@angular/core'; +import { ToastController, Platform } from '@ionic/angular'; +import { BehaviorSubject, Observable } from 'rxjs'; +import { Network } from '@ionic-native/network/ngx' + + +export enum ConnectionStatus { + Online, + Offline +} + + +@Injectable({ + providedIn: 'root' +}) +export class NetworkServiceService { + private status: BehaviorSubject = new BehaviorSubject(ConnectionStatus.Offline); + + constructor(private network: Network, private toastController: ToastController, private plt: Platform) { + this.plt.ready().then(() => { + this.initializeNetworkEvents(); + let status = this.network.type !== 'none' ? ConnectionStatus.Online : ConnectionStatus.Offline; + this.status.next(status); + }); + + } + + public initializeNetworkEvents() { + + this.network.onDisconnect().subscribe(() => { + if (this.status.getValue() === ConnectionStatus.Online) { + this.updateNetworkStatus(ConnectionStatus.Offline); + } + }); + + this.network.onConnect().subscribe(() => { + if (this.status.getValue() === ConnectionStatus.Offline) { + this.updateNetworkStatus(ConnectionStatus.Online); + } + }); + } + + private async updateNetworkStatus(status: ConnectionStatus) { + this.status.next(status); + + let connection = status == ConnectionStatus.Offline ? 'Offline' : 'Online'; + let toast = this.toastController.create({ + message: `You are now ${connection}`, + duration: 3000, + position: 'bottom' + }); + toast.then(toast => toast.present()); + } + + public onNetworkChange(): Observable { + return this.status.asObservable(); + } + + public getCurrentNetworkStatus(): ConnectionStatus { + return this.status.getValue(); + } +} diff --git a/src/app/services/permission.service.ts b/src/app/services/permission.service.ts index 3587a5dc6..7c3b84e0b 100644 --- a/src/app/services/permission.service.ts +++ b/src/app/services/permission.service.ts @@ -26,8 +26,8 @@ export class PermissionService { } - for(let permission of (this.SessionStore.user.UserPermissions || [])){ - if (args.includes(permission)){ + for(let permission of (this.SessionStore.user.UserPermissions || [])) { + if (args.includes(permission)) { return true; } } @@ -46,7 +46,7 @@ export class PermissionService { role = [role] } - if(!UserRoleIsValid) {return false } + if(!UserRoleIsValid) { return false } return true From 5ff9ba77cb13e640d3f095695c5e39feb6dab486 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 29 Mar 2022 17:10:32 +0100 Subject: [PATCH 03/15] save --- src/app/shared/header/header.page.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index 016b7f375..d361bc732 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -78,7 +78,7 @@ -
@@ -89,7 +89,7 @@ -
@@ -100,7 +100,7 @@ -
@@ -110,7 +110,7 @@ -
From 236cc86fbf99066ae284b1d26fd2525eb3ae20a7 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 30 Mar 2022 15:08:23 +0100 Subject: [PATCH 04/15] further improvements in permission --- src/app/guards/inactivity.guard.ts | 15 ++++++++------- src/app/home/home.page.html | 10 +++++----- src/app/home/home.page.ts | 3 ++- src/app/models/permission/actions.permission.ts | 9 +++++++++ src/app/models/permission/agenda-permission.ts | 3 +++ src/app/models/permission/chat-permission.ts | 3 +++ src/app/models/permission/gabinete-permission.ts | 5 +++++ src/app/models/permission/permissionList.ts | 11 +++++++++++ src/app/models/permissionList.ts | 6 ------ src/app/pages/events/events.page.html | 4 ++-- src/app/pages/events/events.page.ts | 9 +++++++-- src/app/pages/login/login.page.ts | 9 +++++---- src/app/shared/header/header.page.html | 10 +++++----- src/app/shared/header/header.page.ts | 2 +- 14 files changed, 66 insertions(+), 33 deletions(-) create mode 100644 src/app/models/permission/actions.permission.ts create mode 100644 src/app/models/permission/agenda-permission.ts create mode 100644 src/app/models/permission/chat-permission.ts create mode 100644 src/app/models/permission/gabinete-permission.ts create mode 100644 src/app/models/permission/permissionList.ts delete mode 100644 src/app/models/permissionList.ts diff --git a/src/app/guards/inactivity.guard.ts b/src/app/guards/inactivity.guard.ts index a712a50e1..64fad8b0b 100644 --- a/src/app/guards/inactivity.guard.ts +++ b/src/app/guards/inactivity.guard.ts @@ -4,7 +4,7 @@ import { Observable } from 'rxjs'; import { SessionStore } from '../store/session.service'; import { AlertController, Platform } from '@ionic/angular'; import { PermissionService } from '../services/permission.service'; -import { PermissionList } from '../models/permissionList'; +import { PermissionList } from '../models/permission/permissionList'; @Injectable({ providedIn: 'root' @@ -24,13 +24,14 @@ export class InactivityGuard implements CanActivate { state: RouterStateSnapshot): Observable | Promise | boolean | UrlTree { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - if(this.permissionService.userPermission(this.permissionList.Agenda) || this.permissionService.userPermission(this.permissionList.Gabinete)){ + console.log(this.permissionList); + if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){ this.router.navigate(['/home/events']); } - else if(this.permissionService.userPermission(this.permissionList.Chat)){ + else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){ this.router.navigate(['/home/chat']); } - else if(this.permissionService.userPermission(this.permissionList.Actions)){ + else if(this.permissionService.userPermission(this.permissionList.Actions.access)){ this.router.navigate(['/home/publications']); } return false @@ -40,13 +41,13 @@ export class InactivityGuard implements CanActivate { return true }//Mobile or Tablet without session else { - if(this.permissionService.userPermission(this.permissionList.Agenda) || this.permissionService.userPermission(this.permissionList.Gabinete)){ + if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){ this.router.navigate(['/home/events']); } - else if(this.permissionService.userPermission(this.permissionList.Chat)){ + else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){ this.router.navigate(['/home/chat']); } - else if(this.permissionService.userPermission(this.permissionList.Actions)){ + else if(this.permissionService.userPermission(this.permissionList.Actions.access)){ this.router.navigate(['/home/publications']); } return false diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 80c3b0444..d730cc84d 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -2,7 +2,7 @@ - + @@ -10,14 +10,14 @@ Início - + Agenda - + @@ -26,13 +26,13 @@ Gabinete - + Ações - + Chat diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 6e7d3c71a..04b9a5291 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -31,7 +31,7 @@ import { environment } from 'src/environments/environment'; import { v4 as uuidv4 } from 'uuid' import { NativeNotificationService } from 'src/app/services/native-notification.service'; import { UserSession } from '../models/user.model'; -import { PermissionList } from '../models/permissionList'; +import { PermissionList } from '../models/permission/permissionList'; @Component({ selector: 'app-home', @@ -180,6 +180,7 @@ export class HomePage implements OnInit { myWorker.postMessage('ali'); */ this.clearTabButtonSelection(); + } clearTabButtonSelection(){ diff --git a/src/app/models/permission/actions.permission.ts b/src/app/models/permission/actions.permission.ts new file mode 100644 index 000000000..8dcbc9a83 --- /dev/null +++ b/src/app/models/permission/actions.permission.ts @@ -0,0 +1,9 @@ +export class ActionsPermission{ + access = 534; + create = 535; + remove = 536; + edit = 537; + createPost = 538; + removePost = 539; + editPost = 540; +} diff --git a/src/app/models/permission/agenda-permission.ts b/src/app/models/permission/agenda-permission.ts new file mode 100644 index 000000000..bb3afb868 --- /dev/null +++ b/src/app/models/permission/agenda-permission.ts @@ -0,0 +1,3 @@ +export class AgendaPermission{ + access = 530 +} diff --git a/src/app/models/permission/chat-permission.ts b/src/app/models/permission/chat-permission.ts new file mode 100644 index 000000000..4f780e33c --- /dev/null +++ b/src/app/models/permission/chat-permission.ts @@ -0,0 +1,3 @@ +export class ChatPermission{ + access = 541; +} diff --git a/src/app/models/permission/gabinete-permission.ts b/src/app/models/permission/gabinete-permission.ts new file mode 100644 index 000000000..be9fa5c45 --- /dev/null +++ b/src/app/models/permission/gabinete-permission.ts @@ -0,0 +1,5 @@ +export class GabinetePermission{ + access = 531; + pr_tasks = 532; + md_tasks = 533; +} diff --git a/src/app/models/permission/permissionList.ts b/src/app/models/permission/permissionList.ts new file mode 100644 index 000000000..43a3fd3b8 --- /dev/null +++ b/src/app/models/permission/permissionList.ts @@ -0,0 +1,11 @@ +import { ActionsPermission } from "./actions.permission"; +import { AgendaPermission } from "./agenda-permission"; +import { ChatPermission } from "./chat-permission"; +import { GabinetePermission } from "./gabinete-permission"; + +export class PermissionList{ + Agenda = new AgendaPermission(); + Gabinete = new GabinetePermission(); + Actions = new ActionsPermission(); + Chat = new ChatPermission(); +} diff --git a/src/app/models/permissionList.ts b/src/app/models/permissionList.ts deleted file mode 100644 index cfaf80f57..000000000 --- a/src/app/models/permissionList.ts +++ /dev/null @@ -1,6 +0,0 @@ -export class PermissionList{ - Agenda = 530; - Gabinete = 531; - Actions = 534; - Chat = 541; -} diff --git a/src/app/pages/events/events.page.html b/src/app/pages/events/events.page.html index 168f4252c..730a225d3 100644 --- a/src/app/pages/events/events.page.html +++ b/src/app/pages/events/events.page.html @@ -26,7 +26,7 @@
-
+
@@ -94,7 +94,7 @@
-
+
diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index e4055a9a8..752a14fe0 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -22,6 +22,8 @@ import { BackgroundService } from 'src/app/services/background.service'; import { momentG } from 'src/plugin/momentG'; import { ThemeService } from 'src/app/services/theme.service' import { Storage } from '@ionic/storage'; +import { PermissionList } from 'src/app/models/permission/permissionList'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-events', templateUrl: './events.page.html', @@ -81,6 +83,8 @@ export class EventsPage implements OnInit { /* existingScreenOrientation: string; */ + permissionList = new PermissionList(); + constructor( private eventService: EventsService, private router: Router, @@ -97,7 +101,8 @@ export class EventsPage implements OnInit { private networkconnection: NetworkConnectionService, private backgroundservice: BackgroundService, public ThemeService: ThemeService, - private storage: Storage + private storage: Storage, + public p: PermissionService, ) { /* this.existingScreenOrientation = this.screenOrientation.type; console.log(this.existingScreenOrientation); */ @@ -213,7 +218,7 @@ export class EventsPage implements OnInit { let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise(); const list = mdOficialEvents.concat(mdPessoalEvents); - + this.addEventToDb(list); this.listToPresent = list diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 9072eb405..a915cdc21 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -13,7 +13,7 @@ import { ThemeService } from 'src/app/services/theme.service'; import { StorageService } from 'src/app/services/storage.service'; import { ChatService } from 'src/app/services/chat.service'; import { PermissionService } from 'src/app/services/permission.service'; -import { PermissionList } from 'src/app/models/permissionList'; +import { PermissionList } from 'src/app/models/permission/permissionList'; @Component({ selector: 'app-login', @@ -148,13 +148,14 @@ export class LoginPage implements OnInit { if(pathName) { this.router.navigate([pathName]); } else { - if(this.permissionService.userPermission(this.permissionList.Agenda) || this.permissionService.userPermission(this.permissionList.Gabinete)){ + if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){ this.router.navigate(['/home/events']); } - else if(this.permissionService.userPermission(this.permissionList.Chat)){ + else if(this.permissionService.userPermission(this.permissionList.Chat.access) && this.permissionService.userPermission(this.permissionList.Actions.access)){ this.router.navigate(['/home/chat']); } - else if(this.permissionService.userPermission(this.permissionList.Actions)){ + else if(this.permissionService.userPermission(this.permissionList.Actions.access)){ + alert('here') this.router.navigate(['/home/publications']); } } diff --git a/src/app/shared/header/header.page.html b/src/app/shared/header/header.page.html index d361bc732..06d76d173 100644 --- a/src/app/shared/header/header.page.html +++ b/src/app/shared/header/header.page.html @@ -66,7 +66,7 @@
-
@@ -78,7 +78,7 @@ -
@@ -89,7 +89,7 @@ -
@@ -100,7 +100,7 @@ -
@@ -110,7 +110,7 @@ -
diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts index 36a61ad9c..b91aa2d7a 100644 --- a/src/app/shared/header/header.page.ts +++ b/src/app/shared/header/header.page.ts @@ -11,7 +11,7 @@ import { EventTrigger } from '../../services/eventTrigger.service'; import { ThemeService } from '../../services/theme.service'; import { interval } from 'rxjs'; import { RouteService } from 'src/app/services/route.service'; -import { PermissionList } from 'src/app/models/permissionList'; +import { PermissionList } from 'src/app/models/permission/permissionList'; import { PermissionService } from 'src/app/services/permission.service'; @Component({ From 274f8f0d62f4990a8434bd2f3d158cd51226ffe0 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Wed, 30 Mar 2022 16:32:56 +0100 Subject: [PATCH 05/15] add permission on actions module --- src/app/models/permission/actions.permission.ts | 2 +- .../publication-detail/publication-detail.page.html | 4 ++-- .../publication-detail/publication-detail.page.ts | 4 +++- src/app/pages/publications/publications.page.html | 6 +++--- src/app/pages/publications/publications.page.ts | 4 +++- .../publication-detail/publication-detail.page.html | 4 ++-- .../publication-detail/publication-detail.page.ts | 4 +++- .../view-publications/view-publications.page.html | 6 +++--- .../view-publications/view-publications.page.ts | 6 ++++-- src/app/services/permission.service.ts | 2 ++ .../publication-detail/publication-detail.page.html | 4 ++-- .../publication-detail/publication-detail.page.ts | 4 +++- .../view-publications/view-publications.page.html | 6 +++--- .../publication/view-publications/view-publications.page.ts | 6 ++++-- 14 files changed, 38 insertions(+), 24 deletions(-) diff --git a/src/app/models/permission/actions.permission.ts b/src/app/models/permission/actions.permission.ts index 8dcbc9a83..bf4d4af1a 100644 --- a/src/app/models/permission/actions.permission.ts +++ b/src/app/models/permission/actions.permission.ts @@ -4,6 +4,6 @@ export class ActionsPermission{ remove = 536; edit = 537; createPost = 538; - removePost = 539; + deletePost = 539; editPost = 540; } diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.html b/src/app/pages/publications/publication-detail/publication-detail.page.html index ea16990a6..d778e071d 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.html +++ b/src/app/pages/publications/publication-detail/publication-detail.page.html @@ -56,12 +56,12 @@ - + - + diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/publication-detail/publication-detail.page.ts index 17681b2cc..84b8746e0 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/publication-detail/publication-detail.page.ts @@ -10,6 +10,7 @@ import { SqliteService } from 'src/app/services/sqlite.service'; import { BackgroundService } from 'src/app/services/background.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'; @Component({ selector: 'app-publication-detail', @@ -31,7 +32,8 @@ export class PublicationDetailPage implements OnInit { private RouteService: RouteService, private sqliteservice: SqliteService, private backgroundservice: BackgroundService, - public ThemeService: ThemeService ) { + public ThemeService: ThemeService, + public p:PermissionService ) { this.publicationId = this.navParams.get('publicationId'); /* this.folderId = this.navParams.get('folderIdId'); */ diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index 3abc2e9ec..622dd150e 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -25,7 +25,7 @@ Acções Presidenciais
- @@ -92,14 +92,14 @@
- + - + diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 77f1df29a..4baeee66c 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -15,6 +15,7 @@ import { SqliteService } from 'src/app/services/sqlite.service'; import { BackgroundService } from 'src/app/services/background.service'; import { ThemeService } from 'src/app/services/theme.service' import { Storage } from '@ionic/storage'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ @@ -68,7 +69,8 @@ export class PublicationsPage implements OnInit { private backgroundservice: BackgroundService, private platform: Platform, public ThemeService: ThemeService, - private storage: Storage + private storage: Storage, + public p: PermissionService, ) { this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]; diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.html b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.html index dd6e0bbb6..7b06bd70d 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.html +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.html @@ -61,12 +61,12 @@ - + - + diff --git a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts index 15afbe6e2..9929de9ef 100644 --- a/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/view-publications/publication-detail/publication-detail.page.ts @@ -10,6 +10,7 @@ import { Location } from '@angular/common'; import { ThemeService } from 'src/app/services/theme.service' import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; import { RouteService } from 'src/app/services/route.service'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-publication-detail', @@ -31,7 +32,8 @@ export class PublicationDetailPage implements OnInit { private activatedRoute: ActivatedRoute, private router: Router, private RouteService: RouteService, - public ThemeService: ThemeService + public ThemeService: ThemeService, + public p:PermissionService, ) { this.activatedRoute.paramMap.subscribe(params => { diff --git a/src/app/pages/publications/view-publications/view-publications.page.html b/src/app/pages/publications/view-publications/view-publications.page.html index 847b460c5..4d5632618 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.html +++ b/src/app/pages/publications/view-publications/view-publications.page.html @@ -15,7 +15,7 @@

{{item.Detail}}

-
+
@@ -57,10 +57,10 @@ *ngFor="let publication of getpublication" (click)="goToPublicationDetail(publication.DocumentId)" > - +
- +
diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index b8c63dfb3..5a7bb8264 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -12,6 +12,7 @@ import { BackgroundService } from 'src/app/services/background.service'; import { ThemeService } from 'src/app/services/theme.service' import { forkJoin } from 'rxjs'; import { ToastService } from 'src/app/services/toast.service'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-view-publications', @@ -42,7 +43,8 @@ export class ViewPublicationsPage implements OnInit { private sqliteservice: SqliteService, private backgroundservice: BackgroundService, public ThemeService: ThemeService, - private toastService: ToastService,) { + private toastService: ToastService, + public p: PermissionService,) { this.item = new PublicationFolder(); this.activatedRoute.paramMap.subscribe(params => { @@ -259,7 +261,7 @@ export class ViewPublicationsPage implements OnInit { publicationArray.push(publicationlis); }); - + this.publicationList = publicationArray; }) } diff --git a/src/app/services/permission.service.ts b/src/app/services/permission.service.ts index a02dd401a..b0ebcf48f 100644 --- a/src/app/services/permission.service.ts +++ b/src/app/services/permission.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@angular/core'; +import { PermissionList } from '../models/permission/permissionList'; import { SessionStore } from '../store/session.service'; @Injectable({ @@ -6,6 +7,7 @@ import { SessionStore } from '../store/session.service'; }) export class PermissionService { + permissionList = new PermissionList(); SessionStore = SessionStore constructor() { } diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html index 42a9de4f1..25b3c03a0 100644 --- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html +++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.html @@ -56,12 +56,12 @@ - + - + diff --git a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts index f9e8f9f19..798297717 100644 --- a/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts +++ b/src/app/shared/publication/view-publications/publication-detail/publication-detail.page.ts @@ -9,6 +9,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page'; import { ThemeService } from 'src/app/services/theme.service' import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-publication-detail-shared', @@ -31,7 +32,8 @@ export class PublicationDetailPage implements OnInit { private publications:PublicationsService, private animationController: AnimationController, private toastService: ToastService, - public ThemeService: ThemeService + public ThemeService: ThemeService, + public p:PermissionService, ) { /* this.folderId = this.navParams.get('folderIdId'); */ diff --git a/src/app/shared/publication/view-publications/view-publications.page.html b/src/app/shared/publication/view-publications/view-publications.page.html index 81573e3ce..872da291d 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.html +++ b/src/app/shared/publication/view-publications/view-publications.page.html @@ -11,11 +11,11 @@
- -
- + diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index 8fa8d4e7c..2879749f1 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -11,6 +11,7 @@ import { ThemeService } from 'src/app/services/theme.service' import { ToastService } from 'src/app/services/toast.service'; import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-action.page'; import { Storage } from '@ionic/storage'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-view-publications', @@ -43,7 +44,8 @@ export class ViewPublicationsPage implements OnInit { private publications: PublicationsService, public ThemeService: ThemeService, private toastService: ToastService, - private storage: Storage + private storage: Storage, + public p:PermissionService, ) { this.item = new PublicationFolder(); } @@ -69,7 +71,7 @@ export class ViewPublicationsPage implements OnInit { //setTimeout(()=>{ this.getPublicationDetail(); this.getPublicationsIds(); - + //}, 100) From edcd2025d144aa7cb04ae497dc36ffe442a9f169 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 31 Mar 2022 14:09:13 +0100 Subject: [PATCH 06/15] save --- src/app/modals/add-note/add-note.page.ts | 2 +- src/app/pages/agenda/agenda-routing.module.ts | 84 ++++++++++--------- .../agenda/evandre/evandre-routing.module.ts | 17 ++++ .../pages/agenda/evandre/evandre.module.ts | 20 +++++ .../pages/agenda/evandre/evandre.page.html | 9 ++ .../pages/agenda/evandre/evandre.page.scss | 0 .../pages/agenda/evandre/evandre.page.spec.ts | 24 ++++++ src/app/pages/agenda/evandre/evandre.page.ts | 15 ++++ 8 files changed, 130 insertions(+), 41 deletions(-) create mode 100644 src/app/pages/agenda/evandre/evandre-routing.module.ts create mode 100644 src/app/pages/agenda/evandre/evandre.module.ts create mode 100644 src/app/pages/agenda/evandre/evandre.page.html create mode 100644 src/app/pages/agenda/evandre/evandre.page.scss create mode 100644 src/app/pages/agenda/evandre/evandre.page.spec.ts create mode 100644 src/app/pages/agenda/evandre/evandre.page.ts diff --git a/src/app/modals/add-note/add-note.page.ts b/src/app/modals/add-note/add-note.page.ts index 21f62129c..8376d76a3 100644 --- a/src/app/modals/add-note/add-note.page.ts +++ b/src/app/modals/add-note/add-note.page.ts @@ -50,7 +50,7 @@ export class AddNotePage implements OnInit { component: SearchPage, cssClass: 'modal-width-100-width-background modal', componentProps: { - type: 'AccoesPresidenciais & ArquivoDespachoElect', + typety: 'AccoesPresidenciais & ArquivoDespachoElect', showSearchInput: true, select: true } diff --git a/src/app/pages/agenda/agenda-routing.module.ts b/src/app/pages/agenda/agenda-routing.module.ts index b177d8a24..dd917765c 100644 --- a/src/app/pages/agenda/agenda-routing.module.ts +++ b/src/app/pages/agenda/agenda-routing.module.ts @@ -1,42 +1,46 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { AgendaPage } from './agenda.page'; - -const routes: Routes = [ - { - path: '', - component: AgendaPage - }, - { - path: 'approve-event-modal', - loadChildren: () => import('../gabinete-digital/event-list/approve-event-modal/approve-event-modal.module').then( m => m.ApproveEventModalPageModule) - }, - { - path: 'event-actions-popover', - loadChildren: () => import('./event-actions-popover/event-actions-popover.module').then( m => m.EventActionsPopoverPageModule) - }, - { - path: 'emend-message-modal', - loadChildren: () => import('./emend-message-modal/emend-message-modal.module').then( m => m.EmendMessageModalPageModule) - }, - { - path: 'new-event', - loadChildren: () => import('./new-event/new-event.module').then( m => m.NewEventPageModule) - }, - { - path: 'edit-event', - loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule) - }, - { - path: 'view-event', - loadChildren: () => import('./view-event/view-event.module').then( m => m.ViewEventPageModule) +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { AgendaPage } from './agenda.page'; + +const routes: Routes = [ + { + path: '', + component: AgendaPage + }, + { + path: 'approve-event-modal', + loadChildren: () => import('../gabinete-digital/event-list/approve-event-modal/approve-event-modal.module').then( m => m.ApproveEventModalPageModule) + }, + { + path: 'event-actions-popover', + loadChildren: () => import('./event-actions-popover/event-actions-popover.module').then( m => m.EventActionsPopoverPageModule) + }, + { + path: 'emend-message-modal', + loadChildren: () => import('./emend-message-modal/emend-message-modal.module').then( m => m.EmendMessageModalPageModule) + }, + { + path: 'new-event', + loadChildren: () => import('./new-event/new-event.module').then( m => m.NewEventPageModule) + }, + { + path: 'edit-event', + loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule) + }, + { + path: 'view-event', + loadChildren: () => import('./view-event/view-event.module').then( m => m.ViewEventPageModule) + }, { + path: 'evandre', + loadChildren: () => import('./evandre/evandre.module').then( m => m.EvandrePageModule) } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class AgendaPageRoutingModule {} + +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class AgendaPageRoutingModule {} diff --git a/src/app/pages/agenda/evandre/evandre-routing.module.ts b/src/app/pages/agenda/evandre/evandre-routing.module.ts new file mode 100644 index 000000000..3fb00a40b --- /dev/null +++ b/src/app/pages/agenda/evandre/evandre-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { EvandrePage } from './evandre.page'; + +const routes: Routes = [ + { + path: '', + component: EvandrePage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class EvandrePageRoutingModule {} diff --git a/src/app/pages/agenda/evandre/evandre.module.ts b/src/app/pages/agenda/evandre/evandre.module.ts new file mode 100644 index 000000000..8a20cd1c2 --- /dev/null +++ b/src/app/pages/agenda/evandre/evandre.module.ts @@ -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 { EvandrePageRoutingModule } from './evandre-routing.module'; + +import { EvandrePage } from './evandre.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + EvandrePageRoutingModule + ], + declarations: [EvandrePage] +}) +export class EvandrePageModule {} diff --git a/src/app/pages/agenda/evandre/evandre.page.html b/src/app/pages/agenda/evandre/evandre.page.html new file mode 100644 index 000000000..0cc537051 --- /dev/null +++ b/src/app/pages/agenda/evandre/evandre.page.html @@ -0,0 +1,9 @@ + + + evandre + + + + + + diff --git a/src/app/pages/agenda/evandre/evandre.page.scss b/src/app/pages/agenda/evandre/evandre.page.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/pages/agenda/evandre/evandre.page.spec.ts b/src/app/pages/agenda/evandre/evandre.page.spec.ts new file mode 100644 index 000000000..adce8c07c --- /dev/null +++ b/src/app/pages/agenda/evandre/evandre.page.spec.ts @@ -0,0 +1,24 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { EvandrePage } from './evandre.page'; + +describe('EvandrePage', () => { + let component: EvandrePage; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ EvandrePage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(EvandrePage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/agenda/evandre/evandre.page.ts b/src/app/pages/agenda/evandre/evandre.page.ts new file mode 100644 index 000000000..ff0b84c65 --- /dev/null +++ b/src/app/pages/agenda/evandre/evandre.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-evandre', + templateUrl: './evandre.page.html', + styleUrls: ['./evandre.page.scss'], +}) +export class EvandrePage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} From fd89eb7f5b466f213c29676bd1f3dc7044d84d39 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 31 Mar 2022 15:49:13 +0100 Subject: [PATCH 07/15] save expedient --- .../models/permission/actions.permission.ts | 2 +- .../expediente-detail.page.html | 22 +++++++++---------- .../gabinete-digital.page.html | 12 +++++----- .../gabinete-digital/gabinete-digital.page.ts | 4 ++-- .../group-messages/group-messages.page.ts | 3 --- src/environments/environment.ts | 9 ++++---- 6 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/app/models/permission/actions.permission.ts b/src/app/models/permission/actions.permission.ts index bf4d4af1a..fcdc95e7c 100644 --- a/src/app/models/permission/actions.permission.ts +++ b/src/app/models/permission/actions.permission.ts @@ -1,7 +1,7 @@ export class ActionsPermission{ access = 534; create = 535; - remove = 536; + delete = 536; edit = 537; createPost = 538; deletePost = 539; diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html index 9d96e8231..05b4e0be8 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html @@ -90,26 +90,26 @@
-
+
-
Enviar para o PR
- -
Solicitar revisão
- -
Outras opções
+
Enviar para o PR
+ +
Solicitar revisão
+ +
Outras opções
- - + + - +
-
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 71556f4dc..1717613ef 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -101,7 +101,7 @@

{{ allProcessesList.length }} Documentos

-
+
@@ -208,7 +208,7 @@
-
+
@@ -220,19 +220,19 @@

{{ deplomasStore.deplomasReviewCount }} Documentos

-
+
-

Diplomas assinados PR

-

Diplomas

+

Diplomas assinados PR

+

Diplomas

{{ deplomasStore.countDiplomasAssinadoListCount }} Documentos

-
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index fa90ee7a4..5634ab2ec 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -128,7 +128,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck { private activatedRoute: ActivatedRoute, private router: Router, authService: AuthService, - public p: PermissionService, public waitForDomService: WaitForDomService, //private notificationsService: NotificationsService, private despachoRule: DespachoService, @@ -139,7 +138,8 @@ export class GabineteDigitalPage implements OnInit, DoCheck { public ThemeService: ThemeService, private sortService: SortService, private dataService: DataService, - private storage: Storage + private storage: Storage, + public p: PermissionService, ) { this.loggeduser = authService.ValidatedUser; diff --git a/src/app/shared/chat/group-messages/group-messages.page.ts b/src/app/shared/chat/group-messages/group-messages.page.ts index 829ce53d3..46f3658e9 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.ts +++ b/src/app/shared/chat/group-messages/group-messages.page.ts @@ -152,9 +152,6 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe } ngOnInit() { - console.log(this.roomId); - this.loggedUser = this.loggedUserChat; - this.loggedUser=this.loggedUserChat; setTimeout(() => { this.getRoomInfo(); diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 3fa4b4df2..c54548512 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,11 +5,12 @@ export const environment = { production: false, //apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/', + apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/', + apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket', + apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/', - /* apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/', - apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket', */ - apiChatUrl: 'https://www.tabularium.pt/api/v1/', - apiWsChatUrl: 'wss://www.tabularium.pt/websocket', + /* apiChatUrl: 'https://www.tabularium.pt/api/v1/', + apiWsChatUrl: 'wss://www.tabularium.pt/websocket', */ /* apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', */ domain: 'gabinetedigital.local', //gabinetedigital.local defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local From e3e7afcd2fa8de1f8cbb2a70a1258ed0f6b58d02 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Thu, 31 Mar 2022 17:10:55 +0100 Subject: [PATCH 08/15] save --- .../despachos/despacho/despacho.page.html | 6 ++--- .../despachos/despacho/despacho.page.ts | 2 +- .../expediente-detail.page.html | 2 +- .../pedidos/pedido/pedido.page.html | 10 ++++---- .../opts-expediente/opts-expediente.page.html | 24 +++++++++---------- .../request-options/request-options.page.html | 12 +++++----- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index f2eb86e87..1f32942d3 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -96,7 +96,7 @@
- +
@@ -106,7 +106,7 @@
- +
@@ -115,7 +115,7 @@
- +
diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 719139cf0..66d55bad0 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -63,7 +63,7 @@ export class DespachoPage implements OnInit { private sqliteservice: SqliteService, private platform: Platform, private backgroundservice: BackgroundService, - public ThemeService: ThemeService + public ThemeService: ThemeService, ) { diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html index 05b4e0be8..da21dfe05 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html @@ -99,7 +99,7 @@
Outras opções
- + diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html index 9801094f5..4f33afd8d 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html @@ -89,7 +89,7 @@ - +
@@ -99,7 +99,7 @@ - +
@@ -110,14 +110,14 @@ - +
- +
@@ -127,7 +127,7 @@ - +
diff --git a/src/app/shared/popover/opts-expediente/opts-expediente.page.html b/src/app/shared/popover/opts-expediente/opts-expediente.page.html index c8a439597..c10130669 100644 --- a/src/app/shared/popover/opts-expediente/opts-expediente.page.html +++ b/src/app/shared/popover/opts-expediente/opts-expediente.page.html @@ -6,27 +6,27 @@
-
+
- - - - - + + + + +
- - - + + + - +
-
+
diff --git a/src/app/shared/popover/request-options/request-options.page.html b/src/app/shared/popover/request-options/request-options.page.html index d76118df8..eab5b99a6 100644 --- a/src/app/shared/popover/request-options/request-options.page.html +++ b/src/app/shared/popover/request-options/request-options.page.html @@ -7,7 +7,7 @@ - +
@@ -18,7 +18,7 @@ - +
@@ -30,7 +30,7 @@ - +
@@ -39,8 +39,8 @@
- - + + @@ -51,7 +51,7 @@ - +
From 36d53cd93c6553101fc27b1545b842a84bb498fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Thu, 31 Mar 2022 17:15:38 +0100 Subject: [PATCH 09/15] Android settings added --- android/app/src/main/assets/capacitor.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index 5912a857e..2a189f2f1 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -18,6 +18,6 @@ } }, "server": { - "url": "http://192.168.137.1:8101" + "url": "http://192.168.137.1:8100" } } From 22aa4adf7ba3461c67e7b7b02b7d716284b2f407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Fri, 1 Apr 2022 09:06:57 +0100 Subject: [PATCH 10/15] Notifications back online --- src/app/services/notifications.service.ts | 206 +++++++++++----------- 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index f2c3d780d..afbefda73 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -86,86 +86,86 @@ export class NotificationsService { } requestPermissions() { - // PushNotifications.requestPermissions().then(result => { - // if (result.receive === 'granted') { - // // Register with Apple / Google to receive push via APNS/FCM - // PushNotifications.register(); - // } else { - // // Show some error - // } - // }); + PushNotifications.requestPermissions().then(result => { + if (result.receive === 'granted') { + // Register with Apple / Google to receive push via APNS/FCM + PushNotifications.register(); + } else { + // Show some error + } + }); } getAndpostToken(username) { - // if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - // console.log('Notifications not supported') - // } else { - // const geturl = environment.apiURL + 'notifications/token'; - // PushNotifications.addListener('registration', - // (token: Token) => { - // console.log('token: ', token.value) - // this.storageService.store(username, token.value); - // this.storageService.get(username).then(value => { - // console.log('STORAGE TOKEN', value) - // this.storageService.get(AuthConnstants.USER).then(res => { - // console.log('USERID', res); - // const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; - // const body = { - // UserId: res.UserId, - // TokenId: token.value, - // Status: 1, - // Service: 1 - // }; + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + console.log('Notifications not supported') + } else { + const geturl = environment.apiURL + 'notifications/token'; + PushNotifications.addListener('registration', + (token: Token) => { + console.log('token: ', token.value) + this.storageService.store(username, token.value); + this.storageService.get(username).then(value => { + console.log('STORAGE TOKEN', value) + this.storageService.get(AuthConnstants.USER).then(res => { + console.log('USERID', res); + const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; + const body = { + UserId: res.UserId, + TokenId: token.value, + Status: 1, + Service: 1 + }; - // this.http.post(`${geturl}`, body, { headers }).subscribe(data => { - // console.log('TOKEN USER MIDLE', data); - // }, (error) => { - // console.log('Post token to backend', error) - // }) - // }); + this.http.post(`${geturl}`, body, { headers }).subscribe(data => { + console.log('TOKEN USER MIDLE', data); + }, (error) => { + console.log('Post token to backend', error) + }) + }); - // }); - // } - // ); - // } + }); + } + ); + } } registrationError() { - // PushNotifications.addListener('registrationError', - // (error: any) => { - // console.log('Error on registration: ' + JSON.stringify(error)); - // } - // ); + PushNotifications.addListener('registrationError', + (error: any) => { + console.log('Error on registration: ' + JSON.stringify(error)); + } + ); } onReciveForeground() { - // PushNotifications.addListener('pushNotificationReceived', - // (notification: PushNotificationSchema) => { - // console.log('Push received: ' + JSON.stringify(notification)); - // this.DataArray.push(notification) - // console.log("On ReceiveNotification", this.DataArray) - // this.storageService.store("Notifications", this.DataArray) - // this.eventtrigger.publishSomeData({ - // notification: "recive" - // }) - // } - // ); + PushNotifications.addListener('pushNotificationReceived', + (notification: PushNotificationSchema) => { + console.log('Push received: ' + JSON.stringify(notification)); + this.DataArray.push(notification) + console.log("On ReceiveNotification", this.DataArray) + this.storageService.store("Notifications", this.DataArray) + this.eventtrigger.publishSomeData({ + notification: "recive" + }) + } + ); } onReciveBackground() { - // PushNotifications.addListener('pushNotificationActionPerformed', - // (notification: ActionPerformed) => { - // console.log('Push action performed: ' + JSON.stringify(notification)); - // /* this.DataArray.push(notification.notification) - // console.log("On ReceiveNotification", this.DataArray) - // this.storageService.store("Notifications", this.DataArray) - // this.eventtrigger.publishSomeData({ - // notification: "recive" - // }) */ - // this.notificatinsRoutes(notification) - // } - // ); + PushNotifications.addListener('pushNotificationActionPerformed', + (notification: ActionPerformed) => { + console.log('Push action performed: ' + JSON.stringify(notification)); + /* this.DataArray.push(notification.notification) + console.log("On ReceiveNotification", this.DataArray) + this.storageService.store("Notifications", this.DataArray) + this.eventtrigger.publishSomeData({ + notification: "recive" + }) */ + this.notificatinsRoutes(notification) + } + ); } tempClearArray() { @@ -175,51 +175,51 @@ export class NotificationsService { notificatinsRoutes = (notification) => { - // console.log('Push action performed 2222: ' + JSON.stringify(notification.data)); + console.log('Push action performed 2222: ' + JSON.stringify(notification.data)); - // if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) { - // console.log("Id Lenght", notification.notification.data.IdObject.length) - // this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda'])); - // } - // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") { - // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital'])); - // } - // else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") { - // //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda'])); - // this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda'])); + if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) { + console.log("Id Lenght", notification.notification.data.IdObject.length) + this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") { + //this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda'])); + this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda'])); - // } else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") { + } else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") { - // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true })); - // } - // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true })); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") { - // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); - // } - // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") { - // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); - // } - // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") { - // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital'])); - // } - // else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") { - // this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject])); - // } - // else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") { - // this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject])); - // } - // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") { - // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital'])); - // } - // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") { + this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject])); + } + else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") { + this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") { - // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital'])); - // } - // else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") { - // this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital'])); - // } + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital'])); + } + else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") { + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital'])); + } } From 2d123c19f71ad0fcbc3b370dd6ed65331288c385 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 1 Apr 2022 11:29:32 +0100 Subject: [PATCH 11/15] save --- .../despacho-pr/despacho-pr.page.html | 28 +++++++++---------- .../despachos/despacho/despacho.page.html | 2 +- .../gabinete-digital.page.html | 10 +++---- .../despachos-options.page.html | 8 +++--- .../despachos-pr-options.page.html | 26 ++++++++--------- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html index b0af3b7a3..982b6eebf 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html @@ -79,25 +79,25 @@
-
Responder ao PR
- +
Responder ao PR
+ -
Reencaminhar para Área jurídica
- +
Reencaminhar para Área jurídica
+ -
Outras opções
- - - - +
Outras opções
+ + + + - +
- - - - + + + +
diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index 1f32942d3..540f866ba 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -14,7 +14,7 @@
{{ task.Folio}}
-
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 1717613ef..5c3376e90 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -133,19 +133,19 @@

{{pendentesstore.count}} Documentos

-
+
-

Despacho do Presidente da República

-

Despachos criados por mim

+

Despacho do Presidente da República

+

Despachos criados por mim

{{ despachoprstore.count }} Documentos

-
+
@@ -193,7 +193,7 @@
--> -
+
diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.html b/src/app/shared/popover/despachos-options/despachos-options.page.html index 1a33fae72..7e0840c6a 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.html +++ b/src/app/shared/popover/despachos-options/despachos-options.page.html @@ -28,7 +28,7 @@
- +
@@ -40,7 +40,7 @@
- +
@@ -51,7 +51,7 @@
- +
@@ -60,7 +60,7 @@
- +
diff --git a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html index f46731c61..a59cfd442 100644 --- a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html +++ b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html @@ -9,27 +9,27 @@
- - - - - - + + + + + +
- + - - + +
- - - - + + + +
From 6b6ff320134d696770580d5b6c1e35e1b4982d97 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 1 Apr 2022 12:57:33 +0100 Subject: [PATCH 12/15] save --- android/app/src/main/assets/capacitor.config.json | 3 --- .../gabinete-digital/gabinete-digital.page.html | 12 ++++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index 2a189f2f1..2399c4927 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -16,8 +16,5 @@ "sound" ] } - }, - "server": { - "url": "http://192.168.137.1:8100" } } diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html index 5c3376e90..27cdc2ed7 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.html +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html @@ -128,8 +128,8 @@
-

Pendentes

-

Meus Pendentes

+

Pendentes

+

Meus Pendentes

{{pendentesstore.count}} Documentos

@@ -163,8 +163,8 @@
-

Pedidos de Parecer

-

Pedidos de Parecer solicitados por mim

+

Pedidos de Parecer

+

Pedidos de Parecer solicitados por mim

{{pedidosstore.countparecer}} Documentos

@@ -215,8 +215,8 @@
-

Diplomas por Validar

-

Diplomas por Assinar

+

Diplomas por Validar

+

Diplomas por Assinar

{{ deplomasStore.deplomasReviewCount }} Documentos

From e1a5fbce14d477968055b811f78be159090d413b Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 1 Apr 2022 15:12:18 +0100 Subject: [PATCH 13/15] save --- .../despachos-pr/despacho-pr/despacho-pr.page.ts | 7 +++++-- .../popover/deploma-options/deploma-options.page.ts | 11 +++++++---- .../opts-expediente-pr/opts-expediente-pr.page.ts | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index 11887369d..25c1c6c86 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -24,6 +24,7 @@ import { SqliteService } from 'src/app/services/sqlite.service'; import { BackgroundService } from 'src/app/services/background.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'; @Component({ selector: 'app-despacho-pr', @@ -45,7 +46,8 @@ export class DespachoPrPage implements OnInit { intervenientes: any; cc: any = []; - constructor(private activateRoute: ActivatedRoute, + constructor( + private activateRoute: ActivatedRoute, private processes: ProcessesService, private iab: InAppBrowser, private attachmentsService: AttachmentsService, @@ -62,7 +64,8 @@ export class DespachoPrPage implements OnInit { private backgroundservice: BackgroundService, private platform: Platform, public ThemeService: ThemeService, - private RouteService: RouteService + private RouteService: RouteService, + public p: PermissionService, ) { this.activatedRoute.paramMap.subscribe(params => { if (params["params"].SerialNumber) { diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.ts b/src/app/shared/popover/deploma-options/deploma-options.page.ts index f388b9636..9ba87b910 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.ts +++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts @@ -8,6 +8,7 @@ import { ProcessesService } from 'src/app/services/processes.service'; import { ToastService } from 'src/app/services/toast.service'; import { Location } from '@angular/common'; import { RouteService } from 'src/app/services/route.service'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-deploma-options', @@ -23,7 +24,8 @@ export class DeplomaOptionsPage implements OnInit { fulltask: any - constructor(public popoverController: PopoverController, + constructor( + public popoverController: PopoverController, private modalController: ModalController, private activatedRoute: ActivatedRoute, private processes: ProcessesService, @@ -31,7 +33,8 @@ export class DeplomaOptionsPage implements OnInit { private toastService: ToastService, private router: Router, private deplomaService: DeplomaService, - private RouteService: RouteService) { + private RouteService: RouteService, + public p: PermissionService,) { this.serialNumber = this.navParams.get('serialNumber'); this.task = this.navParams.get('task'); this.fulltask = this.navParams.get('fulltask'); @@ -138,7 +141,7 @@ export class DeplomaOptionsPage implements OnInit { modal.onDidDismiss(); } - + async askSignature(note:string, documents:any) { let body = { "serialNumber": this.serialNumber, @@ -162,7 +165,7 @@ export class DeplomaOptionsPage implements OnInit { loader.remove() } - } + } async sign(note:string, documents:any) { diff --git a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts index fb91e2029..ba8850156 100644 --- a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts +++ b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts @@ -15,6 +15,7 @@ import { ToastService } from 'src/app/services/toast.service'; import { Location } from '@angular/common' import { ThemeService } from 'src/app/services/theme.service' import { RouteService } from 'src/app/services/route.service'; +import { PermissionService } from 'src/app/services/permission.service'; @Component({ selector: 'app-opts-expediente-pr', @@ -51,7 +52,8 @@ export class OptsExpedientePrPage implements OnInit { private animationController: AnimationController, private toastService: ToastService, private RouteService: RouteService, - public ThemeService: ThemeService + public ThemeService: ThemeService, + public p: PermissionService, ) { From c580220175cbf1b22e00a98cff15a3edf3ec11d1 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 1 Apr 2022 15:32:30 +0100 Subject: [PATCH 14/15] save --- .../despachos-pr/despacho-pr/despacho-pr.page.html | 4 ++-- .../despachos-pr-options/despachos-pr-options.page.html | 4 ++-- .../popover/opts-expediente-pr/opts-expediente-pr.page.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html index 982b6eebf..d713c4f80 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.html @@ -91,13 +91,13 @@ - +
- +
diff --git a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html index a59cfd442..1bf5ad3aa 100644 --- a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html +++ b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.html @@ -20,7 +20,7 @@ - +
@@ -29,7 +29,7 @@ - +
diff --git a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.html b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.html index d4515ed1b..5bfe9c8ad 100644 --- a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.html +++ b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.html @@ -8,7 +8,7 @@
-
+
@@ -17,7 +17,7 @@
-
+
From 37c049be37932f4a926c54c66a8ad49e94eb9c1c Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Fri, 1 Apr 2022 15:40:09 +0100 Subject: [PATCH 15/15] save --- .../gabinete-digital/despachos/despacho/despacho.page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html index 540f866ba..17c082711 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html @@ -14,7 +14,7 @@
{{ task.Folio}}
-
+