File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed
app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits
LocalUnitsTable/LocalUnitTableActions Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " go-web-app " : patch
3+ ---
4+
5+ Hide add/edit local units on production environmet
Original file line number Diff line number Diff line change 77import { resolveToString } from '@ifrc-go/ui/utils' ;
88
99import DropdownMenuItem from '#components/DropdownMenuItem' ;
10+ import { environment } from '#config' ;
1011import usePermissions from '#hooks/domain/usePermissions' ;
1112import useAlert from '#hooks/useAlert' ;
1213import {
@@ -102,14 +103,16 @@ function LocalUnitsTableActions(props: Props) {
102103 >
103104 { strings . localUnitsView }
104105 </ DropdownMenuItem >
105- < DropdownMenuItem
106- type = "button"
107- name = { localUnitId }
108- onClick = { setShowLocalUnitEditModalTrue }
109- disabled = { ! hasValidatePermission }
110- >
111- { strings . localUnitsEdit }
112- </ DropdownMenuItem >
106+ { environment !== 'production' && (
107+ < DropdownMenuItem
108+ type = "button"
109+ name = { localUnitId }
110+ onClick = { setShowLocalUnitEditModalTrue }
111+ disabled = { ! hasValidatePermission }
112+ >
113+ { strings . localUnitsEdit }
114+ </ DropdownMenuItem >
115+ ) }
113116 < DropdownMenuItem
114117 persist
115118 // NOTE sending an empty post request to validate the local unit
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
2525 isNotDefined ,
2626} from '@togglecorp/fujs' ;
2727
28+ import { environment } from '#config' ;
2829import useAuth from '#hooks/domain/useAuth' ;
2930import usePermissions from '#hooks/domain/usePermissions' ;
3031import { CountryOutletContext } from '#utils/outletContext' ;
@@ -117,7 +118,8 @@ function NationalSocietyLocalUnits(props: Props) {
117118 < Tab name = "table" > { strings . localUnitsListView } </ Tab >
118119 </ TabList >
119120 ) }
120- actions = { hasAddLocalUnitPermission && (
121+ // NOTE: disable local units add/edit for now
122+ actions = { hasAddLocalUnitPermission && ( environment !== 'production' ) && (
121123 < Button
122124 name = { undefined }
123125 variant = "secondary"
You can’t perform that action at this time.
0 commit comments