add parameters

This commit is contained in:
Peter Maquiran
2023-08-20 00:26:24 +01:00
parent 8d35abbdd0
commit 6d8e0123b7
18 changed files with 193 additions and 77 deletions
@@ -487,6 +487,7 @@ export class NewEventPage implements OnInit {
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
if(this.documents.length >= 0) {
this.postEvent.HasAttachments = true;
}
@@ -495,9 +496,11 @@ export class NewEventPage implements OnInit {
this.postEvent.EventRecurrence.Type = '-1'
}
if(this.loggeduser.Profile == 'MDGPR') {
const CalendarId = this.selectedCalendarId()
this.showLoader = true;
this.postEvent.CalendarId = CalendarId
let loader = this.toastService.loading();
@@ -554,6 +557,7 @@ export class NewEventPage implements OnInit {
const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading();
this.postEvent.CalendarId = CalendarId
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
(id) => {
@@ -609,11 +613,13 @@ export class NewEventPage implements OnInit {
});
} else {
this.postEvent.CalendarName
const CalendarId = this.selectedCalendarId()
let loader = this.toastService.loading();
this.postEvent.CalendarId = CalendarId
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
(id) => {
@@ -40,7 +40,7 @@
<ion-list class="members-list" *ngFor="let user of members">
<div class="members-checkbox">
<ion-checkbox disabled checked color="primary"></ion-checkbox>
<p>{{user.name}}</p>
<p class="ma-0">{{user.name}}</p>
<ion-icon class="{{user.status}}" name="ellipse"></ion-icon>
<button (click)="deleteMember(user)" class="btn-no-color detele-item-icon">
<ion-icon color="danger" name="close"></ion-icon>
@@ -49,19 +49,19 @@
</ion-list>
</div>
<ion-virtual-scroll [items]="users " approxItemHeight="70px" [headerFn]="separateLetter">
<div class="item-divider" *virtualHeader="let header">
<ion-label>{{header}}</ion-label>
<div *ngFor="let userContainer of userContainer | keyvalue;" >
<div class="item-divider">
<ion-label>{{ userContainer.key }}</ion-label>
</div>
<div *virtualItem="let user" class="item-checkbox">
<ion-checkbox (ionChange)="selectedContact(user)" color="primary"></ion-checkbox>
<ion-label>{{user.name}}</ion-label>
<div *ngFor="let user of userContainer.value" class="d-flex px-20 align-center">
<ion-checkbox [(ngModel)]="user.isChecked" color="primary" (click)="selectedContact(user)"></ion-checkbox>
<ion-label class="flex-grow-1 px-10">{{user.name}}</ion-label>
<div class="icon"><ion-icon class="{{user.status}}" name="ellipse"></ion-icon></div>
</div>
</ion-virtual-scroll>
</div>
</div>
</ion-content>
@@ -36,6 +36,10 @@ export class GroupContactsPage implements OnInit {
@Input() roomId:string;
@Output() openGroupMessage:EventEmitter<any> = new EventEmitter<any>();
objectUserSingleStone = []
userContainer = {}
constructor(
private modalController: ModalController,
private chatService: ChatService,
@@ -168,7 +172,7 @@ export class GroupContactsPage implements OnInit {
});
}
loadUsers(){
loadUsers() {
this.chatService.getAllUsers().subscribe((res:any)=>{
@@ -192,24 +196,31 @@ export class GroupContactsPage implements OnInit {
});
for( const user of this.users) {
const foundUser = this.objectUserSingleStone.find( e => e.name == user.name)
if(!foundUser) {
this.objectUserSingleStone.push(user)
}
}
for(const user of this.objectUserSingleStone) {
const firstLetter = user.name.charAt(0)
if(!this.userContainer[firstLetter]) {
this.userContainer[firstLetter] = [user]
} else {
this.userContainer[firstLetter].push(user)
}
}
this.showLoader = false;
});
}
separateLetter(record, recordIndex, records){
if(recordIndex == 0){
return record.name[0];
}
let first_prev = records[recordIndex - 1].name[0];
let first_current = record.name[0];
if(first_prev != first_current){
return first_current;
}
return null;
}
doRefresh(ev){
ev.target.complete();
}
@@ -267,6 +278,24 @@ export class GroupContactsPage implements OnInit {
this.users = users
let a = this.objectUserSingleStone.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase()))
let b = {}
for(const user of a) {
const firstLetter = user.name.charAt(0)
if(!b[firstLetter]) {
b[firstLetter] = [user]
} else {
b[firstLetter].push(user)
}
}
this.userContainer = b
// console.log('this.users', this.users)
}
@@ -274,18 +303,22 @@ export class GroupContactsPage implements OnInit {
}
selectedContact(user:any){
/* this.groupName = this.room.name; */
user.isChecked = !user.isChecked;
const userIndex = this.users.findIndex((e) => e._id == user._id)
this.users[userIndex] = user
selectedContact(user:any) {
/* this.groupName = this.room.name; */
if(user.isChecked != true ) {
user.isChecked = false
} else {
user.isChecked = true
}
const userIndex = this.objectUserSingleStone.findIndex((e) => e._id == user._id)
this.objectUserSingleStone[userIndex].isChecked = user.isChecked
}
addContacts(roomId:any){
addContacts(roomId:any) {
this.selectedUserList = this.users.filter(function(contact) {
this.selectedUserList = this.objectUserSingleStone.filter(function(contact) {
return contact.isChecked == true;
});
@@ -39,7 +39,6 @@
<div class="messages-list-item-wrapper container-width-100"
*ngFor="let msg of ChatSystemService.getDmRoom(roomId).messages; index as i; let last = last">
<div class='message-item incoming-{{msg.u.username!=sessionStore.user.UserName}} max-width-45' *ngIf="msg.msg !=''">
<div class="message-item-options d-flex justify-content-end">
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer">
@@ -7,7 +7,7 @@
</div>
<div class="width-100">
<div class="d-flex width-100">
<div class="flex-grow-1">
<div class="flex-grow-1 flex-wrap d-flex">
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Enviar para o {{ environment.PR}} </button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Solicitar consideração superior</button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="btn-cancel desk" shape="round"> Solicitar revisão </button>
@@ -22,23 +22,9 @@
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Arquivar</button>
<button (click)="sendExpedienteToPending()" *ngIf="(task.Status || '') != 'Pending'" full class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button *ngIf="p.userPermission([p.permissionList.Chat.access])" (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
</div>
</div>
<!-- <div *ngIf="task && p.userRole(['PR'])" class="d-flex width-100">
<div class="flex-grow-1">
<button (click)="openExpedientActionsModal('0', fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<button (click)="distartExpedientModal('descartar')" class="btn-cancel" shape="round" >Arquivar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" *ngIf="task.Status != 'Pending'" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<div hidden class="solid"></div>
<button hidden class="btn-cancel" shape="round" >Delegar</button>
<button (click)="openNewGroupPage()" class="btn-cancel" shape="round" >Iniciar Conversa</button>
</div>
</div> -->
<div class="solid"></div>
<button (click)="close()" full class="btn-cancel" shape="round" >Cancelar</button>
</div>
</ion-content>
@@ -35,7 +35,7 @@
}
@media only screen and (max-width: 800px) {
.btn-ok, .btn-cancel, .btn-delete{
width: 100% !important;
width: 47% !important;
}
}
@media only screen and (min-width: 1024px) {
@@ -45,11 +45,11 @@
}
.btn-cancel{
display: none;
width: 100% !important;
width: 47% !important;
margin-bottom: 10px !important;
}
.btn-delete, .btn-ok{
width: 100% !important;
width: 47% !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}