Merge branch 'feature/agenda-new-api-eudes' of bitbucket.org:equilibriumito/gabinete-digital-fo into feature/agenda-new-api-eudes

This commit is contained in:
Peter Maquiran
2024-06-13 16:03:50 +01:00
9 changed files with 113 additions and 32 deletions
+11
View File
@@ -133,6 +133,7 @@
"crypto-js": "^4.0.0",
"date-fns": "^2.17.0",
"depd": "^2.0.0",
"dexie": "^4.0.7",
"dompurify": "^3.0.6",
"dotenv": "^10.0.0",
"duration": "^0.2.2",
@@ -14664,6 +14665,11 @@
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1094867.tgz",
"integrity": "sha512-pmMDBKiRVjh0uKK6CT1WqZmM3hBVSgD+N2MrgyV1uNizAZMw4tx6i/RTc+/uCsKSCmg0xXx7arCP/OFcIwTsiQ=="
},
"node_modules/dexie": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.7.tgz",
"integrity": "sha512-M+Lo6rk4pekIfrc2T0o2tvVJwL6EAAM/B78DNfb8aaxFVoI1f8/rz5KTxuAnApkwqTSuxx7T5t0RKH7qprapGg=="
},
"node_modules/di": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz",
@@ -54872,6 +54878,11 @@
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1094867.tgz",
"integrity": "sha512-pmMDBKiRVjh0uKK6CT1WqZmM3hBVSgD+N2MrgyV1uNizAZMw4tx6i/RTc+/uCsKSCmg0xXx7arCP/OFcIwTsiQ=="
},
"dexie": {
"version": "4.0.7",
"resolved": "https://registry.npmjs.org/dexie/-/dexie-4.0.7.tgz",
"integrity": "sha512-M+Lo6rk4pekIfrc2T0o2tvVJwL6EAAM/B78DNfb8aaxFVoI1f8/rz5KTxuAnApkwqTSuxx7T5t0RKH7qprapGg=="
},
"di": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz",
+1
View File
@@ -149,6 +149,7 @@
"crypto-js": "^4.0.0",
"date-fns": "^2.17.0",
"depd": "^2.0.0",
"dexie": "^4.0.7",
"dompurify": "^3.0.6",
"dotenv": "^10.0.0",
"duration": "^0.2.2",
+3
View File
@@ -8,6 +8,9 @@ export class SearchList {
Id: string;
appName?: string;
ApplicationName: string;
docId: number;
subject: string;
applicationId: number
}
export class SearchList_v2 {
@@ -170,12 +170,12 @@ export class EditEventPage implements OnInit {
}
ngOnInit() {
if(!this.postEvent.IsRecurring) {
if (!this.postEvent.IsRecurring) {
this.postEvent.EventRecurrence.frequency = 'never'
} else {
this.postEvent.EventRecurrence.frequency = this.utils.recurenceTypeSeleted(this.postEvent.EventRecurrence.frequency)
}
console.log(this.postEvent?.Attachments)
console.log(this.loadedEventAttachments)
window.onresize = (event) => {
@@ -377,11 +377,25 @@ export class EditEventPage implements OnInit {
this.alertController.create({
header: 'Editar evento?',
message: 'Este evento tem recorrência, deseja editar a Sequência de eventos?',
inputs: [
{
name: 'confirm',
type: 'checkbox',
label: '',
value: 'confirm',
checked: false
}
],
buttons: [
{
text: 'Sim',
handler: () => {
this.save_v2(true)
handler: (data) => {
// Check if the checkbox is checked
if (data.includes('confirm')) {
this.save_v2(true)
} else {
this.save_v2(false)
}
}
},
{
+7 -6
View File
@@ -165,9 +165,10 @@ export class SearchPage implements OnInit {
}
async view(item: SearchList) {
console.log('doc item',item)
const ApplicationType = item.ApplicationType.toString()
const Id = item.Id
const ApplicationType = item.applicationId.toString()
const Id = item.docId
if (ApplicationType == '8') {
@@ -178,12 +179,12 @@ export class SearchPage implements OnInit {
componentProps: {
trustedUrl: '',
file: {
title: item.Assunto,
title: item.subject,
url: '',
title_link: '',
},
applicationId: ApplicationType,
docId: item.Id,
docId: item.docId,
},
cssClass: 'modal-width-100-width-background modal'
});
@@ -196,12 +197,12 @@ export class SearchPage implements OnInit {
componentProps: {
trustedUrl: '',
file: {
title: item.Assunto,
title: item.subject,
url: '',
title_link: '',
},
applicationId: ApplicationType,
docId: item.Id,
docId: item.docId,
},
cssClass: 'modal-width-100-width-background modal'
});
+13 -13
View File
@@ -114,9 +114,9 @@ export class Utils {
atendeesSeletedType(type) {
var selectedType = {
'true': 0,
'false': 1,
'other': 2,
'true': 1,
'false': 2,
'other': 3,
}
return selectedType[type];
}
@@ -135,11 +135,11 @@ export class Utils {
statusEventAproval(type) {
var selectedType = {
'Pending': 0,
'Revision': 1,
'Approved': 2,
"Declined": 3,
"Communicated": 4
'Pending': 1,
'Revision': 2,
'Approved': 3,
"Declined": 4,
"Communicated": 5
}
return selectedType[type];
}
@@ -157,11 +157,11 @@ export class Utils {
eventRecurence(type) {
var selectedType = {
'never': 0,
'daily': 1,
'weekly': 2,
"monthly": 3,
"yearly": 4
'never': 1,
'daily': 2,
'weekly': 3,
"monthly": 4,
"yearly": 5
}
return selectedType[type];
}
@@ -428,7 +428,7 @@
<ion-footer class="ion-no-border">
<ion-toolbar class="width-100 d-flex justify-space-between px-20">
<ion-buttons slot="start">
<button class="btn-ok" fill="clear" color="#fff" (click)="save_v2()">
<button class="btn-ok" fill="clear" color="#fff" (click)="validationEditAllEvent()">
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
@@ -118,12 +118,13 @@ export class EditEventPage implements OnInit {
this.loadedEventAttachments = this.postEvent.Attachments
console.log(this.postEvent)
this._postEvent = this.postEvent
if(!this._postEvent.IsRecurring) {
this.setCalendarNameValue(this._postEvent.CalendarName);
if (!this._postEvent.IsRecurring) {
this._postEvent.EventRecurrence.frequency = 'never';
} else {
this._postEvent.EventRecurrence.frequency = this.utils.recurenceTypeSeleted(this.postEvent.EventRecurrence.frequency)
}
this.allDayCheck = this.postEvent.IsAllDayEvent;
if (!this.restoreTemporaryData()) {
// clear
@@ -353,7 +354,48 @@ export class EditEventPage implements OnInit {
}
async save_v2() {
validationEditAllEvent() {
if (this.postEvent.IsRecurring) {
this.alertController.create({
header: 'Editar evento?',
message: 'Este evento tem recorrência, deseja editar a Sequência de eventos?',
inputs: [
{
name: 'confirm',
type: 'checkbox',
label: '',
value: 'confirm',
checked: false
}
],
buttons: [
{
text: 'Sim',
handler: (data) => {
// Check if the checkbox is checked
if (data.includes('confirm')) {
this.save_v2(true)
} else {
this.save_v2(false)
}
}
},
{
text: 'Não',
handler: () => {
this.save_v2(false)
}
}
]
}).then(res => {
res.present();
});
} else {
this.save_v2(false)
}
}
async save_v2(editAllEvent) {
this.injectValidation()
this.runValidation()
@@ -366,7 +408,7 @@ export class EditEventPage implements OnInit {
try {
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent,false).subscribe((value) => {
this.agendaDataRepository.updateEvent(this._postEvent.EventId, this._postEvent, editAllEvent).subscribe((value) => {
console.log(value)
}, ((error) => {
console.log('edit event error: ', error)
@@ -595,7 +637,7 @@ export class EditEventPage implements OnInit {
console.log(JSON.stringify(id))
let update = this.removeItemById(this.loadedEventAttachments, id)
this.loadedEventAttachments = update
console.log( update)
console.log(update)
this.deletedAttachmentsList.push(id)
}
@@ -619,7 +661,7 @@ export class EditEventPage implements OnInit {
modal.onDidDismiss().then(async (res) => {
if (res) {
const data = res.data;
console.log('Get Doc',data.selected)
console.log('Get Doc', data.selected)
/* const ApplicationIdDocumentToSave: any = {
SourceName: data.selected.Assunto,
@@ -662,6 +704,7 @@ export class EditEventPage implements OnInit {
changeAgenda() {
setTimeout(() => {
console.log('selecione agenda', this.eventsService.calendarNamesType)
if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial'] && this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) {
@@ -731,4 +774,12 @@ export class EditEventPage implements OnInit {
return date
}
setCalendarNameValue(calendarName) {
var selectedCalendar = {
1: 'Oficial',
2: 'Pessoal'
}
return selectedCalendar[calendarName];
}
}
@@ -149,12 +149,12 @@ export class ViewEventPage implements OnInit {
if (this.loadedEvent.IsRecurring) {
this.alertController.create({
header: 'Eliminar evento?',
message: '',
message: 'Este evento tem recorrência, deseja eliminar a Sequência de eventos?',
inputs: [
{
name: 'confirm',
type: 'checkbox',
label: 'Este evento tem recorrência, deseja eliminar a Sequência de eventos?',
label: '',
value: 'confirm',
checked: false,
}