general review

This commit is contained in:
Peter Maquiran
2023-08-21 17:36:32 +01:00
parent dd1ba46b0d
commit a02bcb13a3
14 changed files with 131 additions and 93 deletions
+16 -12
View File
@@ -952,12 +952,14 @@ export class AgendaPage implements OnInit {
this.IsEvent = 'add'; this.IsEvent = 'add';
if (window.innerWidth <= 1024) { if (window.innerWidth <= 1024) {
let taskParticipants = [{ let taskParticipants = [
EmailAddress: SessionStore.user.Email, // {
IsRequired: true, // EmailAddress: SessionStore.user.Email,
Name: SessionStore.user.FullName, // IsRequired: true,
UserType: "GD" // Name: SessionStore.user.FullName,
}] // UserType: "GD"
// }
]
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: NewEventPage, component: NewEventPage,
componentProps: { componentProps: {
@@ -981,12 +983,14 @@ export class AgendaPage implements OnInit {
await modal.present(); await modal.present();
} else { } else {
this.mobileComponent.showAddNewEvent = true; this.mobileComponent.showAddNewEvent = true;
this.taskParticipants = [{ this.taskParticipants = [
EmailAddress: SessionStore.user.Email, // {
IsRequired: true, // EmailAddress: SessionStore.user.Email,
Name: SessionStore.user.FullName, // IsRequired: true,
UserType: "GD" // Name: SessionStore.user.FullName,
}] // UserType: "GD"
// }
]
} }
} }
@@ -133,7 +133,7 @@
[stepHour]="1" [stepHour]="1"
[stepMinute]="15" [stepMinute]="15"
> >
</ngx-mat-datetime-picker> </ngx-mat-datetime-picker>
</mat-form-field> </mat-form-field>
@@ -1,6 +1,6 @@
<ion-header class="ion-no-border px-20"> <ion-header class="ion-no-border px-20">
<ion-toolbar class="px-10"> <ion-toolbar class="px-10">
<ion-title class="pa-0">Adicionar intervenientes</ion-title> <ion-title class="pa-0">Pesquisar contactos</ion-title>
</ion-toolbar> </ion-toolbar>
<ion-searchbar search-icon="undefined" class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" --> <ion-searchbar search-icon="undefined" class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
@@ -90,7 +90,7 @@
</ion-buttons> </ion-buttons>
<ion-buttons class="flex-grow-1" slot="end"> <ion-buttons class="flex-grow-1" slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()"> <button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Adicionar</ion-label> <ion-label>Gravar</ion-label>
</button> </button>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
@@ -693,6 +693,7 @@ export class ExpedienteDetailPage implements OnInit {
} }
async openOptions(taskAction?: any) { async openOptions(taskAction?: any) {
const popover = await this.popoverController.create({ const popover = await this.popoverController.create({
component: OptsExpedientePage, component: OptsExpedientePage,
cssClass: 'exp-options', cssClass: 'exp-options',
@@ -227,8 +227,9 @@ export class NewPublicationPage implements OnInit {
try { try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Publicação Editada') this.httpErrorHandle.httpsSucessMessagge('Publicação Editada')
console.log({response})
this.close(); this.close();
} catch (error) { } catch (error) {
@@ -255,8 +256,9 @@ export class NewPublicationPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Criar publicação') this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
console.log({response})
this.close(); this.close();
} catch (error) { } catch (error) {
@@ -281,9 +283,9 @@ export class NewPublicationPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Publicação Editada') this.httpErrorHandle.httpsSucessMessagge('Publicação Editada')
console.log({response})
this.close(); this.close();
} catch (error) { } catch (error) {
this.httpErrorHandle.httpStatusHandle(error) this.httpErrorHandle.httpStatusHandle(error)
@@ -293,7 +295,8 @@ export class NewPublicationPage implements OnInit {
} }
this.PublicationFolderService.loadPublication(this.publication.DocumentId, this.publication.ProcessId) this.PublicationFolderService.deletePost(this.publication.DocumentId, this.publication.ProcessId)
} }
else { else {
@@ -169,6 +169,14 @@ export class ViewPublicationsPage implements OnInit {
for( let publicationId of loadLater) { for( let publicationId of loadLater) {
await this.loadPublication(publicationId, folderId) await this.loadPublication(publicationId, folderId)
} }
for(let localPublication of this.publicationFolderService.publicationList[folderId]) {
const apiPublication = publicationIds.includes(localPublication.DocumentId)
if(!apiPublication) {
this.publicationFolderService.deletePost(folderId, localPublication.DocumentId)
}
}
this.showLoader = false; this.showLoader = false;
@@ -1,6 +1,6 @@
<ion-header class="ion-no-border px-20"> <ion-header class="ion-no-border px-20">
<ion-toolbar class="px-10"> <ion-toolbar class="px-10">
<ion-title class="pa-0">Adicionar intervenientes</ion-title> <ion-title class="pa-0">Pesquisar contactos</ion-title>
</ion-toolbar> </ion-toolbar>
<ion-searchbar search-icon="undefined" class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" --> <ion-searchbar search-icon="undefined" class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
@@ -85,7 +85,7 @@
</ion-buttons> </ion-buttons>
<ion-buttons class="flex-grow-1" slot="end"> <ion-buttons class="flex-grow-1" slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()"> <button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Adicionar</ion-label> <ion-label>Gravar</ion-label>
<ion-icon name="checkmark" slot="start"></ion-icon> <ion-icon name="checkmark" slot="start"></ion-icon>
</button> </button>
</ion-buttons> </ion-buttons>
+66 -59
View File
@@ -19,6 +19,7 @@ import { customTask } from '../models/dailyworktask.model';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
import { ChangeProfileService } from './change-profile.service'; import { ChangeProfileService } from './change-profile.service';
import { PermissionService } from './permission.service';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@@ -66,6 +67,7 @@ export class TaskService {
public eventService: EventsService, public eventService: EventsService,
private router: Router, private router: Router,
private changeProfileService: ChangeProfileService, private changeProfileService: ChangeProfileService,
public p: PermissionService,
) { ) {
this.changeProfileService.registerCallback(() => { this.changeProfileService.registerCallback(() => {
@@ -324,6 +326,7 @@ export class TaskService {
eventsList = []; eventsList = [];
} }
console.log(calendar, eventsList)
this.eventoaprovacaostore.save(calendar, eventsList) this.eventoaprovacaostore.save(calendar, eventsList)
} else { } else {
@@ -335,6 +338,7 @@ export class TaskService {
eventsList = [] eventsList = []
} }
console.log(calendar, eventsList)
this.eventoaprovacaostore.save(calendar.OwnerUserId, eventsList) this.eventoaprovacaostore.save(calendar.OwnerUserId, eventsList)
} }
} }
@@ -350,68 +354,71 @@ export class TaskService {
async loadDiplomas() { async loadDiplomas() {
this.showLoaderNum++ if(this.p.userPermission([this.p.permissionList.Gabinete.md_tasks]) || this.p.userPermission([this.p.permissionList.Gabinete.pr_tasks])) {
this.showLoaderNum++
try { try {
let depachoAPI = await this.processesbackend.GetTasksList("Despacho do Presidente da República", false).toPromise(); 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"); if(SessionStore.user.Profile != 'PR') {
diplomasValidar = diplomasValidar.filter(data => data.activityInstanceName != "Tarefa de Despacho"); let depacho: any = depachoAPI.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
depacho = depacho.filter(data => data.workflowInstanceDataFields.Status == "Active");
this.deplomasStore.resetDiplomasReview(diplomasValidar.map((element)=> { depacho = depacho.map((e)=> this.customTaskPipe.transform(e))
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-- 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--
}
} }
@@ -1,6 +1,6 @@
<ion-header class="ion-no-border px-20"> <ion-header class="ion-no-border px-20">
<ion-toolbar class="px-10"> <ion-toolbar class="px-10">
<ion-title class="pa-0">Adicionar intervenientes</ion-title> <ion-title class="pa-0">Pesquisar contactos</ion-title>
</ion-toolbar> </ion-toolbar>
<ion-searchbar search-icon="undefined" #Searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" --> <ion-searchbar search-icon="undefined" #Searchbar class="attendee-search-bar" (ionChange)="onChange($event)" placeholder="Insira email para adicionar destinatário"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
@@ -87,7 +87,7 @@
</ion-buttons> </ion-buttons>
<ion-buttons slot="end"> <ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()"> <button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Adicionar</ion-label> <ion-label>Gravar</ion-label>
</button> </button>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
@@ -184,8 +184,9 @@ export class NewPublicationPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErroHandle.httpsSucessMessagge('Criar publicação') this.httpErroHandle.httpsSucessMessagge('Criar publicação')
console.log({response})
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
@@ -212,9 +213,10 @@ export class NewPublicationPage implements OnInit {
try { try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErroHandle.httpsSucessMessagge('Criar publicação') this.httpErroHandle.httpsSucessMessagge('Criar publicação')
console.log({response})
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
@@ -241,9 +243,10 @@ export class NewPublicationPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() const response =await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErroHandle.httpsSucessMessagge('Criar publicação') this.httpErroHandle.httpsSucessMessagge('Criar publicação')
console.log({response})
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
this.httpErroHandle.httpStatusHandle(error) this.httpErroHandle.httpStatusHandle(error)
@@ -254,7 +257,9 @@ export class NewPublicationPage implements OnInit {
} }
this.PublicationFolderService.loadPublication(this.publication.DocumentId, this.publication.ProcessId) this.PublicationFolderService.deletePost(this.publication.DocumentId, this.publication.ProcessId)
} }
else { else {
@@ -144,6 +144,15 @@ export class ViewPublicationsPage implements OnInit {
for( let publicationId of loadLater) { for( let publicationId of loadLater) {
await this.loadPublication(publicationId, folderId) await this.loadPublication(publicationId, folderId)
} }
for(let localPublication of this.publicationFolderService.publicationList[folderId]) {
const apiPublication = publicationIds.includes(localPublication.DocumentId)
if(!apiPublication) {
this.publicationFolderService.deletePost(folderId, localPublication.DocumentId)
}
}
this.showLoader = false; this.showLoader = false;
@@ -89,7 +89,7 @@ export class EventoaprovacaoStoreService {
} }
value = value.filter(e => e.activityInstanceName != 'Comunicar Evento')
value = value.map( e => this.EventoApprovePipe.transform(e, e)) value = value.map( e => this.EventoApprovePipe.transform(e, e))
this._list[segment] = value this._list[segment] = value
+1
View File
@@ -1648,4 +1648,5 @@ h5, .buttons{
.ngx-mat-timepicker input { .ngx-mat-timepicker input {
user-select: none !important; user-select: none !important;
color: black !important;
} }
+5 -5
View File
@@ -1,12 +1,12 @@
export let versionData = { export let versionData = {
"shortSHA": "68c849d0e", "shortSHA": "dd1ba46b0",
"SHA": "68c849d0ee02f2a0c171db7d67c953e919c90167", "SHA": "dd1ba46b0d1ee7bf71b440bc76657ab208659ba4",
"branch": "developer-prod", "branch": "developer-prod",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Mon Aug 21 12:22:19 2023 +0100'", "lastCommitTime": "'Mon Aug 21 12:27:17 2023 +0100'",
"lastCommitMessage": "replicate contact function", "lastCommitMessage": "replicate contact function",
"lastCommitNumber": "5177", "lastCommitNumber": "5187",
"change": "", "change": "",
"changeStatus": "On branch developer-prod\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: android/app/src/main/AndroidManifest.xml\n\tmodified: src/app/modals/profile/edit-profile/edit-profile.page.html\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/pages/events/events.page.html\n\tmodified: src/app/pages/publications/publications.page.html\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/app/shared/header/header.page.scss\n\tmodified: src/app/tiny-mce/tiny-mce.page.html\n\tnew file: src/assets/images/md.webp\n\tnew file: src/assets/images/ministro.png\n\tnew file: src/assets/images/presidente.png\n\tnew file: src/assets/images/secretaria_geral.png\n\tnew file: src/assets/images/sg.jpeg\n\tmodified: version/git-version.ts", "changeStatus": "On branch developer-prod\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.html\n\tmodified: src/app/pages/events/attendees/attendees.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts\n\tmodified: src/app/pages/publications/new-publication/new-publication.page.ts\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/services/events/attendees/attendees.page.html\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/event/attendee-modal/attendee-modal.page.html\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts\n\tmodified: src/app/store/eventoaprovacao-store.service.ts\n\tmodified: src/global.scss",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }