mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
update badge das notificações
This commit is contained in:
@@ -47,19 +47,19 @@
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
<ion-virtual-scroll [items]="users" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
<div *ngFor="let userContainer of userContainer | keyvalue;" >
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{header}}</ion-label>
|
||||
<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>
|
||||
<p>{{user.name}}</p>
|
||||
<ion-icon class="{{user.status}}" name="ellipse"></ion-icon>
|
||||
<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>
|
||||
|
||||
@@ -32,6 +32,10 @@ export class GroupContactsPage implements OnInit {
|
||||
groupName:string;
|
||||
selectedUserList:any;
|
||||
sessionStore = SessionStore
|
||||
|
||||
|
||||
objectUserSingleStone = []
|
||||
userContainer = {}
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -81,6 +85,30 @@ export class GroupContactsPage implements OnInit {
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
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;
|
||||
@@ -178,6 +206,26 @@ 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
|
||||
|
||||
|
||||
}
|
||||
@@ -185,9 +233,16 @@ export class GroupContactsPage implements OnInit {
|
||||
|
||||
|
||||
}
|
||||
selectedContact(user:any){
|
||||
/* this.groupName = this.room.name; */
|
||||
user.isChecked = !user.isChecked;
|
||||
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
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</ion-refresher>
|
||||
<div class="main-content">
|
||||
<ion-progress-bar class="position-absolute" type="indeterminate" *ngIf="loading"></ion-progress-bar>
|
||||
<ion-virtual-scroll [items]="userList" approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
<ion-virtual-scroll [items]="ChatSystemService.users | filter:textSearch: 'name' " approxItemHeight="70px" [headerFn]="separateLetter">
|
||||
|
||||
<div class="item-divider" *virtualHeader="let header">
|
||||
<ion-label>{{header}}</ion-label>
|
||||
|
||||
@@ -1003,6 +1003,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
|
||||
openFile(pdfString, filename, type) {
|
||||
const blob = this.b64toBlob(pdfString, type)
|
||||
console.log(blob)
|
||||
let pathFile = ''
|
||||
const fileName = filename
|
||||
const contentFile = blob
|
||||
@@ -1012,7 +1013,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
pathFile = this.file.externalRootDirectory
|
||||
}
|
||||
|
||||
|
||||
console.log(pathFile)
|
||||
|
||||
this.file
|
||||
.writeFile(pathFile, fileName, contentFile, { replace: true })
|
||||
|
||||
Reference in New Issue
Block a user