Skip to content

Commit

Permalink
UIPFU-77 - refine filter group conditional rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Terala-Priyanka committed Jan 19, 2024
1 parent 16e11ee commit 359bca4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/UserSearchContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const compileQuery = template(
);

export function buildQuery(queryParams, pathComponents, resourceData, logger, props) {
const filters = props.initialSelectedUsers ? filterConfigWithUserAssignedStatus : filterConfig;
const updatedResourceData = props.initialSelectedUsers && resourceData?.query?.filters?.includes(UAS) ? updateResourceData(resourceData) : resourceData;
const filters = Object.keys(props.initialSelectedUsers).length ? filterConfigWithUserAssignedStatus : filterConfig;
const updatedResourceData = Object.keys(props.initialSelectedUsers).length && resourceData?.query?.filters?.includes(UAS) ? updateResourceData(resourceData) : resourceData;

return makeQueryFunction(
'cql.allRecords=1',
Expand Down
2 changes: 1 addition & 1 deletion src/UserSearchView.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class UserSearchView extends React.Component {
isSelected = ({ item }) => Boolean(this.state.checkedMap[item.id]);

getFilterConfig = () => {
if (this.props.initialSelectedUsers) {
if (Object.keys(this.props.initialSelectedUsers).length) {
return filterConfigWithUserAssignedStatus;
}
return filterConfig;
Expand Down

0 comments on commit 359bca4

Please sign in to comment.