-
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-293 (pull request #19)
SHIBUI-293 Updated autocomplete for async searching
- Loading branch information
Showing
40 changed files
with
814 additions
and
354 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 was deleted.
Oops, something went wrong.
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,14 @@ | ||
import * as actions from './filter.action'; | ||
|
||
describe('Filter Actions', () => { | ||
it('should provide actions', () => { | ||
expect(new actions.CancelCreateFilter().type).toBe(actions.CANCEL_CREATE_FILTER); | ||
expect(new actions.CancelViewMore().type).toBe(actions.CANCEL_VIEW_MORE); | ||
expect(new actions.LoadEntityIds('foo').type).toBe(actions.LOAD_ENTITY_IDS); | ||
expect(new actions.LoadEntityIdsSuccess([]).type).toBe(actions.LOAD_ENTITY_IDS_SUCCESS); | ||
expect(new actions.LoadEntityIdsError(new Error('Foobar!')).type).toBe(actions.LOAD_ENTITY_IDS_ERROR); | ||
expect(new actions.ViewMoreIds([]).type).toBe(actions.VIEW_MORE_IDS); | ||
expect(new actions.SelectId('foo').type).toBe(actions.SELECT_ID); | ||
expect(new actions.QueryEntityIds([]).type).toBe(actions.QUERY_ENTITY_IDS); | ||
}); | ||
}); |
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,65 @@ | ||
import { Action } from '@ngrx/store'; | ||
|
||
export const QUERY_ENTITY_IDS = '[Filter] Query Entity Ids'; | ||
export const VIEW_MORE_IDS = '[Filter] View More Ids Modal'; | ||
export const CANCEL_VIEW_MORE = '[Filter] Cancel View More'; | ||
export const SELECT_ID = '[Filter] Select Entity ID'; | ||
export const CANCEL_CREATE_FILTER = '[Filter] Cancel Create Filter'; | ||
|
||
export const LOAD_ENTITY_IDS = '[Entity ID Collection] Load Entity Ids'; | ||
export const LOAD_ENTITY_IDS_SUCCESS = '[Entity ID Collection] Load Entity Ids Success'; | ||
export const LOAD_ENTITY_IDS_ERROR = '[Entity ID Collection] Load Entity Ids Error'; | ||
|
||
export class QueryEntityIds implements Action { | ||
readonly type = QUERY_ENTITY_IDS; | ||
|
||
constructor(public payload: string[]) { } | ||
} | ||
|
||
export class CancelCreateFilter implements Action { | ||
readonly type = CANCEL_CREATE_FILTER; | ||
} | ||
|
||
export class ViewMoreIds implements Action { | ||
readonly type = VIEW_MORE_IDS; | ||
|
||
constructor(public payload: string[]) {} | ||
} | ||
|
||
export class CancelViewMore implements Action { | ||
readonly type = CANCEL_VIEW_MORE; | ||
} | ||
|
||
export class SelectId implements Action { | ||
readonly type = SELECT_ID; | ||
|
||
constructor(public payload: string) { } | ||
} | ||
|
||
export class LoadEntityIds implements Action { | ||
readonly type = LOAD_ENTITY_IDS; | ||
|
||
constructor(public payload: string) { } | ||
} | ||
|
||
export class LoadEntityIdsSuccess implements Action { | ||
readonly type = LOAD_ENTITY_IDS_SUCCESS; | ||
|
||
constructor(public payload: string[]) { } | ||
} | ||
|
||
export class LoadEntityIdsError implements Action { | ||
readonly type = LOAD_ENTITY_IDS_ERROR; | ||
|
||
constructor(public payload: Error) { } | ||
} | ||
|
||
export type Actions = | ||
| ViewMoreIds | ||
| CancelViewMore | ||
| CancelCreateFilter | ||
| SelectId | ||
| LoadEntityIds | ||
| LoadEntityIdsSuccess | ||
| LoadEntityIdsError | ||
| QueryEntityIds; |
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
ui/src/app/metadata-filter/component/search-dialog.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,16 @@ | ||
<div class="modal-header"> | ||
<h4 class="modal-title">Heading</h4> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="activeModal.dismiss()"> | ||
<span aria-hidden="true">×</span> | ||
</button> | ||
</div> | ||
<div class="modal-body"> | ||
Body | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-primary" (click)="activeModal.close('https://account.example.com/sso')"> | ||
<i class="fa fa-save"></i> | ||
Select ID | ||
</button> | ||
<button type="button" class="btn btn-secondary" (click)="activeModal.dismiss()" i18n="@@action--cancel">Cancel</button> | ||
</div> |
39 changes: 39 additions & 0 deletions
39
ui/src/app/metadata-filter/component/search-dialog.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,39 @@ | ||
import { TestBed, ComponentFixture } from '@angular/core/testing'; | ||
import { ReactiveFormsModule, FormBuilder } from '@angular/forms'; | ||
import { NgbModalModule, NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | ||
import { StoreModule, Store, combineReducers } from '@ngrx/store'; | ||
import { SearchDialogComponent } from './search-dialog.component'; | ||
import { NgbActiveModalStub } from '../../../testing/modal.stub'; | ||
import * as fromFilter from '../reducer'; | ||
|
||
describe('Search Dialog', () => { | ||
let fixture: ComponentFixture<SearchDialogComponent>; | ||
let instance: SearchDialogComponent; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
providers: [ | ||
{ provide: NgbActiveModal, useClass: NgbActiveModalStub } | ||
], | ||
imports: [ | ||
ReactiveFormsModule, | ||
NgbModalModule, | ||
StoreModule.forRoot({ | ||
'metadata-filter': combineReducers(fromFilter.reducers), | ||
}), | ||
], | ||
declarations: [ | ||
SearchDialogComponent | ||
], | ||
}); | ||
|
||
fixture = TestBed.createComponent(SearchDialogComponent); | ||
instance = fixture.componentInstance; | ||
}); | ||
|
||
it('should compile', () => { | ||
fixture.detectChanges(); | ||
|
||
expect(fixture).toBeDefined(); | ||
}); | ||
}); |
27 changes: 27 additions & 0 deletions
27
ui/src/app/metadata-filter/component/search-dialog.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,27 @@ | ||
import { Component, OnChanges, OnInit } from '@angular/core'; | ||
import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import { Store } from '@ngrx/store'; | ||
|
||
import * as fromFilter from '../reducer'; | ||
|
||
@Component({ | ||
selector: 'search-dialog', | ||
templateUrl: './search-dialog.component.html' | ||
}) | ||
export class SearchDialogComponent implements OnInit, OnChanges { | ||
constructor( | ||
public activeModal: NgbActiveModal, | ||
private store: Store<fromFilter.State> | ||
) { | ||
// console.log(activeModal); | ||
} | ||
|
||
ngOnChanges(): void { | ||
|
||
} | ||
|
||
ngOnInit(): void { | ||
|
||
} | ||
} /* istanbul ignore next */ |
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
Oops, something went wrong.