Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIPFU-77 - refine filter group conditional rendering. #251

Merged
merged 12 commits into from
Jan 19, 2024
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
Loading