File tree 4 files changed +16
-5
lines changed
packages/fhir-group-management/src/components/CommodityList/Eusm
4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ describe('App - authenticated', () => {
242
242
`${ LIST_COMMODITY_URL } ?${ viewDetailsQuery } =1`
243
243
) ;
244
244
wrapper . update ( ) ;
245
- expect ( wrapper . find ( 'ViewDetails ' ) ) . toHaveLength ( 1 ) ;
245
+ expect ( wrapper . find ( 'ViewDetailsWrapper ' ) ) . toHaveLength ( 1 ) ;
246
246
247
247
// go to new resource page
248
248
( wrapper . find ( 'Router' ) . prop ( 'history' ) as RouteComponentProps [ 'history' ] ) . push (
Original file line number Diff line number Diff line change @@ -44,3 +44,5 @@ export const ENABLE_QUEST = true;
44
44
export const BACKEND_ACTIVE = false ;
45
45
46
46
export const ENABLE_FHIR_USER_MANAGEMENT = true ;
47
+
48
+ export const COMMODITIES_LIST_RESOURCE_ID = 'ad' ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
12
12
import { TFunction } from '@opensrp/i18n' ;
13
13
import { useSearchParams , viewDetailsQuery } from '@opensrp/react-utils' ;
14
14
import { supplyMgSnomedCode , snomedCodeSystem } from '../../../helpers/utils' ;
15
- import { useUserRole } from '@opensrp/rbac' ;
15
+ import { RbacCheck , useUserRole } from '@opensrp/rbac' ;
16
16
import { ViewDetailsWrapper } from './ViewDetails' ;
17
17
18
18
interface GroupListProps {
@@ -90,9 +90,14 @@ export const EusmCommodityList = (props: GroupListProps) => {
90
90
// eslint-disable-next-line react/display-name
91
91
render : ( _ : unknown , record : TableData ) => (
92
92
< span className = "d-flex align-items-center" >
93
- < Link to = { `${ ADD_EDIT_COMMODITY_URL } /${ record . id } ` } className = "m-0 p-1" >
94
- { t ( 'Edit' ) }
95
- </ Link >
93
+ < RbacCheck permissions = { [ 'Group.update' ] } >
94
+ < >
95
+ < Link to = { `${ ADD_EDIT_COMMODITY_URL } /${ record . id } ` } className = "m-0 p-1" >
96
+ { t ( 'Edit' ) }
97
+ </ Link >
98
+ < Divider type = "vertical" />
99
+ </ >
100
+ </ RbacCheck >
96
101
< Divider type = "vertical" />
97
102
< Dropdown
98
103
menu = { { items : getItems ( record ) } }
Original file line number Diff line number Diff line change @@ -269,6 +269,10 @@ exports[`renders correctly when listing resources: table row 1 page 1 6`] = `
269
269
class = " ant-divider css-dev-only-do-not-override-k7429z ant-divider-vertical"
270
270
role = " separator"
271
271
/>
272
+ <div
273
+ class = " ant-divider css-dev-only-do-not-override-k7429z ant-divider-vertical"
274
+ role = " separator"
275
+ />
272
276
<span
273
277
aria-label = " more"
274
278
class = " anticon anticon-more ant-dropdown-trigger more-options"
You can’t perform that action at this time.
0 commit comments