Skip to content

Commit

Permalink
Javascript error when searching applications
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Feb 13, 2024
1 parent 2deeb98 commit 5ebfae1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions client/src/components/Entities.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import {isEmpty} from "../utils/Utils";
import {sortObjects, valueForSort} from "../utils/Sort";
import {headerIcon} from "../utils/Forms";
import "./Entities.scss";
import {Button, Loader, Tooltip} from "@surfnet/sds";

import {Pagination} from "@surfnet/sds";
import {Button, Loader, Pagination, Tooltip} from "@surfnet/sds";
import {pageCount} from "../utils/Pagination";
import {useNavigate} from "react-router-dom";

Expand Down Expand Up @@ -117,13 +115,10 @@ export const Entities = ({
return entities;
}
const queryLower = newQuery.toLowerCase();
return entities.filter(entity => {
return searchAttributes.some(attr => {
return entities.filter(entity => searchAttributes.some(attr => {
const val = valueForSort(attr, entity);
return val.toLowerCase().indexOf(queryLower) > -1
});
});

return isEmpty(val) ? false : val.toLowerCase().indexOf(queryLower) > -1
}));
};

const setSortedKey = key => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/tabs/Applications.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Applications = () => {
role.logo = providerLogoById(role.applicationMaps, providers);
role.provider = providerById(role.applicationMaps, providers);
role.provisioning = provisioningsByProviderId(role.applicationMaps, provisionings);
})
});
setRoles(res[1]);
setLoading(false);
})
Expand Down

0 comments on commit 5ebfae1

Please sign in to comment.