notification added to chat grup

This commit is contained in:
Eudes Inácio
2023-02-06 15:34:46 +01:00
44 changed files with 244 additions and 399 deletions
@@ -78,20 +78,8 @@
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class" >
<ion-select
class="d-block d-md-none"
[(ngModel)]="postData.CalendarName"
placeholder="Selecione repetição"
interface="action-sheet"
Cancel-text="Cancelar" required
(selectionChange)="changeAgenda()"
>
<ion-select-option value="Oficial">Oficial</ion-select-option>
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
</ion-select>
<mat-form-field floatLabel="never" appearance="none" class="d-none d-md-block width-100">
<mat-form-field floatLabel="never" appearance="none" class="d-md-block width-100">
<mat-select placeholder="Selecione agenda" [(ngModel)]="postData.CalendarName" >
<mat-option value="Oficial">
Oficial
@@ -114,19 +102,8 @@
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
<ion-select placeholder="Selecione tipo de evento*"
class="d-block d-md-none"
[(ngModel)]="postData.Category"
interface="action-sheet"
Cancel-text="Cancelar" required>
<ion-select-option value="Reunião">Reunião</ion-select-option>
<ion-select-option value="Viagem">Viagem</ion-select-option>
<ion-select-option value="Conferência">Conferência</ion-select-option>
<ion-select-option value="Encontro">Encontro</ion-select-option>
</ion-select>
<mat-form-field class="d-none d-md-block" appearance="none" class="width-100" placeholder="Sample Type" required>
<mat-form-field class="d-md-block" appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(ngModel)]="postData.Category" >
<mat-option value="Reunião">
@@ -144,7 +121,6 @@
</mat-select>
</mat-form-field>
</div>
</div>
</div>
@@ -155,17 +131,8 @@
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<ion-datetime
class="d-block d-md-none"
placeholder="Início*"
[(ngModel)]="postData.StartDate"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,30"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
value="2020-11-19T11:06Z">
</ion-datetime>
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
<mat-form-field appearance="none" class="width-100 date-hour-picker">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Início*"
[(ngModel)]="postData.StartDate"
@@ -191,21 +158,13 @@
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<ion-datetime
class="d-block d-md-none"
placeholder="Início*"
[(ngModel)]="postData.EndDate"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,30"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
value="2020-11-19T11:06Z">
</ion-datetime>
<mat-form-field appearance="none" class="date-hour-picker width-100 d-none d-md-block">
<mat-form-field appearance="none" class="date-hour-picker width-100 ">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Fim*"
[(ngModel)]="postData.EndDate"
[disabled]="disabled"
[min]="postData.StartDate"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" (click)="setEndDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim
@@ -227,11 +186,7 @@
</div>
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('dateOccurrence')?.invalid && validateFrom ">
<<<<<<< HEAD
=======
>>>>>>> develop_bitOut-fix
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
<mat-select placeholder="Selecione repetição*"
[(ngModel)]="EventRecurrenceType"
@@ -255,18 +210,6 @@
</div>
<!-- (click)="openLastOccurrence()" -->
<div class="ion-input-class flex-grow-1">
<!-- <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"
min="2021"
max="2045"
>
</ion-datetime> -->
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
<!-- [formControl]="dateControlOccurrence" -->
<mat-form-field class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="occurrrence"
@@ -121,7 +121,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
if(!this.CalendarName) {
if(this._eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario';
console.log(this._eventService.calendarNamesAry)
} else {
this.CalendarName = this._eventService.calendarNamesAry[0]
}
@@ -141,6 +140,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.adding = "intervenient";
this.setDefaultTime()
this.getRecurrenceTypes();
this.setStartDate();
this.setEndDate();
}
getRecurrenceTypes() {
@@ -162,6 +165,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.validateFrom = true
}
get dateValid() {
return new Date(this.postData.StartDate).getTime() < new Date(this.postData.EndDate).getTime() ? 'ok': null
}
injectValidation() {
this.Form = new FormGroup({
@@ -175,7 +182,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
CalendarName: new FormControl(this.postData.CalendarName, [
// Validators.required
]),
Date: new FormControl( (this.postData.StartDate < this.postData.EndDate), [
Date: new FormControl( (this.dateValid), [
Validators.required
]),
participantes: new FormControl(this.taskParticipants, [
@@ -279,8 +286,9 @@ export class DocumentSetUpMeetingPage implements OnInit {
laoder.remove()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
} else if(error.error.includes('attachments')) {
throw(error.error + JSON.stringify(postEvent.Attachments))
} else {
this.toastService._badRequest('Não foi possível marcar a reunião');
}
}, ()=>{
@@ -374,7 +382,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
modal.onDidDismiss().then((res)=> {
if(res){
const data = res.data;
console.log('data', data)
this.attachments.push(data.selected);
}
});
@@ -57,11 +57,15 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage();
this.toastService._successMessage('Evento aprovar')
this.goBack();
} catch (error) {
this.toastService.badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não aprovar')
}
}
finally {
loader.remove()
@@ -77,11 +81,15 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage();
this.toastService._successMessage('Evento enviado para revisão');
this.goBack();
} catch (error) {
this.toastService.badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não enviado para revisão');
}
}
finally {
loader.remove()
@@ -119,9 +127,15 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService.successMessage('Pedido enviado');
this.toastService._successMessage('Evento enviado para revisão');
this.goBack();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não enviado para revisão');
}
this.toastService.badRequest();
}
finally {
@@ -140,10 +154,15 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado');
this.toastService._successMessage('Evento rejeitado')
this.goBack();
} catch (error) {
this.toastService.badRequest();
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não rejeitado')
}
}
finally {
loader.remove();
@@ -122,7 +122,6 @@
placeholder="Data Inicio*"
[(ngModel)]="postEvent.StartDate"
[disabled]="disabled"
[min]="currentDate"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" (click)="setStartDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #picker1
@@ -171,28 +170,6 @@
</div>
</div>
<!-- <div class="container-div width-100">
<div class="ion-item-class-2 d-flex">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('dateOccurrence')?.invalid && validateFrom ">
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
<mat-select placeholder="Selecione repetição*"
[(ngModel)]="postEvent.EventRecurrence.Type"
(ngModelChange)="onSelectedRecurringChanged($event)">
<mat-option
*ngFor="let recurring of recurringTypes" value="{{recurring.Code}}"
>
{{recurring.Description}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</div> -->
<div *ngIf="postEvent.EventRecurrence.Type != '-1'" class="container-div width-100">
<div class="ion-item-class-2 d-flex">
+1 -1
View File
@@ -410,7 +410,7 @@ export class ChatPage implements OnInit {
doRefresh(event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 1000);
}
@@ -211,9 +211,9 @@ export class EditEventPage implements OnInit {
}
doRefresh(event){
/* this.RefreshEvents(); */
event.target.complete();
event?.target?.complete();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -209,9 +209,9 @@ export class EventDetailModalPage implements OnInit {
}
doRefresh(event){
/* this.RefreshEvents(); */
event.target.complete();
event?.target?.complete();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -207,9 +207,9 @@ export class EventDetailPage implements OnInit {
}
doRefresh(event){
/* this.RefreshEvents(); */
event.target.complete();
event?.target?.complete();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
+1 -1
View File
@@ -129,7 +129,7 @@ export class EventsPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
this.RefreshEvents();
@@ -227,7 +227,7 @@ export class DespachosPrPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
setTimeout(() => {
@@ -117,7 +117,7 @@ export class DespachosPage implements OnInit {
this.LoadList();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -232,7 +232,7 @@ export class EventListPage implements OnInit {
setTimeout(() => {
this.LoadToApproveEvents();
event.target.complete();
event?.target?.complete();
}, 1000);
}
@@ -87,19 +87,8 @@
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Categories')?.invalid && validateFrom ">
<ion-select placeholder="Selecione tipo de evento*"
class="d-block d-md-none"
[(ngModel)]="postData.Category"
interface="action-sheet"
Cancel-text="Cancelar" required>
<ion-select-option value="Reunião">Reunião</ion-select-option>
<ion-select-option value="Viagem">Viagem</ion-select-option>
<ion-select-option value="Conferência">Conferência</ion-select-option>
<ion-select-option value="Encontro">Encontro</ion-select-option>
</ion-select>
<mat-form-field class="d-none d-md-block" appearance="none" class="width-100" placeholder="Sample Type" required>
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(ngModel)]="postData.Category" >
<mat-option value="Reunião">
@@ -128,23 +117,11 @@
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<ion-datetime
class="d-block d-md-none"
placeholder="Início*"
[(ngModel)]="postData.StartDate"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="{{ionicMinDate}}"
max="2025"
value="2020-11-19T11:06Z">
</ion-datetime>
<mat-form-field appearance="none" class="width-100 date-hour-picker d-md-block">
<mat-form-field appearance="none" class="width-100 date-hour-picker">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Choose a date*"
[formControl]="dateControlStart"
[min]="minDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1" (click)="setStartDate()"></mat-datepicker-toggle>
@@ -167,24 +144,13 @@
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<ion-datetime
class="d-block d-md-none"
placeholder="Fim*"
[(ngModel)]="postData.EndDate"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="{{ionicMinDate}}"
max="2025"
value="2020-11-19T11:06Z">
</ion-datetime>
<mat-form-field appearance="none" class="date-hour-picker width-100 d-none d-md-block">
<mat-form-field appearance="none" class="date-hour-picker width-100 ">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Fim*"
[formControl]="dateControlEnd"
[min]="endMinDate"
[disabled]="disabled"
[min] = "dateControlStart.value"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" (click)="setEndDate()"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #fim
@@ -199,28 +165,6 @@
</div>
</div>
<!-- <div class="container-div width-100">
<div class="ion-item-class-2 d-flex">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-refresh.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('dateOccurrence')?.invalid && validateFrom ">
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
<mat-select placeholder="Selecione repetição*"
[(ngModel)]="EventRecurrenceType"
>
<mat-option
*ngFor="let recurring of recurringTypes" value="{{recurring.Code}}"
>
{{recurring.Description}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</div> -->
<div *ngIf="EventRecurrenceType != '-1'" class="container-div width-100">
<div class="ion-item-class-2 d-flex">
@@ -228,24 +172,13 @@
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div (click)="openLastOccurrence()" class="ion-input-class flex-grow-1">
<!-- <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"
min="2021"
max="2045"
>
</ion-datetime> -->
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
<!-- [formControl]="dateControlOccurrence" -->
<mat-form-field class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="occurrrence"
placeholder="Choose a date"
[(ngModel)]="Occurrence"
[disabled]="disabled"
[min]="dateStart"
>
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #occurrrence
@@ -254,6 +187,7 @@
[stepHour]="stepHour" [stepMinute]="stepMinute"
[stepSecond]="stepSecond"
[touchUi]="touchUi"
>
</ngx-mat-datetime-picker>
</mat-form-field>
@@ -75,21 +75,11 @@ export class BookMeetingModalPage implements OnInit {
showLoader = false
get dateStart () {
if( window.innerWidth < 801) {
return this.postData.StartDate;
}
else{
return this.dateControlStart.value;
}
return this.dateControlStart.value;
}
get dateEnd () {
if( window.innerWidth < 801) {
return this.postData.EndDate;
}
else{
return this.dateControlEnd.value;
}
return this.dateControlEnd.value;
}
@ViewChild('picker') picker: any;
@@ -234,11 +224,7 @@ export class BookMeetingModalPage implements OnInit {
}
get dateValid() {
if (window.innerWidth <= 800) {
return this.postData.StartDate < this.postData.EndDate? ['ok']: []
} else {
return ['ok']
}
return new Date(this.dateControlStart.value).getTime() < new Date(this.dateControlEnd.value).getTime() ? 'ok': null
}
injectValidation() {
@@ -103,7 +103,7 @@ export class ExpedientePage implements OnInit {
doRefresh(event) {
this.LoadList();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 1000);
}
@@ -95,7 +95,7 @@ export class ExpedientesPrPage implements OnInit {
doRefresh(event) {
this.LoadList();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -299,7 +299,7 @@ export class PedidosPage implements OnInit {
doRefresh(event) {
this.LoadList();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -170,7 +170,7 @@ export class PendentesPage implements OnInit {
this.LoadList();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -28,17 +28,9 @@
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<ion-datetime
[(ngModel)]="folder.DateBegin"
class="d-block d-md-none"
placeholder="Data início*"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
max="2025">
</ion-datetime>
<mat-form-field appearance="none" class="date-hour-picker d-none d-md-block">
<mat-form-field appearance="none" class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="picker1"
placeholder="Data inicio*"
[formControl]="dateControlStart"
@@ -59,28 +51,18 @@
</div>
</div>
<div class="container-div">
<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" [class.input-error]="Form?.get('Date')?.invalid && validateFrom ">
<ion-datetime
class="d-block d-md-none"
[(ngModel)]="folder.DateEnd"
placeholder="Data de fim*"
displayFormat="D MMM YYYY H:mm"
minuteValues="0,5,10,15,20,25,30,35,40,45,50,55"
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
min="{{minDate}}"
max="2025">
</ion-datetime>
<div class="ion-input-class" [class.input-error]="Form?.get('Date')?.invalid && validateFrom">
<mat-form-field appearance="none" class="date-hour-picker d-none d-md-block">
<mat-form-field appearance="none" class="date-hour-picker">
<input matInput [ngxMatDatetimePicker]="fim"
placeholder="Data de fim*"
[formControl]="dateControlEnd"
[min]="endMinDate"
[disabled]="disabled"
>
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim" (click)="setEndDate()"></mat-datepicker-toggle>
@@ -75,8 +75,8 @@ export class NewActionPage implements OnInit {
this.dateControlStart = new FormControl(moment(new Date()));
this.dateControlEnd = new FormControl(moment(new Date(new Date().getTime() + 15 * 60000)));
// this.folder.DateBegin = new Date().toISOString()
// this.folder.DateEnd = (new Date(new Date().getTime() + 15 * 60000)).toISOString()
// this.dateControlStart.value = new Date().toISOString()
// this.dateControlEnd.value = (new Date(new Date().getTime() + 15 * 60000)).toISOString()
}
@@ -85,33 +85,18 @@ export class NewActionPage implements OnInit {
// this.setDefaultTime()
}
setDefaultTime() {
this.folder.DateBegin = new Date().toISOString()
this.folder.DateEnd = (new Date(new Date().getTime() + 15 * 60000)).toISOString()
}
segmentChanged(ev: any) {
}
get dateValid() {
var validado: boolean;
if (window.innerWidth <= 800) {
if ((this.folder.DateBegin < this.folder.DateEnd)) {
validado = true;
} else {
validado = false;
}
return validado == true ? ['ok']: [];
} else {
return ['ok']
}
return new Date(this.dateStart).getTime() < new Date(this.dateEnd).getTime() ? 'ok': null
}
runValidation() {
this.validateFrom = true;
if(new Date(this.folder.DateBegin).getTime() > new Date(this.folder.DateEnd).getTime()){
if(new Date(this.dateControlStart.value).getTime() > new Date(this.dateControlEnd.value).getTime()){
this.toastService._badRequest("A data de início não pode ser superior a data de fim");
}
}
@@ -144,8 +129,8 @@ export class NewActionPage implements OnInit {
ProcessId: null,
Description: this.folder.Description,
Detail: this.folder.Detail,
DateBegin: this.folder.DateBegin,
DateEnd: this.folder.DateEnd,
DateBegin: this.dateControlStart.value,
DateEnd: this.dateControlEnd.value,
ActionType: this.segment,
}
@@ -54,7 +54,7 @@ export class PublicationDetailPage implements OnInit {
this.getPublicationDetail();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -124,7 +124,7 @@ export class PublicationsPage implements OnInit {
doRefresh(event) {
this.getActions();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 250);
}
@@ -63,7 +63,7 @@ export class PublicationDetailPage implements OnInit {
this.getPublicationDetail();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -98,7 +98,7 @@ export class ViewPublicationsPage implements OnInit {
//this.testForkJoin()
this.getPublicationDetail();
this.getPublicationsIds();
event.target.complete();
event?.target?.complete();
//}, 3000);
}
+7
View File
@@ -371,6 +371,13 @@ export class MessageService {
var memeberTosend = this.ChatSystemService.getRoomById(this.rid).membersExcludeMe
console.log(ChatMessage)
this.notificationService.ChatSendMessageNotification(memeberTosend[0].username,ChatMessage.u.name,ChatMessage.msg,this.rid)
} else {
var memeberTosend = this.ChatSystemService.getRoomById(this.rid).membersExcludeMe
var usersNames = [];
for(let i = 0; i < memeberTosend.length; i++) {
usersNames.push(memeberTosend[i].username)
}
this.notificationService.ChatSendMessageNotificationGrup(usersNames,ChatMessage.u.name,ChatMessage.msg,this.rid)
}
@@ -206,9 +206,9 @@ export class EditEventPage implements OnInit {
}
doRefresh(event){
/* this.RefreshEvents(); */
event.target.complete();
event?.target?.complete();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -203,9 +203,9 @@ export class EventDetailModalPage implements OnInit {
}
doRefresh(event){
/* this.RefreshEvents(); */
event.target.complete();
event?.target?.complete();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -204,9 +204,9 @@ export class EventDetailPage implements OnInit {
}
doRefresh(event){
/* this.RefreshEvents(); */
event.target.complete();
event?.target?.complete();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
+1 -1
View File
@@ -125,7 +125,7 @@ export class EventsPage implements OnInit {
doRefresh(event) {
this.RefreshEvents();
this.LoadList();
event.target.complete();
event?.target?.complete();
}
onSegmentChange() {
+126 -121
View File
@@ -24,11 +24,13 @@ export class NotificationsService {
DataArray = new Array();
callbacks: {[key: string]: {
type: notificationObject,
funx: Function
id: string
}} = {}
callbacks: {
[key: string]: {
type: notificationObject,
funx: Function
id: string
}
} = {}
active = false
isPushNotificationsAvailable = Capacitor.isPluginAvailable('PushNotifications');
@@ -85,8 +87,8 @@ export class NotificationsService {
}
requestPermissions() {
if(!this.isPushNotificationsAvailable) {
return false
if (!this.isPushNotificationsAvailable) {
return false
}
PushNotifications.requestPermissions().then(result => {
@@ -100,36 +102,36 @@ export class NotificationsService {
}
getAndpostToken(username) {
if(!this.isPushNotificationsAvailable) {
return false
if (!this.isPushNotificationsAvailable) {
return false
}
const geturl = environment.apiURL + 'notifications/token';
PushNotifications.addListener('registration',
(token: Token) => {
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
const body = {
UserId: SessionStore.user.UserId,
TokenId: token.value,
Status: 1,
Service: 1
};
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
const body = {
UserId: SessionStore.user.UserId,
TokenId: token.value,
Status: 1,
Service: 1
};
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
this.active = true
console.log(data)
}, (error) => {
console.log(error)
})
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
this.active = true
console.log(data)
}, (error) => {
console.log(error)
})
}
);
}
registrationError() {
if(!this.isPushNotificationsAvailable) {
return false
if (!this.isPushNotificationsAvailable) {
return false
}
PushNotifications.addListener('registrationError',
@@ -140,44 +142,44 @@ export class NotificationsService {
}
onReciveForeground() {
if(!this.isPushNotificationsAvailable) {
return false
if (!this.isPushNotificationsAvailable) {
return false
}
console.log('foregrund');
PushNotifications.addListener('pushNotificationReceived',
(notification: PushNotificationSchema) => {
PushNotifications.addListener('pushNotificationReceived',
(notification: PushNotificationSchema) => {
this.active = true
console.log(notification)
//this.DataArray.push(notification)
//console.log(this.DataArray)
this.storageService.get("Notifications").then((store) => {
store.push(notification)
this.storageService.store("Notifications", store)
}).catch((error) => {
if(!error) {
this.storageService.store("Notifications", [notification])
}
})
// this.runNotificationCallback(notification)
/* this.eventTriger.publish('notificatioRecive') */
this.eventtrigger.publishSomeData({
notification: "recive"
})
}
);
console.log(notification)
//this.DataArray.push(notification)
//console.log(this.DataArray)
this.storageService.get("Notifications").then((store) => {
store.push(notification)
this.storageService.store("Notifications", store)
}).catch((error) => {
if (!error) {
this.storageService.store("Notifications", [notification])
}
})
// this.runNotificationCallback(notification)
/* this.eventTriger.publish('notificatioRecive') */
this.eventtrigger.publishSomeData({
notification: "recive"
})
}
);
}
onReciveBackground() {
if(!this.isPushNotificationsAvailable) {
return false
if (!this.isPushNotificationsAvailable) {
return false
}
console.log('fbackgrund');
PushNotifications.addListener('pushNotificationActionPerformed',
(notification: ActionPerformed) => {
PushNotifications.addListener('pushNotificationActionPerformed',
(notification: ActionPerformed) => {
this.active = true
console.log(notification)
/* this.DataArray.push(notification.notification)
@@ -186,45 +188,48 @@ export class NotificationsService {
this.eventtrigger.publishSomeData({
notification: "recive"
}) */
this.notificatinsRoutes(notification)
// this.runNotificationCallback(notification)
}
);
this.notificatinsRoutes(notification)
// this.runNotificationCallback(notification)
}
);
}
ChatSendMessageNotification(userID,title,bodymsg,roomId) {
ChatSendMessageNotification(userID, title, bodymsg, roomId) {
const geturl = environment.apiURL + `notifications/sendbyUsername`;
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
const message = {
"Service": "chat",
"IdObject": roomId
}
let id = 437
console.log(userID,title,bodymsg,roomId)
this.http.post<Tokenn>(geturl+`?username=${userID}&title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => {
this.active = true
console.log(data)
}, (error) => {
console.log(error)
})
const message = {
"Service": "chat",
"IdObject": roomId
}
let id = 437
console.log(userID, title, bodymsg, roomId)
this.http.post<Tokenn>(geturl + `?username=${userID}&title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => {
this.active = true
console.log(data)
}, (error) => {
console.log(error)
})
}
ChatSendMessageNotificationGrup(userID,title,bodymsg,roomId) {
const geturl = environment.apiURL + `notifications/send`;
ChatSendMessageNotificationGrup(usersID, title, bodymsg, roomId) {
const geturl = environment.apiURL + `notifications/sendByUsernames`;
const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
const message = {
"Service": "chat",
"IdObject": roomId
}
console.log(userID,title,bodymsg,roomId)
this.http.post<Tokenn>(geturl+`?userId=${userID}&title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => {
this.active = true
console.log(data)
}, (error) => {
console.log(error)
})
const message = {
"Users": usersID,
"NotificationData": {
"Service": "chat",
"IdObject": roomId
}
}
console.log(usersID, title, bodymsg, roomId)
this.http.post<Tokenn>(geturl + `?title=${title}&body=${bodymsg}`, message, { headers }).subscribe(data => {
this.active = true
console.log(data)
}, (error) => {
console.log(error)
})
}
tempClearArray(data) {
@@ -234,51 +239,51 @@ export class NotificationsService {
notificatinsRoutes = (notification) => {
if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") {
//this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda']));
this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda']));
} else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") {
if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true }));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") {
this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "agenda" && notification.notification.data.Object === "event-list") {
//this.zone.run(() => this.router.navigate(['/home/gabinete-digital/event-list/approve-event',IdObject, 'agenda']));
this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', notification.notification.data.IdObject, 'agenda']));
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") {
} else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', notification.notification.data.IdObject, 'gabinete-digital'], { replaceUrl: true }));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "parecer") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") {
this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject]));
}
else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") {
this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject]));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "deferimento") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital']));
} else if (notification.notification.data.Service === "chat") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "despachos-pr") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "accao") {
this.zone.run(() => this.router.navigate(['/home/publications', notification.notification.data.IdObject]));
}
else if (notification.notification.data.Service === "accoes" && notification.notification.data.Object === "publicacao") {
this.zone.run(() => this.router.navigate(['/home/publications/view-publications', notification.notification.data.FolderId, notification.data.IdObject]));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "diplomas-assinar") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar', notification.notification.data.IdObject, 'gabinete-digital']));
}
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expedientes-pr") {
this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', notification.notification.data.IdObject, 'gabinete-digital']));
} else if (notification.notification.data.Service === "chat") {
let navigationExtras: NavigationExtras = { queryParams: { "roomId": notification.notification.data.IdObject, } };
this.zone.run(() => this.router.navigate(['/home/chat'], navigationExtras));
}
@@ -168,7 +168,7 @@ export class EventListPage implements OnInit {
this.LoadToApproveEvents();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -62,7 +62,7 @@ export class AllProcessesPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
setTimeout(() => {
@@ -89,13 +89,13 @@ constructor (
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
setTimeout(() => {
this.LoadList();
//event.target.complete();
//event?.target?.complete();
}, 1000);
}
@@ -49,7 +49,7 @@ export class DespachosPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -52,7 +52,7 @@ export class DiplomasAssinarPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -41,7 +41,7 @@ export class DiplomasGerarPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -97,7 +97,7 @@ export class ExpedientsPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
setTimeout(() => {
@@ -127,7 +127,7 @@ export class DiplomasPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -87,7 +87,7 @@ export class ExpedientesPrPage implements OnInit {
doRefresh(event) {
this.LoadList();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -96,7 +96,7 @@ export class ExpedientsPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -124,7 +124,7 @@ export class PedidosPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
setTimeout(() => {
@@ -90,7 +90,7 @@ export class PendentesPage implements OnInit {
doRefresh(event) {
if (event) {
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}
@@ -54,7 +54,7 @@ export class PublicationDetailPage implements OnInit {
this.getPublicationDetail();
setTimeout(() => {
event.target.complete();
event?.target?.complete();
}, 2000);
}