diff --git a/src/app/pages/agenda/new-event/new-event.page.html b/src/app/pages/agenda/new-event/new-event.page.html index 63ef2105f..b7aa03b6c 100644 --- a/src/app/pages/agenda/new-event/new-event.page.html +++ b/src/app/pages/agenda/new-event/new-event.page.html @@ -123,7 +123,6 @@ displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45" monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez" - min="{{minDate}}" max="2025" > @@ -144,7 +143,6 @@ displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45" monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez" - min="{{minDate}}" max="2025" > @@ -182,7 +180,6 @@ [(ngModel)]="postEvent.EventRecurrence.LastOccurrence" displayFormat="DD MMM YYYY" monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez" - min="2021" max="2045" > diff --git a/src/app/pages/agenda/new-event/new-event.page.ts b/src/app/pages/agenda/new-event/new-event.page.ts index dbe92c75b..2b52cab02 100644 --- a/src/app/pages/agenda/new-event/new-event.page.ts +++ b/src/app/pages/agenda/new-event/new-event.page.ts @@ -31,8 +31,6 @@ export class NewEventPage implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) - public endMinDate = new Date(new Date().getTime() + 15 * 60000); public stepHour = 1; public stepMinute = 5; public stepSecond = 5; @@ -81,8 +79,6 @@ export class NewEventPage implements OnInit { this.selectedDate = this.navParams.get('eventSelectedDate'); this.taskParticipants = this.navParams.get('attendees'); - console.log(this.taskParticipants); - this.postEvent.StartDate = new Date() this.postEvent.EndDate = (new Date(new Date().getTime() + 15 * 60000)) } diff --git a/src/app/pages/publications/publication-detail/publication-detail.page.ts b/src/app/pages/publications/publication-detail/publication-detail.page.ts index 035353783..a13637b80 100644 --- a/src/app/pages/publications/publication-detail/publication-detail.page.ts +++ b/src/app/pages/publications/publication-detail/publication-detail.page.ts @@ -5,6 +5,7 @@ import { PublicationsService } from 'src/app/services/publications.service'; import { ToastService } from 'src/app/services/toast.service'; import { ImageModalPage } from '../gallery/image-modal/image-modal.page'; import { NewPublicationPage } from '../new-publication/new-publication.page'; +import { Location } from '@angular/common'; @Component({ @@ -23,8 +24,8 @@ export class PublicationDetailPage implements OnInit { private navParams:NavParams, private publications:PublicationsService, private animationController: AnimationController, - private toastService: ToastService - ) { + private toastService: ToastService, + private location: Location ) { alert('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!') @@ -56,7 +57,7 @@ export class PublicationDetailPage implements OnInit { }, 2000); } - getPublicationDetail(){ + getPublicationDetail() { this.showLoader = true; console.log(this.publicationId); /* console.log(this.folderId); */ @@ -78,17 +79,21 @@ export class PublicationDetailPage implements OnInit { }); } - close(){ - this.modalController.dismiss(); + close() { + this.location.back() + } - async deletePost(){ + async deletePost() { const loader = this.toastService.loading() try { await this.publications.DeletePublication(this.folderId, this.publicationId).toPromise(); this.toastService.successMessage('Publicação eliminado') + if(window['app-view-publications-page-doRefresh']) { + window['app-view-publications-page-doRefresh']() + } this.close(); } catch (error) { this.toastService.badRequest('Publicação não eliminado') diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 1888cb060..c4d58a5a6 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -47,6 +47,7 @@ export class ViewPublicationsPage implements OnInit { console.log(params["params"]); } + window['app-view-publications-page-doRefresh'] = this.doRefresh }); } @@ -73,7 +74,7 @@ export class ViewPublicationsPage implements OnInit { this.getPublications(); } - doRefresh(event) { + doRefresh =(event) => { setTimeout(() => { this.getPublicationDetail(); this.getPublications(); diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html index c06351678..0dce0afc6 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -108,7 +108,6 @@ @@ -140,7 +139,6 @@ @@ -207,8 +205,7 @@ diff --git a/src/app/shared/agenda/new-event/new-event.page.ts b/src/app/shared/agenda/new-event/new-event.page.ts index 4a28ebb23..755dc8789 100644 --- a/src/app/shared/agenda/new-event/new-event.page.ts +++ b/src/app/shared/agenda/new-event/new-event.page.ts @@ -21,10 +21,9 @@ import { FormControl } from '@angular/forms'; import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'; import { ThemePalette } from '@angular/material/core'; -import { NgZone, ViewChild } from '@angular/core'; +import { ViewChild } from '@angular/core'; import { FormGroup, Validators } from '@angular/forms'; import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; -import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page'; const moment = _rollupMoment || _moment; @@ -61,8 +60,6 @@ export class NewEventPage implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) - public endMinDate = new Date(new Date().getTime() + 15 * 60000); public stepHour = 1; public stepMinute = 5; public stepSecond = 5; @@ -110,13 +107,9 @@ export class NewEventPage implements OnInit { public stepMinutes = [1, 5, 10, 15, 20, 25]; public stepSeconds = [1, 5, 10, 15, 20, 25]; - public dateControlOccurrence = new FormControl(moment("DD MM YYYY hh")); showLoader = false - get dateOccurrence () { - return this.dateControlOccurrence.value - } constructor( private modalController: ModalController, @@ -131,7 +124,7 @@ export class NewEventPage implements OnInit { this.loggeduser = userService.ValidatedUser; this.postEvent = new Event(); - this.postEvent.StartDate = new Date(); + this.postEvent.StartDate = new Date() this.postEvent.EndDate = new Date(new Date().getTime() + 15 * 60000); } @@ -216,7 +209,6 @@ export class NewEventPage implements OnInit { this.date = new Date(2021,9,4,5,6,7); - this.getDatepickerData() this.injectValidation(); @@ -251,7 +243,7 @@ export class NewEventPage implements OnInit { dateEnd: new FormControl(this.postEvent.EndDate, [ Validators.required ]), - dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.dateOccurrence, [ + dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.postEvent.EventRecurrence.LastOccurrence, [ Validators.required ]), participantes: new FormControl(this.taskParticipants, [ @@ -334,17 +326,6 @@ export class NewEventPage implements OnInit { } } - getDatepickerData() { - if (this.postEvent) { - this.postEvent.EventRecurrence.LastOccurrence = this.dateOccurrence - } - } - - restoreDatepickerData() { - if (this.postEvent) { - this.dateControlOccurrence = new FormControl(moment(this.postEvent.EventRecurrence.LastOccurrence, "DD MM YYYY HH:mm")) - } - } @@ -358,7 +339,6 @@ export class NewEventPage implements OnInit { return false } - this.getDatepickerData() this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); @@ -483,7 +463,6 @@ export class NewEventPage implements OnInit { } afterSave() { - this.getDatepickerData() this.deleteTemporaryData(); this.onAddEvent.emit(this.postEvent); @@ -521,7 +500,6 @@ export class NewEventPage implements OnInit { } saveTemporaryData() { - this.getDatepickerData() window['temp.path:/home/agenda/new-event.component.ts'] = { postEvent: this.postEvent, eventBody: this.eventBody, @@ -545,7 +523,7 @@ export class NewEventPage implements OnInit { this.segment = restoredData.segment // restore dater for date and hours picker - this.restoreDatepickerData() + return true; } else { diff --git a/src/app/shared/agenda/view-event/view-event.page.ts b/src/app/shared/agenda/view-event/view-event.page.ts index 862f72ccd..04d844b06 100644 --- a/src/app/shared/agenda/view-event/view-event.page.ts +++ b/src/app/shared/agenda/view-event/view-event.page.ts @@ -146,7 +146,7 @@ export class ViewEventPage implements OnInit { }) } - viewDocument(sourceId){ + viewDocument(sourceId) { this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{ console.log(res); const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); 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 b2469dba3..70016f30e 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -54,6 +54,8 @@ export class ViewPublicationsPage implements OnInit { this.getPublications(); this.getPublicationDetail(); + + window['app-view-publications-page-doRefresh'] = this.doRefresh } ngOnChanges(changes: any): void { @@ -71,7 +73,7 @@ export class ViewPublicationsPage implements OnInit { } - doRefresh(event) { + doRefresh =(event) => { this.getPublications(); setTimeout(() => { diff --git a/src/app/store/deplomas.service.ts b/src/app/store/deplomas.service.ts index 99f1dba71..d00f1f0f1 100644 --- a/src/app/store/deplomas.service.ts +++ b/src/app/store/deplomas.service.ts @@ -48,6 +48,7 @@ export class DeplomasService { } set deplomasReviewCount(arg: number) { this._diplomasReviewCount = arg + this.saveDiplomasReviewList() } get countDiplomasAssinadoListCount() {