mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -219,7 +219,7 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
logout() {
|
||||
SessionStore.setInativity(false)
|
||||
|
||||
SessionStore.setUrlBeforeInactivity(this.router.url)
|
||||
setTimeout(() => {
|
||||
this.router.navigateByUrl('/', { replaceUrl: true });
|
||||
}, 100)
|
||||
|
||||
@@ -301,6 +301,10 @@ export class EventsService {
|
||||
|
||||
params = params.set("conflictResolutionMode", conflictResolutionMode.toString());
|
||||
params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString());
|
||||
params.set('CalendarId', event.CalendarId)
|
||||
params.set('CalendarName', event.CalendarName)
|
||||
this.headers['CalendarId'] = event.CalendarId
|
||||
this.headers['CalendarName'] = event.CalendarName
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
|
||||
@@ -116,8 +116,8 @@
|
||||
<mat-form-field appearance="none" floatLabel="never" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlStart"
|
||||
[min]="minDate" [max]="maxDate"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
[max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
@@ -144,8 +144,8 @@
|
||||
<mat-form-field appearance="none" floatLabel="never" floatLabel="never" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlEnd"
|
||||
[min]="minDate" [max]="maxDate"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
[max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
@@ -195,7 +195,7 @@
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="occurrrence"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlOccurrence"
|
||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||
@@ -213,41 +213,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
|
||||
<ion-select placeholder="Selecione a repetição*"
|
||||
[(ngModel)]="postEvent.IsRecurring"
|
||||
(ngModelChange)="onSelectedRecurringChanged($event)"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option *ngFor="let recurring of recurringTypes" value="{{recurring.Code}}">{{recurring.Description}}</ion-select-option>
|
||||
</ion-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="selectedRecurringType != '-1'" class="container-div width-100">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-datetime
|
||||
placeholder="Última ocorrência"
|
||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||
displayFormat="DD MMM YYYY"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
max="2045"
|
||||
>
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" d-flex width-100">
|
||||
<div class="ion-item-class-2 width-100">
|
||||
@@ -317,7 +283,7 @@
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
<div class="d-flex container-div width-100" *ngFor="let document of loadedEventAttachments; let i = index" >
|
||||
<div class="d-flex container-div width-100" *ngFor="let document of postEvent.Attachments; let i = index" >
|
||||
<ion-list class="width-100 list" *ngIf="!document.remove">
|
||||
<ion-item class="width-100">
|
||||
<ion-label class="width-100">
|
||||
|
||||
@@ -66,18 +66,10 @@ export class EditEventPage implements OnInit {
|
||||
@Output() setIntervenientCC = new EventEmitter<any>();
|
||||
@Output() clearPostEvent = new EventEmitter<any>();
|
||||
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
|
||||
showLoader = false
|
||||
|
||||
get dateStart () {
|
||||
return this.dateControlStart.value
|
||||
}
|
||||
|
||||
get dateEnd () {
|
||||
return this.dateControlEnd.value
|
||||
}
|
||||
|
||||
@ViewChild('picker') picker: any;
|
||||
@ViewChild('fim') fim: any;
|
||||
@@ -89,9 +81,6 @@ export class EditEventPage implements OnInit {
|
||||
{ value: false, label: 'False' }
|
||||
];
|
||||
|
||||
get dateOccurrence () {
|
||||
return this.dateControlOccurrence.value
|
||||
}
|
||||
public listColors = ['primary', 'accent', 'warn'];
|
||||
public stepHours = [1, 2, 3, 4, 5];
|
||||
public stepMinutes = [1, 5, 10, 15, 20, 25];
|
||||
@@ -109,6 +98,7 @@ export class EditEventPage implements OnInit {
|
||||
ngOnInit() {
|
||||
this.dateControlOccurrence = new FormControl(moment(this.postEvent.EventRecurrence.LastOccurrence));
|
||||
|
||||
this.postEvent.EventRecurrence.Type = '-1'
|
||||
|
||||
if(!this.restoreTemporaryData()) {
|
||||
// clear
|
||||
@@ -148,9 +138,7 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
this.getAttachments(this.postEvent.EventId);
|
||||
|
||||
this.restoreDatepickerData();
|
||||
this.getRecurrenceTypes();
|
||||
|
||||
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
|
||||
@@ -202,19 +190,13 @@ export class EditEventPage implements OnInit {
|
||||
Categories: new FormControl(this.postEvent.Category, [
|
||||
Validators.required
|
||||
]),
|
||||
dateStart: new FormControl(this.dateStart, [
|
||||
Validators.required
|
||||
]),
|
||||
dateEnd: new FormControl(this.dateEnd, [
|
||||
Validators.required
|
||||
]),
|
||||
dateOccurrence: new FormControl(this.dateOccurrence, [
|
||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type, [
|
||||
Validators.required
|
||||
]),
|
||||
participantes: new FormControl(this.taskParticipants, [
|
||||
// Validators.required
|
||||
]),
|
||||
Date: new FormControl( new Date(this.dateControlStart.value).toLocaleString() < new Date(this.dateControlEnd.value).toLocaleString()? 'ok': null,[
|
||||
Date: new FormControl( new Date(this.postEvent.StartDate).toLocaleString('pt') < new Date(this.postEvent.EndDate).toLocaleString('pt')? 'ok': null,[
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
@@ -264,7 +246,6 @@ export class EditEventPage implements OnInit {
|
||||
return false
|
||||
}
|
||||
|
||||
this.getDatepickerData()
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
if(!this.postEvent.EventRecurrence.hasOwnProperty('Type')) {
|
||||
@@ -360,25 +341,10 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
getDatepickerData() {
|
||||
if (this.postEvent) {
|
||||
this.postEvent.StartDate = this.dateStart
|
||||
this.postEvent.EndDate = this.dateEnd
|
||||
this.postEvent.EventRecurrence.LastOccurrence = this.dateOccurrence
|
||||
}
|
||||
}
|
||||
|
||||
restoreDatepickerData() {
|
||||
if (this.postEvent) {
|
||||
this.dateControlStart = new FormControl(moment(this.postEvent.StartDate));
|
||||
this.dateControlEnd = new FormControl(moment(this.postEvent.EndDate));
|
||||
}
|
||||
}
|
||||
|
||||
saveTemporaryData() {
|
||||
|
||||
this.getDatepickerData()
|
||||
|
||||
window['temp.path:/home/agenda/edit-event.component.ts'] = {
|
||||
postEvent: this.postEvent,
|
||||
eventBody: this.eventBody,
|
||||
@@ -395,8 +361,6 @@ export class EditEventPage implements OnInit {
|
||||
this.eventBody = restoredData.eventBody
|
||||
this.segment = restoredData.segment
|
||||
|
||||
this.restoreDatepickerData()
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user