Skip to content

Commit

Permalink
SHIBUI-736 Fixed bug with resolvers not appearing on dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Aug 7, 2018
1 parent 903b7e0 commit 8c6e0d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
15 changes: 6 additions & 9 deletions ui/src/app/metadata/manager/effect/search.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ import { FileBackedHttpMetadataResolver } from '../../domain/entity';

@Injectable()
export class SearchEffects {
@Effect()
filter$ = this.actions$.pipe(
ofType<entitySearch.FilterAction>(entitySearch.ENTITY_FILTER),
switchMap(() => this.performSearch())
);

@Effect()
search$ = this.actions$.pipe(
ofType<entitySearch.SearchAction>(entitySearch.ENTITY_SEARCH),
Expand All @@ -45,9 +39,12 @@ export class SearchEffects {
),
combineLatest(
this.store.select(fromManager.getSearchQuery),
(entities, term) => entities.filter(
e => this.matcher(e.name, term) || this.matcher(e.entityId, term)
)
(entities, term) => {
const filtered = entities.filter(
e => this.matcher(e.name, term) || this.matcher(e.entityId, term)
);
return filtered;
}
),
map(entities => new entitySearch.SearchCompleteAction(entities))
);
Expand Down
5 changes: 0 additions & 5 deletions ui/src/app/metadata/manager/reducer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@ export const getSearchResults = createSelector(
getSearchState,
fromSearch.getEntities
);

export const getSearchQuery = createSelector(
getSearchState,
fromSearch.getQuery
);
export const getFilterType = createSelector(
getSearchState,
fromSearch.getFilter
);
export const getSearchLoading = createSelector(
getSearchState,
fromSearch.getLoading
Expand Down
14 changes: 9 additions & 5 deletions ui/src/app/metadata/manager/reducer/search.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ export interface SearchState {
entities: MetadataEntity[];
loading: boolean;
query: string;
kind: string;
}

const initialState: SearchState = {
entities: [],
loading: false,
query: '',
kind: 'all'
query: ''
};

export function reducer(state = initialState, action: searchActions.Actions): SearchState {
Expand All @@ -25,6 +23,14 @@ export function reducer(state = initialState, action: searchActions.Actions): Se
};
}

case searchActions.ENTITY_SEARCH_COMPLETE: {
return {
entities: action.payload,
loading: false,
query: state.query
};
}

default: {
return state;
}
Expand All @@ -36,5 +42,3 @@ export const getEntities = (state: SearchState) => state.entities;
export const getQuery = (state: SearchState) => state.query;

export const getLoading = (state: SearchState) => state.loading;

export const getFilter = (state: SearchState) => state.kind;

0 comments on commit 8c6e0d6

Please sign in to comment.