From c3ce444db56cbb089c3023aa4c1866cc7f158c1f Mon Sep 17 00:00:00 2001 From: Eirik Haugstulen Date: Tue, 13 Aug 2024 17:00:14 +0200 Subject: [PATCH] fix: [DHIS2-17352] Changing program in event workspace does nothing (#3754) --- .../QuickSelector/Program/ProgramSelector.component.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core_modules/capture-core/components/ScopeSelector/QuickSelector/Program/ProgramSelector.component.js b/src/core_modules/capture-core/components/ScopeSelector/QuickSelector/Program/ProgramSelector.component.js index 3af9b00bd8..d6d0ec6ad6 100644 --- a/src/core_modules/capture-core/components/ScopeSelector/QuickSelector/Program/ProgramSelector.component.js +++ b/src/core_modules/capture-core/components/ScopeSelector/QuickSelector/Program/ProgramSelector.component.js @@ -50,6 +50,7 @@ const ProgramSelectorPlain = ({ const [programsArray, setProgramsArray] = useState>([]); const selectedProgram = selectedProgramId ? programCollection.get(selectedProgramId) : null; const programOptions = getOptions(selectedOrgUnitId, programsArray); + const isMenuDisabled = !handleClickProgram; useEffect(() => { setProgramsArray(Array.from(programCollection.values())); @@ -83,7 +84,8 @@ const ProgramSelectorPlain = ({ noValueMessage={i18n.t('Choose a program')} value={selectedProgram && } open={open} - setOpen={openSelectorBarItem => setOpen(openSelectorBarItem)} + setOpen={openSelectorBarItem => (isMenuDisabled ? null : setOpen(openSelectorBarItem))} + displayOnly={isMenuDisabled} onClearSelectionClick={() => onResetProgramId(resetProgramIdBase())} dataTest="program-selector-container" >