diff options
author | 2019-11-27 15:04:18 +0200 | |
---|---|---|
committer | 2019-11-27 15:04:18 +0200 | |
commit | eea49075a4a8bb62a5a15ec31adfe52e1f1f3b7a (patch) | |
tree | d0c8e90ba9ce30262e72b86873c8fde5ff60605c /cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages | |
parent | 341db21b2ac0a14a1ed2b8bf7930914dda054bfe (diff) |
filter packages by tag
rename filter-by-keyword to search-by-packages
Issue-ID: CCSDK-1968
Issue-ID: CCSDK-1951
Signed-off-by: Ahmed Abbas <ahmad.helmy@orange.com>
Change-Id: I4667f2b9e98ba7e217ba7ab15e5cd8c45bee0c33
Diffstat (limited to 'cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages')
4 files changed, 54 insertions, 0 deletions
diff --git a/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.css b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.css new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.css diff --git a/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.html b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.html new file mode 100644 index 000000000..e7c605fd1 --- /dev/null +++ b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.html @@ -0,0 +1,4 @@ +<div class="searchBox"> + <input class="searchInput" [ngClass]="{'searchBox-expanded': searchQuery}" (input)="searchPackages($event)" type="text" name="" placeholder="Search packages"> + <button class="searchButton" href="#"></button> +</div>
\ No newline at end of file diff --git a/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.spec.ts b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.spec.ts new file mode 100644 index 000000000..7e50c55cc --- /dev/null +++ b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PackagesSearchComponent } from './search-by-packages.component'; + +describe('PackagesSearchComponent', () => { + let component: PackagesSearchComponent; + let fixture: ComponentFixture<PackagesSearchComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PackagesSearchComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PackagesSearchComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.ts b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.ts new file mode 100644 index 000000000..91304e5c2 --- /dev/null +++ b/cds-ui/client-frankfurt/src/app/modules/feature-modules/packages/packages-dashboard/search-by-packages/search-by-packages.component.ts @@ -0,0 +1,25 @@ +import {Component, OnInit} from '@angular/core'; +import {PackagesStore} from '../../packages.store'; + +@Component({ + selector: 'app-packages-search', + templateUrl: './search-by-packages.component.html', + styleUrls: ['./search-by-packages.component.css'] +}) +export class PackagesSearchComponent implements OnInit { + + private searchQuery = ''; + + constructor(private packagesStore: PackagesStore) { + } + + ngOnInit() { + } + + + searchPackages(event: any) { + this.searchQuery = event.target.value; + this.searchQuery = this.searchQuery.trim(); + this.packagesStore.search(this.searchQuery); + } +} |