-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in feature/SHIBUI-280 (pull request #4)
SHIBUI-334 Stubbed out filter page, added new filter dropdown Approved-by: Jodie Muramoto <jmuramoto@unicon.net> Approved-by: Ryan Mathis <rmathis@unicon.net>
- Loading branch information
Showing
13 changed files
with
247 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| @import '../theme/palette'; | ||
| nav.navbar { | ||
| background-color: $white; | ||
|
|
||
| .dropdown-menu { | ||
| min-width: 12rem; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { Action } from '@ngrx/store'; | ||
|
|
||
| export const QUERY_ENTITY_IDS = '[Filter] Query Entity Ids'; | ||
|
|
||
| export class QueryEntityIds implements Action { | ||
| readonly type = QUERY_ENTITY_IDS; | ||
|
|
||
| constructor(public payload: string[]) { } | ||
| } | ||
|
|
||
| export type Actions = | ||
| | QueryEntityIds; |
17 changes: 17 additions & 0 deletions
17
ui/src/app/metadata-filter/container/new-filter.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <div class="container-fluid p-3" role="main"> | ||
| <section class="section"> | ||
| <div class="section-header bg-info p-2 text-light"> | ||
| <div class="row justify-content-between"> | ||
| <div class="col-md-12"> | ||
| <span class="display-6"> | ||
| <i class="fa fa-gears"></i> | ||
| <ng-container i18n="@@label--new-filter">New Filter</ng-container> | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="section-body p-4 border border-top-0 border-info"> | ||
| Body | ||
| </div> | ||
| </section> | ||
| </div> |
36 changes: 36 additions & 0 deletions
36
ui/src/app/metadata-filter/container/new-filter.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { TestBed, ComponentFixture } from '@angular/core/testing'; | ||
| import { ReactiveFormsModule } from '@angular/forms'; | ||
| import { StoreModule, Store, combineReducers } from '@ngrx/store'; | ||
| import { NewFilterComponent } from './new-filter.component'; | ||
| import * as fromFilter from '../reducer'; | ||
|
|
||
| describe('New Metadata Filter Page', () => { | ||
| let fixture: ComponentFixture<NewFilterComponent>; | ||
| let store: Store<fromFilter.State>; | ||
| let instance: NewFilterComponent; | ||
|
|
||
| beforeEach(() => { | ||
| TestBed.configureTestingModule({ | ||
| providers: [], | ||
| imports: [ | ||
| StoreModule.forRoot({ | ||
| providers: combineReducers(fromFilter.reducers), | ||
| }), | ||
| ReactiveFormsModule | ||
| ], | ||
| declarations: [NewFilterComponent], | ||
| }); | ||
|
|
||
| fixture = TestBed.createComponent(NewFilterComponent); | ||
| instance = fixture.componentInstance; | ||
| store = TestBed.get(Store); | ||
|
|
||
| spyOn(store, 'dispatch').and.callThrough(); | ||
| }); | ||
|
|
||
| it('should compile', () => { | ||
| fixture.detectChanges(); | ||
|
|
||
| expect(fixture).toBeDefined(); | ||
| }); | ||
| }); |
18 changes: 18 additions & 0 deletions
18
ui/src/app/metadata-filter/container/new-filter.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { Component } from '@angular/core'; | ||
| import { Store } from '@ngrx/store'; | ||
|
|
||
| import * as fromFilter from '../reducer'; | ||
|
|
||
| @Component({ | ||
| selector: 'new-filter-page', | ||
| templateUrl: './new-filter.component.html' | ||
| }) | ||
| export class NewFilterComponent { | ||
| constructor( | ||
| private store: Store<fromFilter.State> | ||
| ) {} | ||
|
|
||
| save(): void {} | ||
|
|
||
| cancel(): void {} | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { NgModule } from '@angular/core'; | ||
| import { RouterModule, Routes } from '@angular/router'; | ||
| import { CommonModule } from '@angular/common'; | ||
| import { ReactiveFormsModule } from '@angular/forms'; | ||
| import { StoreModule } from '@ngrx/store'; | ||
| import { EffectsModule } from '@ngrx/effects'; | ||
|
|
||
| import { NewFilterComponent } from './container/new-filter.component'; | ||
| import { reducers } from './reducer'; | ||
|
|
||
| export const routes: Routes = [ | ||
| { | ||
| path: 'new', | ||
| component: NewFilterComponent, | ||
| canActivate: [] | ||
| } | ||
| ]; | ||
|
|
||
| @NgModule({ | ||
| declarations: [ | ||
| NewFilterComponent | ||
| ], | ||
| entryComponents: [], | ||
| imports: [ | ||
| CommonModule, | ||
| RouterModule, | ||
| ReactiveFormsModule, | ||
| StoreModule.forFeature('metadata-filter', reducers), | ||
| EffectsModule.forFeature([]), | ||
| RouterModule.forChild(routes) | ||
| ], | ||
| providers: [] | ||
| }) | ||
| export class FilterModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { createSelector, createFeatureSelector } from '@ngrx/store'; | ||
| import { MetadataProvider } from '../../metadata-provider/model/metadata-provider'; | ||
| import * as filter from '../action/filter.action'; | ||
| import * as fromRoot from '../../core/reducer'; | ||
|
|
||
| export interface FilterState { | ||
| entityIds: string[]; | ||
| } | ||
|
|
||
| export const initialState: FilterState = { | ||
| entityIds: [] | ||
| }; | ||
|
|
||
| export function reducer(state = initialState, action: filter.Actions): FilterState { | ||
| switch (action.type) { | ||
| default: { | ||
| return state; | ||
| } | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { createSelector, createFeatureSelector } from '@ngrx/store'; | ||
| import * as fromRoot from '../../core/reducer'; | ||
| import * as fromFilter from './filter.reducer'; | ||
|
|
||
| export interface FilterState { | ||
| filter: fromFilter.FilterState; | ||
| } | ||
|
|
||
| export const reducers = { | ||
| filter: fromFilter.reducer | ||
| }; | ||
|
|
||
| export interface State extends fromRoot.State { | ||
| 'metadata-filter': FilterState; | ||
| } | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters