Fix refresh

This commit is contained in:
Peter Maquiran
2021-08-25 15:23:30 +01:00
parent c15c45243f
commit e76df5c22f
9 changed files with 23 additions and 46 deletions
@@ -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"
>
</ion-datetime>
@@ -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"
>
</ion-datetime>
@@ -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))
}
@@ -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')
@@ -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();
@@ -108,7 +108,6 @@
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date"
[(ngModel)]="postEvent.StartDate"
[min]="minDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
@@ -140,7 +139,6 @@
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Choose a date"
[(ngModel)]="postEvent.EndDate"
[min]="endMinDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
@@ -207,8 +205,7 @@
<mat-form-field class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="occurrrence"
placeholder="Choose a date"
[formControl]="dateControlOccurrence"
[min]="endMinDate"
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
[disabled]="disabled"
>
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
@@ -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 {
@@ -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");
@@ -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(() => {
+1
View File
@@ -48,6 +48,7 @@ export class DeplomasService {
}
set deplomasReviewCount(arg: number) {
this._diplomasReviewCount = arg
this.saveDiplomasReviewList()
}
get countDiplomasAssinadoListCount() {