Skip to content

Commit

Permalink
fix: change program in search
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikhaugstulen committed Aug 14, 2023
1 parent 72ac535 commit 261d312
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ import { getSearchGroups } from './getSearchGroups';
import { getTrackedEntityTypeThrowIfNotFound } from '../../../../../metaData';

const mapStateToProps = (state: ReduxState, props: OwnProps) => {
const { selectedProgramId, selectedTrackedEntityTypeId } = props;
const searchGroups = getSearchGroups(selectedTrackedEntityTypeId, selectedProgramId);
const { name } = getTrackedEntityTypeThrowIfNotFound(selectedTrackedEntityTypeId);
const currentTeiSearch = state.teiSearch[props.id] ?? {};
const { selectedTrackedEntityTypeId } = props;
const searchGroups = getSearchGroups(selectedTrackedEntityTypeId, currentTeiSearch.selectedProgramId);
const { name } = getTrackedEntityTypeThrowIfNotFound(selectedTrackedEntityTypeId);
return {
searchGroups,
showResults: !!currentTeiSearch.searchResults,
openSearchGroupSection: currentTeiSearch.openSearchGroupSection,
trackedEntityTypeName: name.toLowerCase(),
selectedProgramId: currentTeiSearch.selectedProgramId,
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type PropsFromRedux = {|
showResults?: ?boolean,
openSearchGroupSection: ?string,
trackedEntityTypeName: string,
selectedProgramId: ?string,
|}

type DispatchersFromRedux = {|
Expand All @@ -22,7 +23,6 @@ export type OwnProps = {|
getResultsView: Function,
resultsPageSize: number,
selectedTrackedEntityTypeId: string,
selectedProgramId: ?string,
|}

export type Props = {| ...OwnProps, ...DispatchersFromRedux, ...PropsFromRedux, ...CssClasses |}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ export const TrackedEntityRelationshipsWrapper = ({
<TeiSearch
resultsPageSize={5}
id="relationshipTeiSearchWidget"
selectedProgramId={searchProgramId}
selectedTrackedEntityTypeId={searchTrackedEntityTypeId}
getResultsView={viewProps => (
<TeiRelationshipSearchResults
Expand Down

0 comments on commit 261d312

Please sign in to comment.