mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix ubgs
This commit is contained in:
@@ -110,9 +110,9 @@ export class CreateProcessPage implements OnInit {
|
||||
console.log('this.fulltask', this.fulltask)
|
||||
|
||||
|
||||
if(this.fulltask?.Documents) {
|
||||
this.documents = this.fulltask.Documents
|
||||
}
|
||||
// if(this.fulltask?.Documents) {
|
||||
// this.documents = this.fulltask.Documents
|
||||
// }
|
||||
|
||||
if (this.task.SerialNumber) {
|
||||
this.task.serialNumber = this.task.SerialNumber
|
||||
@@ -355,7 +355,7 @@ export class CreateProcessPage implements OnInit {
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
AttachmentList: docs
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if (this.task.activityInstanceName == 'Tarefa de Despacho' || this.task.activityInstanceName == 'Reexecutar Despacho') {
|
||||
// create parecer
|
||||
@@ -604,7 +604,7 @@ export class CreateProcessPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
|
||||
if (data) {
|
||||
@@ -683,7 +683,7 @@ export class CreateProcessPage implements OnInit {
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
|
||||
modal.onDidDismiss().then(res => {
|
||||
if (res['data'] == 'close') {
|
||||
this.modalController.dismiss(res['data'])
|
||||
@@ -742,7 +742,7 @@ export class CreateProcessPage implements OnInit {
|
||||
cssClass: classs,
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
|
||||
}, (error) => {
|
||||
@@ -770,7 +770,7 @@ export class CreateProcessPage implements OnInit {
|
||||
select: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
if (res) {
|
||||
const data = res.data;
|
||||
|
||||
@@ -86,7 +86,7 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
this.getNotificationData();
|
||||
|
||||
|
||||
|
||||
this.getProfilpicture();
|
||||
|
||||
}
|
||||
@@ -259,7 +259,7 @@ export class ProfilePage implements OnInit {
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', IdObject, 'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "diplomas-assinar") {
|
||||
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', IdObject, 'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "diploma-revisao") {
|
||||
@@ -309,26 +309,26 @@ export class ProfilePage implements OnInit {
|
||||
else if (Service === "agenda" && 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', IdObject, 'agenda']));
|
||||
|
||||
|
||||
} else if (Service === "gabinete-digital" && Object === "despachos") {
|
||||
this.processesService.GetTask(IdObject).subscribe((task) => {
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', IdObject, 'gabinete-digital'], { replaceUrl: true }));
|
||||
}, (error) => {
|
||||
this.notificationdata[i].read = true;
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "parecer") {
|
||||
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', IdObject, 'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "deferimento") {
|
||||
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', IdObject, 'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "despachos-pr") {
|
||||
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', IdObject, 'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "accoes" && Object === "accao") {
|
||||
@@ -341,7 +341,7 @@ export class ProfilePage implements OnInit {
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', IdObject, 'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "diplomas-assinar") {
|
||||
|
||||
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', IdObject, 'gabinete-digital']));
|
||||
}
|
||||
else if (Service === "gabinete-digital" && Object === "expedientes-pr") {
|
||||
@@ -383,13 +383,16 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
if (environment.production) {
|
||||
window.location.pathname = '/auth'
|
||||
this.notificationService.DeletePostToken()
|
||||
} else {
|
||||
const pathBeforeGoOut = window.location.pathname
|
||||
this.router.navigateByUrl('/auth', { replaceUrl: true });
|
||||
this.notificationService.DeletePostToken()
|
||||
|
||||
setTimeout(() => {
|
||||
if (this.logoutOut == false || pathBeforeGoOut == window.location.pathname) {
|
||||
window.location.pathname = '/auth'
|
||||
this.notificationService.DeletePostToken()
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ion-content class="height-100 container-wrapper">
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
|
||||
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
@@ -41,7 +41,7 @@
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
|
||||
<div class=" aside overflow-y-auto d-flex flex-wrap flex-grow-1">
|
||||
<div class="width-100" [ngSwitch]="segment">
|
||||
<ion-list *ngSwitchCase="'Contactos'">
|
||||
@@ -142,7 +142,7 @@
|
||||
<div *ngIf="group.lastMessage" class="item-description d-flex align-items-center" [class.item-description-active]="group.id ==idSelected">
|
||||
<div class="item-message font-13-em white-space-nowrap" *ngIf="group.otherUserType == false">{{group.lastMessage.u.name}}: {{group.lastMessage.msg}} </div>
|
||||
<div class="font-13-em" *ngIf="group.otherUserType == true">{{group.userThatIsTyping}} está escrever ...</div>
|
||||
|
||||
|
||||
<div class="item-files add-ellipsis" *ngIf="group.lastMessage.file">
|
||||
<fa-icon *ngIf="group.lastMessage.file.type != 'application/meeting' && group.lastMessage.file.type != 'application/audio'" icon="file-alt" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
|
||||
<fa-icon *ngIf="group.lastMessage.file.type == 'application/audio'" icon="file-audio" class="file-icon" [class.set-active-item-font-to-white]="group.id == idSelected"></fa-icon>
|
||||
@@ -231,9 +231,8 @@
|
||||
[roomId]="roomId"
|
||||
(backToChat)="backToChat($event)"
|
||||
(closeAllDesktopComponents)="closeAllDesktopComponents()"
|
||||
[style.display]="showNewGroup ? 'flex' : 'none'"
|
||||
*ngIf="showNewGroup"
|
||||
class=" height-100 flex-column">
|
||||
class=" height-100 flex-column d-flex">
|
||||
</app-new-group>
|
||||
|
||||
<app-edit-group [roomId]="roomId"
|
||||
|
||||
@@ -185,6 +185,7 @@ export class ChatPage implements OnInit {
|
||||
|
||||
setTimeout(() => {
|
||||
this.ChatSystemService.subscribeToRoom()
|
||||
this.RochetChatConnectorService.setStatus('online')
|
||||
},1000);
|
||||
|
||||
/* const webSocketURL = environment.apiWsChatUrl;
|
||||
@@ -193,13 +194,13 @@ export class ChatPage implements OnInit {
|
||||
ws.addEventListener('open', () => {
|
||||
console.log('WebSocket connection opened');
|
||||
});
|
||||
|
||||
|
||||
ws.addEventListener('message', (event) => {
|
||||
const data = JSON.parse(event.data);
|
||||
// Handle incoming messages from the Rocket.Chat server.
|
||||
console.log('Received message:', data);
|
||||
});
|
||||
|
||||
|
||||
ws.addEventListener('close', (event) => {
|
||||
console.log('WebSocket connection closed', event);
|
||||
// Optionally, attempt to reopen the connection when it's closed.
|
||||
@@ -209,8 +210,8 @@ export class ChatPage implements OnInit {
|
||||
}, 5000); // Reopen the connection after 5 seconds (adjust as needed).
|
||||
});
|
||||
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom("26XgGhKghKN8fN6v8KvDfW9jrjhKhoAWhM", SessionStore.user.UserName, 'typing', true).catch((error) => console.error(error));
|
||||
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom("26XgGhKghKN8fN6v8KvDfW9jrjhKhoAWhM", SessionStore.user.UserName, 'typing', true).catch((error) => console.error(error));
|
||||
|
||||
ws.addEventListener('error', (error) => {
|
||||
console.error('WebSocket error:', error);
|
||||
// Handle WebSocket errors here.
|
||||
@@ -365,6 +366,7 @@ export class ChatPage implements OnInit {
|
||||
}
|
||||
openNewGroupPage() {
|
||||
this.segment = 'Grupos';
|
||||
|
||||
this.idSelected = '';
|
||||
if (window.innerWidth < 701) {
|
||||
this.newGroup();
|
||||
@@ -518,7 +520,7 @@ export class ChatPage implements OnInit {
|
||||
// }).catch((error) => {
|
||||
// console.error('storage getchatusers: ',error)
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// // else {
|
||||
// // this.sqlservice.getAllChatRoom().then((rooms: any) => {
|
||||
// // //
|
||||
|
||||
@@ -36,7 +36,7 @@ export class GroupContactsPage implements OnInit {
|
||||
|
||||
objectUserSingleStone = []
|
||||
userContainer = {}
|
||||
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
private http: HttpClient,
|
||||
@@ -61,8 +61,8 @@ export class GroupContactsPage implements OnInit {
|
||||
// this.chatService.refreshtoken();
|
||||
this.loadUsers();
|
||||
// this.getMembers();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
loadUsers(){
|
||||
@@ -98,10 +98,10 @@ export class GroupContactsPage implements OnInit {
|
||||
} else {
|
||||
'not found'
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const userContainer = {}
|
||||
for(const user of this.objectUserSingleStone) {
|
||||
const firstLetter = user.name.charAt(0)
|
||||
@@ -111,11 +111,11 @@ export class GroupContactsPage implements OnInit {
|
||||
} else {
|
||||
userContainer[firstLetter].push(user)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.userContainer = userContainer
|
||||
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
});
|
||||
@@ -155,16 +155,16 @@ export class GroupContactsPage implements OnInit {
|
||||
"roomId": this.room._id,
|
||||
"userId": data._id,
|
||||
}
|
||||
|
||||
|
||||
if(this.room.t == "p"){
|
||||
this.chatService.removeGroupMember(body).subscribe(res=>{
|
||||
|
||||
|
||||
this.getMembers();
|
||||
});
|
||||
}
|
||||
else if(this.room.t == "c"){
|
||||
this.chatService.removeChannelMember(body).subscribe(res=>{
|
||||
|
||||
|
||||
this.getMembers();
|
||||
});
|
||||
}
|
||||
@@ -195,7 +195,7 @@ export class GroupContactsPage implements OnInit {
|
||||
});
|
||||
|
||||
const selectedUsers = this.users.filter( e => e?.isChecked == true)
|
||||
|
||||
|
||||
users.forEach( (user, index) => {
|
||||
if(user[index]) {
|
||||
console.log({user, index})
|
||||
@@ -215,7 +215,7 @@ export class GroupContactsPage implements OnInit {
|
||||
|
||||
|
||||
let a = this.objectUserSingleStone.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase()))
|
||||
|
||||
|
||||
let b = {}
|
||||
for(const user of a) {
|
||||
const firstLetter = user.name.charAt(0)
|
||||
@@ -225,16 +225,16 @@ export class GroupContactsPage implements OnInit {
|
||||
} else {
|
||||
b[firstLetter].push(user)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.userContainer = b
|
||||
|
||||
|
||||
|
||||
}
|
||||
clicked(){
|
||||
|
||||
|
||||
|
||||
}
|
||||
selectedContact(user:any) {
|
||||
@@ -244,18 +244,18 @@ export class GroupContactsPage implements OnInit {
|
||||
} else {
|
||||
user.isChecked = true
|
||||
}
|
||||
|
||||
|
||||
const userIndex = this.objectUserSingleStone.findIndex((e) => e._id == user._id)
|
||||
this.objectUserSingleStone[userIndex].isChecked = user.isChecked
|
||||
|
||||
|
||||
}
|
||||
addContacts(room:any){
|
||||
|
||||
|
||||
this.selectedUserList = this.users.filter(function(contact) {
|
||||
return contact.isChecked == true;
|
||||
});
|
||||
|
||||
|
||||
this.selectedUserList.forEach(user=>{
|
||||
let body ={
|
||||
"roomId":room._id,
|
||||
@@ -263,7 +263,7 @@ export class GroupContactsPage implements OnInit {
|
||||
|
||||
}
|
||||
this.chatService.addUserToGroup(body).subscribe(res=>{
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -271,12 +271,12 @@ export class GroupContactsPage implements OnInit {
|
||||
loading = false
|
||||
updateGroup(){
|
||||
if(this.loading) {
|
||||
return
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
this.loading = true
|
||||
console.log('this.room', this.room)
|
||||
|
||||
|
||||
this.chatService.getRoomInfo(this.room._id).subscribe(room=>{
|
||||
this.room = room['room'];
|
||||
this.addContacts(this.room);
|
||||
@@ -288,8 +288,8 @@ export class GroupContactsPage implements OnInit {
|
||||
}
|
||||
|
||||
async openGroupMessages(roomId:any){
|
||||
this.close();
|
||||
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupMessagesPage,
|
||||
componentProps: {
|
||||
@@ -300,9 +300,11 @@ export class GroupContactsPage implements OnInit {
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss();
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.close();
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,25 +41,24 @@ export class NewGroupPage implements OnInit {
|
||||
ngOnInit() {
|
||||
// this.chatService.refreshtoken();
|
||||
// console.log(this.documents)
|
||||
|
||||
}
|
||||
|
||||
_ionChange(event){
|
||||
_ionChange(event) {
|
||||
this.showDuration = event.detail.checked;
|
||||
|
||||
if(event.detail.checked){
|
||||
if(event.detail.checked) {
|
||||
this.thedate = new Date();
|
||||
}
|
||||
else{
|
||||
else {
|
||||
this.thedate = '';
|
||||
}
|
||||
}
|
||||
close(){
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
async createGroup(){
|
||||
|
||||
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
//Take out all special characters in string
|
||||
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
||||
@@ -72,17 +71,15 @@ export class NewGroupPage implements OnInit {
|
||||
"countDownDate": this.thedate
|
||||
}
|
||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
|
||||
}
|
||||
else{
|
||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
|
||||
}
|
||||
|
||||
this.isGroupCreated = true;
|
||||
this.addContacts(res.result);
|
||||
this.ChatSystemService.getAllRooms();
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result);
|
||||
}, 10)
|
||||
@@ -90,23 +87,23 @@ export class NewGroupPage implements OnInit {
|
||||
|
||||
|
||||
if(res?.result?.rid) {
|
||||
|
||||
|
||||
this.ChatSystemService.getAllRooms(() => {
|
||||
if(!this.ChatSystemService.getGroupRoom(res.result.rid)) {
|
||||
this.createGroupWithAttachmentsCath(res)
|
||||
} else {
|
||||
setTimeout(()=> {
|
||||
|
||||
|
||||
this.createGroupWithAttachments(res)
|
||||
|
||||
|
||||
}, 500)
|
||||
}
|
||||
}, res.result.rid);
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
this.toastService._badRequest('Existe um grupo com este nome!');
|
||||
|
||||
}
|
||||
@@ -169,7 +166,7 @@ export class NewGroupPage implements OnInit {
|
||||
this.close();
|
||||
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupContactsPage,
|
||||
@@ -206,7 +203,7 @@ export class NewGroupPage implements OnInit {
|
||||
text: 'Ok',
|
||||
cssClass: 'btn-cancel',
|
||||
handler:(value:any) => {
|
||||
|
||||
|
||||
let now = new Date();
|
||||
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
|
||||
|
||||
@@ -215,7 +212,7 @@ export class NewGroupPage implements OnInit {
|
||||
value.hours.value,
|
||||
value.minutes.value,
|
||||
]
|
||||
|
||||
|
||||
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
|
||||
if(value.days.value > 0) {
|
||||
if(value.days.value == 1) {
|
||||
|
||||
+26
-26
@@ -120,30 +120,30 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.loggeduser = SessionStore.user;
|
||||
this.task = this.navParams.get('task');
|
||||
|
||||
|
||||
|
||||
|
||||
this.SearchFolder = this.navParams.get('SearchFolder');
|
||||
this.aplicationId = this.navParams.get('aplicationId')
|
||||
this.document = this.navParams.get('document')
|
||||
// this.document = this.navParams.get('document')
|
||||
|
||||
this.taskType = this.navParams.get('taskAction');
|
||||
|
||||
|
||||
if(this.document) {
|
||||
const doc: any = this.document
|
||||
// if(this.document) {
|
||||
// const doc: any = this.document
|
||||
|
||||
this.documents.push({
|
||||
ApplicationId: (doc.ApplicationType || doc.ApplicationId),
|
||||
ApplicationType: (doc.ApplicationType || doc.ApplicationId),
|
||||
SourceId: (doc.Id || doc.DocId || doc.SourceId),
|
||||
Id: (doc.Id || doc.DocId || doc.SourceId),
|
||||
EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
|
||||
Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
|
||||
Data: (doc.DocDate || doc.Data),
|
||||
DocDate: (doc.DocDate || doc.Data),
|
||||
Assunto: doc.Assunto,
|
||||
} as any)
|
||||
}
|
||||
// this.documents.push({
|
||||
// ApplicationId: (doc.ApplicationType || doc.ApplicationId),
|
||||
// ApplicationType: (doc.ApplicationType || doc.ApplicationId),
|
||||
// SourceId: (doc.Id || doc.DocId || doc.SourceId),
|
||||
// Id: (doc.Id || doc.DocId || doc.SourceId),
|
||||
// EntidadeOrganicaNome: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
|
||||
// Sender: (doc.sender || doc.SourceName || doc. EntidadeOrganicaNome),
|
||||
// Data: (doc.DocDate || doc.Data),
|
||||
// DocDate: (doc.DocDate || doc.Data),
|
||||
// Assunto: doc.Assunto,
|
||||
// } as any)
|
||||
// }
|
||||
|
||||
|
||||
const DocumentToSave = this.documents.map((e) => {
|
||||
@@ -181,7 +181,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.postData.DispatchFolder.Subject = this.task.workflowInstanceDataFields.Subject;
|
||||
this.profile = this.navParams.get('profile');
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
async setAdding(type: "intervenient" | "CC") {
|
||||
@@ -199,9 +199,9 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
|
||||
onSelectedTypesChanged(ev:any) {
|
||||
|
||||
|
||||
if(ev.length > 1){
|
||||
|
||||
|
||||
this.selectedTypes = ev.filter(data => data != '99999850');
|
||||
}
|
||||
if(ev.length == 0){
|
||||
@@ -216,7 +216,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
getSubjectType() {
|
||||
this.processes.GetSubjectType().subscribe(res=>{
|
||||
|
||||
|
||||
this.subjectTypes = res;
|
||||
});
|
||||
}
|
||||
@@ -233,7 +233,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
if(this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks])) {
|
||||
return ['MDGPR']
|
||||
}
|
||||
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case '1': // Parecer
|
||||
@@ -434,7 +434,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -450,7 +450,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
AttachmentList: docs,
|
||||
}
|
||||
|
||||
|
||||
|
||||
let action_despacho_pr = {
|
||||
"serialNumber": this.task.serialNumber,
|
||||
@@ -520,7 +520,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
getAttachments() {
|
||||
this.attachmentsService.getAttachmentsBySerial(this.task.serialNumber).subscribe(res=>{
|
||||
this.loadedAttachments = res;
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
@@ -601,7 +601,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
|
||||
async viewExpedientDetail() {
|
||||
|
||||
|
||||
|
||||
let classs;
|
||||
if( window.innerWidth <= 800){
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi"
|
||||
[hideTime]="true"
|
||||
>
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
@@ -74,6 +75,7 @@
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi"
|
||||
[hideTime]="true"
|
||||
>
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
|
||||
@@ -14,7 +14,7 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
dateInput: "YYYY-MMMM-DD HH:mm"
|
||||
},
|
||||
display: {
|
||||
dateInput: "DD MMM YYYY H:mm",
|
||||
dateInput: "DD MMM YYYY",
|
||||
monthYearLabel: "MMM YYYY",
|
||||
dateA11yLabel: "LL",
|
||||
monthYearA11yLabel: "MMMM YYYY"
|
||||
@@ -97,7 +97,7 @@ export class NewActionPage implements OnInit {
|
||||
}, 1000);
|
||||
|
||||
segmentChanged(ev: any) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
get dateValid() {
|
||||
@@ -173,7 +173,7 @@ export class NewActionPage implements OnInit {
|
||||
date.setSeconds(0);
|
||||
|
||||
if(minutes % 15 != 0) {
|
||||
|
||||
|
||||
if (minutes > 45) {
|
||||
date.setMinutes(60)
|
||||
} else if (minutes > 30) {
|
||||
@@ -184,7 +184,7 @@ export class NewActionPage implements OnInit {
|
||||
date.setMinutes(15)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return date
|
||||
}
|
||||
@@ -193,7 +193,7 @@ export class NewActionPage implements OnInit {
|
||||
const _date = new Date(date);
|
||||
const minutes = _date .getMinutes();
|
||||
_date .setMinutes(minutes + 15)
|
||||
return _date
|
||||
return _date
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export class ChatSystemService {
|
||||
|
||||
onRoomsLoad = new Subscribe({execute : false, deleteOnExecute: true})
|
||||
|
||||
|
||||
|
||||
constructor(
|
||||
private RochetChatConnectorService: RochetChatConnectorService,
|
||||
private storage: Storage,
|
||||
@@ -76,6 +76,7 @@ export class ChatSystemService {
|
||||
|
||||
await this.chatService.refreshtoken();
|
||||
await this.getUser();
|
||||
this.RochetChatConnectorService.setStatus('online')
|
||||
await this.getAllRooms();
|
||||
this.subscribeToRoom();
|
||||
//
|
||||
@@ -179,7 +180,7 @@ export class ChatSystemService {
|
||||
const rooms = await this.storage.get('Rooms');
|
||||
|
||||
if(rooms) {
|
||||
for (let roomData of rooms.result.update) {
|
||||
for (let roomData of rooms.result.update) {
|
||||
await this.prepareRoom(roomData);
|
||||
}
|
||||
}
|
||||
@@ -213,7 +214,7 @@ export class ChatSystemService {
|
||||
}
|
||||
try {
|
||||
await this.storage.remove('Rooms');
|
||||
} catch(e) {}
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
let index = 0
|
||||
@@ -224,7 +225,7 @@ export class ChatSystemService {
|
||||
const roomId = this.getRoomId(roomData);
|
||||
|
||||
if(roomData.t == 'd') {
|
||||
|
||||
|
||||
let error = false
|
||||
let res;
|
||||
|
||||
@@ -238,13 +239,13 @@ export class ChatSystemService {
|
||||
if(error) {
|
||||
res = await this.chatService.getMembers(roomId).toPromise();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const members = res['members'];
|
||||
const users = members.filter(data => data.username != this.sessionStore.user.UserName);
|
||||
rooms.result.update[index]['members'] = members
|
||||
rooms.result.update[index]['membersExcludeMe'] = users
|
||||
|
||||
|
||||
await this.prepareRoom(roomData);
|
||||
} else {
|
||||
if (roomData.t === 'p') {
|
||||
@@ -257,19 +258,19 @@ export class ChatSystemService {
|
||||
await this.chatService.refreshtoken();
|
||||
error = true
|
||||
}
|
||||
|
||||
|
||||
if(error) {
|
||||
res = await this.chatService.getGroupMembers(roomId).toPromise()
|
||||
}
|
||||
|
||||
const members = res['members'];
|
||||
const users = members.filter(data => data.username != this.sessionStore.user.UserName);
|
||||
|
||||
|
||||
rooms.result.update[index]['members'] = members
|
||||
rooms.result.update[index]['membersExcludeMe'] = users
|
||||
|
||||
|
||||
await this.prepareRoom(roomData);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -283,7 +284,7 @@ export class ChatSystemService {
|
||||
await this.chatService.refreshtoken();
|
||||
error = true
|
||||
}
|
||||
|
||||
|
||||
if(error) {
|
||||
res = await this.chatService.getChannelMembers(roomId).toPromise()
|
||||
}
|
||||
@@ -291,19 +292,19 @@ export class ChatSystemService {
|
||||
|
||||
const members = res['members'];
|
||||
const users = members.filter(data => data.username != this.sessionStore.user.UserName);
|
||||
|
||||
|
||||
rooms.result.update[index]['members'] = members
|
||||
rooms.result.update[index]['membersExcludeMe'] = users
|
||||
await this.prepareRoom(roomData);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(roomId == roomIdCallback) {
|
||||
callback()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
index++;
|
||||
}
|
||||
}
|
||||
@@ -372,29 +373,29 @@ export class ChatSystemService {
|
||||
* @param id room id
|
||||
*/
|
||||
private defaultSubtribe(id: any) {
|
||||
|
||||
|
||||
const room = this.getRoomById(id);
|
||||
|
||||
|
||||
if(!room.subscribeAttempt) {
|
||||
room.subscribeAttempt = true;
|
||||
|
||||
|
||||
this.RochetChatConnectorService.streamRoomMessages(id).then((subscription) => {
|
||||
room.status.receive.message = true;
|
||||
})
|
||||
|
||||
|
||||
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'typing', false).then((subscription) => {
|
||||
room.status.receive.typing = true;
|
||||
//
|
||||
})
|
||||
|
||||
|
||||
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
|
||||
room.status.receive.readMessage = true;
|
||||
})
|
||||
|
||||
|
||||
this.RochetChatConnectorService.streamNotifyRoomDeleteMessage(id).then((subscription) => {
|
||||
room.status.receive.deleteMessage = true;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -485,7 +486,7 @@ export class ChatSystemService {
|
||||
|
||||
this.delete.push(roomId)
|
||||
delete this.group[roomId];
|
||||
this._group = this._group.filter((e)=> e.id != roomId);
|
||||
this._group = this._group.filter((e)=> e.id != roomId);
|
||||
}
|
||||
|
||||
deleteRecently(roomId) {
|
||||
@@ -626,7 +627,7 @@ export class ChatSystemService {
|
||||
return 'Sem nome'
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
return roomData.fname
|
||||
}
|
||||
|
||||
@@ -721,11 +721,11 @@ export class RoomService {
|
||||
|
||||
formatDateToDDMMYYYY(dateStamp) {
|
||||
const date = new Date(dateStamp);
|
||||
|
||||
|
||||
const day = date.getDate().toString().padStart(2, '0');
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0'); // Month is zero-based
|
||||
const year = date.getFullYear();
|
||||
|
||||
|
||||
return `${day}-${month}-${year}`;
|
||||
}
|
||||
|
||||
@@ -780,6 +780,8 @@ export class RoomService {
|
||||
let currentDateMessage = new Date().toLocaleDateString()
|
||||
if(!this.labelDates.find( e => e == currentDateMessage)) {
|
||||
|
||||
this.labelDates.push(currentDateMessage)
|
||||
|
||||
const cloneMessage = new MessageServiceDateLabel()
|
||||
|
||||
cloneMessage.ChatSystemService = this.ChatSystemService
|
||||
|
||||
@@ -18,4 +18,12 @@ export class DataService {
|
||||
return this.data[name]
|
||||
}
|
||||
|
||||
delate(name: string) {
|
||||
delete this.data[name]
|
||||
}
|
||||
|
||||
|
||||
clear() {
|
||||
this.data = {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NotificationsEndsPointsService } from './notifications-ends-points.service';
|
||||
|
||||
describe('NotificationsEndsPointsService', () => {
|
||||
let service: NotificationsEndsPointsService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(NotificationsEndsPointsService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NotificationsEndsPointsService {
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
) { }
|
||||
|
||||
|
||||
|
||||
postToken(token) {
|
||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||
const body = {
|
||||
UserId: SessionStore.user.UserId,
|
||||
TokenId: token,
|
||||
Status: 1,
|
||||
Service: 1
|
||||
};
|
||||
|
||||
return this.http.post<Token>(`${environment.apiURL}+ 'notifications/token'`, body, { headers })
|
||||
}
|
||||
|
||||
|
||||
DeleteToken(token) {
|
||||
|
||||
const geturl = environment.apiURL + `notifications/token?userId=${SessionStore.user.UserId}&tokenId=${token}`;
|
||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||
const body = {};
|
||||
|
||||
return this.http.delete<Token>(`${geturl}`, { headers, body })
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NotificationsStoreService } from './notifications-store.service';
|
||||
|
||||
describe('NotificationsStoreService', () => {
|
||||
let service: NotificationsStoreService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(NotificationsStoreService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NotificationsStoreService {
|
||||
|
||||
constructor() { }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NotificationsTriggerService } from './notifications-trigger.service';
|
||||
|
||||
describe('NotificationsTriggerService', () => {
|
||||
let service: NotificationsTriggerService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(NotificationsTriggerService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,70 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NotificationsTriggerService {
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
) { }
|
||||
|
||||
|
||||
|
||||
|
||||
sendNotificationWithSend(userID, title, bodymsg, roomId) {
|
||||
const geturl = environment.apiURL + `notifications/send`;
|
||||
|
||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||
const message = {
|
||||
"Service": "chat",
|
||||
"IdObject": roomId
|
||||
}
|
||||
let id = 437
|
||||
this.http.post<Token>(geturl + `?userId=${userID}&title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => {
|
||||
|
||||
}, (error) => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
ChatSendMessageNotification(userID, title, bodymsg, roomId) {
|
||||
const geturl = environment.apiURL + `notifications/sendbyUsername`;
|
||||
|
||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||
const message = {
|
||||
"Service": "chat",
|
||||
"IdObject": roomId
|
||||
}
|
||||
let id = 437
|
||||
this.http.post<Token>(geturl + `?username=${userID}&title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => {
|
||||
// this.active = true
|
||||
}, (error) => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
ChatSendMessageNotificationGrup(usersID, title, bodymsg, roomId) {
|
||||
const geturl = environment.apiURL + `notifications/sendByUsernames`;
|
||||
|
||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||
const message = {
|
||||
"Users": usersID,
|
||||
"NotificationData": {
|
||||
"Service": "chat",
|
||||
"IdObject": roomId
|
||||
}
|
||||
}
|
||||
|
||||
this.http.post<Token>(geturl + `?title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => {
|
||||
// this.active = true
|
||||
}, (error) => {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { NotificationsService } from './notifications.service';
|
||||
|
||||
describe('NotificationsService', () => {
|
||||
let service: NotificationsService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(NotificationsService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,200 @@
|
||||
import { Injectable, NgZone } from '@angular/core';
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
import { Capacitor } from '@capacitor/core';
|
||||
import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { NotificationsEndsPointsService } from './notifications-ends-points.service'
|
||||
import { AngularFireMessaging } from '@angular/fire/messaging';
|
||||
import { NavigationExtras, Router } from '@angular/router';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class NotificationsService {
|
||||
|
||||
isPushNotificationsAvailable = Capacitor.isPluginAvailable('PushNotifications');
|
||||
active = false
|
||||
|
||||
constructor(
|
||||
private platform: Platform,
|
||||
private NotificationsEndsPointsService: NotificationsEndsPointsService,
|
||||
private afMessaging: AngularFireMessaging,
|
||||
private router: Router,
|
||||
private zone: NgZone,
|
||||
) { }
|
||||
|
||||
|
||||
requestPermissions() {
|
||||
|
||||
if (this.platform.is('mobile')) {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
PushNotifications.requestPermissions().then(result => {
|
||||
if (result.receive === 'granted') {
|
||||
// Register with Apple / Google to receive push via APNS/FCM
|
||||
PushNotifications.register();
|
||||
} else {
|
||||
// Show some error
|
||||
}
|
||||
});
|
||||
} else {}
|
||||
}
|
||||
|
||||
|
||||
getToken(): Promise<string> {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.platform.is('mobile')) {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
PushNotifications.addListener('registration',
|
||||
(token: Token) => {
|
||||
resolve(token.value)
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.afMessaging.requestToken.subscribe(
|
||||
(token) => {
|
||||
resolve(token)
|
||||
},
|
||||
(error) => {
|
||||
console.error('Permission denied:', error);
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
async registerToken(username) {
|
||||
const token = await this.getToken()
|
||||
|
||||
if (this.platform.is('mobile')) {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
|
||||
this.NotificationsEndsPointsService.postToken(token)
|
||||
} else {
|
||||
this.afMessaging.requestToken.subscribe(
|
||||
(token) => {
|
||||
// Save the token to your server for sending notifications
|
||||
console.log('Permission granted! Token:', token);
|
||||
this.NotificationsEndsPointsService.postToken(token)
|
||||
},
|
||||
(error) => {
|
||||
console.error('Permission denied:', error);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
onReciveBackground() {
|
||||
|
||||
if(this.platform.is('mobile')) {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
|
||||
PushNotifications.addListener('pushNotificationActionPerformed',
|
||||
(notification: ActionPerformed) => {
|
||||
this.active = true
|
||||
console.log('NOtification Listener Backgroud', notification)
|
||||
/* this.DataArray.push(notification.notification)
|
||||
|
||||
this.storageService.store("Notifications", this.DataArray)
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
}) */
|
||||
this.notificatinsRoutes(notification)
|
||||
// this.runNotificationCallback(notification)
|
||||
}
|
||||
);
|
||||
} else {
|
||||
navigator.serviceWorker.onmessage = (event) => {
|
||||
console.log('Mensagem recebida do Service Worker:', event.data.data);
|
||||
let object = {
|
||||
notification: event.data
|
||||
}
|
||||
|
||||
if (event.data.notificationClicked) {
|
||||
console.log('Notificação push do Firebase clicada em segundo plano!');
|
||||
this.notificatinsRoutes(object)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
registrationError() {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
|
||||
PushNotifications.addListener('registrationError',
|
||||
(error: any) => {
|
||||
this.active = false
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
notificatinsRoutes = (notification) => {
|
||||
|
||||
console.log('BACK BACK',notification)
|
||||
|
||||
if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
|
||||
|
||||
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 === "expedientes") {
|
||||
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") {
|
||||
|
||||
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 === "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/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||
}
|
||||
|
||||
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diploma-revisao") {
|
||||
|
||||
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 === "expedientes-pr") {
|
||||
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital']));
|
||||
} else if (notification.notification.data.Service === "chat") {
|
||||
let navigationExtras: NavigationExtras = { queryParams: { "roomId": notification.notification.data.IdObject, } };
|
||||
this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ export class NotificationsService {
|
||||
active = false
|
||||
isPushNotificationsAvailable = Capacitor.isPluginAvailable('PushNotifications');
|
||||
notificationReceived: EventEmitter<void> = new EventEmitter<void>();
|
||||
token = ''
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
@@ -81,6 +82,7 @@ export class NotificationsService {
|
||||
PushNotifications.addListener('registration',
|
||||
(token: Token) => {
|
||||
this.postToken(token.value, geturl)
|
||||
this.token = token.value
|
||||
}
|
||||
);
|
||||
} else {
|
||||
@@ -89,6 +91,7 @@ export class NotificationsService {
|
||||
// Save the token to your server for sending notifications
|
||||
console.log('Permission granted! Token:', token);
|
||||
this.postToken(token, geturl)
|
||||
this.token = token
|
||||
},
|
||||
(error) => {
|
||||
console.error('Permission denied:', error);
|
||||
@@ -98,6 +101,13 @@ export class NotificationsService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
DeletePostToken() {
|
||||
const geturl = environment.apiURL + `notifications/token?userId=${SessionStore.user.UserId}&tokenId=${this.token}`;
|
||||
|
||||
this.DeleteToken(geturl)
|
||||
}
|
||||
|
||||
postToken(token, geturl) {
|
||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||
const body = {
|
||||
@@ -113,6 +123,19 @@ export class NotificationsService {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
DeleteToken(geturl) {
|
||||
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
|
||||
const body = {};
|
||||
|
||||
this.http.delete<Tokenn>(`${geturl}`, { headers, body }).subscribe(data => {
|
||||
this.active = true
|
||||
}, (error) => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
registrationError() {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
@@ -137,8 +160,8 @@ export class NotificationsService {
|
||||
this.active = true
|
||||
console.log('NOtification Listener', notification)
|
||||
this.storenotification(notification)
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
@@ -154,7 +177,7 @@ export class NotificationsService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
storenotification(notification) {
|
||||
console.log('Store Notification ',notification)
|
||||
this.storageService.get("Notifications").then((store) => {
|
||||
@@ -168,21 +191,21 @@ export class NotificationsService {
|
||||
let exists = accumulator.find(item => {
|
||||
return item.id === current.id;
|
||||
});
|
||||
|
||||
if(!exists) {
|
||||
|
||||
if(!exists) {
|
||||
accumulator = accumulator.concat(current);
|
||||
}
|
||||
return accumulator;
|
||||
}, []);
|
||||
|
||||
|
||||
console.log('Notification Result',result);
|
||||
this.storageService.store("Notifications", result).then(() => {
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
this.storageService.store("Notifications", store).then(() => {
|
||||
this.eventtrigger.publishSomeData({
|
||||
@@ -190,11 +213,6 @@ export class NotificationsService {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}).catch((error) => {
|
||||
if (!error) {
|
||||
this.storageService.store("Notifications", [notification])
|
||||
@@ -208,13 +226,13 @@ export class NotificationsService {
|
||||
if (!this.isPushNotificationsAvailable) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
PushNotifications.addListener('pushNotificationActionPerformed',
|
||||
(notification: ActionPerformed) => {
|
||||
this.active = true
|
||||
console.log('NOtification Listener Backgroud', notification)
|
||||
/* this.DataArray.push(notification.notification)
|
||||
|
||||
|
||||
this.storageService.store("Notifications", this.DataArray)
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
@@ -236,7 +254,7 @@ export class NotificationsService {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
sendNotificationWithSend(userID, title, bodymsg, roomId) {
|
||||
@@ -254,7 +272,7 @@ export class NotificationsService {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
ChatSendMessageNotification(userID, title, bodymsg, roomId) {
|
||||
const geturl = environment.apiURL + `notifications/sendbyUsername`;
|
||||
@@ -298,7 +316,7 @@ export class NotificationsService {
|
||||
|
||||
notificatinsRoutes = (notification) => {
|
||||
|
||||
console.log('BACK BACK',notification)
|
||||
console.log('BACK BACK',notification)
|
||||
|
||||
if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ export class TaskService {
|
||||
deplomasStore = DeplomasStore
|
||||
|
||||
SessionStore = SessionStore
|
||||
|
||||
|
||||
AllProcess = []
|
||||
showLoader: boolean = false
|
||||
showLoaderNum: number = 0
|
||||
@@ -57,8 +57,8 @@ export class TaskService {
|
||||
funx: Function
|
||||
id: string
|
||||
}
|
||||
} = {}
|
||||
|
||||
} = {}
|
||||
|
||||
|
||||
constructor(
|
||||
private processesbackend: ProcessesService,
|
||||
@@ -95,7 +95,7 @@ export class TaskService {
|
||||
registerCallback({funx, id = uuidv4()}) {
|
||||
|
||||
this.callbacks[id] = { funx, id}
|
||||
|
||||
|
||||
return {
|
||||
delete: ()=> {
|
||||
delete this.callbacks[id]
|
||||
@@ -132,7 +132,7 @@ export class TaskService {
|
||||
if(!isoDateString) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
const creationDate = new Date(isoDateString)
|
||||
return momentG(new Date(), 'dd MMMM yyyy') == momentG(new Date(creationDate), 'dd MMMM yyyy')
|
||||
}
|
||||
@@ -149,7 +149,7 @@ export class TaskService {
|
||||
} else if (attribute == 'OverdueTasks') {
|
||||
|
||||
return this.overdueTask(item.Deadline || item.deadline)
|
||||
|
||||
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -168,9 +168,9 @@ export class TaskService {
|
||||
|
||||
sortArrayISODate(myArray: any): any[] {
|
||||
|
||||
return myArray.sort((a,b) =>
|
||||
Date.parse(b.CreateDate || b.taskStartDate || b.TaskStartDate || b.TaskReceiveDate || b.taskReceiveDate )
|
||||
-
|
||||
return myArray.sort((a,b) =>
|
||||
Date.parse(b.CreateDate || b.taskStartDate || b.TaskStartDate || b.TaskReceiveDate || b.taskReceiveDate )
|
||||
-
|
||||
Date.parse(a.CreateDate || b.taskStartDate || b.TaskStartDate || a.TaskReceiveDate || a.taskReceiveDate ))
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ export class TaskService {
|
||||
await this.loadPendestes()
|
||||
|
||||
await this.loadDiplomas()
|
||||
|
||||
|
||||
|
||||
await this.loadEventosParaAprovacao()
|
||||
this.loadCount = true
|
||||
@@ -241,17 +241,17 @@ export class TaskService {
|
||||
try {
|
||||
let expedientes;
|
||||
expedientes = await this.processesbackend.GetTaskListExpediente(false).toPromise()
|
||||
|
||||
|
||||
expedientes = (expedientes || [] ).filter(data => data.workflowInstanceDataFields.Status == "" || data.workflowInstanceDataFields.Status == "Active")
|
||||
|
||||
|
||||
expedientes = expedientes.filter((item) => {
|
||||
return item.activityInstanceName != 'Retificar Expediente'
|
||||
});
|
||||
|
||||
|
||||
expedientes = expedientes.map((element) => this.expedienteTaskPipe.transform(element));
|
||||
|
||||
expedientes = this.sortArrayISODate(expedientes).reverse()
|
||||
|
||||
|
||||
this.expedientegbstore.reset(expedientes);
|
||||
} catch (error) {
|
||||
|
||||
@@ -268,15 +268,15 @@ export class TaskService {
|
||||
try {
|
||||
let pareceres = await this.processesbackend.GetTasksList("Pedido de Parecer", false).toPromise();
|
||||
let pareceresPr = await this.processesbackend.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
|
||||
|
||||
|
||||
let allParecer = pareceres.concat(pareceresPr);
|
||||
|
||||
|
||||
this.pedidosstore.countparecer = Object.keys(allParecer.filter(data => data.workflowInstanceDataFields.Status == "Active")).length;
|
||||
|
||||
|
||||
this.pedidosstore.resetparecer(allParecer.filter(data => data.workflowInstanceDataFields.Status == "Active").map((element) => {
|
||||
return this.customTaskPipe.transform(element)
|
||||
}));
|
||||
|
||||
}));
|
||||
|
||||
let deferimentos = await this.processesbackend.GetTasksList("Pedido de Deferimento", false).toPromise();
|
||||
this.pedidosstore.countdeferimento = Object.keys(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active")).length
|
||||
this.pedidosstore.resetdeferimento(deferimentos.filter(data => data.workflowInstanceDataFields.Status == "Active").map((element) => {
|
||||
@@ -292,7 +292,7 @@ export class TaskService {
|
||||
this.showLoaderNum++
|
||||
|
||||
try {
|
||||
|
||||
|
||||
let pendentes = await this.processesbackend.GetPendingTasks(false).toPromise();
|
||||
this.pendentesstore.count = Object.keys(pendentes).length;
|
||||
|
||||
@@ -304,7 +304,7 @@ export class TaskService {
|
||||
}
|
||||
|
||||
this.showLoaderNum--
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ export class TaskService {
|
||||
console.log('PR')
|
||||
// PR dont have event to approve
|
||||
/* if(this.SessionStore.user.Profile != 'PR') { */
|
||||
try {
|
||||
try {
|
||||
for(let calendar of this.eventService.calendarNamesAry) {
|
||||
if(calendar == 'Meu calendario') {
|
||||
// color
|
||||
@@ -324,10 +324,10 @@ export class TaskService {
|
||||
} catch (error) {
|
||||
eventsList = [];
|
||||
}
|
||||
|
||||
|
||||
console.log(calendar, eventsList)
|
||||
this.eventoaprovacaostore.save(calendar, eventsList)
|
||||
|
||||
|
||||
} else {
|
||||
let allEvents = await this.processesbackend.eventsToApprove(calendar.OwnerUserId, 'againete page').toPromise()
|
||||
let eventsList
|
||||
@@ -336,13 +336,13 @@ export class TaskService {
|
||||
} catch(error) {
|
||||
eventsList = []
|
||||
}
|
||||
|
||||
|
||||
console.log(calendar, eventsList)
|
||||
this.eventoaprovacaostore.save(calendar.OwnerUserId, eventsList)
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
|
||||
}
|
||||
/* } */
|
||||
|
||||
@@ -357,64 +357,64 @@ export class TaskService {
|
||||
this.showLoaderNum++
|
||||
|
||||
try {
|
||||
|
||||
|
||||
let depachoAPI = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||
|
||||
|
||||
|
||||
|
||||
if(SessionStore.user.Profile != 'PR') {
|
||||
|
||||
|
||||
let depacho: any = depachoAPI.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||
depacho = depacho.filter(data => data.workflowInstanceDataFields.Status == "Active");
|
||||
|
||||
|
||||
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
|
||||
|
||||
|
||||
this.despachoprstore.reset(depacho)
|
||||
|
||||
|
||||
} else if(SessionStore.user.Profile == 'PR') {
|
||||
|
||||
|
||||
let depacho: any = depachoAPI.filter(data => data.activityInstanceName == "Concluir Despacho").filter(data => data.workflowInstanceDataFields.Status == "Active")
|
||||
depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
|
||||
this.despachoprstore.reset(depacho)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let gerarDiploma = depachoAPI.reverse().filter(data => data.activityInstanceName == "Gerar Diploma" || data.activityInstanceName == "Retificar Diploma");
|
||||
let diplomasList = []
|
||||
|
||||
|
||||
gerarDiploma.forEach(element => {
|
||||
let task: customTask = this.customTaskPipe.transform(element);
|
||||
diplomasList.push(task);
|
||||
});
|
||||
|
||||
|
||||
diplomasList = diplomasList
|
||||
this.deplomasStore.resetDiplomaGerar(diplomasList);
|
||||
|
||||
|
||||
|
||||
|
||||
let diplomasValidar = depachoAPI.filter(data => data.activityInstanceName == "Revisar Diploma");
|
||||
|
||||
|
||||
diplomasValidar = diplomasValidar.filter(data => data.activityInstanceName != "Tarefa de Despacho");
|
||||
|
||||
|
||||
|
||||
|
||||
this.deplomasStore.resetDiplomasReview(diplomasValidar.map((element)=> {
|
||||
|
||||
|
||||
let date = new Date(element.taskStartDate);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
|
||||
|
||||
return this.customTaskPipe.transform(element)
|
||||
}))
|
||||
|
||||
|
||||
|
||||
|
||||
let diplomasAssinar: any = depachoAPI.filter(data => data.activityInstanceName == "Assinar Diploma");
|
||||
diplomasAssinar = diplomasAssinar.map((element) => this.expedienteTaskPipe.transform(element))
|
||||
this.deplomasStore.resetDiplomasParaAssinar(diplomasAssinar)
|
||||
|
||||
|
||||
let diplomasAssinados: any = depachoAPI.filter(data => data.activityInstanceName == "Diploma Assinado");
|
||||
diplomasAssinados = diplomasAssinados.map((element) => this.expedienteTaskPipe.transform(element))
|
||||
this.deplomasStore.resetDiplomasAssinadoList(diplomasAssinados)
|
||||
} catch (error) {}
|
||||
|
||||
|
||||
this.showLoaderNum--
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ export class TaskService {
|
||||
|
||||
dynamicSearch({searchSubject, ordinance, list}) {
|
||||
if(searchSubject) {
|
||||
|
||||
|
||||
const AllProcess = list.filter((task) => {
|
||||
let subject = task.Folio || task.Subject || task.workflowInstanceDataFields.Subject
|
||||
subject = subject.toLowerCase();
|
||||
|
||||
@@ -37,8 +37,8 @@ export class NewGroupPage implements OnInit{
|
||||
@Input() groupName:string;
|
||||
@Output() addGroupMessage:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() closeAllDesktopComponents:EventEmitter<any> = new EventEmitter<any>();
|
||||
@Output() backToChat:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@Output() backToChat:EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
|
||||
constructor(
|
||||
private pickerController: PickerController,
|
||||
@@ -57,23 +57,17 @@ export class NewGroupPage implements OnInit{
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log(this.dataService.get("task"))
|
||||
|
||||
this.task = this.dataService.get("task");
|
||||
this.event = this.dataService.get("event");
|
||||
|
||||
console.log(this.task)
|
||||
|
||||
this
|
||||
|
||||
if(this.task) {
|
||||
if(this.task && this.dataService.get("newGroup")) {
|
||||
this.link = this.dataService.get("link");
|
||||
this.groupName = this.task.Folio;
|
||||
this.documents = this.dataService.get("documents");
|
||||
this.dataService.set("newGroup", false);
|
||||
this.dataService.set("link", false);
|
||||
} else if (this.event) {
|
||||
} else if (this.event && this.dataService.get("newGroup")) {
|
||||
//
|
||||
this.link = this.dataService.get("link");
|
||||
this.groupName = this.event.Subject;
|
||||
@@ -83,12 +77,14 @@ export class NewGroupPage implements OnInit{
|
||||
this.dataService.set("newGroup", false);
|
||||
this.dataService.set("link", false);
|
||||
|
||||
} else {
|
||||
this.dataService.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_ionChange(event) {
|
||||
|
||||
|
||||
this.showDuration = event.detail.checked;
|
||||
|
||||
if(event.detail.checked) {
|
||||
@@ -112,12 +108,12 @@ export class NewGroupPage implements OnInit{
|
||||
this.viewContainerRef.clear();
|
||||
this.closeAllDesktopComponents.emit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
async createGroup() {
|
||||
|
||||
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
//Take out all special characters in string
|
||||
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
||||
@@ -132,12 +128,12 @@ export class NewGroupPage implements OnInit{
|
||||
let customFields = {
|
||||
"countDownDate":this.thedate
|
||||
}
|
||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
}
|
||||
else {
|
||||
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
|
||||
}
|
||||
|
||||
|
||||
|
||||
loader.remove();
|
||||
|
||||
@@ -146,23 +142,23 @@ export class NewGroupPage implements OnInit{
|
||||
|
||||
if(res?.result?.rid) {
|
||||
this.addGroupMessage.emit(res.result.rid);
|
||||
|
||||
|
||||
this.ChatSystemService.getAllRooms(() => {
|
||||
if(!this.ChatSystemService.getGroupRoom(res.result.rid)) {
|
||||
this.createGroupWithAttachmentsCath(res)
|
||||
} else {
|
||||
setTimeout(()=> {
|
||||
|
||||
|
||||
this.createGroupWithAttachments(res)
|
||||
|
||||
|
||||
}, 500)
|
||||
}
|
||||
}, res.result.rid);
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
this.toastService._badRequest('Existe um grupo com este nome!');
|
||||
|
||||
}
|
||||
@@ -224,7 +220,7 @@ export class NewGroupPage implements OnInit{
|
||||
this.close();
|
||||
|
||||
let name = this.groupName.split(' ').join('-');
|
||||
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupContactsPage,
|
||||
@@ -263,7 +259,7 @@ export class NewGroupPage implements OnInit{
|
||||
text: 'Ok',
|
||||
cssClass: 'btn-cancel',
|
||||
handler:(value:any)=>{
|
||||
|
||||
|
||||
let now = new Date();
|
||||
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
|
||||
|
||||
@@ -272,7 +268,7 @@ export class NewGroupPage implements OnInit{
|
||||
value.hours.value,
|
||||
value.minutes.value,
|
||||
]
|
||||
|
||||
|
||||
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
|
||||
if(value.days.value > 0){
|
||||
if(value.days.value == 1){
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
|
||||
<div *ngIf="profilePicture != ''" class="profile-image">
|
||||
<img class="profile-image" src={{profilePicture}}>
|
||||
<img class="profile-image image-prety" src={{profilePicture}}>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@
|
||||
|
||||
|
||||
<div *ngIf="profilePicture != ''" class="profile-image">
|
||||
<img class="profile-image font-45-em" src={{profilePicture}}>
|
||||
<img class="profile-image font-45-em image-prety" src={{profilePicture}}>
|
||||
</div>
|
||||
|
||||
<div class="profile-text">
|
||||
@@ -242,4 +242,4 @@
|
||||
|
||||
</div>
|
||||
<div [class.header-bottom-line]="ThemeService.currentTheme == 'gov'" style="height: 5px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
|
||||
SessionStore = SessionStore;
|
||||
environment = environment
|
||||
|
||||
|
||||
constructor(
|
||||
private popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
@@ -58,7 +58,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
public TaskService: TaskService,
|
||||
private dataService: DataService,
|
||||
) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -66,12 +66,12 @@ export class OptsExpedientePage implements OnInit {
|
||||
}
|
||||
|
||||
async openNewGroupPage() {
|
||||
|
||||
this.dataService.set("newGroup", true);
|
||||
this.dataService.set("task", this.task);
|
||||
this.dataService.set("newGroupName", this.task.Folio);
|
||||
this.dataService.set("documents", this.fulltask.Documents);
|
||||
this.dataService.set("link", window.location.pathname);
|
||||
|
||||
// this.dataService.set("newGroup", true);
|
||||
// this.dataService.set("task", this.task);
|
||||
// this.dataService.set("newGroupName", this.task.Folio);
|
||||
// this.dataService.set("documents", this.fulltask.Documents);
|
||||
// this.dataService.set("link", window.location.pathname);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: NewGroupPage,
|
||||
@@ -180,7 +180,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
});
|
||||
|
||||
modal.onDidDismiss().then( async (res) => {
|
||||
|
||||
|
||||
if(res.data){
|
||||
const DocumentToSave = res.data.documents.map((e) => {
|
||||
return {
|
||||
@@ -232,7 +232,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
} finally {
|
||||
@@ -249,7 +249,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
});
|
||||
@@ -266,7 +266,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
"AttachmentList" :documents,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
@@ -313,7 +313,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
|
||||
async openExpedientActionsModal(taskAction: any, task: any) {
|
||||
|
||||
|
||||
|
||||
|
||||
this.close();
|
||||
let classs;
|
||||
@@ -330,9 +330,9 @@ export class OptsExpedientePage implements OnInit {
|
||||
},
|
||||
cssClass: classs,
|
||||
});
|
||||
|
||||
|
||||
modal.onDidDismiss().then(async res=>{
|
||||
|
||||
|
||||
let body = res['data'];
|
||||
if(res['data']){
|
||||
const loader = this.toastService.loading()
|
||||
@@ -344,7 +344,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
}
|
||||
} finally {
|
||||
@@ -352,7 +352,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
|
||||
}
|
||||
}, (error) => {
|
||||
console.log(error)
|
||||
@@ -373,7 +373,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
|
||||
|
||||
modal.onDidDismiss().then( async (res) => {
|
||||
|
||||
|
||||
|
||||
if(body == 'descartar') {
|
||||
if(res['data']== 'Yes') {
|
||||
@@ -389,7 +389,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
}
|
||||
} finally {
|
||||
@@ -415,7 +415,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
|
||||
this.toastService._badRequest('Processo não descartado')
|
||||
}
|
||||
} finally {
|
||||
@@ -424,7 +424,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
this.goBack();
|
||||
}
|
||||
else if(res['data'] == 'No'){
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
@@ -432,7 +432,7 @@ export class OptsExpedientePage implements OnInit {
|
||||
this.TaskService.loadExpedientes()
|
||||
this.toastService._successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
@@ -53,7 +53,8 @@
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond"
|
||||
[touchUi]="touchUi">
|
||||
[hideTime]="true"
|
||||
>
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
|
||||
@@ -89,7 +90,9 @@
|
||||
[showSpinners]="showSpinners"
|
||||
[showSeconds]="showSeconds"
|
||||
[stepHour]="stepHour" [stepMinute]="stepMinute"
|
||||
[stepSecond]="stepSecond">
|
||||
[stepSecond]="stepSecond"
|
||||
[hideTime]="true"
|
||||
>
|
||||
</ngx-mat-datetime-picker>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
@@ -5,12 +5,29 @@ import { PublicationFolder } from 'src/app/models/publicationfolder';
|
||||
import { PublicationsService } from 'src/app/services/publications.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
dateInput: "YYYY-MMMM-DD HH:mm"
|
||||
},
|
||||
display: {
|
||||
dateInput: "DD MMM YYYY",
|
||||
monthYearLabel: "MMM YYYY",
|
||||
dateA11yLabel: "LL",
|
||||
monthYearA11yLabel: "MMMM YYYY"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-action',
|
||||
templateUrl: './new-action.page.html',
|
||||
styleUrls: ['./new-action.page.scss'],
|
||||
providers: [
|
||||
{ provide: NGX_MAT_DATE_FORMATS, useValue: CUSTOM_DATE_FORMATS },
|
||||
]
|
||||
})
|
||||
export class NewActionPage implements OnInit {
|
||||
|
||||
@@ -42,7 +59,7 @@ export class NewActionPage implements OnInit {
|
||||
) {
|
||||
this.folder = new PublicationFolder();
|
||||
|
||||
|
||||
|
||||
this.setStartDate()
|
||||
this.setEndDate()
|
||||
}
|
||||
@@ -53,7 +70,7 @@ export class NewActionPage implements OnInit {
|
||||
}
|
||||
|
||||
segmentChanged(ev: any) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
get dateValid() {
|
||||
@@ -103,10 +120,10 @@ export class NewActionPage implements OnInit {
|
||||
if(this.Form.invalid) {
|
||||
return false
|
||||
} else {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
this.folder = {
|
||||
ProcessId: null,
|
||||
@@ -116,7 +133,7 @@ export class NewActionPage implements OnInit {
|
||||
DateEnd: this.folder.DateEnd,
|
||||
ActionType: this.segment,
|
||||
}
|
||||
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
@@ -145,7 +162,7 @@ export class NewActionPage implements OnInit {
|
||||
date.setSeconds(0);
|
||||
|
||||
if(minutes % 15 != 0) {
|
||||
|
||||
|
||||
if (minutes > 45) {
|
||||
date.setMinutes(60)
|
||||
} else if (minutes > 30) {
|
||||
@@ -156,18 +173,18 @@ export class NewActionPage implements OnInit {
|
||||
date.setMinutes(15)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return date
|
||||
}
|
||||
|
||||
|
||||
roundTimeQuarterHour() {
|
||||
let date = new Date();
|
||||
const minutes = date.getMinutes();
|
||||
date.setSeconds(0);
|
||||
|
||||
if(minutes % 15 != 0) {
|
||||
|
||||
|
||||
if (minutes > 45) {
|
||||
date.setMinutes(60)
|
||||
} else if (minutes > 30) {
|
||||
@@ -178,7 +195,7 @@ export class NewActionPage implements OnInit {
|
||||
date.setMinutes(15)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return date
|
||||
}
|
||||
@@ -187,9 +204,9 @@ export class NewActionPage implements OnInit {
|
||||
const _date = new Date(date);
|
||||
const minutes = _date .getMinutes();
|
||||
_date .setMinutes(minutes + 15)
|
||||
return _date
|
||||
return _date
|
||||
}
|
||||
|
||||
|
||||
|
||||
setStartDate() {
|
||||
this.folder.DateBegin = this.roundTimeQuarterHour()
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="35" height="35" viewBox="0 0 35 35">
|
||||
<defs>
|
||||
<linearGradient id="3fz9vpdwbc" x1="50%" x2="50%" y1="0%" y2="100%">
|
||||
<stop offset="0%" stop-color="#80C2FF"/>
|
||||
<stop offset="99.962%" stop-color="#0085FF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="ytz5rxohcf" x1="50%" x2="50%" y1="0%" y2="100%">
|
||||
<stop offset="0%" stop-color="#FFEFBB"/>
|
||||
<stop offset="100%" stop-color="#FFC200"/>
|
||||
</linearGradient>
|
||||
<filter id="3idfuqbbja" width="117.4%" height="120%" x="-8.7%" y="-5%" filterUnits="objectBoundingBox">
|
||||
<feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/>
|
||||
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation=".5"/>
|
||||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/>
|
||||
<feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.187390734 0"/>
|
||||
</filter>
|
||||
<filter id="uv9cnvernd" width="125%" height="128.6%" x="-12.5%" y="-7.1%" filterUnits="objectBoundingBox">
|
||||
<feOffset dy="1" in="SourceAlpha" result="shadowOffsetOuter1"/>
|
||||
<feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation=".5"/>
|
||||
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/>
|
||||
<feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.187390734 0"/>
|
||||
</filter>
|
||||
<path id="a49fg2bilb" d="M14.5 19.1c1.404 0 2.75-.208 3.993-.59.666-.206 4.252 1.758 4.853 1.459.607-.302-1.77-2.867-1.243-3.253C24.493 14.966 26 12.404 26 9.55 26 4.276 20.851 0 14.5 0S3 4.276 3 9.55c0 5.275 5.149 9.55 11.5 9.55z"/>
|
||||
<path id="6npze5akpe" d="M8 25.37c.977 0 1.913-.146 2.778-.414.463-.143 2.958 1.232 3.376 1.022.422-.21-1.232-2.006-.865-2.277C14.951 22.476 16 20.683 16 18.685c0-1.552-.633-2.98-1.695-4.115C12.841 13.006 10.561 12 8 12c-4.418 0-8 2.993-8 6.685 0 1.037.282 2.018.786 2.894C2.077 23.822 4.822 25.37 8 25.37z"/>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<g transform="translate(-30 -508) translate(20 495) translate(10 10) translate(0 3) translate(5 5)">
|
||||
<use fill="#000" filter="url(#3idfuqbbja)" xlink:href="#a49fg2bilb"/>
|
||||
<path fill="url(#3fz9vpdwbc)" stroke="#EBEBEB" stroke-linejoin="square" stroke-opacity=".194" d="M14.5.5c3.05 0 5.813 1.022 7.812 2.682C24.275 4.812 25.5 7.06 25.5 9.55c0 2.698-1.437 5.111-3.692 6.763-.066 1.374.22 1.842.51 2.307.17.273.342.545.467.782-.413.145-1.28-.44-1.758-.634-1.178-.478-2.317-.848-2.68-.737-1.199.369-2.495.57-3.847.57-3.05 0-5.813-1.022-7.812-2.682C4.725 14.289 3.5 12.04 3.5 9.55c0-2.49 1.225-4.738 3.188-6.368C8.688 1.522 11.45.5 14.5.5z"/>
|
||||
</g>
|
||||
<g transform="translate(-30 -508) translate(20 495) translate(10 10) translate(0 3) translate(5 5) matrix(-1 0 0 1 16 0)">
|
||||
<use fill="#000" filter="url(#uv9cnvernd)" xlink:href="#6npze5akpe"/>
|
||||
<path fill="url(#ytz5rxohcf)" stroke="#EBEBEB" stroke-linejoin="square" stroke-opacity=".194" d="M8 12.5c2.41 0 4.56.938 5.94 2.412.974 1.04 1.56 2.349 1.56 3.773 0 1.842-.979 3.487-2.508 4.614-.152 1.023.008 1.308.19 1.608.14.225.26.421.355.587-.296-.022-.819-.446-.939-.495-.868-.355-1.702-.602-1.968-.52-.82.253-1.705.392-2.63.392-1.477 0-2.856-.353-4.02-.965-1.186-.623-2.15-1.515-2.76-2.576-.46-.8-.72-1.697-.72-2.645 0-1.7.834-3.232 2.164-4.343C4.029 13.2 5.917 12.5 8 12.5z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
+15
-1
@@ -1475,12 +1475,19 @@ $font-size: rem(15);
|
||||
ngx-mat-datetime-content .actions {
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
top: -66px;
|
||||
|
||||
button {
|
||||
z-index: 11111111;
|
||||
}
|
||||
}
|
||||
|
||||
ngx-mat-datetime-content .time-container {
|
||||
margin-bottom: -44px;
|
||||
|
||||
button {
|
||||
z-index: 11111111;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1659,3 +1666,10 @@ h5, .buttons{
|
||||
.welcome-text {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
|
||||
.image-prety {
|
||||
border-color: transparent !important;
|
||||
-o-object-fit: cover;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user