diff --git a/src/app/pages/agenda/view-event/view-event.page.html b/src/app/pages/agenda/view-event/view-event.page.html index b2c974144..5f0b6cd41 100644 --- a/src/app/pages/agenda/view-event/view-event.page.html +++ b/src/app/pages/agenda/view-event/view-event.page.html @@ -53,7 +53,7 @@
-

{{customDate}}

+

{{customDate}}, {{ TimeZoneString }}

das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}

{{loadedEvent.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.EndDate | date: 'dd/M/yy'}}

diff --git a/src/app/pages/agenda/view-event/view-event.page.ts b/src/app/pages/agenda/view-event/view-event.page.ts index 176d1cb29..5a4dc374b 100644 --- a/src/app/pages/agenda/view-event/view-event.page.ts +++ b/src/app/pages/agenda/view-event/view-event.page.ts @@ -53,6 +53,8 @@ export class ViewEventPage implements OnInit { LoadedDocument: any = null; sesseionStora = SessionStore + TimeZoneString = '' + constructor( private modalController: ModalController, /* private navParams: NavParams, */ @@ -70,7 +72,7 @@ export class ViewEventPage implements OnInit { private attachmentsService: AttachmentsService, ) { - + this.isEventEdited = false; this.loadedEvent = new Event(); this.eventBody = { BodyType: "1", Text: "" }; @@ -107,7 +109,7 @@ export class ViewEventPage implements OnInit { JSON.parse(req).forEach(element => { this.eventsService.editEvent(element, 2, 3).subscribe((res) => { this.storage.remove('eventEdit') - + }) }); }) @@ -115,7 +117,7 @@ export class ViewEventPage implements OnInit { JSON.parse(req).forEach(element => { this.eventsService.editEvent(element, 2, 3).subscribe((res) => { this.storage.remove('eventDelete') - + }) }); }) @@ -141,7 +143,7 @@ export class ViewEventPage implements OnInit { // } else { // this.sqliteservice.getAllEvents().then((events: any[] = []) => { // resolve(events) - + // }) // } // }).catch ((error) => { @@ -167,7 +169,7 @@ export class ViewEventPage implements OnInit { else { // this.router.navigate(['/home', params["params"].caller]); this.RouteService.goBack(); - + } }); } @@ -179,19 +181,24 @@ export class ViewEventPage implements OnInit { ev.target.complete(); } + setTimeZone() { + this.TimeZoneString = this.loadedEvent.TimeZone.split(')')[1] + } + loadEvent() { const loader = this.toastService.loading(); - + if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') { this.eventsService.getEvent(this.eventId).subscribe(res => { this.loadedEvent = res; + this.setTimeZone() // this.addEventToDb(res); - + loader.remove() }, (error) => { - - + + if (error.status === 0) { this.getFromDb(); } else { @@ -204,20 +211,21 @@ export class ViewEventPage implements OnInit { }); } else { - + if(this.CalendarId) { this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => { - + const div = document.createElement("div") div.innerHTML = res.Body.Text res.Body.Text = div.innerText this.loadedEvent = res; - + this.setTimeZone() + // this.addEventToDb(res); - + loader.remove() }, (error) => { - + if (error.status === 0) { this.getFromDb(); } else { @@ -261,14 +269,14 @@ export class ViewEventPage implements OnInit { const loader = this.toastService.loading() - if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') { + if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') { this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => { const alert = await this.alertController.create({ cssClass: 'my-custom-class', header: 'Evento removido', buttons: ['OK'] }); - + setTimeout(() => { alert.dismiss(); }, 1500); @@ -278,29 +286,29 @@ export class ViewEventPage implements OnInit { () => { loader.remove(); }); - + } else { - + this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => { const alert = await this.alertController.create({ cssClass: 'my-custom-class', header: 'Evento removido', buttons: ['OK'] }); - + setTimeout(() => { alert.dismiss(); }, 1500); this.goBack(); this.httpErrorHandle.httpsSucessMessagge('delete event') - }, (error) => { + }, (error) => { this.httpErrorHandle.httpStatusHandle(error) }, () => { loader.remove(); }); - - + + } } @@ -318,7 +326,7 @@ export class ViewEventPage implements OnInit { }); modal.onDidDismiss().then((res) => { - + if (res) { setTimeout(() => { @@ -350,7 +358,7 @@ export class ViewEventPage implements OnInit { }); await modal.present(); modal.onDidDismiss().then((res) => { - + if (res) { setTimeout(() => { @@ -365,7 +373,7 @@ export class ViewEventPage implements OnInit { } async editEvent() { - + let classs; if (window.innerWidth <= 800) { @@ -384,19 +392,19 @@ export class ViewEventPage implements OnInit { }); modal.onDidDismiss().then((res) => { - + if (res) { setTimeout(() => { /* this.loadEvent(); */ this.loadEvent() - + }, 250); this.isEventEdited = true; if(res.data.Attendees?.length >= 1) { this.loadedEvent.HasAttachments = true - this.getAttachments() + this.getAttachments() } console.log('res', res) } @@ -416,10 +424,10 @@ export class ViewEventPage implements OnInit { if(this.loadedEvent.HasAttachments) { this.attachmentsService.getAttachmentsById(this.loadedEvent.EventId).subscribe(res=>{ this.loadedEvent.Attachments = res; - + },((erro) => { console.error('editgetAttchament', erro) - })); + })); } } @@ -429,7 +437,7 @@ export class ViewEventPage implements OnInit { const applicationId: any = this.loadedEvent.Attachments[this.dicIndex].ApplicationId const selectedDoc = this.loadedEvent.Attachments[this.dicIndex] - + this.task = { serialNumber: '', @@ -515,37 +523,6 @@ export class ViewEventPage implements OnInit { } - // addEventToDb(data) { - // if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - // this.ionicStorage.set('eventDetails', data).then(() => { - - // }) - // } else { - // let event = { - // Attendees: JSON.stringify(data.Attendees) || JSON.stringify(''), - // Body: JSON.stringify(data.Body) || JSON.stringify(''), - // CalendarId: data.CalendarId, - // CalendarName: data.CalendarName, - // Category: data.Category, - // EndDate: data.EndDate, - // EventId: data.EventId, - // EventRecurrence: JSON.stringify(data.EventRecurrence) || JSON.stringify(''), - // EventType: data.EventType, - // HasAttachments: data.HasAttachments, - // IsAllDayEvent: data.IsAllDayEvent, - // IsMeeting: data.IsMeeting, - // IsRecurring: data.IsRecurring, - // Location: data.Location, - // Organizer: JSON.stringify(data.Organizer) || JSON.stringify(''), - // StartDate: data.StartDate, - // Subject: data.Subject, - // TimeZone: data.TimeZone - // } - - // this.sqliteservice.updateEvent(event); - // } - // } - getFromDb() { diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index cc6274e5c..c61ea3c46 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -75,7 +75,7 @@

-

{{room.lastMessage.msg}}

+

{{room.lastMessage.msg}}

está escrever...

+
diff --git a/src/app/shared/publication/view-publications/view-publications.page.scss b/src/app/shared/publication/view-publications/view-publications.page.scss index 91f0576ee..eef93331c 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.scss +++ b/src/app/shared/publication/view-publications/view-publications.page.scss @@ -135,12 +135,23 @@ } .post-img{ width: 100%; - height: 56.25vh !important; - border-radius: 0px!important; + height: 100%; + + max-height: 500px; + max-width: 468px; + + min-height: 350px; + min-width: 468px; + + margin: 5px auto; + + border-radius: 0px !important; overflow: hidden; background-color: white; display: flex; justify-content: center; + align-items: center; + background: black; } .post-img img{ @@ -191,4 +202,11 @@ ion-fab-button:hover{ +ion-card{ + width: fit-content; + max-width: calc(468px + 16px + 16px); + margin: 0px auto; + margin-top: 10px; + margin-bottom: 20px; +} diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index 6ad1c7a91..90899c555 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -125,10 +125,10 @@ export class ViewPublicationsPage implements OnInit { this.showLoader = true; const folderId = this.folderId - + try { const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise(); - + this.createPublicationList(folderId) let loadLater = [] for (let publicationId of publicationIds) { @@ -147,17 +147,17 @@ export class ViewPublicationsPage implements OnInit { 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.storage.set(folderId, this.publicationFolderService.publicationList[folderId]); - + this.oldpublicationIds = publicationIds } catch(error) { this.showLoader = false; @@ -166,10 +166,8 @@ export class ViewPublicationsPage implements OnInit { } _deletePublication = (folderId, publicationId) => { - + this.publicationFolderService.publicationList[folderId] = this.publicationFolderService.publicationList[folderId].filter( e => e.DocumentId != publicationId) - - console.log('this.publicationFolderService.publicationList[folderId]', this.publicationFolderService.publicationList[folderId].length) } @@ -186,7 +184,7 @@ export class ViewPublicationsPage implements OnInit { async loadPublication(publicationId, folderId) { let Publication = await this.publications.GetPublicationById(publicationId).toPromise(); let publicationDetails: Publication = this.publicationPipe.itemList(Publication) - + const findIndex = this.publicationFindIndex(publicationId, folderId) const found = this.publicationIsPresent(publicationId, folderId) if(!found) { @@ -194,7 +192,7 @@ export class ViewPublicationsPage implements OnInit { } else { this.publicationFolderService.publicationList[folderId][findIndex] = publicationDetails } - + } getFromDB() { @@ -242,7 +240,7 @@ export class ViewPublicationsPage implements OnInit { cssClass: 'new-action modal modal-desktop', backdropDismiss: true }); - + modal.onDidDismiss().then(() => { // Do nothing });