From c89551bd1308da992f35cf0a63fa0490eb6d2c51 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 8 Jan 2021 11:02:19 +0100 Subject: [PATCH 01/17] Add models for search --- src/app/models/event-search.spec.ts | 7 +++++++ src/app/models/event-search.ts | 19 +++++++++++++++++++ src/app/models/search-category.spec.ts | 7 +++++++ src/app/models/search-category.ts | 5 +++++ src/app/models/search-document.spec.ts | 7 +++++++ src/app/models/search-document.ts | 10 ++++++++++ src/app/models/search.ts | 7 +++++++ 7 files changed, 62 insertions(+) create mode 100644 src/app/models/event-search.spec.ts create mode 100644 src/app/models/event-search.ts create mode 100644 src/app/models/search-category.spec.ts create mode 100644 src/app/models/search-category.ts create mode 100644 src/app/models/search-document.spec.ts create mode 100644 src/app/models/search-document.ts create mode 100644 src/app/models/search.ts diff --git a/src/app/models/event-search.spec.ts b/src/app/models/event-search.spec.ts new file mode 100644 index 000000000..b615a4a5b --- /dev/null +++ b/src/app/models/event-search.spec.ts @@ -0,0 +1,7 @@ +import { EventSearch } from './event-search'; + +describe('EventSearch', () => { + it('should create an instance', () => { + expect(new EventSearch()).toBeTruthy(); + }); +}); diff --git a/src/app/models/event-search.ts b/src/app/models/event-search.ts new file mode 100644 index 000000000..6a693d231 --- /dev/null +++ b/src/app/models/event-search.ts @@ -0,0 +1,19 @@ +export class EventSearch { + + Categories: { + Id: number; + Name: string; + Qtd: 6; + }[] = []; + + Documents: { + ApplicationType: number; + Assunto: string; + Data: string; + DocTypeDesc: string; + EntidadeOrganicaId: number; + EntidadeOrganicaNome: string + Id: string + }[] = []; + +} diff --git a/src/app/models/search-category.spec.ts b/src/app/models/search-category.spec.ts new file mode 100644 index 000000000..a2afea185 --- /dev/null +++ b/src/app/models/search-category.spec.ts @@ -0,0 +1,7 @@ +import { SearchCategory } from './search-category'; + +describe('SearchCategory', () => { + it('should create an instance', () => { + expect(new SearchCategory()).toBeTruthy(); + }); +}); diff --git a/src/app/models/search-category.ts b/src/app/models/search-category.ts new file mode 100644 index 000000000..6fb6ec0ed --- /dev/null +++ b/src/app/models/search-category.ts @@ -0,0 +1,5 @@ +export class SearchCategory { + Id: number; + Name: string; + Qtd: 6; +} \ No newline at end of file diff --git a/src/app/models/search-document.spec.ts b/src/app/models/search-document.spec.ts new file mode 100644 index 000000000..6944883c5 --- /dev/null +++ b/src/app/models/search-document.spec.ts @@ -0,0 +1,7 @@ +import { SearchDocument } from './search-document'; + +describe('SearchDocument', () => { + it('should create an instance', () => { + expect(new SearchDocument()).toBeTruthy(); + }); +}); diff --git a/src/app/models/search-document.ts b/src/app/models/search-document.ts new file mode 100644 index 000000000..1fb009d8c --- /dev/null +++ b/src/app/models/search-document.ts @@ -0,0 +1,10 @@ +export class SearchDocument { + + ApplicationType: number; + Assunto: string; + Data: string; + DocTypeDesc: string; + EntidadeOrganicaId: number; + EntidadeOrganicaNome: string + Id: string +} diff --git a/src/app/models/search.ts b/src/app/models/search.ts new file mode 100644 index 000000000..1470cb0ef --- /dev/null +++ b/src/app/models/search.ts @@ -0,0 +1,7 @@ +export class Search { + subject: string; + date: string; + sender: string; + organicEntity: string; + docTypeId: string; +} \ No newline at end of file From a96cdb2487c23ddc194e4aa0c0f6903fc737e6b7 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 8 Jan 2021 11:02:44 +0100 Subject: [PATCH 02/17] Add service for search --- src/app/services/search.service.spec.ts | 16 ++++++++ src/app/services/search.service.ts | 54 +++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 src/app/services/search.service.spec.ts create mode 100644 src/app/services/search.service.ts diff --git a/src/app/services/search.service.spec.ts b/src/app/services/search.service.spec.ts new file mode 100644 index 000000000..23c42c7bb --- /dev/null +++ b/src/app/services/search.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { SearchService } from './search.service'; + +describe('SearchService', () => { + let service: SearchService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(SearchService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/search.service.ts b/src/app/services/search.service.ts new file mode 100644 index 000000000..9e3f29b4f --- /dev/null +++ b/src/app/services/search.service.ts @@ -0,0 +1,54 @@ +import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Event } from '../models/event.model'; +import { Observable } from 'rxjs'; +import { environment } from 'src/environments/environment'; +import { AuthService } from '../services/auth.service'; +import { User } from '../models/user.model'; +import { EventSearch } from "src/app/models/event-search"; + +@Injectable({ + providedIn: 'root' +}) +export class SearchService { + // state + authheader = {}; + loggeduser: User; + headers: HttpHeaders; + + + + categories= Array; + + // setup + constructor(private http: HttpClient, user: AuthService) { + this.loggeduser = user.ValidatedUser; + this.headers = new HttpHeaders(); + this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey); + } + + + basicSearch(subject:string, date:string, sender:string, organicEntity:string, docTypeId:string): Observable{ + // Endpoint + const geturl = environment.apiURL + 'search'; + // store params + let params = new HttpParams(); + // set https params + console.log(subject); + + params = params.set("assunto", 'actividades'); + params = params.set("data", date); + params = params.set("remetente", sender); + params = params.set("entidadeOrganica", organicEntity); + params = params.set("docTypeId", docTypeId); + + + const options = { + headers: this.headers, + params: params + }; + + return this.http.get(`${geturl}`, options); + } + +} From 0dea72f50846a7ab0af304e1e76561bc97441c87 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 8 Jan 2021 11:04:36 +0100 Subject: [PATCH 03/17] Add dynamic list for service response --- src/app/pages/search/search.page.html | 86 +++------------------------ src/app/pages/search/search.page.scss | 11 +++- src/app/pages/search/search.page.ts | 42 ++++++++++++- 3 files changed, 57 insertions(+), 82 deletions(-) diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index c47ea5e6c..e613a2d9e 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -24,33 +24,13 @@ - +
-
-

Relatório

- 10 -
-
-

Relatório

- 10 -
-
-

Relatório

- 10 -
-
-

Relatório

- 10 -
-
-

Relatório

- 10 -
-
-

Relatório

- 10 +
+

{{ category.Name }}

+ {{ category.Qtd }}
@@ -66,7 +46,7 @@

Palavas mais pesquisdas

- +
@@ -79,63 +59,15 @@
    -
  • +
  • -

    title

    +

    {{ searchDocument.Assunto}}

    - MINEC, MINFIN - 13/04/2020 -
    -
    -
  • -
  • -
    - -
    -
    -

    title

    -
    - MINEC, MINFIN - 13/04/2020 -
    -
    -
  • -
  • -
    - -
    -
    -

    title

    -
    - MINEC, MINFIN - 13/04/2020 -
    -
    -
  • -
  • -
    - -
    -
    -

    title

    -
    - MINEC, MINFIN - 13/04/2020 -
    -
    -
  • -
  • -
    - -
    -
    -

    title

    -
    - MINEC, MINFIN - 13/04/2020 + {{ searchDocument.EntidadeOrganicaNome }} + {{ formateIsoDate(searchDocument.Data) }}
  • diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index df087037b..c4379ad86 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -44,7 +44,7 @@ width: 100%; flex-wrap: wrap; .button{ - width: 116px; + min-width: 116px; border: solid 1px #e9e9e9; margin: 0px 5px; margin-bottom: 10px; @@ -92,7 +92,7 @@ } - +// document .d-flex{ display: flex; // search result @@ -148,12 +148,17 @@ line-height: 1.67; } span{ - height: 15px; font-family: Roboto; font-size: 13px; font-weight: 300; color: #797979; } + span.documente-date{ + + } + span.organic-entity{ + width: 100%; + } } } } diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index a20587ad8..0d2ead495 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -1,6 +1,10 @@ import { Component, OnInit } from '@angular/core'; import { ModalController } from '@ionic/angular'; - +import { ProcessesService } from 'src/app/services/processes.service'; +import { SearchService } from "../../services/search.service"; +import { SearchCategory } from "src/app/models/search-category"; +import { SearchDocument } from "src/app/models/search-document"; +import { formatDate } from '@angular/common'; @Component({ selector: 'app-search', templateUrl: './search.page.html', @@ -8,7 +12,31 @@ import { ModalController } from '@ionic/angular'; }) export class SearchPage implements OnInit { - constructor(private modalController: ModalController) { } + // https params + private searchSubject: string; + private searchDate: string; + private searchSender: string; + private searchOrganicEntiry: string; + private searchDocTypeId: string; + + searchCategories: SearchCategory[]; + searchDocuments: SearchDocument[]; + + constructor(private modalController: ModalController, + private search: SearchService) { + + // search in API + this.search.basicSearch(this.searchSubject, this.searchDate, this.searchSender + ,this.searchOrganicEntiry, this.searchDocTypeId).subscribe(res=>{ + + this.searchCategories = res.Categories; + this.searchDocuments = res.Documents; + + console.log(this.searchDocuments); + console.log(this.searchCategories); + }); + + } ngOnInit() { } @@ -16,4 +44,14 @@ export class SearchPage implements OnInit { this.modalController.dismiss(); } + /** + * @param isoDate String Iso date + * @returns date in formate DD:MM:YYYY + * @description convert Iso date to MM/DD/YYYY + */ + formateIsoDate(isoDate:string): string{ + const date = new Date(isoDate); + return formatDate(date, 'dd/MM/yyyy', 'pt'); + } + } From 8c5156fb576b95bcb5e56c274c42df4be5741604 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 8 Jan 2021 11:05:36 +0100 Subject: [PATCH 04/17] Edit comment --- src/app/pages/search/search.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 0d2ead495..af9888540 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -46,7 +46,7 @@ export class SearchPage implements OnInit { /** * @param isoDate String Iso date - * @returns date in formate DD:MM:YYYY + * @returns date in formate MM/DD/YYYY * @description convert Iso date to MM/DD/YYYY */ formateIsoDate(isoDate:string): string{ From 4fbcc7b10c6f81f4d5ee1f3b58eda89a26438071 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 8 Jan 2021 11:43:47 +0100 Subject: [PATCH 05/17] Add search button event --- src/app/pages/search/search.page.html | 6 ++--- src/app/pages/search/search.page.scss | 2 +- src/app/pages/search/search.page.ts | 32 ++++++++++++++++++--------- src/app/services/search.service.ts | 2 +- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index e613a2d9e..f9bbfec7c 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -2,12 +2,12 @@ -
    -
    +
    +
    - +
    diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index c4379ad86..04459ff7f 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -17,7 +17,7 @@ align-items: center; } .icon-z{ - width: 15px; + width: 20px; } } .icon-z{ diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index af9888540..97e8c096c 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -25,17 +25,6 @@ export class SearchPage implements OnInit { constructor(private modalController: ModalController, private search: SearchService) { - // search in API - this.search.basicSearch(this.searchSubject, this.searchDate, this.searchSender - ,this.searchOrganicEntiry, this.searchDocTypeId).subscribe(res=>{ - - this.searchCategories = res.Categories; - this.searchDocuments = res.Documents; - - console.log(this.searchDocuments); - console.log(this.searchCategories); - }); - } ngOnInit() { @@ -44,6 +33,27 @@ export class SearchPage implements OnInit { this.modalController.dismiss(); } + /** + * + * @description get respose from the server + * @returns repn + */ + basicSearch(){ + // search in API + + this.search.basicSearch(this.searchSubject, this.searchDate, this.searchSender + ,this.searchOrganicEntiry, this.searchDocTypeId).subscribe(res=>{ + + // binde respose + this.searchCategories = res.Categories; + this.searchDocuments = res.Documents; + + console.log(this.searchCategories); + console.log(this.searchDocuments); + + }); + } + /** * @param isoDate String Iso date * @returns date in formate MM/DD/YYYY diff --git a/src/app/services/search.service.ts b/src/app/services/search.service.ts index 9e3f29b4f..63b5312e6 100644 --- a/src/app/services/search.service.ts +++ b/src/app/services/search.service.ts @@ -36,7 +36,7 @@ export class SearchService { // set https params console.log(subject); - params = params.set("assunto", 'actividades'); + params = params.set("assunto", subject); params = params.set("data", date); params = params.set("remetente", sender); params = params.set("entidadeOrganica", organicEntity); From 441955a20bc12612afbffa9652ee970a4d04f6f0 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 8 Jan 2021 12:29:59 +0100 Subject: [PATCH 06/17] Hide and show html elements --- src/app/pages/search/search.page.html | 10 ++-- src/app/pages/search/search.page.scss | 80 ++++++++++++++++----------- src/app/pages/search/search.page.ts | 27 ++++++--- 3 files changed, 71 insertions(+), 46 deletions(-) diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index f9bbfec7c..f15d89e7d 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -9,7 +9,7 @@
    -
    +
    @@ -40,14 +40,14 @@
    -
    +
    -
    -

    Palavas mais pesquisdas

    +
    +

    Palavas mais pesquisdas

    -
    +
    diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index 04459ff7f..489df8eed 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -92,9 +92,14 @@ } -// document .d-flex{ display: flex; +} + +// document +.word-searh-result-container{ + display: flex; + flex-wrap: wrap; // search result .search-result{ width: 100%; @@ -165,9 +170,9 @@ } // most searched word .most-searched-words{ - width: 400px; - display: none; - p{ + width: 100%; + p.title{ + width: 100%; height: 24px; font-family: Roboto; font-size: 20px; @@ -180,36 +185,45 @@ -@media only screen and (min-width: 1024px) { - .header-main { - background-color: #0782c9; - .profile{ - display: inline-block; - } - .icon-most-searched-word-open{ - display: none !important; - } - } +//@media only screen and (min-width: 1024px) { - .options{ - .container{ - border-bottom: 1px solid #ebebeb; - .icon{ - display: flex; - } - } - padding: 0px 20px; - } +// .header-main { +// background-color: #0782c9; +// .profile{ +// display: inline-block; +// } +// .icon-most-searched-word-open{ +// display: none !important; +// } +// } + +// .options{ +// .container{ +// border-bottom: 1px solid #ebebeb; +// .icon{ +// display: flex; +// } +// } +// padding: 0px 20px; +// } - .most-searched-words{ - display: inline-block !important; - } - .search-result{ - border-left: 1px solid #d8d8d8; - .header{ - border-top: unset !important; - } - } -} + +// .search-result{ +// border-left: 1px solid #d8d8d8; +// .header{ +// border-top: unset !important; +// } +// } + +// .most-searched-words{ +// width: 400px !important; +// } + +// .word-searh-result-container{ +// flex-wrap: wrap; +// } + + +//} diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 97e8c096c..32d9343bb 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -21,10 +21,11 @@ export class SearchPage implements OnInit { searchCategories: SearchCategory[]; searchDocuments: SearchDocument[]; + showDocuments: boolean; constructor(private modalController: ModalController, private search: SearchService) { - + this.showDocuments = false; } ngOnInit() { @@ -34,9 +35,7 @@ export class SearchPage implements OnInit { } /** - * * @description get respose from the server - * @returns repn */ basicSearch(){ // search in API @@ -44,20 +43,32 @@ export class SearchPage implements OnInit { this.search.basicSearch(this.searchSubject, this.searchDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId).subscribe(res=>{ - // binde respose + // bind respose this.searchCategories = res.Categories; this.searchDocuments = res.Documents; - console.log(this.searchCategories); - console.log(this.searchDocuments); + // hide show document + if(this.searchDocuments.length >= 1){ + this.showDocuments = true; + } else { + this.showDocuments = false + } + }); } + /** + * @description set empty value to searchSubject + */ + clearSearchInput(){ + this.searchSubject = "" + } + /** * @param isoDate String Iso date - * @returns date in formate MM/DD/YYYY - * @description convert Iso date to MM/DD/YYYY + * @returns date in formate dd/MM/yyyy + * @description convert Iso date to dd/MM/yyyy */ formateIsoDate(isoDate:string): string{ const date = new Date(isoDate); From 701973226f7fdd40f47c664dbf8891bb1e63f2b2 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 8 Jan 2021 12:32:24 +0100 Subject: [PATCH 07/17] Update search html --- src/app/pages/search/search.page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index f15d89e7d..279099136 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -43,7 +43,7 @@
    -

    Palavas mais pesquisdas

    +

    Palavras mais pesquisadas

    From 2414d8dc8f0f25ba4ac13fc3d8722da265e478f1 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 8 Jan 2021 13:00:34 +0100 Subject: [PATCH 08/17] Add hide and show for most searched words --- src/app/pages/search/search.page.html | 1 + src/app/pages/search/search.page.scss | 4 ++-- src/app/pages/search/search.page.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index 279099136..957e14236 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -42,6 +42,7 @@
    +

    Palavras mais pesquisadas

    diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index 489df8eed..377beb5f0 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -185,8 +185,8 @@ +@media only screen and (min-width: 1024px) { -//@media only screen and (min-width: 1024px) { // .header-main { // background-color: #0782c9; @@ -226,4 +226,4 @@ // } -//} +} diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 32d9343bb..b9544efee 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -67,7 +67,7 @@ export class SearchPage implements OnInit { /** * @param isoDate String Iso date - * @returns date in formate dd/MM/yyyy + * @returns date in format dd/MM/yyyy * @description convert Iso date to dd/MM/yyyy */ formateIsoDate(isoDate:string): string{ From 4f397960338d7fad0c573237a23f65eac6d83ea8 Mon Sep 17 00:00:00 2001 From: Peter Dias Date: Fri, 15 Jan 2021 08:16:36 +0100 Subject: [PATCH 09/17] Improve search page --- package-lock.json | 15 +++++ package.json | 1 + src/app/pages/events/events.page.ts | 4 ++ src/app/pages/search/search.module.ts | 2 + src/app/pages/search/search.page.html | 45 ++++++++++++- src/app/pages/search/search.page.scss | 44 +++++++++++++ src/app/pages/search/search.page.ts | 63 +++++++++++++++++-- .../images/advance-search-show-modal.svg | 19 ++++++ .../images/icons-advance-search-document.svg | 21 +++++++ .../images/icons-advance-search-sender.svg | 18 ++++++ .../images/icons-arrow-arrow-down-25-copy.svg | 19 ++++++ 11 files changed, 244 insertions(+), 7 deletions(-) create mode 100644 src/assets/images/advance-search-show-modal.svg create mode 100644 src/assets/images/icons-advance-search-document.svg create mode 100644 src/assets/images/icons-advance-search-sender.svg create mode 100644 src/assets/images/icons-arrow-arrow-down-25-copy.svg diff --git a/package-lock.json b/package-lock.json index 0457eeada..45f2fbd6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3328,6 +3328,21 @@ "semver": "^5.4.1" } }, + "angular-tag-cloud-module": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/angular-tag-cloud-module/-/angular-tag-cloud-module-5.2.0.tgz", + "integrity": "sha512-F89pvDWmpy4VHMhw1CN5kSwiGjGhBIXS4ektJZraJTBwjxCf9GsTNiw0mjcMWpuqEIxccxcaN3kIx+Z+wvoV3Q==", + "requires": { + "tslib": "^2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", + "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + } + } + }, "ansi": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", diff --git a/package.json b/package.json index d9347c770..76eb547b7 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@ionic/pwa-elements": "^3.0.1", "@ionic/storage": "^2.3.1", "@logisticinfotech/ionic4-datepicker": "^1.4.4", + "angular-tag-cloud-module": "^5.2.0", "axios": "^0.19.2", "cordova-ios": "6.1.0", "cordova-plugin-camera": "^5.0.1", diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index 002c690a9..0385279ad 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -131,6 +131,8 @@ export class EventsPage implements OnInit { if(this.profile == "mdgpr"){ this.eventService.getAllMdEvents(formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss', 'pt') /* + ' 00:00:00' */, formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => { this.eventsList = res; + console.log(res) + console.log(res[0]) this.currentEvent = res[0].Subject; this.totalEvent = this.eventsList.length; this.showLoader = false; @@ -139,6 +141,8 @@ export class EventsPage implements OnInit { this.eventService.getAllPrEvents(formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 00:00:00', formatDate(new Date(), 'yyyy-MM-dd', 'pt') + ' 23:59:59').subscribe(res => { this.eventsList = res; console.log(this.eventsList); + console.log(res) + console.log(res[0]) this.currentEvent = res[0].Subject; this.totalEvent = this.eventsList.length; this.showLoader = false; diff --git a/src/app/pages/search/search.module.ts b/src/app/pages/search/search.module.ts index aee85ee54..186391f01 100644 --- a/src/app/pages/search/search.module.ts +++ b/src/app/pages/search/search.module.ts @@ -8,12 +8,14 @@ import { SearchPageRoutingModule } from './search-routing.module'; import { SearchPage } from './search.page'; /* import { ComponentsModule } from 'src/app/components/components.module'; */ +import { TagCloudModule } from 'angular-tag-cloud-module'; @NgModule({ imports: [ CommonModule, FormsModule, IonicModule, + TagCloudModule, /* ComponentsModule, */ SearchPageRoutingModule ], diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index 957e14236..65d9a07d8 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -14,15 +14,20 @@
    -
    + +
    +
    + +
    +
    - +
    @@ -45,6 +50,7 @@

    Palavras mais pesquisadas

    +
    @@ -78,3 +84,38 @@
    + + + \ No newline at end of file diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index 377beb5f0..6b30cf9ce 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -227,3 +227,47 @@ } + + +/* Advance search */ +.advance-search{ + padding: 20px 20px; + padding-bottom: 10px; + width: 368px; + background-color: white; + position: absolute; + top: 100px; + left: 22px; + border-radius: 10px; + box-shadow: 0 4px 9px 0 rgba(0, 0, 0, 0.3); + margin-top: 20px; + .icon{ + color: #797979; + width: 45px; + height: 45px; + display: flex; + justify-content: center; + font-size: 25px; + align-items: center; + } + .input-container{ + margin-bottom: 15px; + width: 100%; + border-radius: 5px; + border: solid 1px #ebebeb; + } + .date-container{ + .icon{ + + margin-right: 10px; + } + } + + ion-datetime{ + width: 100%; + } + + .subject-container{ + + } +} diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index b9544efee..5a6b7dbb6 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -5,6 +5,8 @@ import { SearchService } from "../../services/search.service"; import { SearchCategory } from "src/app/models/search-category"; import { SearchDocument } from "src/app/models/search-document"; import { formatDate } from '@angular/common'; +import { CloudData, CloudOptions } from 'angular-tag-cloud-module'; + @Component({ selector: 'app-search', templateUrl: './search.page.html', @@ -14,18 +16,36 @@ export class SearchPage implements OnInit { // https params private searchSubject: string; - private searchDate: string; + private advanceSearchSubject: string; + private searchDocumentDate: string; private searchSender: string; private searchOrganicEntiry: string; private searchDocTypeId: string; searchCategories: SearchCategory[]; searchDocuments: SearchDocument[]; - showDocuments: boolean; + showDocuments = false; + showAdvanceSearch = false; + + + + options: CloudOptions = { + // if width is between 0 and 1 it will be set to the width of the upper element multiplied by the value + width: 1000, + // if height is between 0 and 1 it will be set to the height of the upper element multiplied by the value + height: 400, + overflow: false, + }; + + data: CloudData[] = [ + {text: 'Weight-8-link-color', weight: 8, link: 'https://google.com', color: '#ffaaee'}, + {text: 'Weight-10-link', weight: 10, link: 'https://google.com', tooltip: 'display a tooltip'}, + // ... + ]; constructor(private modalController: ModalController, private search: SearchService) { - this.showDocuments = false; + } ngOnInit() { @@ -35,12 +55,30 @@ export class SearchPage implements OnInit { } /** - * @description get respose from the server + * @description Basic search */ basicSearch(){ // search in API - this.search.basicSearch(this.searchSubject, this.searchDate, this.searchSender + this.search.basicSearch(this.searchSubject, "", "", "", "").subscribe(res=>{ + + // bind respose + this.searchCategories = res.Categories; + this.searchDocuments = res.Documents; + + // hide show document + if(this.searchDocuments.length >= 1){ + this.showDocuments = true; + } else { + this.showDocuments = false + } + + }); + } + + advanceSearch(){ + + this.search.basicSearch(this.advanceSearchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId).subscribe(res=>{ // bind respose @@ -75,4 +113,19 @@ export class SearchPage implements OnInit { return formatDate(date, 'dd/MM/yyyy', 'pt'); } + /** + * @description Clean inputs + */ + showHideAdvanceSearch(show:boolean) { + this.showAdvanceSearch = show; + + /* Clear inputs */ + this.searchDocumentDate = ""; + this.searchSender = ""; + this.searchOrganicEntiry = ""; + this.searchDocTypeId = ""; + this.advanceSearchSubject = ""; + } + + } diff --git a/src/assets/images/advance-search-show-modal.svg b/src/assets/images/advance-search-show-modal.svg new file mode 100644 index 000000000..3a60de7ff --- /dev/null +++ b/src/assets/images/advance-search-show-modal.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/icons-advance-search-document.svg b/src/assets/images/icons-advance-search-document.svg new file mode 100644 index 000000000..820bc7412 --- /dev/null +++ b/src/assets/images/icons-advance-search-document.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/icons-advance-search-sender.svg b/src/assets/images/icons-advance-search-sender.svg new file mode 100644 index 000000000..f3ae89ced --- /dev/null +++ b/src/assets/images/icons-advance-search-sender.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/assets/images/icons-arrow-arrow-down-25-copy.svg b/src/assets/images/icons-arrow-arrow-down-25-copy.svg new file mode 100644 index 000000000..ce99378c5 --- /dev/null +++ b/src/assets/images/icons-arrow-arrow-down-25-copy.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + From cde236d4cae587f13c1790712178990f557c6088 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 16 Jan 2021 17:44:38 +0100 Subject: [PATCH 10/17] Add swipe --- package-lock.json | 6 ++++++ package.json | 1 + src/app/pages/events/events.page.html | 4 ++-- src/app/pages/events/events.page.ts | 5 +++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 45f2fbd6a..3279b6d9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3328,6 +3328,12 @@ "semver": "^5.4.1" } }, + "angular-swipe": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/angular-swipe/-/angular-swipe-0.4.0.tgz", + "integrity": "sha1-wwpyFLEhKIMzIu5ECbM7Ojx0AGc=", + "dev": true + }, "angular-tag-cloud-module": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/angular-tag-cloud-module/-/angular-tag-cloud-module-5.2.0.tgz", diff --git a/package.json b/package.json index 76eb547b7..54bbe4cb2 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", + "angular-swipe": "^0.4.0", "codelyzer": "^5.1.2", "cordova-android": "^9.0.0", "cordova-browser": "^6.0.0", diff --git a/src/app/pages/events/events.page.html b/src/app/pages/events/events.page.html index 9de3185fa..4bbbf63f8 100644 --- a/src/app/pages/events/events.page.html +++ b/src/app/pages/events/events.page.html @@ -2,7 +2,7 @@ - + @@ -17,7 +17,7 @@
    "{{currentEvent}}"
    -
    +
    diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index 0385279ad..4302c5cab 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -76,6 +76,11 @@ export class EventsPage implements OnInit { } + + swipe(){ + console.log('!!!!'); + } + ngOnInit() { //Inicializar segment this.segment = "Combinada"; From 8c4fea8c92bd70a309d0adcb9b2a935293e8e3d6 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 16 Jan 2021 17:45:09 +0100 Subject: [PATCH 11/17] Improve search page --- src/app/pages/search/search-routing.module.ts | 4 + src/app/pages/search/search.page.html | 89 ++++++++++++------- src/app/pages/search/search.page.scss | 11 +-- src/app/pages/search/search.page.ts | 24 ++++- .../search/sender/sender-routing.module.ts | 17 ++++ src/app/pages/search/sender/sender.module.ts | 20 +++++ src/app/pages/search/sender/sender.page.html | 9 ++ src/app/pages/search/sender/sender.page.scss | 0 .../pages/search/sender/sender.page.spec.ts | 24 +++++ src/app/pages/search/sender/sender.page.ts | 21 +++++ src/app/shared/header/header.page.ts | 2 - 11 files changed, 176 insertions(+), 45 deletions(-) create mode 100644 src/app/pages/search/sender/sender-routing.module.ts create mode 100644 src/app/pages/search/sender/sender.module.ts create mode 100644 src/app/pages/search/sender/sender.page.html create mode 100644 src/app/pages/search/sender/sender.page.scss create mode 100644 src/app/pages/search/sender/sender.page.spec.ts create mode 100644 src/app/pages/search/sender/sender.page.ts diff --git a/src/app/pages/search/search-routing.module.ts b/src/app/pages/search/search-routing.module.ts index 0d44f2e14..401249075 100644 --- a/src/app/pages/search/search-routing.module.ts +++ b/src/app/pages/search/search-routing.module.ts @@ -7,6 +7,10 @@ const routes: Routes = [ { path: '', component: SearchPage + }, + { + path: 'sender', + loadChildren: () => import('./sender/sender.module').then( m => m.SenderPageModule) } ]; diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index 65d9a07d8..aa8514512 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -29,6 +29,62 @@ + + + + + + +

    Slide 1

    +
    + +

    Slide 2

    +
    + +

    Slide 3

    +
    + +

    Slide 4

    +
    + +

    Slide 5

    +
    + +

    Slide 6

    +
    + +

    Slide 7

    +
    +
    +
    +
    @@ -86,36 +142,3 @@ - \ No newline at end of file diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index 6b30cf9ce..2b0d1f1b6 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -232,15 +232,8 @@ /* Advance search */ .advance-search{ padding: 20px 20px; - padding-bottom: 10px; - width: 368px; - background-color: white; - position: absolute; - top: 100px; - left: 22px; - border-radius: 10px; - box-shadow: 0 4px 9px 0 rgba(0, 0, 0, 0.3); - margin-top: 20px; + padding-top: 14px; + .icon{ color: #797979; width: 45px; diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 5a6b7dbb6..1b7c67a0e 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -6,6 +6,7 @@ import { SearchCategory } from "src/app/models/search-category"; import { SearchDocument } from "src/app/models/search-document"; import { formatDate } from '@angular/common'; import { CloudData, CloudOptions } from 'angular-tag-cloud-module'; +import { SenderPage } from 'src/app/pages/search/sender/sender.page'; @Component({ selector: 'app-search', @@ -42,7 +43,15 @@ export class SearchPage implements OnInit { {text: 'Weight-10-link', weight: 10, link: 'https://google.com', tooltip: 'display a tooltip'}, // ... ]; - + + // See http://idangero.us/swiper/api/ for valid options. + slideOpts = { + slidesPerView: 3, + initialSlide: 0, + speed: 400, + height: '100px' + } + constructor(private modalController: ModalController, private search: SearchService) { @@ -128,4 +137,17 @@ export class SearchPage implements OnInit { } + async openAdvanceSearchSelection() { + + const modal = await this.modalController.create({ + component: SenderPage, + cssClass: 'sender', + componentProps: { + } + }); + + return await modal.present(); + + } + } diff --git a/src/app/pages/search/sender/sender-routing.module.ts b/src/app/pages/search/sender/sender-routing.module.ts new file mode 100644 index 000000000..07ce353dd --- /dev/null +++ b/src/app/pages/search/sender/sender-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { SenderPage } from './sender.page'; + +const routes: Routes = [ + { + path: '', + component: SenderPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class SenderPageRoutingModule {} diff --git a/src/app/pages/search/sender/sender.module.ts b/src/app/pages/search/sender/sender.module.ts new file mode 100644 index 000000000..d20c632b0 --- /dev/null +++ b/src/app/pages/search/sender/sender.module.ts @@ -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 { SenderPageRoutingModule } from './sender-routing.module'; + +import { SenderPage } from './sender.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + SenderPageRoutingModule + ], + declarations: [SenderPage] +}) +export class SenderPageModule {} diff --git a/src/app/pages/search/sender/sender.page.html b/src/app/pages/search/sender/sender.page.html new file mode 100644 index 000000000..66e06fa57 --- /dev/null +++ b/src/app/pages/search/sender/sender.page.html @@ -0,0 +1,9 @@ + + + Remetentes + + + + + + diff --git a/src/app/pages/search/sender/sender.page.scss b/src/app/pages/search/sender/sender.page.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/pages/search/sender/sender.page.spec.ts b/src/app/pages/search/sender/sender.page.spec.ts new file mode 100644 index 000000000..763d17dc8 --- /dev/null +++ b/src/app/pages/search/sender/sender.page.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { SenderPage } from './sender.page'; + +describe('SenderPage', () => { + let component: SenderPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SenderPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(SenderPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/search/sender/sender.page.ts b/src/app/pages/search/sender/sender.page.ts new file mode 100644 index 000000000..39048617f --- /dev/null +++ b/src/app/pages/search/sender/sender.page.ts @@ -0,0 +1,21 @@ +import { Component, OnInit } from '@angular/core'; +import { ModalController } from '@ionic/angular'; + +@Component({ + selector: 'app-sender', + templateUrl: './sender.page.html', + styleUrls: + ['./sender.page.scss'], +}) +export class SenderPage implements OnInit { + + constructor(private modalController:ModalController) { } + + ngOnInit() { + } + + close(){ + this.modalController.dismiss(); + } + +} diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts index a983f75e9..2476cf83b 100644 --- a/src/app/shared/header/header.page.ts +++ b/src/app/shared/header/header.page.ts @@ -24,6 +24,4 @@ export class HeaderPage implements OnInit { return await modal.present(); } - - } From e75b1e9f399549c1f8c6b9649f9a16e2cadb0198 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 18 Jan 2021 09:52:33 +0100 Subject: [PATCH 12/17] Add response effect in search page --- src/app/pages/search/search.page.html | 4 ++-- src/app/pages/search/search.page.scss | 5 ++++- src/app/pages/search/search.page.ts | 27 +++------------------------ 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index aa8514512..a42600742 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -2,7 +2,7 @@ -
    +
    @@ -18,7 +18,7 @@
    -
    +
    diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index 2b0d1f1b6..e64c1438e 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -2,8 +2,11 @@ padding: 5px 18px; padding-bottom: 2px; padding-top: 25px; + ion-form{ + width: 100%; + padding-right: 10px; + } .search-input-container{ - max-width: 309px; background-color: white; border-radius: 27.5px; border: solid 1px #ebebeb; diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 1b7c67a0e..fa24ab761 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -17,7 +17,6 @@ export class SearchPage implements OnInit { // https params private searchSubject: string; - private advanceSearchSubject: string; private searchDocumentDate: string; private searchSender: string; private searchOrganicEntiry: string; @@ -28,8 +27,6 @@ export class SearchPage implements OnInit { showDocuments = false; showAdvanceSearch = false; - - options: CloudOptions = { // if width is between 0 and 1 it will be set to the width of the upper element multiplied by the value width: 1000, @@ -63,31 +60,13 @@ export class SearchPage implements OnInit { this.modalController.dismiss(); } + /** * @description Basic search */ basicSearch(){ - // search in API - this.search.basicSearch(this.searchSubject, "", "", "", "").subscribe(res=>{ - - // bind respose - this.searchCategories = res.Categories; - this.searchDocuments = res.Documents; - - // hide show document - if(this.searchDocuments.length >= 1){ - this.showDocuments = true; - } else { - this.showDocuments = false - } - - }); - } - - advanceSearch(){ - - this.search.basicSearch(this.advanceSearchSubject, this.searchDocumentDate, this.searchSender + this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId).subscribe(res=>{ // bind respose @@ -133,7 +112,7 @@ export class SearchPage implements OnInit { this.searchSender = ""; this.searchOrganicEntiry = ""; this.searchDocTypeId = ""; - this.advanceSearchSubject = ""; + this.searchSubject = ""; } From ac654811cc3c51db128716e58cd8bb66552139d2 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 18 Jan 2021 10:11:37 +0100 Subject: [PATCH 13/17] Add respnsive effect in search input --- src/app/pages/search/search.page.scss | 3 +++ src/app/pages/search/search.page.ts | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index e64c1438e..cc2f83341 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -19,6 +19,9 @@ font-size: 25px; align-items: center; } + .input-text{ + width: 100%; + } .icon-z{ width: 20px; } diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index fa24ab761..ba0916f9b 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -46,7 +46,9 @@ export class SearchPage implements OnInit { slidesPerView: 3, initialSlide: 0, speed: 400, - height: '100px' + autoHeight: true, + calculateHeight:true, + height: 50 } constructor(private modalController: ModalController, From c4bbbb948ddb4102e1fc39ecdaa74d64632641ed Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 18 Jan 2021 14:59:09 +0100 Subject: [PATCH 14/17] Search page improvve --- src/app/pages/events/events.page.ts | 7 ++ .../search/filter/filter-routing.module.ts | 17 ++++ src/app/pages/search/filter/filter.module.ts | 20 +++++ src/app/pages/search/filter/filter.page.html | 7 ++ src/app/pages/search/filter/filter.page.scss | 0 .../pages/search/filter/filter.page.spec.ts | 24 ++++++ src/app/pages/search/filter/filter.page.ts | 15 ++++ src/app/pages/search/search-routing.module.ts | 4 + src/app/pages/search/search.page.html | 79 ++++++++----------- src/app/pages/search/search.page.scss | 15 +++- src/app/pages/search/search.page.ts | 49 +++++++++--- 11 files changed, 180 insertions(+), 57 deletions(-) create mode 100644 src/app/pages/search/filter/filter-routing.module.ts create mode 100644 src/app/pages/search/filter/filter.module.ts create mode 100644 src/app/pages/search/filter/filter.page.html create mode 100644 src/app/pages/search/filter/filter.page.scss create mode 100644 src/app/pages/search/filter/filter.page.spec.ts create mode 100644 src/app/pages/search/filter/filter.page.ts diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index 4302c5cab..7f0702dcc 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -123,6 +123,13 @@ export class EventsPage implements OnInit { event.target.complete(); } + + sortArrayISODate(myArray: any){ + return myArray.sort(function(a, b) { + return (a.Data < b.Data) ? -1 : ((a.Data > b.Data) ? 1 : 0); + }); + } + onSegmentChange(){ this.RefreshEvents(); } diff --git a/src/app/pages/search/filter/filter-routing.module.ts b/src/app/pages/search/filter/filter-routing.module.ts new file mode 100644 index 000000000..0c4b39cdb --- /dev/null +++ b/src/app/pages/search/filter/filter-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { FilterPage } from './filter.page'; + +const routes: Routes = [ + { + path: '', + component: FilterPage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class FilterPageRoutingModule {} diff --git a/src/app/pages/search/filter/filter.module.ts b/src/app/pages/search/filter/filter.module.ts new file mode 100644 index 000000000..d0da9ea85 --- /dev/null +++ b/src/app/pages/search/filter/filter.module.ts @@ -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 { FilterPageRoutingModule } from './filter-routing.module'; + +import { FilterPage } from './filter.page'; + +@NgModule({ + imports: [ + CommonModule, + FormsModule, + IonicModule, + FilterPageRoutingModule + ], + declarations: [FilterPage] +}) +export class FilterPageModule {} diff --git a/src/app/pages/search/filter/filter.page.html b/src/app/pages/search/filter/filter.page.html new file mode 100644 index 000000000..fae9472e5 --- /dev/null +++ b/src/app/pages/search/filter/filter.page.html @@ -0,0 +1,7 @@ + + Ionic + + + + + \ No newline at end of file diff --git a/src/app/pages/search/filter/filter.page.scss b/src/app/pages/search/filter/filter.page.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/pages/search/filter/filter.page.spec.ts b/src/app/pages/search/filter/filter.page.spec.ts new file mode 100644 index 000000000..ea8b41dfb --- /dev/null +++ b/src/app/pages/search/filter/filter.page.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { IonicModule } from '@ionic/angular'; + +import { FilterPage } from './filter.page'; + +describe('FilterPage', () => { + let component: FilterPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ FilterPage ], + imports: [IonicModule.forRoot()] + }).compileComponents(); + + fixture = TestBed.createComponent(FilterPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/search/filter/filter.page.ts b/src/app/pages/search/filter/filter.page.ts new file mode 100644 index 000000000..64f0350ac --- /dev/null +++ b/src/app/pages/search/filter/filter.page.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-filter', + templateUrl: './filter.page.html', + styleUrls: ['./filter.page.scss'], +}) +export class FilterPage implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/pages/search/search-routing.module.ts b/src/app/pages/search/search-routing.module.ts index 401249075..839ff8092 100644 --- a/src/app/pages/search/search-routing.module.ts +++ b/src/app/pages/search/search-routing.module.ts @@ -11,6 +11,10 @@ const routes: Routes = [ { path: 'sender', loadChildren: () => import('./sender/sender.module').then( m => m.SenderPageModule) + }, + { + path: 'filter', + loadChildren: () => import('./filter/filter.module').then( m => m.FilterPageModule) } ]; diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index a42600742..55ab2697b 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -14,7 +14,7 @@
    - +
    @@ -29,81 +29,70 @@ - + - - - -

    Slide 1

    -
    - -

    Slide 2

    -
    - -

    Slide 3

    -
    - -

    Slide 4

    -
    - -

    Slide 5

    -
    - -

    Slide 6

    -
    - -

    Slide 7

    -
    -
    -
    - -
    +
    -
    -

    {{ category.Name }}

    - {{ category.Qtd }} -
    + + + +
    +

    {{ category.Name }}

    + {{ category.Qtd }} +
    +
    +
    -
    + +
    +
    -
    +
    -

    Palavras mais pesquisadas

    @@ -122,7 +111,7 @@
      -
    • +
    • @@ -139,6 +128,4 @@
    - - - + \ No newline at end of file diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index cc2f83341..8418b4a7e 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -39,6 +39,10 @@ } +ion-slide{ + padding-top: 5px +} + // search result type .options{ margin-top: 10px; @@ -55,14 +59,22 @@ margin: 0px 5px; margin-bottom: 10px; padding: 5px 20px; + height: 100%; + box-sizing: 100%; + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; p{ padding: 0px; margin: 0px; font-family: Roboto; color: #0d89d1; font-size: 15px; + width: 100%; } .label{ + width: 100%; font-family: Roboto; font-size: 13px; font-weight: 300; @@ -256,8 +268,7 @@ border: solid 1px #ebebeb; } .date-container{ - .icon{ - + .icon-mer{ margin-right: 10px; } } diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index ba0916f9b..bf130bee2 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -7,7 +7,6 @@ import { SearchDocument } from "src/app/models/search-document"; import { formatDate } from '@angular/common'; import { CloudData, CloudOptions } from 'angular-tag-cloud-module'; import { SenderPage } from 'src/app/pages/search/sender/sender.page'; - @Component({ selector: 'app-search', templateUrl: './search.page.html', @@ -23,7 +22,10 @@ export class SearchPage implements OnInit { private searchDocTypeId: string; searchCategories: SearchCategory[]; + showSearchDocuments: SearchDocument[]; + showCategory: string; searchDocuments: SearchDocument[]; + showDocuments = false; showAdvanceSearch = false; @@ -46,9 +48,6 @@ export class SearchPage implements OnInit { slidesPerView: 3, initialSlide: 0, speed: 400, - autoHeight: true, - calculateHeight:true, - height: 50 } constructor(private modalController: ModalController, @@ -63,17 +62,26 @@ export class SearchPage implements OnInit { } + sortArrayISODate(myArray: any){ + return myArray.sort(function(a, b) { + return (a.Data < b.Data) ? -1 : ((a.Data > b.Data) ? 1 : 0); + }); + } + /** * @description Basic search */ basicSearch(){ + console.log(this.searchDocumentDate); + this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId).subscribe(res=>{ // bind respose this.searchCategories = res.Categories; - this.searchDocuments = res.Documents; + this.searchDocuments = this.sortArrayISODate(res.Documents); + this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments); // hide show document if(this.searchDocuments.length >= 1){ @@ -82,7 +90,6 @@ export class SearchPage implements OnInit { this.showDocuments = false } - }); } @@ -103,12 +110,24 @@ export class SearchPage implements OnInit { return formatDate(date, 'dd/MM/yyyy', 'pt'); } + + clearInputRemetente(){ + this.searchSender = ""; + } + + clearInputDocumentDate(){ + this.searchDocumentDate = ""; + } + + clearInputOrganicEntity(){ + this.searchOrganicEntiry = ""; + } + /** * @description Clean inputs */ showHideAdvanceSearch(show:boolean) { this.showAdvanceSearch = show; - /* Clear inputs */ this.searchDocumentDate = ""; this.searchSender = ""; @@ -117,7 +136,6 @@ export class SearchPage implements OnInit { this.searchSubject = ""; } - async openAdvanceSearchSelection() { const modal = await this.modalController.create({ @@ -131,4 +149,17 @@ export class SearchPage implements OnInit { } -} + async filterDocList(categoryName:string){ + + // show all category + if(this. showCategory == categoryName ){ + + this.showSearchDocuments = this.searchDocuments; + + } else { // filter category + this.showSearchDocuments = this.searchDocuments.filter((e) => e.DocTypeDesc == categoryName); + } + + this.showCategory = categoryName; + } +} \ No newline at end of file From 285b9ea323e29d33c0da37af6e89a44fd306c0fd Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Mon, 18 Jan 2021 16:24:57 +0100 Subject: [PATCH 15/17] Improve search page --- src/app/services/sender.service.spec.ts | 16 ++++++++++++++++ src/app/services/sender.service.ts | 9 +++++++++ 2 files changed, 25 insertions(+) create mode 100644 src/app/services/sender.service.spec.ts create mode 100644 src/app/services/sender.service.ts diff --git a/src/app/services/sender.service.spec.ts b/src/app/services/sender.service.spec.ts new file mode 100644 index 000000000..383816b4c --- /dev/null +++ b/src/app/services/sender.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { SenderService } from './sender.service'; + +describe('SenderService', () => { + let service: SenderService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(SenderService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/sender.service.ts b/src/app/services/sender.service.ts new file mode 100644 index 000000000..cf50b23db --- /dev/null +++ b/src/app/services/sender.service.ts @@ -0,0 +1,9 @@ +import { Injectable } from '@angular/core'; + +@Injectable({ + providedIn: 'root' +}) +export class SenderService { + + constructor() { } +} From d2fc8338b38a01c7c77f1d0590e0df41f3a380d5 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 19 Jan 2021 16:44:39 +0100 Subject: [PATCH 16/17] Improve search page --- src/app/models/organic-entity.model.spec.ts | 7 + src/app/models/organic-entity.model.ts | 4 + src/app/pages/events/events.page.html | 156 +++++++++--------- src/app/pages/events/events.page.scss | 1 + src/app/pages/events/events.page.ts | 1 + .../organic-entity-routing.module.ts | 17 ++ .../organic-entity/organic-entity.module.ts | 20 +++ .../organic-entity/organic-entity.page.html | 23 +++ .../organic-entity/organic-entity.page.scss | 39 +++++ .../organic-entity.page.spec.ts | 24 +++ .../organic-entity/organic-entity.page.ts | 58 +++++++ src/app/pages/search/search-routing.module.ts | 4 + src/app/pages/search/search.page.html | 5 +- src/app/pages/search/search.page.ts | 41 ++++- src/app/pages/search/sender/sender.page.html | 13 +- src/app/pages/search/sender/sender.page.scss | 15 ++ src/app/pages/search/sender/sender.page.ts | 32 ++-- .../services/organic-entity.service.spec.ts | 16 ++ src/app/services/organic-entity.service.ts | 35 ++++ src/assets/images/icons-arrow-arrow-up.svg | 11 ++ 20 files changed, 421 insertions(+), 101 deletions(-) create mode 100644 src/app/models/organic-entity.model.spec.ts create mode 100644 src/app/models/organic-entity.model.ts create mode 100644 src/app/pages/search/organic-entity/organic-entity-routing.module.ts create mode 100644 src/app/pages/search/organic-entity/organic-entity.module.ts create mode 100644 src/app/pages/search/organic-entity/organic-entity.page.html create mode 100644 src/app/pages/search/organic-entity/organic-entity.page.scss create mode 100644 src/app/pages/search/organic-entity/organic-entity.page.spec.ts create mode 100644 src/app/pages/search/organic-entity/organic-entity.page.ts create mode 100644 src/app/services/organic-entity.service.spec.ts create mode 100644 src/app/services/organic-entity.service.ts create mode 100644 src/assets/images/icons-arrow-arrow-up.svg diff --git a/src/app/models/organic-entity.model.spec.ts b/src/app/models/organic-entity.model.spec.ts new file mode 100644 index 000000000..5149a44f7 --- /dev/null +++ b/src/app/models/organic-entity.model.spec.ts @@ -0,0 +1,7 @@ +import { OrganicEntity } from './organic-entity.model'; + +describe('OrganicEntity', () => { + it('should create an instance', () => { + expect(new OrganicEntity()).toBeTruthy(); + }); +}); diff --git a/src/app/models/organic-entity.model.ts b/src/app/models/organic-entity.model.ts new file mode 100644 index 000000000..bc7b6a6af --- /dev/null +++ b/src/app/models/organic-entity.model.ts @@ -0,0 +1,4 @@ +export class OrganicEntity { + Code: number; + Description: string; +} diff --git a/src/app/pages/events/events.page.html b/src/app/pages/events/events.page.html index 4bbbf63f8..a7d0236f2 100644 --- a/src/app/pages/events/events.page.html +++ b/src/app/pages/events/events.page.html @@ -2,90 +2,96 @@ + + - + + + + - -

    {{customDate}}

    -
    - -

    {{totalEvent}} eventos agendados para hoje

    -
    + + + +

    {{customDate}}

    +
    + +

    {{totalEvent}} eventos agendados para hoje

    +
    -
    -
    {{hoursMinutes}}
    -
    "{{currentEvent}}"
    -
    +
    +
    {{hoursMinutes}}
    +
    "{{currentEvent}}"
    +
    -
    -
    -
    -
    - -
    A sua Agenda
    -
    - - -
    -
    -
      -
    • -
      -
      -
      {{event.StartDate | date: 'hh:mm'}}
      -
      {{event.EndDate | date: 'hh:mm'}}
      -
      -
      -
      {{event.Location}}
      -
      {{event.Subject}}
      -
      -
      -
    • - -
    - +
    +
    + +
    +
    +
    + +
    Correspondência por ler
    +
    + + +
    +
    +
      +
    • +
      +
      +
      {{task.CreateDate | date: 'd/M/yy'}}
      +
      {{task.CreateDate | date: 'hh:mm'}}
      +
      +
      +
      {{ task.Remetente }}
      +
      {{ task.Folio }}
      +
      +
      +
    • + +
    - -->
    - -
    -
    -
    - -
    Correspondência por ler
    -
    - - -
    -
    -
      -
    • -
      -
      -
      {{task.CreateDate | date: 'd/M/yy'}}
      -
      {{task.CreateDate | date: 'hh:mm'}}
      -
      -
      -
      {{ task.Remetente }}
      -
      {{ task.Folio }}
      -
      -
      -
    • - -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/src/app/pages/events/events.page.scss b/src/app/pages/events/events.page.scss index 5df488337..1aa69f087 100644 --- a/src/app/pages/events/events.page.scss +++ b/src/app/pages/events/events.page.scss @@ -394,6 +394,7 @@ ion-toolbar{ } } .schedule-date{ + margin-right: 10px; width: 22%; color: #797979 !important; font-size: 13px; diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index e4fb49600..71ffbf06a 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -292,6 +292,7 @@ export class EventsPage implements OnInit { return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0); }); } + diff --git a/src/app/pages/search/organic-entity/organic-entity-routing.module.ts b/src/app/pages/search/organic-entity/organic-entity-routing.module.ts new file mode 100644 index 000000000..d2d5efc7d --- /dev/null +++ b/src/app/pages/search/organic-entity/organic-entity-routing.module.ts @@ -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 {} diff --git a/src/app/pages/search/organic-entity/organic-entity.module.ts b/src/app/pages/search/organic-entity/organic-entity.module.ts new file mode 100644 index 000000000..00aaf1c2d --- /dev/null +++ b/src/app/pages/search/organic-entity/organic-entity.module.ts @@ -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 {} diff --git a/src/app/pages/search/organic-entity/organic-entity.page.html b/src/app/pages/search/organic-entity/organic-entity.page.html new file mode 100644 index 000000000..084aa573b --- /dev/null +++ b/src/app/pages/search/organic-entity/organic-entity.page.html @@ -0,0 +1,23 @@ + + +
    + +
    + + + Remetentes + +
    + + +
    +
    + +
    +
      +
    • + {{ organicEntity.Description }} +
    • +
    +
    +
    diff --git a/src/app/pages/search/organic-entity/organic-entity.page.scss b/src/app/pages/search/organic-entity/organic-entity.page.scss new file mode 100644 index 000000000..1623ab266 --- /dev/null +++ b/src/app/pages/search/organic-entity/organic-entity.page.scss @@ -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; + } + } + } \ No newline at end of file diff --git a/src/app/pages/search/organic-entity/organic-entity.page.spec.ts b/src/app/pages/search/organic-entity/organic-entity.page.spec.ts new file mode 100644 index 000000000..26fcdc6ae --- /dev/null +++ b/src/app/pages/search/organic-entity/organic-entity.page.spec.ts @@ -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; + + 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(); + }); +}); diff --git a/src/app/pages/search/organic-entity/organic-entity.page.ts b/src/app/pages/search/organic-entity/organic-entity.page.ts new file mode 100644 index 000000000..55e4a521b --- /dev/null +++ b/src/app/pages/search/organic-entity/organic-entity.page.ts @@ -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); + } +} diff --git a/src/app/pages/search/search-routing.module.ts b/src/app/pages/search/search-routing.module.ts index 839ff8092..b12bf9b5b 100644 --- a/src/app/pages/search/search-routing.module.ts +++ b/src/app/pages/search/search-routing.module.ts @@ -15,6 +15,10 @@ const routes: Routes = [ { path: 'filter', loadChildren: () => import('./filter/filter.module').then( m => m.FilterPageModule) + }, + { + path: 'organic-entity', + loadChildren: () => import('./organic-entity/organic-entity.module').then( m => m.OrganicEntityPageModule) } ]; diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index 55ab2697b..abb5201fd 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -61,7 +61,7 @@
    - +
    @@ -106,7 +106,8 @@

    Order por:Mais Recente

    - + +
    diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index bab5bbef7..54cb5ec48 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -7,6 +7,9 @@ import { SearchDocument } from "src/app/models/search-document"; import { formatDate } from '@angular/common'; import { CloudData, CloudOptions } from 'angular-tag-cloud-module'; 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({ selector: 'app-search', templateUrl: './search.page.html', @@ -20,6 +23,7 @@ export class SearchPage implements OnInit { private searchSender: string; private searchOrganicEntiry: string; private searchDocTypeId: string; + private ordinance: string; searchCategories: SearchCategory[]; showSearchDocuments: SearchDocument[]; @@ -52,7 +56,7 @@ export class SearchPage implements OnInit { constructor(private modalController: ModalController, private search: SearchService) { - + this.ordinance = "recent"; } ngOnInit() { @@ -62,6 +66,10 @@ export class SearchPage implements OnInit { } + changeOrder(order: string){ + this.ordinance = order; + } + sortArrayISODate(myArray: any){ return myArray.sort(function(a, b) { return (a.Data < b.Data) ? -1 : ((a.Data > b.Data) ? 1 : 0); @@ -129,12 +137,6 @@ export class SearchPage implements OnInit { */ showHideAdvanceSearch(show:boolean) { this.showAdvanceSearch = show; - /* Clear inputs */ - this.searchDocumentDate = ""; - this.searchSender = ""; - this.searchOrganicEntiry = ""; - this.searchDocTypeId = ""; - this.searchSubject = ""; } 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; + }); } diff --git a/src/app/pages/search/sender/sender.page.html b/src/app/pages/search/sender/sender.page.html index 5164bd49a..928716704 100644 --- a/src/app/pages/search/sender/sender.page.html +++ b/src/app/pages/search/sender/sender.page.html @@ -1,16 +1,21 @@ - + + +
    + +
    + - Remetentes + Remetentes
    - +
      -
    • +
    • {{ contact.Name }}
    diff --git a/src/app/pages/search/sender/sender.page.scss b/src/app/pages/search/sender/sender.page.scss index 7608d29c6..abda67839 100644 --- a/src/app/pages/search/sender/sender.page.scss +++ b/src/app/pages/search/sender/sender.page.scss @@ -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{ padding: 0px 20px; .input-text { diff --git a/src/app/pages/search/sender/sender.page.ts b/src/app/pages/search/sender/sender.page.ts index 1246144d2..be9e73763 100644 --- a/src/app/pages/search/sender/sender.page.ts +++ b/src/app/pages/search/sender/sender.page.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { ModalController } from '@ionic/angular'; import { ContactsService } from 'src/app/services/contacts.service'; import { EventPerson } from 'src/app/models/eventperson.model'; + @Component({ selector: 'app-sender', templateUrl: './sender.page.html', @@ -12,7 +13,8 @@ export class SenderPage implements OnInit { contacts: EventPerson[]; showContacts: EventPerson[]; - + sender: string; + selectedUser: string; constructor(private modalController:ModalController, private ContactsService: ContactsService) { @@ -28,23 +30,29 @@ export class SenderPage implements OnInit { this.contacts = res; }); } + + filterContact(){ - filterContact(findName){ - console.log(findName) - // const persons = this.contacts.filter((person) => { + const findPerson = this.sender.toLowerCase(); + const persons = this.contacts.filter((person) => { - // if (person.Name.indexOf(findName) == 0){ - // return true; - // } + if (person.Name.toLowerCase().indexOf(findPerson) == 0){ + return true; + } - // }); - - // this.showContacts = persons; + }); + this.showContacts = persons; } - close(){ - this.modalController.dismiss(); + selectUser(username:string){ + console.log(username); + this.selectedUser = username; + this.close(this.selectedUser); + } + + close(username: string){ + this.modalController.dismiss(username); } } diff --git a/src/app/services/organic-entity.service.spec.ts b/src/app/services/organic-entity.service.spec.ts new file mode 100644 index 000000000..29bef2e16 --- /dev/null +++ b/src/app/services/organic-entity.service.spec.ts @@ -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(); + }); +}); diff --git a/src/app/services/organic-entity.service.ts b/src/app/services/organic-entity.service.ts new file mode 100644 index 000000000..42f036475 --- /dev/null +++ b/src/app/services/organic-entity.service.ts @@ -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{ + + const geturl = environment.apiURL + 'ecm/organic'; + + let options = { + headers: this.headers, + }; + + return this.http.get(`${geturl}`, options); + } +} diff --git a/src/assets/images/icons-arrow-arrow-up.svg b/src/assets/images/icons-arrow-arrow-up.svg new file mode 100644 index 000000000..cce793713 --- /dev/null +++ b/src/assets/images/icons-arrow-arrow-up.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + From 36e34b21d9320fdb00ebc32515367ee5301e9d93 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Wed, 20 Jan 2021 13:52:25 +0100 Subject: [PATCH 17/17] Improve search page --- package-lock.json | 6 +++--- package.json | 1 + src/app/home/home.page.html | 5 ----- src/app/pages/search/search.page.html | 6 +++--- src/app/pages/search/search.page.scss | 2 +- src/app/pages/search/search.page.ts | 15 +++++++++++++-- src/environments/environment.ts | 2 +- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index c050eb256..79e26565e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3440,9 +3440,9 @@ "dev": true }, "angular-tag-cloud-module": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/angular-tag-cloud-module/-/angular-tag-cloud-module-5.2.0.tgz", - "integrity": "sha512-F89pvDWmpy4VHMhw1CN5kSwiGjGhBIXS4ektJZraJTBwjxCf9GsTNiw0mjcMWpuqEIxccxcaN3kIx+Z+wvoV3Q==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/angular-tag-cloud-module/-/angular-tag-cloud-module-5.2.2.tgz", + "integrity": "sha512-lb/GeK5n0CDH3rjRC7PHBMgRcafc102sovfjyU3W05m9B8JELTDqk6jVEFqiCg+NbLy+zDm7g68Ij7k7LzxmAA==", "requires": { "tslib": "^2.0.0" }, diff --git a/package.json b/package.json index 042c9f13f..bc51da979 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "@ionic/pwa-elements": "^3.0.1", "@ionic/storage": "^2.3.1", "@logisticinfotech/ionic4-datepicker": "^1.4.4", + "angular-tag-cloud-module": "^5.2.2", "cordova-ios": "6.1.0", "cordova-plugin-camera": "^5.0.1", "cordova-plugin-file": "^6.0.2", diff --git a/src/app/home/home.page.html b/src/app/home/home.page.html index 683cde2d8..c227681f4 100644 --- a/src/app/home/home.page.html +++ b/src/app/home/home.page.html @@ -24,15 +24,10 @@ Acções - - - Pesquisa - Chat - --> diff --git a/src/app/pages/search/search.page.html b/src/app/pages/search/search.page.html index bdab410f9..037bd502d 100644 --- a/src/app/pages/search/search.page.html +++ b/src/app/pages/search/search.page.html @@ -76,7 +76,7 @@ -
    +

    {{ category.Name }}

    {{ category.Qtd }}
    @@ -109,8 +109,8 @@

    - - + +
    diff --git a/src/app/pages/search/search.page.scss b/src/app/pages/search/search.page.scss index 8418b4a7e..3262d2a75 100644 --- a/src/app/pages/search/search.page.scss +++ b/src/app/pages/search/search.page.scss @@ -83,7 +83,7 @@ ion-slide{ border-radius: 15px; } - .button:hover{ + .active-category{ background-color: #42b9fe; color: white; p{ diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 0b6bf1c08..ba7165846 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -72,9 +72,9 @@ export class SearchPage implements OnInit { this.ordinance = orderBy; if(this.ordinance == 'recent'){ - this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments); - } else { this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments).reverse(); + } else { + this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments) } } @@ -102,6 +102,8 @@ export class SearchPage implements OnInit { this.searchDocuments = this.sortArrayISODate(res.Documents); + this.reorderList(this.ordinance); + // hide show document if(this.searchDocuments.length >= 1){ this.showDocuments = true; @@ -130,6 +132,15 @@ export class SearchPage implements OnInit { } + activeCategoty(i){ + + this.searchCategories.forEach((e) => { + e['Active'] = false; + }) + + this.searchCategories[i]['Active'] = true; + } + clearInputRemetente(){ this.searchSender = ""; } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 597a17cd2..8792937f1 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { production: false, - apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V3/api/', + apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V3/api/', apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/', domain: 'gabinetedigital.local', defaultuser: 'paulo.pinto',