@@ -12,6 +12,7 @@ import { Button, ButtonDelete, ButtonMenu } from '@webapp/components'
1212
1313import { NodeDefEntitySelectorDialog } from './nodeDefEntitySelectorDialog'
1414import { NodeDefConversionDialog } from './nodeDefConversionDialog'
15+ import { useSystemConfigExperimentalFeatures } from '@webapp/store/system'
1516
1617const actionsWithEntitySelection = { clone : 'clone' , move : 'move' }
1718
@@ -39,7 +40,8 @@ const isEntitySelectableByAction = {
3940}
4041
4142const availabilityByAction = {
42- [ actionsWithEntitySelection . clone ] : ( ) => true ,
43+ [ actionsWithEntitySelection . clone ] : ( { nodeDef, experimentalFeatures } ) =>
44+ experimentalFeatures || NodeDef . isAttribute ( nodeDef ) ,
4345 [ actionsWithEntitySelection . move ] : ( { survey, cycle, nodeDef } ) => {
4446 // published node defs cannot be moved
4547 if ( NodeDef . isPublished ( nodeDef ) ) return false
@@ -71,6 +73,7 @@ export const NodeDefEditButtonsMenu = (props) => {
7173 const dispatch = useDispatch ( )
7274 const navigate = useNavigate ( )
7375
76+ const experimentalFeatures = useSystemConfigExperimentalFeatures ( )
7477 const survey = useSurvey ( )
7578 const cycle = useSurveyCycleKey ( )
7679 const lang = useSurveyPreferredLang ( )
@@ -129,7 +132,7 @@ export const NodeDefEditButtonsMenu = (props) => {
129132 const _menuItems = [ ]
130133 // items with entity selection (clone or move actions)
131134 const availableActions = Object . keys ( actionsWithEntitySelection ) . filter ( ( action ) =>
132- availabilityByAction [ action ] ( { survey, cycle, nodeDef } )
135+ availabilityByAction [ action ] ( { survey, cycle, nodeDef, experimentalFeatures } )
133136 )
134137 _menuItems . push (
135138 ...availableActions . map ( ( action ) => ( {
@@ -180,7 +183,16 @@ export const NodeDefEditButtonsMenu = (props) => {
180183 } )
181184 }
182185 return _menuItems
183- } , [ cycle , dispatch , nodeDef , nodeDefLabel , openConvertIntoDialog , openEntitySelectDialog , survey ] )
186+ } , [
187+ cycle ,
188+ dispatch ,
189+ experimentalFeatures ,
190+ nodeDef ,
191+ nodeDefLabel ,
192+ openConvertIntoDialog ,
193+ openEntitySelectDialog ,
194+ survey ,
195+ ] )
184196
185197 if ( menuItems . length === 0 ) return null
186198
0 commit comments