Skip to content

Commit 38e7d9e

Browse files
feat: Added SimpleAccessControlFilter component -- ERM-3783 (#1477)
refs ERM-3783
1 parent 086c5a3 commit 38e7d9e

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"rxjs": "^6.6.3"
4646
},
4747
"dependencies": {
48-
"@k-int/stripes-kint-components": "^5.26.0",
48+
"@k-int/stripes-kint-components": "^5.27.0",
4949
"@rehooks/local-storage": "^2.4.4",
5050
"compose-function": "^3.0.3",
5151
"final-form": "^4.18.4",

src/components/AgreementFilters/AgreementFilters.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ import {
2020
DocumentFilter,
2121
InternalContactSelection,
2222
OrganizationSelection,
23+
SimpleAccessControlFilter
2324
} from '@folio/stripes-erm-components';
2425

2526
import { CustomPropertiesFilter } from '@k-int/stripes-kint-components';
2627

2728
import AgreementContentFilter from '../AgreementContentFilter';
28-
import { CUSTPROP_ENDPOINT } from '../../constants';
29+
import { AGREEMENTS_ACCESSCONTROL_ENDPOINT, CUSTPROP_ENDPOINT } from '../../constants';
2930

3031
const propTypes = {
3132
activeFilters: PropTypes.object,
@@ -384,9 +385,20 @@ const AgreementFilters = ({
384385
/>;
385386
};
386387

388+
const renderAccessControlFilter = () => {
389+
return (
390+
<SimpleAccessControlFilter
391+
accessControlEndpoint={AGREEMENTS_ACCESSCONTROL_ENDPOINT}
392+
activeFilters={activeFilters}
393+
filterHandlers={filterHandlers}
394+
/>
395+
);
396+
};
397+
387398
return (
388399
<AccordionSet>
389400
{renderCheckboxFilter('agreementStatus')}
401+
{renderAccessControlFilter()}
390402
{renderMultiSelectFilter('reasonForClosure')}
391403
{renderCheckboxFilter('renewalPriority', { closedByDefault: true })}
392404
{renderCheckboxFilter('isPerpetual', { closedByDefault: true })}

src/routes/AgreementsRoute/AgreementsRoute.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
getRefdataValuesByDesc,
88
useTags,
99
useSASQQIndex,
10+
POLICIES_FILTER_CONFIG,
1011
} from '@folio/stripes-erm-components';
1112

1213
import {
@@ -85,6 +86,9 @@ const AgreementsRoute = ({ children, history, location, match }) => {
8586
{
8687
/* There were problems with using truthiness ?? on an empty string '' */
8788
searchKey,
89+
filterConfig: [
90+
POLICIES_FILTER_CONFIG
91+
],
8892
filterKeys: {
8993
agreementContentType: 'agreementContentTypes.contentType.value',
9094
agreementStatus: 'agreementStatus.value',

0 commit comments

Comments
 (0)