pull made

This commit is contained in:
Eudes Inácio
2023-08-15 18:10:45 +01:00
21 changed files with 196 additions and 234 deletions
@@ -235,20 +235,39 @@ export class GroupContactsPage implements OnInit {
}
}
onChange(event){
onChange(event) {
this.textSearch = event.detail.value;
this.users = this.contacts.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase())).sort((a,b) => {
if(a.name < b.name){
const users: any[] = this.contacts.filter( e => e.name.toLowerCase().includes(this.textSearch.toLowerCase())).sort((a,b) => {
if(a.name < b.name) {
return -1;
}
if(a.name > b.name){
if(a.name > b.name) {
return 1;
}
return 0;
});
const selectedUsers = this.users.filter( e => e?.isChecked == true)
users.forEach( (user, index) => {
if(user[index]) {
console.log({user, index})
const isCheck = selectedUsers.find( e => e._id == user._id)?.isChecked
if(isCheck) {
user[index].isChecked = isCheck
}
// if(user[index].isChecked) {
// console.log('user[index].isChecked', user[index].isChecked)
// }
}
})
this.users = users
// console.log('this.users', this.users)
}
clicked(){
@@ -22,7 +22,6 @@
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<!-- <ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar> -->
<ion-refresher-content>
@@ -30,7 +29,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">
<div class="item-divider" *virtualHeader="let header">
@@ -21,6 +21,7 @@ export class ContactsPage implements OnInit {
room:any;
dm:any;
sessionStore = SessionStore
loading = false
@Input() roomId: string;
@Output() openMessage:EventEmitter<any> = new EventEmitter<any>();
@@ -67,10 +68,19 @@ export class ContactsPage implements OnInit {
let body = {
username: username,
}
this.loading = true
this.chatService.createRoom(body).subscribe(res => {
this.ChatSystemService.getAllRooms();
this.room = res['room'];
this.openMessage.emit(this.room._id);
this.ChatSystemService.getAllRooms(() => {
this.openMessage.emit(this.room._id);
this.loading = false
}, this.room._id);
}, ()=> {
this.loading = false
});
}
}
@@ -1,5 +1,5 @@
<ion-content class="container width-100 header-fix">
<div *ngIf="content == ''" class="buttons">
<ion-content class="container width-100 ">
<div *ngIf="content == ''" class="buttons header-fix">
<button (click)="openExpedientActionsModal('0')" class="btn-cancel" shape="round" >Efetuar Despacho</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('1')" class="btn-cancel" shape="round" >Solicitar Parecer</button>
@@ -7,7 +7,7 @@
<button (click)="openBookMeetingModal()" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
</div>
<div *ngIf="content != ''" class="buttons">
<div *ngIf="content != ''" class="buttons header-fix">
<!-- <button (click)="save(Document, content)" class="btn-cancel" shape="round" >Salvar</button> -->
<button (click)="saveDraft(Document, content)" class="btn-cancel" shape="round" >Salvar Rascunho</button>
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
@@ -29,39 +29,47 @@
</div>
<!-- Captured -->
<!-- Captured -->
<div class="ion-item-container-no-border" *ngIf="capturedImage">
<ion-label class="attached-title">Fotografia Anexada</ion-label>
<ion-item lines="none" >
<ion-thumbnail slot="start">
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="capturedImage"></ion-img>
</ion-thumbnail>
<ion-label>
<p>{{capturedImageTitle}}</p>
<p hidden>size</p>
</ion-label>
<ion-label class="attached-title pb-10">Fotografia Anexada</ion-label>
<div class="d-flex justify-content-between">
<div class="d-flex">
<ion-thumbnail slot="start">
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="capturedImage"></ion-img>
</ion-thumbnail>
<ion-label class="pl-10">
<p>{{capturedImageTitle}}</p>
<p hidden>size</p>
</ion-label>
</div>
<button class="btn-no-color" (click)="clear()">
<ion-icon name="close"></ion-icon>
</button>
</ion-item>
</div>
</div>
<!-- Current -->
<div class="ion-item-container-no-border mb-20" *ngIf="publication && !( publication.FileBase64 == 'data:image/jpg;base64,null' || publication.FileBase64 == '' ) && !capturedImage">
<!-- <ion-label class="attached-title pb-10">Fotografia Anexada</ion-label> -->
<div class="d-flex justify-content-between">
<div class="d-flex">
<ion-thumbnail slot="start">
<ion-img [(ngModel)]="publication.FileBase64" name="image" ngDefaultControl [src]="publication.FileBase64"></ion-img>
</ion-thumbnail>
<ion-label class="pl-10">
<p>{{publication.OriginalFileName}}.{{publication.FileExtension}}</p>
<p hidden>size</p>
</ion-label>
</div>
<button class="btn-no-color" (click)="deletePublicationImage()" >
<ion-icon name="close"></ion-icon>
</button>
</div>
</div>
<!-- current image -->
<div class="picture d-flex pb-5 hide-desktop" *ngIf="!( publication.FileBase64 == 'data:image/jpg;base64,null' || publication.FileBase64 == '' )" >
<div class="post-img">
<img src="{{publication.FileBase64}}" alt="image" >
</div>
<div class="d-flex flex-column pl-10">
<div class="picture-file-name">{{publication.OriginalFileName}}.{{publication.FileExtension}}</div>
<div class="size">75 Kb</div>
</div>
<div class="flex-grow-1 d-flex align-center justify-end">
<div style="color: red;">X</div>
</div>
</div>
<div class="ion-item-container-no-border hide-desktop">
<ion-label (click)="takePicture()">
@@ -99,7 +107,7 @@
</ion-buttons>
<ion-buttons slot="end">
<button class="btn-ok" fill="clear" color="#fff" (click)="save()">
<ion-label>Criar</ion-label>
<ion-label>Gravar</ion-label>
</button>
</ion-buttons>
</ion-toolbar>
@@ -93,7 +93,7 @@ export class NewPublicationPage implements OnInit {
});
this.capturedImage = 'data:image/jpeg;base64,' +capturedImage.base64String;
this.capturedImageTitle = capturedImage.path;
this.capturedImageTitle = 'foto';
//
}
@@ -105,7 +105,7 @@ export class NewPublicationPage implements OnInit {
});
this.capturedImage = 'data:image/jpeg;base64,' +capturedImage.base64String;
this.capturedImageTitle = capturedImage.path;
this.capturedImageTitle = 'foto';
}
@@ -272,10 +272,15 @@ export class NewPublicationPage implements OnInit {
this.goBack();
}
clear(){
clear() {
this.capturedImageTitle = '';
this.capturedImage = '';
}
deletePublicationImage() {
this.publication.FileBase64 = ""
}
setTitle(){
if(this.publicationType == '1') {
this.publicationTitle = 'Nova Publicação Rápida';