mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
Improve search page
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
import { OrganicEntity } from './organic-entity.model';
|
||||||
|
|
||||||
|
describe('OrganicEntity', () => {
|
||||||
|
it('should create an instance', () => {
|
||||||
|
expect(new OrganicEntity()).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
export class OrganicEntity {
|
||||||
|
Code: number;
|
||||||
|
Description: string;
|
||||||
|
}
|
||||||
@@ -2,90 +2,96 @@
|
|||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
|
<!-- Default Refresher -->
|
||||||
|
|
||||||
<ion-content class="main bg-blue" ng-controller="AppController">
|
<ion-content class="main bg-blue" ng-controller="AppController">
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||||
|
<ion-refresher-content>
|
||||||
|
</ion-refresher-content>
|
||||||
|
</ion-refresher>
|
||||||
|
|
||||||
<ion-label>
|
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||||
<p class="time ion-text-center">{{customDate}}</p>
|
|
||||||
</ion-label>
|
<ion-label>
|
||||||
<ion-label>
|
<p class="time ion-text-center">{{customDate}}</p>
|
||||||
<p class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
|
</ion-label>
|
||||||
</ion-label>
|
<ion-label>
|
||||||
|
<p class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
|
||||||
|
</ion-label>
|
||||||
|
|
||||||
<div class="next-meeting">
|
<div class="next-meeting">
|
||||||
<div class="meeting-time">{{hoursMinutes}}</div>
|
<div class="meeting-time">{{hoursMinutes}}</div>
|
||||||
<div class="meeting-description"> "{{currentEvent}}"</div>
|
<div class="meeting-description"> "{{currentEvent}}"</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="conteiner-box" ng-swipe-up="swipe($event)">
|
<div class="conteiner-box" ng-swipe-up="swipe($event)">
|
||||||
<div class="schedule">
|
<div class="schedule">
|
||||||
<div class="schedule-header">
|
<div class="schedule-header">
|
||||||
<div class="title">
|
|
||||||
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
|
||||||
<div class="text">A sua Agenda</div>
|
|
||||||
</div>
|
|
||||||
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
|
||||||
<ul>
|
|
||||||
<li *ngFor="let event of eventsList"
|
|
||||||
[routerLink]="['/home/events', event.EventId, 'events']">
|
|
||||||
<div class="d-flex content-{{profile}}-{{event.CalendarName}}">
|
|
||||||
<div class="schedule-time">
|
|
||||||
<div class="time-start">{{event.StartDate | date: 'hh:mm'}}</div>
|
|
||||||
<div class="time-end">{{event.EndDate | date: 'hh:mm'}}</div>
|
|
||||||
</div>
|
|
||||||
<div class="schedule-details">
|
|
||||||
<div class="location">{{event.Location}}</div>
|
|
||||||
<div class="description">{{event.Subject}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
<!--
|
|
||||||
<div class="resume">
|
|
||||||
<div class="title">
|
<div class="title">
|
||||||
Resumo para Amnahã
|
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||||
|
<div class="text">A sua Agenda</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="event-num">4 eventos ageandados para amanhã</div>
|
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
|
||||||
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
|
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<ul>
|
||||||
|
<li *ngFor="let event of eventsList"
|
||||||
|
[routerLink]="['/home/events', event.EventId, 'events']">
|
||||||
|
<div class="d-flex content-{{profile}}-{{event.CalendarName}}">
|
||||||
|
<div class="schedule-time">
|
||||||
|
<div class="time-start">{{event.StartDate | date: 'hh:mm'}}</div>
|
||||||
|
<div class="time-end">{{event.EndDate | date: 'hh:mm'}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="schedule-details">
|
||||||
|
<div class="location">{{event.Location}}</div>
|
||||||
|
<div class="description">{{event.Subject}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
<!--
|
||||||
|
<div class="resume">
|
||||||
|
<div class="title">
|
||||||
|
Resumo para Amnahã
|
||||||
|
</div>
|
||||||
|
<div class="event-num">4 eventos ageandados para amanhã</div>
|
||||||
|
<div class="first-event-time">08:30 "Reunião Staff" no Palácio Presidencial</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="schedule">
|
||||||
|
<div class="schedule-header">
|
||||||
|
<div class="title">
|
||||||
|
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||||
|
<div class="text">Correspondência por ler</div>
|
||||||
|
</div>
|
||||||
|
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<ul>
|
||||||
|
<li *ngFor = "let task of taskslist"
|
||||||
|
[routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]">
|
||||||
|
<div class="d-flex">
|
||||||
|
<div class="schedule-date">
|
||||||
|
<div class="time-end">{{task.CreateDate | date: 'd/M/yy'}}</div>
|
||||||
|
<div class="time-start">{{task.CreateDate | date: 'hh:mm'}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="schedule-details pointer">
|
||||||
|
<div class="description">{{ task.Remetente }}</div>
|
||||||
|
<div class="location">{{ task.Folio }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
-->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="schedule">
|
|
||||||
<div class="schedule-header">
|
|
||||||
<div class="title">
|
|
||||||
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
|
||||||
<div class="text">Correspondência por ler</div>
|
|
||||||
</div>
|
|
||||||
<ion-icon class="icon-next" slot="end" src="assets/images/icons-arrow-circle-arrow-right.svg" ></ion-icon>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
|
||||||
<ul>
|
|
||||||
<li *ngFor = "let task of taskslist"
|
|
||||||
[routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]">
|
|
||||||
<div class="d-flex">
|
|
||||||
<div class="schedule-date">
|
|
||||||
<div class="time-end">{{task.CreateDate | date: 'd/M/yy'}}</div>
|
|
||||||
<div class="time-start">{{task.CreateDate | date: 'hh:mm'}}</div>
|
|
||||||
</div>
|
|
||||||
<div class="schedule-details pointer">
|
|
||||||
<div class="description">{{ task.Remetente }}</div>
|
|
||||||
<div class="location">{{ task.Folio }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
@@ -394,6 +394,7 @@ ion-toolbar{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.schedule-date{
|
.schedule-date{
|
||||||
|
margin-right: 10px;
|
||||||
width: 22%;
|
width: 22%;
|
||||||
color: #797979 !important;
|
color: #797979 !important;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|||||||
@@ -292,6 +292,7 @@ export class EventsPage implements OnInit {
|
|||||||
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { OrganicEntityPage } from './organic-entity.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: OrganicEntityPage
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule],
|
||||||
|
})
|
||||||
|
export class OrganicEntityPageRoutingModule {}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { OrganicEntityPageRoutingModule } from './organic-entity-routing.module';
|
||||||
|
|
||||||
|
import { OrganicEntityPage } from './organic-entity.page';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
IonicModule,
|
||||||
|
OrganicEntityPageRoutingModule
|
||||||
|
],
|
||||||
|
declarations: [OrganicEntityPage]
|
||||||
|
})
|
||||||
|
export class OrganicEntityPageModule {}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<ion-header class="main-header">
|
||||||
|
|
||||||
|
<div class="icon" (click)="close()">
|
||||||
|
<ion-icon name="chevron-back" slot="start"></ion-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Remetentes</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<ion-content>
|
||||||
|
<div class="main-container">
|
||||||
|
<div class="input-text d-flex ion-align-items-center">
|
||||||
|
<ion-input [(ngModel)]='findEntity' class="search-input" type="search" placeholder="Pesquisar" (ngModelChange)="filterContact($event)" ></ion-input>
|
||||||
|
</div>
|
||||||
|
<ul>
|
||||||
|
<li *ngFor="let organicEntity of showOrganicEntities" (click)="selectOrganicEntidy(organicEntity.Description)">
|
||||||
|
{{ organicEntity.Description }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
.main-header{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.icon{
|
||||||
|
color: #797979;
|
||||||
|
width: 45px;
|
||||||
|
height: 45px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 25px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-container{
|
||||||
|
padding: 0px 20px;
|
||||||
|
.input-text {
|
||||||
|
margin-top: 20px;
|
||||||
|
width: 100%;
|
||||||
|
height: 45px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid #ebebeb;
|
||||||
|
}
|
||||||
|
ul{
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
padding-top: 10px;
|
||||||
|
li{
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
margin: 0px;
|
||||||
|
padding-bottom: 10px;
|
||||||
|
border-bottom: 1px solid #ebebeb;
|
||||||
|
list-style: none;
|
||||||
|
font-family: Roboto;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
|
||||||
|
import { OrganicEntityPage } from './organic-entity.page';
|
||||||
|
|
||||||
|
describe('OrganicEntityPage', () => {
|
||||||
|
let component: OrganicEntityPage;
|
||||||
|
let fixture: ComponentFixture<OrganicEntityPage>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ OrganicEntityPage ],
|
||||||
|
imports: [IonicModule.forRoot()]
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(OrganicEntityPage);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { ModalController } from '@ionic/angular';
|
||||||
|
import { from } from 'rxjs';
|
||||||
|
import { OrganicEntityService } from 'src/app/services/organic-entity.service';
|
||||||
|
import { OrganicEntity } from 'src/app/models/organic-entity.model';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-organic-entity',
|
||||||
|
templateUrl: './organic-entity.page.html',
|
||||||
|
styleUrls: ['./organic-entity.page.scss'],
|
||||||
|
})
|
||||||
|
export class OrganicEntityPage implements OnInit {
|
||||||
|
|
||||||
|
organicEntities: OrganicEntity[];
|
||||||
|
showOrganicEntities: OrganicEntity[];
|
||||||
|
findEntity: string;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(private modalController:ModalController,
|
||||||
|
private OrganicEntityService: OrganicEntityService) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.getOrganicEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getOrganicEntity(){
|
||||||
|
this.OrganicEntityService.getOrganicEntity().subscribe(res=>{
|
||||||
|
console.log(res)
|
||||||
|
this.organicEntities = res;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
filterContact(){
|
||||||
|
|
||||||
|
const findEntity = this.findEntity.toLowerCase();
|
||||||
|
|
||||||
|
const entities = this.organicEntities.filter((Entity) => {
|
||||||
|
|
||||||
|
if (Entity.Description.toLowerCase().indexOf(findEntity) == 0){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.showOrganicEntities = entities;
|
||||||
|
}
|
||||||
|
|
||||||
|
selectOrganicEntidy(selectedOraganicEntit: string){
|
||||||
|
this.close(selectedOraganicEntit)
|
||||||
|
}
|
||||||
|
|
||||||
|
close(username: string){
|
||||||
|
this.modalController.dismiss(username);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,6 +15,10 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: 'filter',
|
path: 'filter',
|
||||||
loadChildren: () => import('./filter/filter.module').then( m => m.FilterPageModule)
|
loadChildren: () => import('./filter/filter.module').then( m => m.FilterPageModule)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'organic-entity',
|
||||||
|
loadChildren: () => import('./organic-entity/organic-entity.module').then( m => m.OrganicEntityPageModule)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<ion-icon name="restaurant-outline" src="assets/images/icons-arrow-arrow-down-25-copy.svg"></ion-icon>
|
<ion-icon name="restaurant-outline" src="assets/images/icons-arrow-arrow-down-25-copy.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-container d-flex ion-align-items-center">
|
<div class="input-container d-flex ion-align-items-center">
|
||||||
<ion-input [(ngModel)]='searchOrganicEntiry' class="search-input" type="search" placeholder="Entidade Orgânica"></ion-input>
|
<ion-input [(ngModel)]='searchOrganicEntiry' class="search-input" type="search" placeholder="Entidade Orgânica" (click)="openOrganicEntitySelection()"></ion-input>
|
||||||
<div class="icon" (click)="clearInputOrganicEntity()" >
|
<div class="icon" (click)="clearInputOrganicEntity()" >
|
||||||
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
|
<ion-icon name="restaurant-outline" src="assets/images/icons-search-close.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
@@ -106,7 +106,8 @@
|
|||||||
<p><span class="order">Order por:</span><span class="order-labal">Mais Recente</span></p>
|
<p><span class="order">Order por:</span><span class="order-labal">Mais Recente</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ion-icon src="assets/images/icons-arrow-arrow-down-25.svg"></ion-icon>
|
<ion-icon *ngIf="ordinance == 'recent'" (click)="changeOrder('old')" src="assets/images/icons-arrow-arrow-up.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="ordinance == 'old'" (click)="changeOrder('recent')" src="assets/images/icons-arrow-arrow-down-25.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import { SearchDocument } from "src/app/models/search-document";
|
|||||||
import { formatDate } from '@angular/common';
|
import { formatDate } from '@angular/common';
|
||||||
import { CloudData, CloudOptions } from 'angular-tag-cloud-module';
|
import { CloudData, CloudOptions } from 'angular-tag-cloud-module';
|
||||||
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
|
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
|
||||||
|
import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-entity.page';
|
||||||
|
|
||||||
|
import { NgModel } from '@angular/forms';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-search',
|
selector: 'app-search',
|
||||||
templateUrl: './search.page.html',
|
templateUrl: './search.page.html',
|
||||||
@@ -20,6 +23,7 @@ export class SearchPage implements OnInit {
|
|||||||
private searchSender: string;
|
private searchSender: string;
|
||||||
private searchOrganicEntiry: string;
|
private searchOrganicEntiry: string;
|
||||||
private searchDocTypeId: string;
|
private searchDocTypeId: string;
|
||||||
|
private ordinance: string;
|
||||||
|
|
||||||
searchCategories: SearchCategory[];
|
searchCategories: SearchCategory[];
|
||||||
showSearchDocuments: SearchDocument[];
|
showSearchDocuments: SearchDocument[];
|
||||||
@@ -52,7 +56,7 @@ export class SearchPage implements OnInit {
|
|||||||
|
|
||||||
constructor(private modalController: ModalController,
|
constructor(private modalController: ModalController,
|
||||||
private search: SearchService) {
|
private search: SearchService) {
|
||||||
|
this.ordinance = "recent";
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -62,6 +66,10 @@ export class SearchPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
changeOrder(order: string){
|
||||||
|
this.ordinance = order;
|
||||||
|
}
|
||||||
|
|
||||||
sortArrayISODate(myArray: any){
|
sortArrayISODate(myArray: any){
|
||||||
return myArray.sort(function(a, b) {
|
return myArray.sort(function(a, b) {
|
||||||
return (a.Data < b.Data) ? -1 : ((a.Data > b.Data) ? 1 : 0);
|
return (a.Data < b.Data) ? -1 : ((a.Data > b.Data) ? 1 : 0);
|
||||||
@@ -129,12 +137,6 @@ export class SearchPage implements OnInit {
|
|||||||
*/
|
*/
|
||||||
showHideAdvanceSearch(show:boolean) {
|
showHideAdvanceSearch(show:boolean) {
|
||||||
this.showAdvanceSearch = show;
|
this.showAdvanceSearch = show;
|
||||||
/* Clear inputs */
|
|
||||||
this.searchDocumentDate = "";
|
|
||||||
this.searchSender = "";
|
|
||||||
this.searchOrganicEntiry = "";
|
|
||||||
this.searchDocTypeId = "";
|
|
||||||
this.searchSubject = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async openAdvanceSearchSelection() {
|
async openAdvanceSearchSelection() {
|
||||||
@@ -146,7 +148,30 @@ export class SearchPage implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return await modal.present();
|
await modal.present();
|
||||||
|
|
||||||
|
|
||||||
|
modal.onDidDismiss().then((data) => {
|
||||||
|
this.searchSender = data.data;
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async openOrganicEntitySelection(){
|
||||||
|
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: OrganicEntityPage,
|
||||||
|
cssClass: 'organicEnity',
|
||||||
|
componentProps: {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await modal.present();
|
||||||
|
|
||||||
|
modal.onDidDismiss().then((data) => {
|
||||||
|
this.searchOrganicEntiry = data.data;
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
<ion-header>
|
<ion-header class="main-header">
|
||||||
|
|
||||||
|
<div class="icon" (click)="close()">
|
||||||
|
<ion-icon name="chevron-back" slot="start"></ion-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title (click)="close()">Remetentes</ion-title>
|
<ion-title>Remetentes</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
<div class="main-container">
|
<div class="main-container">
|
||||||
<div class="input-text d-flex ion-align-items-center">
|
<div class="input-text d-flex ion-align-items-center">
|
||||||
<ion-input class="search-input" type="search" placeholder="Pesquisar" (change)="filterContact($event)"></ion-input>
|
<ion-input [(ngModel)]='sender' class="search-input" type="search" placeholder="Pesquisar" (ngModelChange)="filterContact($event)" ></ion-input>
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let contact of showContacts">
|
<li *ngFor="let contact of showContacts" (click)="selectUser(contact.Name)">
|
||||||
{{ contact.Name }}
|
{{ contact.Name }}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
|
.main-header{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon{
|
||||||
|
color: #797979;
|
||||||
|
width: 45px;
|
||||||
|
height: 45px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 25px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.main-container{
|
.main-container{
|
||||||
padding: 0px 20px;
|
padding: 0px 20px;
|
||||||
.input-text {
|
.input-text {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { ModalController } from '@ionic/angular';
|
import { ModalController } from '@ionic/angular';
|
||||||
import { ContactsService } from 'src/app/services/contacts.service';
|
import { ContactsService } from 'src/app/services/contacts.service';
|
||||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-sender',
|
selector: 'app-sender',
|
||||||
templateUrl: './sender.page.html',
|
templateUrl: './sender.page.html',
|
||||||
@@ -12,7 +13,8 @@ export class SenderPage implements OnInit {
|
|||||||
|
|
||||||
contacts: EventPerson[];
|
contacts: EventPerson[];
|
||||||
showContacts: EventPerson[];
|
showContacts: EventPerson[];
|
||||||
|
sender: string;
|
||||||
|
selectedUser: string;
|
||||||
|
|
||||||
constructor(private modalController:ModalController,
|
constructor(private modalController:ModalController,
|
||||||
private ContactsService: ContactsService) {
|
private ContactsService: ContactsService) {
|
||||||
@@ -28,23 +30,29 @@ export class SenderPage implements OnInit {
|
|||||||
this.contacts = res;
|
this.contacts = res;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filterContact(){
|
||||||
|
|
||||||
filterContact(findName){
|
const findPerson = this.sender.toLowerCase();
|
||||||
console.log(findName)
|
const persons = this.contacts.filter((person) => {
|
||||||
// const persons = this.contacts.filter((person) => {
|
|
||||||
|
|
||||||
// if (person.Name.indexOf(findName) == 0){
|
if (person.Name.toLowerCase().indexOf(findPerson) == 0){
|
||||||
// return true;
|
return true;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// });
|
});
|
||||||
|
|
||||||
// this.showContacts = persons;
|
|
||||||
|
|
||||||
|
this.showContacts = persons;
|
||||||
}
|
}
|
||||||
|
|
||||||
close(){
|
selectUser(username:string){
|
||||||
this.modalController.dismiss();
|
console.log(username);
|
||||||
|
this.selectedUser = username;
|
||||||
|
this.close(this.selectedUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
close(username: string){
|
||||||
|
this.modalController.dismiss(username);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { OrganicEntityService } from './organic-entity.service';
|
||||||
|
|
||||||
|
describe('OrganicEntityService', () => {
|
||||||
|
let service: OrganicEntityService;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({});
|
||||||
|
service = TestBed.inject(OrganicEntityService);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be created', () => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { EventPerson } from '../models/eventperson.model';
|
||||||
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { AuthService } from '../services/auth.service';
|
||||||
|
import { User } from '../models/user.model';
|
||||||
|
import { OrganicEntity } from 'src/app/models/organic-entity.model';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class OrganicEntityService {
|
||||||
|
|
||||||
|
authheader = {};
|
||||||
|
loggeduser: User;
|
||||||
|
headers: HttpHeaders;
|
||||||
|
|
||||||
|
constructor(private http: HttpClient, user: AuthService) {
|
||||||
|
this.loggeduser = user.ValidatedUser;
|
||||||
|
this.headers = new HttpHeaders();
|
||||||
|
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
getOrganicEntity(): Observable<OrganicEntity[]>{
|
||||||
|
|
||||||
|
const geturl = environment.apiURL + 'ecm/organic';
|
||||||
|
|
||||||
|
let options = {
|
||||||
|
headers: this.headers,
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.http.get<OrganicEntity[]>(`${geturl}`, options);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 25 25">
|
||||||
|
<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<g stroke="#42B9FE" stroke-width="2">
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path d="M15.5 7.5L9.5 13 15.5 18.5" transform="translate(-345 -413) translate(20 403) translate(325 10) rotate(90 12.5 13)"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 467 B |
Reference in New Issue
Block a user